File tree Expand file tree Collapse file tree 6 files changed +41
-10
lines changed
Expand file tree Collapse file tree 6 files changed +41
-10
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ import type {
8383- [ ` ExportsKey ` ] ( ./src/exports-key.ts )
8484- [ ` ExportsList ` ] ( ./src/exports-list.ts )
8585- [ ` ExportsObject ` ] ( ./src/exports-object.ts )
86+ - [ ` ExportsSubpath ` ] ( ./src/exports-subpath.ts )
8687- [ ` ImportConditions ` ] ( ./src/import-conditions.ts )
8788- [ ` Imports ` ] ( ./src/imports.ts )
8889- [ ` ImportsKey ` ] ( ./src/imports-key.ts )
Original file line number Diff line number Diff line change 55
66import type Condition from '../condition'
77import type TestSubject from '../exports-key'
8+ import type ExportsSubpath from '../exports-subpath'
89
910describe ( 'unit-d:ExportsKey' , ( ) => {
10- it ( 'should extract "."' , ( ) => {
11- expectTypeOf < TestSubject > ( ) . extract < '.' > ( ) . not . toBeNever ( )
12- } )
13-
14- it ( 'should extract `./${string}`' , ( ) => {
15- expectTypeOf < TestSubject > ( ) . extract < `./${string } `> ( ) . not . toBeNever ( )
16- } )
17-
1811 it ( 'should extract Condition' , ( ) => {
1912 expectTypeOf < TestSubject > ( ) . extract < Condition > ( ) . not . toBeNever ( )
2013 } )
14+
15+ it ( 'should extract ExportsSubpath' , ( ) => {
16+ expectTypeOf < TestSubject > ( ) . extract < ExportsSubpath > ( ) . not . toBeNever ( )
17+ } )
2118} )
Original file line number Diff line number Diff line change 1+ /**
2+ * @file Unit Tests - ExportsSubpath
3+ * @module pkg-types/tests/unit-d/ExportsSubpath
4+ */
5+
6+ import type TestSubject from '../exports-subpath'
7+
8+ describe ( 'unit-d:ExportsSubpath' , ( ) => {
9+ it ( 'should extract "."' , ( ) => {
10+ expectTypeOf < TestSubject > ( ) . extract < '.' > ( ) . not . toBeNever ( )
11+ } )
12+
13+ it ( 'should extract `./${string}`' , ( ) => {
14+ expectTypeOf < TestSubject > ( ) . extract < `./${string } `> ( ) . not . toBeNever ( )
15+ } )
16+ } )
Original file line number Diff line number Diff line change 44 */
55
66import type Condition from './condition'
7+ import type ExportsSubpath from './exports-subpath'
78
89/**
910 * An `exports` object key.
1011 *
11- * @see https://nodejs.org/api/packages.html#subpath-exports
12+ * @see {@linkcode Condition }
13+ * @see {@linkcode ExportsSubpath }
14+ * @see https://nodejs.org/api/packages.html#package-entry-points
1215 */
13- type ExportsKey = '.' | `./${ string } ` | Condition
16+ type ExportsKey = Condition | ExportsSubpath
1417
1518export type { ExportsKey as default }
Original file line number Diff line number Diff line change 1+ /**
2+ * @file ExportsSubpath
3+ * @module pkg-types/ExportsSubpath
4+ */
5+
6+ /**
7+ * A subpath `exports` object key.
8+ *
9+ * @see https://nodejs.org/api/packages.html#subpath-exports
10+ */
11+ type ExportsSubpath = '.' | `./${string } `
12+
13+ export type { ExportsSubpath as default }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export type { default as Exports } from './exports'
2525export type { default as ExportsKey } from './exports-key'
2626export type { default as ExportsList } from './exports-list'
2727export type { default as ExportsObject } from './exports-object'
28+ export type { default as ExportsSubpath } from './exports-subpath'
2829export type { default as ImportConditions } from './import-conditions'
2930export type { default as Imports } from './imports'
3031export type { default as ImportsKey } from './imports-key'
You can’t perform that action at this time.
0 commit comments