Skip to content

Commit

Permalink
feat(types): VariableKind
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Mar 7, 2024
1 parent 94c09fb commit 1b613fe
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/types/__tests__/kind-variable.spec-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* @file Type Tests - VariableKind
* @module esast/types/tests/unit-d/VariableKind
*/

import type TestSubject from '../kind-variable'

describe('unit-d:types/VariableKind', () => {
it('should extract "const"', () => {
expectTypeOf<TestSubject>().extract<'const'>().not.toBeNever()
})

it('should extract "let"', () => {
expectTypeOf<TestSubject>().extract<'let'>().not.toBeNever()
})

it('should extract "var"', () => {
expectTypeOf<TestSubject>().extract<'var'>().not.toBeNever()
})
})
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
export type { default as ImportKind } from './kind-import'
export type { default as MethodKind } from './kind-method'
export type { default as PropertyKind } from './kind-property'
export type { default as VariableKind } from './kind-variable'
11 changes: 11 additions & 0 deletions src/types/kind-variable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @file Type Definitions - VariableKind
* @module esast/types/VariableKind
*/

/**
* Variable declaration kinds.
*/
type VariableKind = 'const' | 'let' | 'var'

export type { VariableKind as default }

0 comments on commit 1b613fe

Please sign in to comment.