-
-
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 <unicornware@flexdevelopment.llc>
- Loading branch information
1 parent
70f8c93
commit e6e4cd5
Showing
3 changed files
with
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* @file Unit Tests - ExportCondition | ||
* @module pkg-types/types/tests/ExportCondition | ||
*/ | ||
|
||
import type TestSubject from '../export-condition' | ||
|
||
describe('unit:types/ExportCondition', () => { | ||
it('should allow "browser"', () => { | ||
assertType<TestSubject>('browser') | ||
}) | ||
|
||
it('should allow "default"', () => { | ||
assertType<TestSubject>('default') | ||
}) | ||
|
||
it('should allow "deno"', () => { | ||
assertType<TestSubject>('deno') | ||
}) | ||
|
||
it('should allow "development"', () => { | ||
assertType<TestSubject>('development') | ||
}) | ||
|
||
it('should allow "electron"', () => { | ||
assertType<TestSubject>('electron') | ||
}) | ||
|
||
it('should allow "import"', () => { | ||
assertType<TestSubject>('import') | ||
}) | ||
|
||
it('should allow "node-addons"', () => { | ||
assertType<TestSubject>('node-addons') | ||
}) | ||
|
||
it('should allow "node"', () => { | ||
assertType<TestSubject>('node') | ||
}) | ||
|
||
it('should allow "production"', () => { | ||
assertType<TestSubject>('production') | ||
}) | ||
|
||
it('should allow "react-native"', () => { | ||
assertType<TestSubject>('react-native') | ||
}) | ||
|
||
it('should allow "require"', () => { | ||
assertType<TestSubject>('require') | ||
}) | ||
|
||
it('should allow "types"', () => { | ||
assertType<TestSubject>('types') | ||
}) | ||
}) |
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,29 @@ | ||
/** | ||
* @file Type Definitions - ExportCondition | ||
* @module pkg-types/types/ExportCondition | ||
*/ | ||
|
||
import type { LiteralUnion } from '@flex-development/tutils' | ||
|
||
/** | ||
* Conditions indicating how to resolve a package entry point. | ||
* | ||
* @see https://nodejs.org/api/packages.html#conditional-exports | ||
*/ | ||
type ExportCondition = LiteralUnion< | ||
| 'browser' | ||
| 'default' | ||
| 'deno' | ||
| 'development' | ||
| 'electron' | ||
| 'import' | ||
| 'node-addons' | ||
| 'node' | ||
| 'production' | ||
| 'react-native' | ||
| 'require' | ||
| 'types', | ||
string | ||
> | ||
|
||
export type { ExportCondition 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