-
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.
- Loading branch information
Showing
22 changed files
with
247 additions
and
194 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,2 @@ | ||
/dist | ||
*.js |
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,15 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
root: true, | ||
overrides: [ | ||
{ | ||
files: ['*.ts'], | ||
rules: { | ||
"@typescript-eslint/no-explicit-any": "off" | ||
} | ||
} | ||
] | ||
}; |
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 |
---|---|---|
@@ -1 +1 @@ | ||
12.14.1 | ||
18.13.0 |
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
module.exports = { | ||
singleQuote: true, | ||
useTabs: false, | ||
printWidth: 120, | ||
tabWidth: 2, | ||
semi: true, | ||
htmlWhitespaceSensitivity: 'strict', | ||
arrowParens: 'avoid', | ||
bracketSpacing: true, | ||
proseWrap: 'preserve', | ||
trailingComma: 'none', | ||
endOfLine: 'lf' | ||
}; |
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,22 @@ | ||
/** | ||
* Lazily compiled dynamic import loader function. | ||
*/ | ||
let load: (<T>(modulePath: string | URL) => Promise<T>) | undefined; | ||
|
||
/** | ||
* This uses a dynamic import to load a module which may be ESM. | ||
* CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript | ||
* will currently, unconditionally downlevel dynamic import into a require call. | ||
* require calls cannot load ESM code and will result in a runtime error. To workaround | ||
* this, a Function constructor is used to prevent TypeScript from changing the dynamic import. | ||
* Once TypeScript provides support for keeping the dynamic import this workaround can | ||
* be dropped. | ||
* | ||
* @param modulePath The path of the module to load. | ||
* @returns A Promise that resolves to the dynamically imported module. | ||
*/ | ||
export function loadEsmModule<T>(modulePath: string | URL): Promise<T> { | ||
load ??= new Function('modulePath', `return import(modulePath);`) as Exclude<typeof load, undefined>; | ||
|
||
return load(modulePath); | ||
} |
Oops, something went wrong.