Commit 97ee265 1 parent a536567 commit 97ee265 Copy full SHA for 97ee265
File tree 4 files changed +72
-0
lines changed
4 files changed +72
-0
lines changed Original file line number Diff line number Diff line change 21
21
"{@linkcode NodeError}" : " https://github.com/flex-development/errnode/blob/1.2.0/src/types/node-error.ts" ,
22
22
"{@linkcode PackageJson}" : " https://github.com/flex-development/pkg-types/blob/2.0.0/src/interfaces/package-json.ts" ,
23
23
"{@linkcode PackageScope}" : " /api/interfaces/#packagescope" ,
24
+ "{@linkcode ParsedModuleIdOptions}" : " /api/interfaces/#parsedmoduleidoptions" ,
24
25
"{@linkcode Protocol}" : " /api/types#protocol" ,
25
26
"{@linkcode RESOLVE_EXTENSIONS}" : " /api/#resolve-extensions" ,
26
27
"{@linkcode RequestInit}" : " https://github.com/node-fetch/node-fetch/blob/v3.3.0/@types/index.d.ts#L71-L112" ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @file Type Tests - ParseModuleIdOptions
3
+ * @module mlly/interfaces/tests/unit-d/ParseModuleIdOptions
4
+ */
5
+
6
+ import type { ModuleId } from '#src/types'
7
+ import type { KeysRequired } from '@flex-development/tutils'
8
+ import type TestSubject from '../options-parse-module-id'
9
+
10
+ describe ( 'unit-d:interfaces/ParseModuleIdOptions' , ( ) => {
11
+ it ( 'should allow empty object' , ( ) => {
12
+ expectTypeOf < KeysRequired < TestSubject > > ( ) . toBeNever ( )
13
+ } )
14
+
15
+ it ( 'should match [internal?: boolean]' , ( ) => {
16
+ expectTypeOf < TestSubject > ( )
17
+ . toHaveProperty ( 'internal' )
18
+ . toEqualTypeOf < boolean | undefined > ( )
19
+ } )
20
+
21
+ it ( 'should match [parent?: ModuleId]' , ( ) => {
22
+ expectTypeOf < TestSubject > ( )
23
+ . toHaveProperty ( 'parent' )
24
+ . toEqualTypeOf < ModuleId | undefined > ( )
25
+ } )
26
+
27
+ it ( 'should match [pkgname?: boolean]' , ( ) => {
28
+ expectTypeOf < TestSubject > ( )
29
+ . toHaveProperty ( 'pkgname' )
30
+ . toEqualTypeOf < boolean | undefined > ( )
31
+ } )
32
+ } )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export type { default as DynamicImport } from './import-dynamic'
8
8
export type { default as StaticImport } from './import-static'
9
9
export type { default as GetFormatOptions } from './options-get-format'
10
10
export type { default as GetSourceOptions } from './options-get-source'
11
+ export type { default as ParseModuleIdOptions } from './options-parse-module-id'
11
12
export type { default as ResolveOptions } from './options-resolve'
12
13
export type { default as ResolveAliasOptions } from './options-resolve-alias'
13
14
export type { default as PackageScope } from './package-scope'
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @file Interfaces - ParseModuleIdOptions
3
+ * @module mlly/interfaces/ParseModuleIdOptions
4
+ */
5
+
6
+ import type { ModuleId } from '#src/types'
7
+
8
+ /**
9
+ * Module id parsing options.
10
+ *
11
+ * @see {@linkcode ModuleId }
12
+ */
13
+ interface ParseModuleIdOptions {
14
+ /**
15
+ * Ensure module id is a valid internal specifier, syntactically.
16
+ *
17
+ * @see https://nodejs.org/api/packages.html#subpath-imports
18
+ *
19
+ * @default id instanceof URL ? false : id.startsWith('#')
20
+ */
21
+ internal ?: boolean | undefined
22
+
23
+ /**
24
+ * URL of module to resolve from.
25
+ *
26
+ * **Note**: Used for error reporting only.
27
+ *
28
+ * @default undefined
29
+ */
30
+ parent ?: ModuleId | undefined
31
+
32
+ /**
33
+ * Ensure module id begins with a valid package name.
34
+ */
35
+ pkgname ?: boolean | undefined
36
+ }
37
+
38
+ export type { ParseModuleIdOptions as default }
You can’t perform that action at this time.
0 commit comments