Skip to content

Commit

Permalink
feat(types): ImportsKey
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Dec 1, 2022
1 parent 22c207e commit 14a69ec
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/types/__tests__/imports-key.spec-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @file Unit Tests - ImportsKey
* @module pkg-types/types/tests/ImportsKey
*/

import type TestSubject from '../imports-key'

describe('unit:types/ImportsKey', () => {
it('should allow "#src"', () => {
assertType<TestSubject>('#src')
})
})
13 changes: 13 additions & 0 deletions src/types/imports-key.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* @file Type Definitions - ImportsKey
* @module pkg-types/types/ImportsKey
*/

/**
* [Subpath imports][1] object key.
*
*[1]: https://nodejs.org/api/packages.html#subpath-imports
*/
type ImportsKey = `#${string}`

export type { ImportsKey as default }
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type { default as ExportConditions } from './export-conditions'
export type { default as Exports } from './exports'
export type { default as FundingType } from './funding-type'
export type { default as HoistingLimits } from './hoisiting-limits'
export type { default as ImportsKey } from './imports-key'
export type { default as OS } from './os'
export type { default as Registry } from './registry'
export type { default as Type } from './type'
Expand Down

0 comments on commit 14a69ec

Please sign in to comment.