Skip to content

Commit

Permalink
feat(nodes): ImportIdentifier
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 03f2d28 commit 10e6f41
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/nodes/__tests__/identifier-import.spec-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @file Type Tests - IdentifierImport
* @module esast/nodes/tests/unit-d/IdentifierImport
*/

import type { Identifier } from '@flex-development/esast'
import type TestSubject from '../identifier-import'

describe('unit-d:nodes/IdentifierImport', () => {
it('should extend Identifier', () => {
expectTypeOf<TestSubject>().toMatchTypeOf<Identifier>()
})

it('should match [name: "import"]', () => {
expectTypeOf<TestSubject>().toHaveProperty('name').toEqualTypeOf<'import'>()
})
})
22 changes: 22 additions & 0 deletions src/nodes/identifier-import.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @file Nodes - ImportIdentifier
* @module esast/nodes/ImportIdentifier
*/

import type { Identifier } from '@flex-development/esast'

/**
* The identifier `import`.
*
* @see {@linkcode Identifier}
*
* @extends {Identifier}
*/
interface ImportIdentifier extends Identifier {
/**
* Identifier name.
*/
name: 'import'
}

export type { ImportIdentifier as default }
1 change: 1 addition & 0 deletions src/nodes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

export type { default as Identifier, IdentifierData } from './identifier'
export type { default as DefaultIdentifier } from './identifier-default'
export type { default as ImportIdentifier } from './identifier-import'
export type { default as Literal } from './literal'
export type { default as BigIntLiteral } from './literal-bigint'
export type { default as BooleanLiteral } from './literal-boolean'
Expand Down

0 comments on commit 10e6f41

Please sign in to comment.