-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
f0507df
commit b5ab3dc
Showing
33 changed files
with
724 additions
and
78 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
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
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,43 @@ | ||
/** | ||
* @file Type Tests - GetSourceContext | ||
* @module mlly/interfaces/tests/unit-d/GetSourceContext | ||
*/ | ||
|
||
import type TestSubject from '#interfaces/context-get-source' | ||
import type { | ||
FileSystem, | ||
GetSourceHandlers, | ||
GetSourceOptions | ||
} from '@flex-development/mlly' | ||
|
||
describe('unit-d:interfaces/GetSourceContext', () => { | ||
it('should extend GetSourceOptions', () => { | ||
expectTypeOf<TestSubject>().toMatchTypeOf<GetSourceOptions>() | ||
}) | ||
|
||
it('should match [error: boolean]', () => { | ||
expectTypeOf<TestSubject>().toHaveProperty('error').toEqualTypeOf<boolean>() | ||
}) | ||
|
||
it('should match [fs: FileSystem]', () => { | ||
expectTypeOf<TestSubject>().toHaveProperty('fs').toEqualTypeOf<FileSystem>() | ||
}) | ||
|
||
it('should match [handlers: GetSourceHandlers]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('handlers') | ||
.toEqualTypeOf<GetSourceHandlers>() | ||
}) | ||
|
||
it('should match [req: RequestInit]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('req') | ||
.toEqualTypeOf<RequestInit>() | ||
}) | ||
|
||
it('should match [schemes: Set<string>', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('schemes') | ||
.toEqualTypeOf<Set<string>>() | ||
}) | ||
}) |
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,54 @@ | ||
/** | ||
* @file Type Tests - GetSourceOptions | ||
* @module mlly/interfaces/tests/unit-d/GetSourceOptions | ||
*/ | ||
|
||
import type TestSubject from '#interfaces/options-get-source' | ||
import type { | ||
FileSystem, | ||
GetSourceHandlers, | ||
ModuleFormat | ||
} from '@flex-development/mlly' | ||
import type { Nilable } from '@flex-development/tutils' | ||
|
||
describe('unit-d:interfaces/GetSourceOptions', () => { | ||
it('should allow empty object', () => { | ||
assertType<TestSubject>({}) | ||
}) | ||
|
||
it('should match [format?: ModuleFormat | null | undefined]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('format') | ||
.toEqualTypeOf<Nilable<ModuleFormat>>() | ||
}) | ||
|
||
it('should match [fs?: FileSystem | null | undefined]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('fs') | ||
.toEqualTypeOf<Nilable<FileSystem>>() | ||
}) | ||
|
||
it('should match [handlers?: GetSourceHandlers | null | undefined]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('handlers') | ||
.toEqualTypeOf<Nilable<GetSourceHandlers>>() | ||
}) | ||
|
||
it('should match [ignoreErrors?: boolean | null | undefined]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('ignoreErrors') | ||
.toEqualTypeOf<Nilable<boolean>>() | ||
}) | ||
|
||
it('should match [req?: RequestInit | null | undefined]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('req') | ||
.toEqualTypeOf<Nilable<RequestInit>>() | ||
}) | ||
|
||
it('should match [schemes?: Set<string> | readonly string[] | null | undefined]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('schemes') | ||
.toEqualTypeOf<Nilable<Set<string> | readonly string[]>>() | ||
}) | ||
}) |
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,63 @@ | ||
/** | ||
* @file Interfaces - GetSourceContext | ||
* @module mlly/interfaces/GetSourceContext | ||
*/ | ||
|
||
import type { | ||
FileSystem, | ||
GetSourceHandlers, | ||
GetSourceOptions | ||
} from '@flex-development/mlly' | ||
|
||
/** | ||
* Source code retrieval context. | ||
* | ||
* @see {@linkcode GetSourceOptions} | ||
* | ||
* @extends {GetSourceOptions} | ||
*/ | ||
interface GetSourceContext extends GetSourceOptions { | ||
/** | ||
* Throw [`ERR_UNSUPPORTED_ESM_URL_SCHEME`][err]? | ||
* | ||
* [err]: https://nodejs.org/api/errors.html#err_unsupported_esm_url_scheme | ||
*/ | ||
error: boolean | ||
|
||
/** | ||
* File system API. | ||
* | ||
* @see {@linkcode FileSystem} | ||
* | ||
* @override | ||
*/ | ||
fs: FileSystem | ||
|
||
/** | ||
* URL handler map. | ||
* | ||
* @see {@linkcode GetSourceHandlers} | ||
* | ||
* @override | ||
*/ | ||
handlers: GetSourceHandlers | ||
|
||
/** | ||
* Request options for network based modules. | ||
* | ||
* > 👉 **Note**: Only applicable if {@linkcode network} is | ||
* > enabled. | ||
* | ||
* @override | ||
*/ | ||
req: RequestInit | ||
|
||
/** | ||
* List of supported URL schemes. | ||
* | ||
* @override | ||
*/ | ||
schemes: Set<string> | ||
} | ||
|
||
export type { GetSourceContext 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
Oops, something went wrong.