-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
14a69ec
commit cc68844
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* @file Unit Tests - Imports | ||
* @module pkg-types/types/tests/Imports | ||
*/ | ||
|
||
import type TestSubject from '../imports' | ||
|
||
describe('unit:types/Imports', () => { | ||
it('should allow empty object', () => { | ||
assertType<TestSubject>({}) | ||
}) | ||
|
||
it('should allow object with ExportConditions values', () => { | ||
assertType<TestSubject>({ | ||
'#src': { development: './src/index.ts', production: './dist/index.mjs' }, | ||
'#src/*': { development: './src/*.ts', production: './dist/*.mjs' } | ||
}) | ||
}) | ||
|
||
it('should allow object with string values', () => { | ||
assertType<TestSubject>({ | ||
'#src': './src/index.ts', | ||
'#src/*': './src/*.ts' | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @file Type Definitions - Imports | ||
* @module pkg-types/types/Imports | ||
*/ | ||
|
||
import type ExportConditions from './export-conditions' | ||
import type ImportsKey from './imports-key' | ||
|
||
/** | ||
* Private mappings that only apply to import specifiers from within a | ||
* package. | ||
* | ||
* @see https://nodejs.org/api/packages.html#subpath-imports | ||
*/ | ||
type Imports = { [key: ImportsKey]: ExportConditions | string } | ||
|
||
export type { Imports as default } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters