Skip to content

Commit

Permalink
feat(nodes): RequireIdentifier
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 aad365e commit 3e6045b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/nodes/__tests__/identifier-require.spec-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @file Type Tests - IdentifierRequire
* @module esast/nodes/tests/unit-d/IdentifierRequire
*/

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

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

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

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

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

export type { RequireIdentifier as default }
1 change: 1 addition & 0 deletions src/nodes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,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 MetaIdentifier } from './identifier-meta'
export type { default as RequireIdentifier } from './identifier-require'
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 3e6045b

Please sign in to comment.