-
-
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.
feat(interfaces):
LoadTsconfigOptions
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
- Loading branch information
1 parent
8eea639
commit c9cdf33
Showing
4 changed files
with
67 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
* @module tsconfig-utils | ||
*/ | ||
|
||
export {} | ||
export * from './interfaces' |
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 Type Tests - LoadTsconfigOptions | ||
* @module tsconfig-utils/interfaces/tests/unit-d/LoadTsconfigOptions | ||
*/ | ||
|
||
import type { Fn, KeysRequired } from '@flex-development/tutils' | ||
import type { URL } from 'node:url' | ||
import type TestSubject from '../options-load-tsconfig' | ||
|
||
describe('unit-d:interfaces/LoadTsconfigOptions', () => { | ||
it('should allow empty object', () => { | ||
expectTypeOf<KeysRequired<TestSubject>>().toBeNever() | ||
}) | ||
|
||
it('should match [file?: Fn<[URL | string], boolean>]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('file') | ||
.toEqualTypeOf<Fn<[URL | string], boolean> | undefined>() | ||
}) | ||
|
||
it('should match [read?: Fn<[URL | string], string>]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('read') | ||
.toEqualTypeOf<Fn<[URL | string], string> | undefined>() | ||
}) | ||
}) |
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,6 @@ | ||
/** | ||
* @file Entry Point - Interfaces | ||
* @module tsconfig-utils/interfaces | ||
*/ | ||
|
||
export type { default as LoadTsconfigOptions } from './options-load-tsconfig' |
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,34 @@ | ||
/** | ||
* @file Interfaces - LoadTsconfigOptions | ||
* @module tsconfig-utils/interfaces/LoadTsconfigOptions | ||
*/ | ||
|
||
import type { Fn } from '@flex-development/tutils' | ||
import type { URL } from 'node:url' | ||
|
||
/** | ||
* Options for loading tsconfig files. | ||
*/ | ||
interface LoadTsconfigOptions { | ||
/** | ||
* Checks if a file exists at the given module `id`. | ||
* | ||
* @default internal.isFile | ||
* | ||
* @param {URL | string} id - Module id to evaluate | ||
* @return {boolean} `true` if file exists at `id`, `false` otherwise | ||
*/ | ||
file?: Fn<[URL | string], boolean> | undefined | ||
|
||
/** | ||
* Reads the file at the given module `id`. | ||
* | ||
* @default internal.readFile | ||
* | ||
* @param {URL | string} id - Module id to evaluate | ||
* @return {string} File content at `id` | ||
*/ | ||
read?: Fn<[URL | string], string> | undefined | ||
} | ||
|
||
export type { LoadTsconfigOptions as default } |