diff --git a/.cspell.json b/.cspell.json index 423d93a7..38717337 100644 --- a/.cspell.json +++ b/.cspell.json @@ -7,6 +7,7 @@ "anotherhashishere", "arcanis", "Builtins", + "camelcase", "complexm", "endregion", "entrypoints", diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 6c6b57ac..00000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -test/fixtures/**/* \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index c5a1f0d5..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,82 +0,0 @@ -module.exports = { - root: true, - plugins: ["prettier", "node", "jsdoc"], - extends: [ - "eslint:recommended", - "plugin:node/recommended", - "plugin:prettier/recommended" - ], - env: { - node: true, - es6: true - }, - parserOptions: { - ecmaVersion: 2018 - }, - rules: { - "prettier/prettier": "error", - "no-template-curly-in-string": "error", - "no-caller": "error", - "no-control-regex": "off", - yoda: "error", - eqeqeq: "error", - "eol-last": "error", - "no-extra-bind": "warn", - "no-process-exit": "warn", - "no-use-before-define": "off", - "no-unused-vars": ["error", { args: "none", ignoreRestSiblings: true }], - "no-loop-func": "warn", - "node/no-missing-require": "error", - "jsdoc/check-indentation": "error", - "jsdoc/check-param-names": "error", - "jsdoc/check-property-names": "error", - "jsdoc/check-tag-names": "error", - "jsdoc/require-hyphen-before-param-description": ["error", "never"], - "jsdoc/require-param-description": "error", - "jsdoc/require-param-name": "error", - "jsdoc/require-param-type": "error", - "jsdoc/require-param": "error", - "jsdoc/require-property": "error", - "jsdoc/require-property-name": "error", - "jsdoc/require-property-type": "error", - "jsdoc/require-returns-description": "error", - "jsdoc/require-returns-type": "error", - "jsdoc/require-returns": "error" - }, - settings: { - jsdoc: { - mode: "typescript", - // supported tags https://github.com/microsoft/TypeScript-wiki/blob/master/JSDoc-support-in-JavaScript.md - tagNamePreference: { - ...["implements", "const", "memberof", "readonly", "yields"].reduce( - (acc, tag) => { - acc[tag] = { - message: `@${tag} currently not supported in Typescript` - }; - return acc; - }, - {} - ), - extends: "extends", - return: "returns", - constructor: "constructor", - prop: "property", - arg: "param", - augments: "extends", - description: false, - desc: false, - inheritdoc: false, - class: "constructor" - }, - overrideReplacesDocs: false - } - }, - overrides: [ - { - files: ["test/**/*.js"], - env: { - jest: true - } - } - ] -}; diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40291942..2ae625fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,7 +50,7 @@ jobs: run: | yarn upgrade typescript@^4 --ignore-engines yarn --frozen-lockfile - if: matrix.node-version == '10.x' || matrix.node-version == '12.x' + if: matrix.node-version == '10.x' || matrix.node-version == '12.x' || matrix.node-version == '14.x' || matrix.node-version == '16.x' || matrix.node-version == '18.x' - name: Install dependencies run: yarn --frozen-lockfile if: matrix.node-version != '10.x' diff --git a/.prettierrc.js b/.prettierrc.js index f3dfe152..cee6cf91 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,21 +1,24 @@ +"use strict"; + module.exports = { printWidth: 80, useTabs: true, tabWidth: 2, - trailingComma: "none", + trailingComma: "all", + arrowParens: "always", overrides: [ { files: "*.json", options: { parser: "json", - useTabs: false - } + useTabs: false, + }, }, { files: "*.{cts,mts,ts}", options: { - parser: "typescript" - } - } - ] + parser: "typescript", + }, + }, + ], }; diff --git a/README.md b/README.md index 3a043267..b20a383b 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ myResolver.resolve( lookupStartPath, request, resolveContext, - (err /*Error*/, filepath /*string*/) => { + (err /* Error */, filepath /* string */) => { // Do something with the path } ); @@ -151,7 +151,7 @@ enhanced-resolve will try to resolve requests containing `#` as path and as frag ## Tests -```javascript +```sh yarn test ``` diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..e54d3fa5 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,12 @@ +import { defineConfig } from "eslint/config"; +import config from "eslint-config-webpack"; + +export default defineConfig([ + { + extends: [config], + rules: { + "n/prefer-global/process": "off", + "n/prefer-node-protocol": "off", + }, + }, +]); diff --git a/jest.config.js b/jest.config.js index 723c2f9e..8eb74796 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,6 @@ +"use strict"; + module.exports = { - moduleFileExtensions: ["js", "mjs", "cjs", "ts"] + prettierPath: require.resolve("prettier-2"), + moduleFileExtensions: ["js", "mjs", "cjs", "ts"], }; diff --git a/lib/AliasFieldPlugin.js b/lib/AliasFieldPlugin.js index 765c8353..90b2a08f 100644 --- a/lib/AliasFieldPlugin.js +++ b/lib/AliasFieldPlugin.js @@ -39,37 +39,38 @@ module.exports = class AliasFieldPlugin { if (!innerRequest) return callback(); const fieldData = DescriptionFileUtils.getField( request.descriptionFileData, - this.field + this.field, ); if (fieldData === null || typeof fieldData !== "object") { - if (resolveContext.log) + if (resolveContext.log) { resolveContext.log( - "Field '" + - this.field + - "' doesn't contain a valid alias configuration" + `Field '${ + this.field + }' doesn't contain a valid alias configuration`, ); + } return callback(); } /** @type {JsonPrimitive | undefined} */ const data = Object.prototype.hasOwnProperty.call( fieldData, - innerRequest + innerRequest, ) ? /** @type {{[Key in string]: JsonPrimitive}} */ (fieldData)[ innerRequest - ] + ] : innerRequest.startsWith("./") - ? /** @type {{[Key in string]: JsonPrimitive}} */ (fieldData)[ - innerRequest.slice(2) - ] - : undefined; + ? /** @type {{[Key in string]: JsonPrimitive}} */ (fieldData)[ + innerRequest.slice(2) + ] + : undefined; if (data === innerRequest) return callback(); if (data === undefined) return callback(); if (data === false) { /** @type {ResolveRequest} */ const ignoreObj = { ...request, - path: false + path: false, }; if (typeof resolveContext.yield === "function") { resolveContext.yield(ignoreObj); @@ -82,18 +83,14 @@ module.exports = class AliasFieldPlugin { ...request, path: /** @type {string} */ (request.descriptionFileRoot), request: /** @type {string} */ (data), - fullySpecified: false + fullySpecified: false, }; resolver.doResolve( target, obj, - "aliased from description file " + - request.descriptionFilePath + - " with mapping '" + - innerRequest + - "' to '" + - /** @type {string} */ (data) + - "'", + `aliased from description file ${ + request.descriptionFilePath + } with mapping '${innerRequest}' to '${/** @type {string} */ data}'`, resolveContext, (err, result) => { if (err) return callback(err); @@ -101,7 +98,7 @@ module.exports = class AliasFieldPlugin { // Don't allow other aliasing or raw request if (result === undefined) return callback(null, null); callback(null, result); - } + }, ); }); } diff --git a/lib/AliasPlugin.js b/lib/AliasPlugin.js index f1b047ff..aed64ed0 100644 --- a/lib/AliasPlugin.js +++ b/lib/AliasPlugin.js @@ -86,7 +86,7 @@ module.exports = class AliasPlugin { /** @type {ResolveRequest} */ const ignoreObj = { ...request, - path: false + path: false, }; if (typeof resolveContext.yield === "function") { resolveContext.yield(ignoreObj); @@ -105,7 +105,7 @@ module.exports = class AliasPlugin { ) { const match = innerRequest.slice( prefix.length, - innerRequest.length - suffix.length + innerRequest.length - suffix.length, ); newRequestStr = item.alias.toString().replace("*", match); } @@ -113,7 +113,7 @@ module.exports = class AliasPlugin { if ( matchRequest && innerRequest !== alias && - !innerRequest.startsWith(alias + "/") + !innerRequest.startsWith(`${alias}/`) ) { /** @type {string} */ const remainingRequest = innerRequest.slice(item.name.length); @@ -126,32 +126,28 @@ module.exports = class AliasPlugin { const obj = { ...request, request: newRequestStr, - fullySpecified: false + fullySpecified: false, }; return resolver.doResolve( target, obj, - "aliased with mapping '" + - item.name + - "': '" + - alias + - "' to '" + - newRequestStr + - "'", + `aliased with mapping '${item.name}': '${alias}' to '${ + newRequestStr + }'`, resolveContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); return callback(); - } + }, ); } return callback(); }; /** - * @param {null|Error} [err] error - * @param {null|ResolveRequest} [result] result + * @param {(null | Error)=} err error + * @param {(null | ResolveRequest)=} result result * @returns {void} */ const stoppingCallback = (err, result) => { @@ -167,16 +163,15 @@ module.exports = class AliasPlugin { return forEachBail( item.alias, resolveWithAlias, - stoppingCallback + stoppingCallback, ); - } else { - return resolveWithAlias(item.alias, stoppingCallback); } + return resolveWithAlias(item.alias, stoppingCallback); } return callback(); }, - callback + callback, ); }); } diff --git a/lib/AppendPlugin.js b/lib/AppendPlugin.js index 45ad052b..6763d528 100644 --- a/lib/AppendPlugin.js +++ b/lib/AppendPlugin.js @@ -35,14 +35,14 @@ module.exports = class AppendPlugin { ...request, path: request.path + this.appending, relativePath: - request.relativePath && request.relativePath + this.appending + request.relativePath && request.relativePath + this.appending, }; resolver.doResolve( target, obj, this.appending, resolveContext, - callback + callback, ); }); } diff --git a/lib/CachedInputFileSystem.js b/lib/CachedInputFileSystem.js index 11f2bd61..cc1ef80b 100644 --- a/lib/CachedInputFileSystem.js +++ b/lib/CachedInputFileSystem.js @@ -5,7 +5,7 @@ "use strict"; -const nextTick = require("process").nextTick; +const { nextTick } = require("process"); /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {import("./Resolver").PathLike} PathLike */ @@ -25,9 +25,9 @@ const nextTick = require("process").nextTick; const dirname = (path) => { let idx = path.length - 1; while (idx >= 0) { - const c = path.charCodeAt(idx); + const char = path.charCodeAt(idx); // slash or backslash - if (c === 47 || c === 92) break; + if (char === 47 || char === 92) break; idx--; } if (idx < 0) return ""; @@ -50,18 +50,23 @@ const runCallbacks = (callbacks, err, result) => { for (const callback of callbacks) { try { callback(err, result); - } catch (e) { - if (!error) error = e; + } catch (err) { + if (!error) error = err; } } callbacks.length = 0; if (error) throw error; }; +// eslint-disable-next-line jsdoc/no-restricted-syntax +/** @typedef {Function} EXPECTED_FUNCTION */ +// eslint-disable-next-line jsdoc/no-restricted-syntax +/** @typedef {any} EXPECTED_ANY */ + class OperationMergerBackend { /** - * @param {Function | undefined} provider async method in filesystem - * @param {Function | undefined} syncProvider sync method in filesystem + * @param {EXPECTED_FUNCTION | undefined} provider async method in filesystem + * @param {EXPECTED_FUNCTION | undefined} syncProvider sync method in filesystem * @param {BaseFileSystem} providerContext call context for the provider methods */ constructor(provider, syncProvider, providerContext) { @@ -71,15 +76,18 @@ class OperationMergerBackend { this._activeAsyncOperations = new Map(); this.provide = this._provider - ? /** - * @param {PathLike | PathOrFileDescriptor} path path - * @param {object | FileSystemCallback | undefined} options options - * @param {FileSystemCallback=} callback callback - * @returns {any} result - */ - (path, options, callback) => { + ? // Comment to align jsdoc + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {object | FileSystemCallback | undefined} options options + * @param {FileSystemCallback=} callback callback + * @returns {EXPECTED_ANY} result + */ + (path, options, callback) => { if (typeof options === "function") { - callback = /** @type {FileSystemCallback} */ (options); + callback = + /** @type {FileSystemCallback} */ + (options); options = undefined; } if ( @@ -88,18 +96,18 @@ class OperationMergerBackend { !(path instanceof URL) && typeof path !== "number" ) { - /** @type {Function} */ + /** @type {EXPECTED_FUNCTION} */ (callback)( - new TypeError("path must be a string, Buffer, URL or number") + new TypeError("path must be a string, Buffer, URL or number"), ); return; } if (options) { - return /** @type {Function} */ (this._provider).call( + return /** @type {EXPECTED_FUNCTION} */ (this._provider).call( this._providerContext, path, options, - callback + callback, ); } let callbacks = this._activeAsyncOperations.get(path); @@ -108,37 +116,38 @@ class OperationMergerBackend { return; } this._activeAsyncOperations.set(path, (callbacks = [callback])); - /** @type {Function} */ + /** @type {EXPECTED_FUNCTION} */ (provider)( path, /** * @param {Error} err error - * @param {any} result result + * @param {EXPECTED_ANY} result result */ (err, result) => { this._activeAsyncOperations.delete(path); runCallbacks(callbacks, err, result); - } + }, ); - } + } : null; this.provideSync = this._syncProvider - ? /** - * @param {PathLike | PathOrFileDescriptor} path path - * @param {object=} options options - * @returns {any} result - */ - (path, options) => { - return /** @type {Function} */ (this._syncProvider).call( + ? // Comment to align jsdoc + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {object=} options options + * @returns {EXPECTED_ANY} result + */ + (path, options) => + /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( this._providerContext, path, - options - ); - } + options, + ) : null; } purge() {} + purgeParent() {} } @@ -169,16 +178,16 @@ const STORAGE_MODE_ASYNC = 2; /** * @callback Provide * @param {PathLike | PathOrFileDescriptor} path path - * @param {any} options options - * @param {FileSystemCallback} callback callback + * @param {EXPECTED_ANY} options options + * @param {FileSystemCallback} callback callback * @returns {void} */ class CacheBackend { /** * @param {number} duration max cache duration of items - * @param {function | undefined} provider async method - * @param {function | undefined} syncProvider sync method + * @param {EXPECTED_FUNCTION | undefined} provider async method + * @param {EXPECTED_FUNCTION | undefined} syncProvider sync method * @param {BaseFileSystem} providerContext call context for the provider methods */ constructor(duration, provider, syncProvider, providerContext) { @@ -186,9 +195,9 @@ class CacheBackend { this._provider = provider; this._syncProvider = syncProvider; this._providerContext = providerContext; - /** @type {Map[]>} */ + /** @type {Map[]>} */ this._activeAsyncOperations = new Map(); - /** @type {Map }>} */ + /** @type {Map }>} */ this._data = new Map(); /** @type {Set[]} */ this._levels = []; @@ -204,16 +213,18 @@ class CacheBackend { /** @type {number | undefined} */ this._nextDecay = undefined; + // eslint-disable-next-line no-warning-comments // @ts-ignore this.provide = provider ? this.provide.bind(this) : null; + // eslint-disable-next-line no-warning-comments // @ts-ignore this.provideSync = syncProvider ? this.provideSync.bind(this) : null; } /** * @param {PathLike | PathOrFileDescriptor} path path - * @param {any} options options - * @param {FileSystemCallback} callback callback + * @param {EXPECTED_ANY} options options + * @param {FileSystemCallback} callback callback * @returns {void} */ provide(path, options, callback) { @@ -232,11 +243,11 @@ class CacheBackend { } const strPath = typeof path !== "string" ? path.toString() : path; if (options) { - return /** @type {Function} */ (this._provider).call( + return /** @type {EXPECTED_FUNCTION} */ (this._provider).call( this._providerContext, path, options, - callback + callback, ); } @@ -246,7 +257,7 @@ class CacheBackend { } // Check in cache - let cacheEntry = this._data.get(strPath); + const cacheEntry = this._data.get(strPath); if (cacheEntry !== undefined) { if (cacheEntry.err) return nextTick(callback, cacheEntry.err); return nextTick(callback, null, cacheEntry.result); @@ -261,13 +272,13 @@ class CacheBackend { this._activeAsyncOperations.set(strPath, (callbacks = [callback])); // Run the operation - /** @type {Function} */ + /** @type {EXPECTED_FUNCTION} */ (this._provider).call( this._providerContext, path, /** * @param {Error | null} err error - * @param {any} [result] result + * @param {EXPECTED_ANY=} result result */ (err, result) => { this._activeAsyncOperations.delete(strPath); @@ -277,18 +288,18 @@ class CacheBackend { this._enterAsyncMode(); runCallbacks( - /** @type {FileSystemCallback[]} */ (callbacks), + /** @type {FileSystemCallback[]} */ (callbacks), err, - result + result, ); - } + }, ); } /** * @param {PathLike | PathOrFileDescriptor} path path - * @param {any} options options - * @returns {any} result + * @param {EXPECTED_ANY} options options + * @returns {EXPECTED_ANY} result */ provideSync(path, options) { if ( @@ -301,10 +312,10 @@ class CacheBackend { } const strPath = typeof path !== "string" ? path.toString() : path; if (options) { - return /** @type {Function} */ (this._syncProvider).call( + return /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( this._providerContext, path, - options + options, ); } @@ -314,7 +325,7 @@ class CacheBackend { } // Check in cache - let cacheEntry = this._data.get(strPath); + const cacheEntry = this._data.get(strPath); if (cacheEntry !== undefined) { if (cacheEntry.err) throw cacheEntry.err; return cacheEntry.result; @@ -329,9 +340,9 @@ class CacheBackend { // When in idle mode, we will enter sync mode let result; try { - result = /** @type {Function} */ (this._syncProvider).call( + result = /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( this._providerContext, - path + path, ); } catch (err) { this._storeResult(strPath, /** @type {Error} */ (err), undefined); @@ -350,7 +361,7 @@ class CacheBackend { } /** - * @param {string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set} [what] what to purge + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge */ purge(what) { if (!what) { @@ -368,7 +379,7 @@ class CacheBackend { typeof what === "number" ) { const strWhat = typeof what !== "string" ? what.toString() : what; - for (let [key, data] of this._data) { + for (const [key, data] of this._data) { if (key.startsWith(strWhat)) { this._data.delete(key); data.level.delete(key); @@ -378,7 +389,7 @@ class CacheBackend { this._enterIdleMode(); } } else { - for (let [key, data] of this._data) { + for (const [key, data] of this._data) { for (const item of what) { const strItem = typeof item !== "string" ? item.toString() : item; if (key.startsWith(strItem)) { @@ -395,7 +406,7 @@ class CacheBackend { } /** - * @param {string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set} [what] what to purge + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge */ purgeParent(what) { if (!what) { @@ -421,7 +432,7 @@ class CacheBackend { /** * @param {string} path path * @param {Error | null} err error - * @param {any} result result + * @param {EXPECTED_ANY} result result */ _storeResult(path, err, result) { if (this._data.has(path)) return; @@ -434,7 +445,7 @@ class CacheBackend { const nextLevel = (this._currentLevel + 1) % this._levels.length; const decay = this._levels[nextLevel]; this._currentLevel = nextLevel; - for (let item of decay) { + for (const item of decay) { this._data.delete(item); } decay.clear(); @@ -468,13 +479,14 @@ class CacheBackend { this._runDecays(); // _runDecays may change the mode if ( - /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC}*/ + /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC} */ (this._mode) === STORAGE_MODE_IDLE - ) + ) { return; + } timeout = Math.max( 0, - /** @type {number} */ (this._nextDecay) - Date.now() + /** @type {number} */ (this._nextDecay) - Date.now(), ); break; } @@ -502,8 +514,8 @@ class CacheBackend { } /** - * @template {function} Provider - * @template {function} AsyncProvider + * @template {EXPECTED_FUNCTION} Provider + * @template {EXPECTED_FUNCTION} AsyncProvider * @template FileSystem * @param {number} duration duration in ms files are cached * @param {Provider | undefined} provider provider @@ -530,7 +542,7 @@ module.exports = class CachedInputFileSystem { duration, this.fileSystem.lstat, this.fileSystem.lstatSync, - this.fileSystem + this.fileSystem, ); const lstat = this._lstatBackend.provide; this.lstat = /** @type {FileSystem["lstat"]} */ (lstat); @@ -541,7 +553,7 @@ module.exports = class CachedInputFileSystem { duration, this.fileSystem.stat, this.fileSystem.statSync, - this.fileSystem + this.fileSystem, ); const stat = this._statBackend.provide; this.stat = /** @type {FileSystem["stat"]} */ (stat); @@ -552,7 +564,7 @@ module.exports = class CachedInputFileSystem { duration, this.fileSystem.readdir, this.fileSystem.readdirSync, - this.fileSystem + this.fileSystem, ); const readdir = this._readdirBackend.provide; this.readdir = /** @type {FileSystem["readdir"]} */ (readdir); @@ -565,7 +577,7 @@ module.exports = class CachedInputFileSystem { duration, this.fileSystem.readFile, this.fileSystem.readFileSync, - this.fileSystem + this.fileSystem, ); const readFile = this._readFileBackend.provide; this.readFile = /** @type {FileSystem["readFile"]} */ (readFile); @@ -582,18 +594,18 @@ module.exports = class CachedInputFileSystem { ( /** * @param {string} path path - * @param {FileSystemCallback} callback + * @param {FileSystemCallback} callback callback */ (path, callback) => { this.readFile(path, (err, buffer) => { if (err) return callback(err); if (!buffer || buffer.length === 0) - return callback(new Error("No file content")); + {return callback(new Error("No file content"));} let data; try { - data = JSON.parse(buffer.toString("utf-8")); - } catch (e) { - return callback(/** @type {Error} */ (e)); + data = JSON.parse(buffer.toString("utf8")); + } catch (err_) { + return callback(/** @type {Error} */ (err_)); } callback(null, data); }); @@ -605,15 +617,15 @@ module.exports = class CachedInputFileSystem { ( /** * @param {string} path path - * @returns {any} result + * @returns {EXPECTED_ANY} result */ (path) => { const buffer = this.readFileSync(path); - const data = JSON.parse(buffer.toString("utf-8")); + const data = JSON.parse(buffer.toString("utf8")); return data; } )), - this.fileSystem + this.fileSystem, ); const readJson = this._readJsonBackend.provide; this.readJson = /** @type {FileSystem["readJson"]} */ (readJson); @@ -626,7 +638,7 @@ module.exports = class CachedInputFileSystem { duration, this.fileSystem.readlink, this.fileSystem.readlinkSync, - this.fileSystem + this.fileSystem, ); const readlink = this._readlinkBackend.provide; this.readlink = /** @type {FileSystem["readlink"]} */ (readlink); @@ -639,7 +651,7 @@ module.exports = class CachedInputFileSystem { duration, this.fileSystem.realpath, this.fileSystem.realpathSync, - this.fileSystem + this.fileSystem, ); const realpath = this._realpathBackend.provide; this.realpath = /** @type {FileSystem["realpath"]} */ (realpath); @@ -650,7 +662,7 @@ module.exports = class CachedInputFileSystem { } /** - * @param {string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set} [what] what to purge + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge */ purge(what) { this._statBackend.purge(what); diff --git a/lib/CloneBasenamePlugin.js b/lib/CloneBasenamePlugin.js index cc193f58..295adaaa 100644 --- a/lib/CloneBasenamePlugin.js +++ b/lib/CloneBasenamePlugin.js @@ -5,7 +5,7 @@ "use strict"; -const basename = require("./getPaths").basename; +const { basename } = require("./getPaths"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ @@ -39,14 +39,14 @@ module.exports = class CloneBasenamePlugin { path: filePath, relativePath: request.relativePath && - resolver.join(request.relativePath, filename) + resolver.join(request.relativePath, filename), }; resolver.doResolve( target, obj, - "using path: " + filePath, + `using path: ${filePath}`, resolveContext, - callback + callback, ); }); } diff --git a/lib/ConditionalPlugin.js b/lib/ConditionalPlugin.js index 0e661076..99cc09d4 100644 --- a/lib/ConditionalPlugin.js +++ b/lib/ConditionalPlugin.js @@ -52,7 +52,7 @@ module.exports = class ConditionalPlugin { // Don't allow other alternatives if (result === undefined) return callback(null, null); callback(null, result); - } + }, ); }); } diff --git a/lib/DescriptionFilePlugin.js b/lib/DescriptionFilePlugin.js index 8bbdb720..9fbb1656 100644 --- a/lib/DescriptionFilePlugin.js +++ b/lib/DescriptionFilePlugin.js @@ -36,7 +36,7 @@ module.exports = class DescriptionFilePlugin { .tapAsync( "DescriptionFilePlugin", (request, resolveContext, callback) => { - const path = request.path; + const { path } = request; if (!path) return callback(); const directory = this.pathIsFile ? DescriptionFileUtils.cdUp(path) @@ -50,37 +50,37 @@ module.exports = class DescriptionFilePlugin { ? { path: request.descriptionFilePath, content: request.descriptionFileData, - directory: /** @type {string} */ (request.descriptionFileRoot) - } + directory: + /** @type {string} */ + (request.descriptionFileRoot), + } : undefined, resolveContext, (err, result) => { if (err) return callback(err); if (!result) { - if (resolveContext.log) + if (resolveContext.log) { resolveContext.log( - `No description file found in ${directory} or above` + `No description file found in ${directory} or above`, ); + } return callback(); } - const relativePath = - "." + path.slice(result.directory.length).replace(/\\/g, "/"); + const relativePath = `.${path.slice(result.directory.length).replace(/\\/g, "/")}`; /** @type {ResolveRequest} */ const obj = { ...request, descriptionFilePath: result.path, descriptionFileData: result.content, descriptionFileRoot: result.directory, - relativePath: relativePath + relativePath, }; resolver.doResolve( target, obj, - "using description file: " + - result.path + - " (relative path: " + - relativePath + - ")", + `using description file: ${result.path} (relative path: ${ + relativePath + })`, resolveContext, (err, result) => { if (err) return callback(err); @@ -88,11 +88,11 @@ module.exports = class DescriptionFilePlugin { // Don't allow other processing if (result === undefined) return callback(null, null); callback(null, result); - } + }, ); - } + }, ); - } + }, ); } }; diff --git a/lib/DescriptionFileUtils.js b/lib/DescriptionFileUtils.js index ff53ad5f..48269aa2 100644 --- a/lib/DescriptionFileUtils.js +++ b/lib/DescriptionFileUtils.js @@ -14,10 +14,10 @@ const forEachBail = require("./forEachBail"); /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** - * @typedef {Object} DescriptionFileInfo - * @property {JsonObject=} content - * @property {string} path - * @property {string} directory + * @typedef {object} DescriptionFileInfo + * @property {JsonObject=} content content + * @property {string} path path + * @property {string} directory directory */ /** @@ -27,12 +27,25 @@ const forEachBail = require("./forEachBail"); */ /** - * @typedef {Object} Result + * @typedef {object} Result * @property {string} path path to description file * @property {string} directory directory of description file * @property {JsonObject} content content of description file */ +/** + * @param {string} directory directory + * @returns {string|null} parent directory or null + */ +function cdUp(directory) { + if (directory === "/") return null; + const i = directory.lastIndexOf("/"); + const j = directory.lastIndexOf("\\"); + const path = i < 0 ? j : j < 0 ? i : i < j ? j : i; + if (path < 0) return null; + return directory.slice(0, path || 1); +} + /** * @param {Resolver} resolver resolver * @param {string} directory directory @@ -47,7 +60,7 @@ function loadDescriptionFile( filenames, oldInfo, resolveContext, - callback + callback, ) { (function findDescriptionFile() { if (oldInfo && oldInfo.directory === directory) { @@ -63,6 +76,30 @@ function loadDescriptionFile( */ (filename, callback) => { const descriptionFilePath = resolver.join(directory, filename); + + /** + * @param {(null | Error)=} err error + * @param {JsonObject=} resolvedContent content + * @returns {void} + */ + function onJson(err, resolvedContent) { + if (err) { + if (resolveContext.log) { + resolveContext.log( + `${descriptionFilePath} (directory description file): ${err}`, + ); + } else { + err.message = `${descriptionFilePath} (directory description file): ${err}`; + } + return callback(err); + } + callback(null, { + content: /** @type {JsonObject} */ (resolvedContent), + directory, + path: descriptionFilePath, + }); + } + if (resolver.fileSystem.readJson) { resolver.fileSystem.readJson(descriptionFilePath, (err, content) => { if (err) { @@ -103,8 +140,8 @@ function loadDescriptionFile( if (content) { try { json = JSON.parse(content.toString()); - } catch (/** @type {unknown} */ e) { - return onJson(/** @type {Error} */ (e)); + } catch (/** @type {unknown} */ err_) { + return onJson(/** @type {Error} */ (err_)); } } else { return onJson(new Error("No content in file")); @@ -113,49 +150,22 @@ function loadDescriptionFile( onJson(null, json); }); } - - /** - * @param {null|Error} [err] error - * @param {JsonObject} [content] content - * @returns {void} - */ - function onJson(err, content) { - if (err) { - if (resolveContext.log) - resolveContext.log( - descriptionFilePath + " (directory description file): " + err - ); - else - err.message = - descriptionFilePath + " (directory description file): " + err; - return callback(err); - } - callback(null, { - content: /** @type {JsonObject} */ (content), - directory, - path: descriptionFilePath - }); - } }, /** - * @param {null|Error} [err] error - * @param {null|Result} [result] result + * @param {(null | Error)=} err error + * @param {(null | Result)=} result result * @returns {void} */ (err, result) => { if (err) return callback(err); - if (result) { - return callback(null, result); - } else { - const dir = cdUp(directory); - if (!dir) { - return callback(); - } else { - directory = dir; - return findDescriptionFile(); - } + if (result) return callback(null, result); + const dir = cdUp(directory); + if (!dir) { + return callback(); } - } + directory = dir; + return findDescriptionFile(); + }, ); })(); } @@ -178,24 +188,10 @@ function getField(content, field) { current = /** @type {JsonObject} */ (current)[field[j]]; } return current; - } else { - return content[field]; } + return content[field]; } -/** - * @param {string} directory directory - * @returns {string|null} parent directory or null - */ -function cdUp(directory) { - if (directory === "/") return null; - const i = directory.lastIndexOf("/"), - j = directory.lastIndexOf("\\"); - const p = i < 0 ? j : j < 0 ? i : i < j ? j : i; - if (p < 0) return null; - return directory.slice(0, p || 1); -} - -exports.loadDescriptionFile = loadDescriptionFile; -exports.getField = getField; -exports.cdUp = cdUp; +module.exports.loadDescriptionFile = loadDescriptionFile; +module.exports.getField = getField; +module.exports.cdUp = cdUp; diff --git a/lib/DirectoryExistsPlugin.js b/lib/DirectoryExistsPlugin.js index 80c94094..78a46394 100644 --- a/lib/DirectoryExistsPlugin.js +++ b/lib/DirectoryExistsPlugin.js @@ -34,30 +34,35 @@ module.exports = class DirectoryExistsPlugin { if (!directory) return callback(); fs.stat(directory, (err, stat) => { if (err || !stat) { - if (resolveContext.missingDependencies) + if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(directory); - if (resolveContext.log) - resolveContext.log(directory + " doesn't exist"); + } + if (resolveContext.log) { + resolveContext.log(`${directory} doesn't exist`); + } return callback(); } if (!stat.isDirectory()) { - if (resolveContext.missingDependencies) + if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(directory); - if (resolveContext.log) - resolveContext.log(directory + " is not a directory"); + } + if (resolveContext.log) { + resolveContext.log(`${directory} is not a directory`); + } return callback(); } - if (resolveContext.fileDependencies) + if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(directory); + } resolver.doResolve( target, request, `existing directory ${directory}`, resolveContext, - callback + callback, ); }); - } + }, ); } }; diff --git a/lib/ExportsFieldPlugin.js b/lib/ExportsFieldPlugin.js index 671c1fee..6f581fb3 100644 --- a/lib/ExportsFieldPlugin.js +++ b/lib/ExportsFieldPlugin.js @@ -11,7 +11,7 @@ const { processExportsField } = require("./util/entrypoints"); const { parseIdentifier } = require("./util/identifier"); const { invalidSegmentRegEx, - deprecatedInvalidSegmentRegEx + deprecatedInvalidSegmentRegEx, } = require("./util/path"); /** @typedef {import("./Resolver")} Resolver */ @@ -53,21 +53,22 @@ module.exports = class ExportsFieldPlugin { // (There is no description file inside of this package) request.relativePath !== "." || request.request === undefined - ) + ) { return callback(); + } const remainingRequest = request.query || request.fragment ? (request.request === "." ? "./" : request.request) + - request.query + - request.fragment + request.query + + request.fragment : request.request; const exportsField = /** @type {ExportsField|null|undefined} */ ( DescriptionFileUtils.getField( /** @type {JsonObject} */ (request.descriptionFileData), - this.fieldName + this.fieldName, ) ); if (!exportsField) return callback(); @@ -75,8 +76,8 @@ module.exports = class ExportsFieldPlugin { if (request.directory) { return callback( new Error( - `Resolving to directories is not possible with the exports field (request was ${remainingRequest}/)` - ) + `Resolving to directories is not possible with the exports field (request was ${remainingRequest}/)`, + ), ); } @@ -90,23 +91,23 @@ module.exports = class ExportsFieldPlugin { // because we use a WeakMap and the exportsField could be a string too. // Description file is always an object when exports field can be accessed. let fieldProcessor = this.fieldProcessorCache.get( - /** @type {JsonObject} */ (request.descriptionFileData) + /** @type {JsonObject} */ (request.descriptionFileData), ); if (fieldProcessor === undefined) { fieldProcessor = processExportsField(exportsField); this.fieldProcessorCache.set( /** @type {JsonObject} */ (request.descriptionFileData), - fieldProcessor + fieldProcessor, ); } [paths, usedField] = fieldProcessor( remainingRequest, - this.conditionNames + this.conditionNames, ); } catch (/** @type {unknown} */ err) { if (resolveContext.log) { resolveContext.log( - `Exports field in ${request.descriptionFilePath} can't be processed: ${err}` + `Exports field in ${request.descriptionFilePath} can't be processed: ${err}`, ); } return callback(/** @type {Error} */ (err)); @@ -115,21 +116,21 @@ module.exports = class ExportsFieldPlugin { if (paths.length === 0) { return callback( new Error( - `Package path ${remainingRequest} is not exported from package ${request.descriptionFileRoot} (see exports field in ${request.descriptionFilePath})` - ) + `Package path ${remainingRequest} is not exported from package ${request.descriptionFileRoot} (see exports field in ${request.descriptionFilePath})`, + ), ); } forEachBail( paths, /** - * @param {string} p path + * @param {string} path path * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback * @param {number} i index * @returns {void} */ - (p, callback, i) => { - const parsedIdentifier = parseIdentifier(p); + (path, callback, i) => { + const parsedIdentifier = parseIdentifier(path); if (!parsedIdentifier) return callback(); @@ -139,8 +140,8 @@ module.exports = class ExportsFieldPlugin { if (paths.length === i) { return callback( new Error( - `Invalid "exports" target "${p}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"` - ) + `Invalid "exports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, + ), ); } @@ -154,8 +155,8 @@ module.exports = class ExportsFieldPlugin { if (paths.length === i) { return callback( new Error( - `Invalid "exports" target "${p}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"` - ) + `Invalid "exports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, + ), ); } @@ -168,32 +169,32 @@ module.exports = class ExportsFieldPlugin { request: undefined, path: resolver.join( /** @type {string} */ (request.descriptionFileRoot), - relativePath + relativePath, ), relativePath, query, - fragment + fragment, }; resolver.doResolve( target, obj, - "using exports field: " + p, + `using exports field: ${path}`, resolveContext, (err, result) => { if (err) return callback(err); // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 if (result === undefined) return callback(null, null); callback(null, result); - } + }, ); }, /** - * @param {null|Error} [err] error - * @param {null|ResolveRequest} [result] result + * @param {(null | Error)=} err error + * @param {(null | ResolveRequest)=} result result * @returns {void} */ - (err, result) => callback(err, result || null) + (err, result) => callback(err, result || null), ); }); } diff --git a/lib/ExtensionAliasPlugin.js b/lib/ExtensionAliasPlugin.js index a9479906..4184eb36 100644 --- a/lib/ExtensionAliasPlugin.js +++ b/lib/ExtensionAliasPlugin.js @@ -39,14 +39,14 @@ module.exports = class ExtensionAliasPlugin { const isAliasString = typeof alias === "string"; /** * @param {string} alias extension alias - * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback - * @param {number} [index] index + * @param {(err?: null | Error, result?: null|ResolveRequest) => void} callback callback + * @param {number=} index index * @returns {void} */ const resolve = (alias, callback, index) => { const newRequest = `${requestPath.slice( 0, - -extension.length + -extension.length, )}${alias}`; return resolver.doResolve( @@ -54,7 +54,7 @@ module.exports = class ExtensionAliasPlugin { { ...request, request: newRequest, - fullySpecified: true + fullySpecified: true, }, `aliased from extension alias with mapping '${extension}' to '${alias}'`, resolveContext, @@ -64,7 +64,7 @@ module.exports = class ExtensionAliasPlugin { if (index !== this.options.alias.length) { if (resolveContext.log) { resolveContext.log( - `Failed to alias from extension alias with mapping '${extension}' to '${alias}' for '${newRequest}': ${err}` + `Failed to alias from extension alias with mapping '${extension}' to '${alias}' for '${newRequest}': ${err}`, ); } @@ -72,15 +72,14 @@ module.exports = class ExtensionAliasPlugin { } return callback(err, result); - } else { - callback(err, result); } - } + callback(err, result); + }, ); }; /** - * @param {null|Error} [err] error - * @param {null|ResolveRequest} [result] result + * @param {(null | Error)=} err error + * @param {(null | ResolveRequest)=} result result * @returns {void} */ const stoppingCallback = (err, result) => { diff --git a/lib/FileExistsPlugin.js b/lib/FileExistsPlugin.js index 2dd33e3e..cf9c8391 100644 --- a/lib/FileExistsPlugin.js +++ b/lib/FileExistsPlugin.js @@ -32,25 +32,28 @@ module.exports = class FileExistsPlugin { if (!file) return callback(); fs.stat(file, (err, stat) => { if (err || !stat) { - if (resolveContext.missingDependencies) + if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(file); - if (resolveContext.log) resolveContext.log(file + " doesn't exist"); + } + if (resolveContext.log) resolveContext.log(`${file} doesn't exist`); return callback(); } if (!stat.isFile()) { - if (resolveContext.missingDependencies) + if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(file); - if (resolveContext.log) resolveContext.log(file + " is not a file"); + } + if (resolveContext.log) resolveContext.log(`${file} is not a file`); return callback(); } - if (resolveContext.fileDependencies) + if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(file); + } resolver.doResolve( target, request, - "existing file: " + file, + `existing file: ${file}`, resolveContext, - callback + callback, ); }); }); diff --git a/lib/ImportsFieldPlugin.js b/lib/ImportsFieldPlugin.js index 15cad76f..ebc1b597 100644 --- a/lib/ImportsFieldPlugin.js +++ b/lib/ImportsFieldPlugin.js @@ -11,7 +11,7 @@ const { processImportsField } = require("./util/entrypoints"); const { parseIdentifier } = require("./util/identifier"); const { invalidSegmentRegEx, - deprecatedInvalidSegmentRegEx + deprecatedInvalidSegmentRegEx, } = require("./util/path"); /** @typedef {import("./Resolver")} Resolver */ @@ -36,7 +36,7 @@ module.exports = class ImportsFieldPlugin { conditionNames, fieldNamePath, targetFile, - targetPackage + targetPackage, ) { this.source = source; this.targetFile = targetFile; @@ -70,7 +70,7 @@ module.exports = class ImportsFieldPlugin { ( DescriptionFileUtils.getField( /** @type {JsonObject} */ (request.descriptionFileData), - this.fieldName + this.fieldName, ) ); if (!importsField) return callback(); @@ -78,8 +78,8 @@ module.exports = class ImportsFieldPlugin { if (request.directory) { return callback( new Error( - `Resolving to directories is not possible with the imports field (request was ${remainingRequest}/)` - ) + `Resolving to directories is not possible with the imports field (request was ${remainingRequest}/)`, + ), ); } @@ -93,23 +93,23 @@ module.exports = class ImportsFieldPlugin { // because we use a WeakMap and the importsField could be a string too. // Description file is always an object when exports field can be accessed. let fieldProcessor = this.fieldProcessorCache.get( - /** @type {JsonObject} */ (request.descriptionFileData) + /** @type {JsonObject} */ (request.descriptionFileData), ); if (fieldProcessor === undefined) { fieldProcessor = processImportsField(importsField); this.fieldProcessorCache.set( /** @type {JsonObject} */ (request.descriptionFileData), - fieldProcessor + fieldProcessor, ); } [paths, usedField] = fieldProcessor( remainingRequest, - this.conditionNames + this.conditionNames, ); } catch (/** @type {unknown} */ err) { if (resolveContext.log) { resolveContext.log( - `Imports field in ${request.descriptionFilePath} can't be processed: ${err}` + `Imports field in ${request.descriptionFilePath} can't be processed: ${err}`, ); } return callback(/** @type {Error} */ (err)); @@ -118,21 +118,21 @@ module.exports = class ImportsFieldPlugin { if (paths.length === 0) { return callback( new Error( - `Package import ${remainingRequest} is not imported from package ${request.descriptionFileRoot} (see imports field in ${request.descriptionFilePath})` - ) + `Package import ${remainingRequest} is not imported from package ${request.descriptionFileRoot} (see imports field in ${request.descriptionFilePath})`, + ), ); } forEachBail( paths, /** - * @param {string} p path + * @param {string} path path * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback * @param {number} i index * @returns {void} */ - (p, callback, i) => { - const parsedIdentifier = parseIdentifier(p); + (path, callback, i) => { + const parsedIdentifier = parseIdentifier(path); if (!parsedIdentifier) return callback(); @@ -148,8 +148,8 @@ module.exports = class ImportsFieldPlugin { if (paths.length === i) { return callback( new Error( - `Invalid "imports" target "${p}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"` - ) + `Invalid "imports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, + ), ); } @@ -162,24 +162,24 @@ module.exports = class ImportsFieldPlugin { request: undefined, path: resolver.join( /** @type {string} */ (request.descriptionFileRoot), - path_ + path_, ), relativePath: path_, query, - fragment + fragment, }; resolver.doResolve( targetFile, obj, - "using imports field: " + p, + `using imports field: ${path}`, resolveContext, (err, result) => { if (err) return callback(err); // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 if (result === undefined) return callback(null, null); callback(null, result); - } + }, ); break; } @@ -193,30 +193,30 @@ module.exports = class ImportsFieldPlugin { relativePath: path_, fullySpecified: true, query, - fragment + fragment, }; resolver.doResolve( targetPackage, obj, - "using imports field: " + p, + `using imports field: ${path}`, resolveContext, (err, result) => { if (err) return callback(err); // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 if (result === undefined) return callback(null, null); callback(null, result); - } + }, ); } } }, /** - * @param {null|Error} [err] error - * @param {null|ResolveRequest} [result] result + * @param {(null|Error)=} err error + * @param {(null|ResolveRequest)=} result result * @returns {void} */ - (err, result) => callback(err, result || null) + (err, result) => callback(err, result || null), ); }); } diff --git a/lib/JoinRequestPartPlugin.js b/lib/JoinRequestPartPlugin.js index 21c2cae0..a171b988 100644 --- a/lib/JoinRequestPartPlugin.js +++ b/lib/JoinRequestPartPlugin.js @@ -51,7 +51,7 @@ module.exports = class JoinRequestPartPlugin { fullySpecified = false; } else { moduleName = req.slice(0, i); - remainingRequest = "." + req.slice(i); + remainingRequest = `.${req.slice(i)}`; fullySpecified = /** @type {boolean} */ (request.fullySpecified); } /** @type {ResolveRequest} */ @@ -60,16 +60,16 @@ module.exports = class JoinRequestPartPlugin { path: resolver.join( /** @type {string} */ (request.path), - moduleName + moduleName, ), relativePath: request.relativePath && resolver.join(request.relativePath, moduleName), request: remainingRequest, - fullySpecified + fullySpecified, }; resolver.doResolve(target, obj, null, resolveContext, callback); - } + }, ); } }; diff --git a/lib/JoinRequestPlugin.js b/lib/JoinRequestPlugin.js index 2ac99e97..108958ec 100644 --- a/lib/JoinRequestPlugin.js +++ b/lib/JoinRequestPlugin.js @@ -37,7 +37,7 @@ module.exports = class JoinRequestPlugin { relativePath: request.relativePath && resolver.join(request.relativePath, requestRequest), - request: undefined + request: undefined, }; resolver.doResolve(target, obj, null, resolveContext, callback); }); diff --git a/lib/LogInfoPlugin.js b/lib/LogInfoPlugin.js index d8b92070..94aecc1d 100644 --- a/lib/LogInfoPlugin.js +++ b/lib/LogInfoPlugin.js @@ -21,33 +21,39 @@ module.exports = class LogInfoPlugin { * @returns {void} */ apply(resolver) { - const source = this.source; + const { source } = this; resolver .getHook(this.source) .tapAsync("LogInfoPlugin", (request, resolveContext, callback) => { if (!resolveContext.log) return callback(); - const log = resolveContext.log; - const prefix = "[" + source + "] "; - if (request.path) - log(prefix + "Resolving in directory: " + request.path); - if (request.request) - log(prefix + "Resolving request: " + request.request); - if (request.module) log(prefix + "Request is an module request."); - if (request.directory) log(prefix + "Request is a directory request."); - if (request.query) - log(prefix + "Resolving request query: " + request.query); - if (request.fragment) - log(prefix + "Resolving request fragment: " + request.fragment); - if (request.descriptionFilePath) + const { log } = resolveContext; + const prefix = `[${source}] `; + if (request.path) { + log(`${prefix}Resolving in directory: ${request.path}`); + } + if (request.request) { + log(`${prefix}Resolving request: ${request.request}`); + } + if (request.module) log(`${prefix}Request is an module request.`); + if (request.directory) log(`${prefix}Request is a directory request.`); + if (request.query) { + log(`${prefix}Resolving request query: ${request.query}`); + } + if (request.fragment) { + log(`${prefix}Resolving request fragment: ${request.fragment}`); + } + if (request.descriptionFilePath) { log( - prefix + "Has description data from " + request.descriptionFilePath + `${prefix}Has description data from ${request.descriptionFilePath}`, ); - if (request.relativePath) + } + if (request.relativePath) { log( - prefix + - "Relative path from description file is: " + + `${prefix}Relative path from description file is: ${ request.relativePath + }`, ); + } callback(); }); } diff --git a/lib/MainFieldPlugin.js b/lib/MainFieldPlugin.js index 645b7df2..1a526816 100644 --- a/lib/MainFieldPlugin.js +++ b/lib/MainFieldPlugin.js @@ -43,15 +43,16 @@ module.exports = class MainFieldPlugin { /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ (request)[alreadyTriedMainField] === request.descriptionFilePath || !request.descriptionFilePath - ) + ) { return callback(); + } const filename = path.basename(request.descriptionFilePath); let mainModule = /** @type {string|null|undefined} */ ( DescriptionFileUtils.getField( /** @type {JsonObject} */ (request.descriptionFileData), - this.options.name + this.options.name, ) ); @@ -63,27 +64,23 @@ module.exports = class MainFieldPlugin { ) { return callback(); } - if (this.options.forceRelative && !/^\.\.?\//.test(mainModule)) - mainModule = "./" + mainModule; + if (this.options.forceRelative && !/^\.\.?\//.test(mainModule)) { + mainModule = `./${mainModule}`; + } /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ const obj = { ...request, request: mainModule, module: false, directory: mainModule.endsWith("/"), - [alreadyTriedMainField]: request.descriptionFilePath + [alreadyTriedMainField]: request.descriptionFilePath, }; return resolver.doResolve( target, obj, - "use " + - mainModule + - " from " + - this.options.name + - " in " + - filename, + `use ${mainModule} from ${this.options.name} in ${filename}`, resolveContext, - callback + callback, ); }); } diff --git a/lib/ModulesInHierarchicalDirectoriesPlugin.js b/lib/ModulesInHierarchicalDirectoriesPlugin.js index 1e51638c..8ed78cdb 100644 --- a/lib/ModulesInHierarchicalDirectoriesPlugin.js +++ b/lib/ModulesInHierarchicalDirectoriesPlugin.js @@ -20,7 +20,7 @@ module.exports = class ModulesInHierarchicalDirectoriesPlugin { */ constructor(source, directories, target) { this.source = source; - this.directories = /** @type {Array} */ ([]).concat(directories); + this.directories = /** @type {Array} */ [...directories]; this.target = target; } @@ -37,11 +37,13 @@ module.exports = class ModulesInHierarchicalDirectoriesPlugin { (request, resolveContext, callback) => { const fs = resolver.fileSystem; const addrs = getPaths(/** @type {string} */ (request.path)) - .paths.map((p) => { - return this.directories.map((d) => resolver.join(p, d)); - }) - .reduce((array, p) => { - array.push.apply(array, p); + .paths.map((path) => + this.directories.map((directory) => + resolver.join(path, directory), + ), + ) + .reduce((array, path) => { + array.push(...path); return array; }, []); forEachBail( @@ -58,30 +60,32 @@ module.exports = class ModulesInHierarchicalDirectoriesPlugin { const obj = { ...request, path: addr, - request: "./" + request.request, - module: false + request: `./${request.request}`, + module: false, }; - const message = "looking for modules in " + addr; + const message = `looking for modules in ${addr}`; return resolver.doResolve( target, obj, message, resolveContext, - callback + callback, ); } - if (resolveContext.log) + if (resolveContext.log) { resolveContext.log( - addr + " doesn't exist or is not a directory" + `${addr} doesn't exist or is not a directory`, ); - if (resolveContext.missingDependencies) + } + if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(addr); + } return callback(); }); }, - callback + callback, ); - } + }, ); } }; diff --git a/lib/ModulesInRootPlugin.js b/lib/ModulesInRootPlugin.js index b7e51688..7797a11e 100644 --- a/lib/ModulesInRootPlugin.js +++ b/lib/ModulesInRootPlugin.js @@ -34,15 +34,15 @@ module.exports = class ModulesInRootPlugin { const obj = { ...request, path: this.path, - request: "./" + request.request, - module: false + request: `./${request.request}`, + module: false, }; resolver.doResolve( target, obj, - "looking for modules in " + this.path, + `looking for modules in ${this.path}`, resolveContext, - callback + callback, ); }); } diff --git a/lib/ParsePlugin.js b/lib/ParsePlugin.js index b7db0b07..c96c210b 100644 --- a/lib/ParsePlugin.js +++ b/lib/ParsePlugin.js @@ -41,8 +41,9 @@ module.exports = class ParsePlugin { } if (parsed && resolveContext.log) { if (parsed.module) resolveContext.log("Parsed request is a module"); - if (parsed.directory) + if (parsed.directory) { resolveContext.log("Parsed request is a directory"); + } } // There is an edge-case where a request with # can be a path or a fragment -> try both if (obj.request && !obj.query && obj.fragment) { @@ -55,7 +56,7 @@ module.exports = class ParsePlugin { obj.request + (obj.directory ? "/" : "") + (directory ? obj.fragment.slice(0, -1) : obj.fragment), - fragment: "" + fragment: "", }; resolver.doResolve( target, @@ -66,7 +67,7 @@ module.exports = class ParsePlugin { if (err) return callback(err); if (result) return callback(null, result); resolver.doResolve(target, obj, null, resolveContext, callback); - } + }, ); return; } diff --git a/lib/PnpPlugin.js b/lib/PnpPlugin.js index d3d98bad..9f767cab 100644 --- a/lib/PnpPlugin.js +++ b/lib/PnpPlugin.js @@ -9,8 +9,8 @@ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** - * @typedef {Object} PnpApiImpl - * @property {function(string, string, object): string | null} resolveToUnqualified + * @typedef {object} PnpApiImpl + * @property {(packageName: string, issuer: string, options: { considerBuiltins: boolean }) => string | null} resolveToUnqualified resolve to unqualified */ module.exports = class PnpPlugin { @@ -47,7 +47,7 @@ module.exports = class PnpPlugin { const packageMatch = /^(@[^/]+\/)?[^/]+/.exec(req); if (!packageMatch) return callback(); - const packageName = packageMatch[0]; + const [packageName] = packageMatch; const innerRequest = `.${req.slice(packageName.length)}`; /** @type {string|undefined|null} */ @@ -56,7 +56,7 @@ module.exports = class PnpPlugin { let apiResolution; try { resolution = this.pnpApi.resolveToUnqualified(packageName, issuer, { - considerBuiltins: false + considerBuiltins: false, }); if (resolution === null) { @@ -72,14 +72,14 @@ module.exports = class PnpPlugin { if (result) return callback(null, result); // Skip alternatives return callback(null, null); - } + }, ); return; } if (resolveContext.fileDependencies) { apiResolution = this.pnpApi.resolveToUnqualified("pnpapi", issuer, { - considerBuiltins: false + considerBuiltins: false, }); } } catch (/** @type {unknown} */ error) { @@ -92,11 +92,12 @@ module.exports = class PnpPlugin { // This is not a PnP managed dependency. // Try to continue resolving with our alternatives if (resolveContext.log) { - resolveContext.log(`request is not managed by the pnpapi`); + resolveContext.log("request is not managed by the pnpapi"); for (const line of /** @type {Error} */ (error).message .split("\n") - .filter(Boolean)) + .filter(Boolean)) { resolveContext.log(` ${line}`); + } } return callback(); } @@ -114,7 +115,7 @@ module.exports = class PnpPlugin { path: resolution, request: innerRequest, ignoreSymlinks: true, - fullySpecified: request.fullySpecified && innerRequest !== "." + fullySpecified: request.fullySpecified && innerRequest !== ".", }; resolver.doResolve( target, @@ -126,7 +127,7 @@ module.exports = class PnpPlugin { if (result) return callback(null, result); // Skip alternatives return callback(null, null); - } + }, ); }); } diff --git a/lib/Resolver.js b/lib/Resolver.js index fe0516e8..969d4526 100644 --- a/lib/Resolver.js +++ b/lib/Resolver.js @@ -12,7 +12,7 @@ const { normalize, cachedJoin: join, getType, - PathType + PathType, } = require("./util/path"); /** @typedef {import("./ResolverFactory").ResolveOptions} ResolveOptions */ @@ -22,11 +22,11 @@ const { /** @typedef {(err: ErrorWithDetail | null, res?: string | false, req?: ResolveRequest) => void} ResolveCallback */ /** - * @typedef {Object} PossibleFileSystemError - * @property {string=} code - * @property {number=} errno - * @property {string=} path - * @property {string=} syscall + * @typedef {object} PossibleFileSystemError + * @property {string=} code code + * @property {number=} errno number + * @property {string=} path path + * @property {string=} syscall syscall */ /** @@ -45,50 +45,50 @@ const { */ /** - * @typedef {Object} ObjectEncodingOptions - * @property {BufferEncoding | null | undefined} [encoding] + * @typedef {object} ObjectEncodingOptions + * @property {(BufferEncoding | null | undefined)=} encoding encoding */ -/** @typedef {function(NodeJS.ErrnoException | null, string=): void} StringCallback */ -/** @typedef {function(NodeJS.ErrnoException | null, Buffer=): void} BufferCallback */ -/** @typedef {function(NodeJS.ErrnoException | null, (string | Buffer)=): void} StringOrBufferCallback */ -/** @typedef {function(NodeJS.ErrnoException | null, IStats=): void} StatsCallback */ -/** @typedef {function(NodeJS.ErrnoException | null, IBigIntStats=): void} BigIntStatsCallback */ -/** @typedef {function(NodeJS.ErrnoException | null, (IStats | IBigIntStats)=): void} StatsOrBigIntStatsCallback */ -/** @typedef {function(NodeJS.ErrnoException | Error | null, JsonObject=): void} ReadJsonCallback */ -/** @typedef {function(NodeJS.ErrnoException | null, string[]=): void} ReaddirStringCallback */ -/** @typedef {function(NodeJS.ErrnoException | null, Buffer[]=): void} ReaddirBufferCallback */ -/** @typedef {function(NodeJS.ErrnoException | null, (string[] | Buffer[])=): void} ReaddirStringOrBufferCallback */ -/** @typedef {function(NodeJS.ErrnoException | null, Dirent[]=): void} ReaddirDirentCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: string) => void} StringCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: Buffer) => void} BufferCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: (string | Buffer)) => void} StringOrBufferCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: IStats) => void} StatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: IBigIntStats) => void} BigIntStatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: (IStats | IBigIntStats)) => void} StatsOrBigIntStatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | Error | null, result?: JsonObject) => void} ReadJsonCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: string[]) => void} ReaddirStringCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: Buffer[]) => void} ReaddirBufferCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: (string[] | Buffer[])) => void} ReaddirStringOrBufferCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: Dirent[]) => void} ReaddirDirentCallback */ /** * @template T - * @typedef {Object} IStatsBase - * @property {() => boolean} isFile - * @property {() => boolean} isDirectory - * @property {() => boolean} isBlockDevice - * @property {() => boolean} isCharacterDevice - * @property {() => boolean} isSymbolicLink - * @property {() => boolean} isFIFO - * @property {() => boolean} isSocket - * @property {T} dev - * @property {T} ino - * @property {T} mode - * @property {T} nlink - * @property {T} uid - * @property {T} gid - * @property {T} rdev - * @property {T} size - * @property {T} blksize - * @property {T} blocks - * @property {T} atimeMs - * @property {T} mtimeMs - * @property {T} ctimeMs - * @property {T} birthtimeMs - * @property {Date} atime - * @property {Date} mtime - * @property {Date} ctime - * @property {Date} birthtime + * @typedef {object} IStatsBase + * @property {() => boolean} isFile is file + * @property {() => boolean} isDirectory is directory + * @property {() => boolean} isBlockDevice is block device + * @property {() => boolean} isCharacterDevice is character device + * @property {() => boolean} isSymbolicLink is symbolic link + * @property {() => boolean} isFIFO is FIFO + * @property {() => boolean} isSocket is socket + * @property {T} dev dev + * @property {T} ino ino + * @property {T} mode mode + * @property {T} nlink nlink + * @property {T} uid uid + * @property {T} gid gid + * @property {T} rdev rdev + * @property {T} size size + * @property {T} blksize blksize + * @property {T} blocks blocks + * @property {T} atimeMs atime ms + * @property {T} mtimeMs mtime ms + * @property {T} ctimeMs ctime ms + * @property {T} birthtimeMs birthtime ms + * @property {Date} atime atime + * @property {Date} mtime mtime + * @property {Date} ctime ctime + * @property {Date} birthtime birthtime */ /** @@ -100,27 +100,27 @@ const { */ /** - * @typedef {Object} Dirent - * @property {() => boolean} isFile - * @property {() => boolean} isDirectory - * @property {() => boolean} isBlockDevice - * @property {() => boolean} isCharacterDevice - * @property {() => boolean} isSymbolicLink - * @property {() => boolean} isFIFO - * @property {() => boolean} isSocket - * @property {string} name - * @property {string} path + * @typedef {object} Dirent + * @property {() => boolean} isFile true when is file, otherwise false + * @property {() => boolean} isDirectory true when is directory, otherwise false + * @property {() => boolean} isBlockDevice true when is block device, otherwise false + * @property {() => boolean} isCharacterDevice true when is character device, otherwise false + * @property {() => boolean} isSymbolicLink true when is symbolic link, otherwise false + * @property {() => boolean} isFIFO true when is FIFO, otherwise false + * @property {() => boolean} isSocket true when is socket, otherwise false + * @property {string} name name + * @property {string} path path */ /** - * @typedef {Object} StatOptions - * @property {(boolean | undefined)=} bigint + * @typedef {object} StatOptions + * @property {(boolean | undefined)=} bigint need bigint values */ /** - * @typedef {Object} StatSyncOptions - * @property {(boolean | undefined)=} bigint - * @property {(boolean | undefined)=} throwIfNoEntry + * @typedef {object} StatSyncOptions + * @property {(boolean | undefined)=} bigint need bigint values + * @property {(boolean | undefined)=} throwIfNoEntry throw if no entry */ /** @@ -165,13 +165,13 @@ const { * (path: PathLike, options?: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | null): string[] | Buffer[]; * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }): Dirent[]; * }} ReaddirSync - - /** - * @typedef {function(PathOrFileDescriptor, ReadJsonCallback): void} ReadJson + * + * /** + * @typedef {(pathOrFileDescription: PathOrFileDescriptor, callback: ReadJsonCallback) => void} ReadJson */ /** - * @typedef {function(PathOrFileDescriptor): JsonObject} ReadJsonSync + * @typedef {(pathOrFileDescription: PathOrFileDescriptor) => JsonObject} ReadJsonSync */ /** @@ -251,36 +251,36 @@ const { */ /** - * @typedef {Object} FileSystem - * @property {ReadFile} readFile - * @property {Readdir} readdir - * @property {ReadJson=} readJson - * @property {Readlink} readlink - * @property {LStat=} lstat - * @property {Stat} stat - * @property {RealPath=} realpath + * @typedef {object} FileSystem + * @property {ReadFile} readFile read file method + * @property {Readdir} readdir readdir method + * @property {ReadJson=} readJson read json method + * @property {Readlink} readlink read link method + * @property {LStat=} lstat lstat method + * @property {Stat} stat stat method + * @property {RealPath=} realpath realpath method */ /** - * @typedef {Object} SyncFileSystem - * @property {ReadFileSync} readFileSync - * @property {ReaddirSync} readdirSync - * @property {ReadJsonSync=} readJsonSync - * @property {ReadlinkSync} readlinkSync - * @property {LStatSync=} lstatSync - * @property {StatSync} statSync - * @property {RealPathSync=} realpathSync + * @typedef {object} SyncFileSystem + * @property {ReadFileSync} readFileSync read file sync method + * @property {ReaddirSync} readdirSync read dir sync method + * @property {ReadJsonSync=} readJsonSync read json sync method + * @property {ReadlinkSync} readlinkSync read link sync method + * @property {LStatSync=} lstatSync lstat sync method + * @property {StatSync} statSync stat sync method + * @property {RealPathSync=} realpathSync real path sync method */ /** - * @typedef {Object} ParsedIdentifier - * @property {string} request - * @property {string} query - * @property {string} fragment - * @property {boolean} directory - * @property {boolean} module - * @property {boolean} file - * @property {boolean} internal + * @typedef {object} ParsedIdentifier + * @property {string} request request + * @property {string} query query + * @property {string} fragment fragment + * @property {boolean} directory is directory + * @property {boolean} module is module + * @property {boolean} file is file + * @property {boolean} internal is internal */ /** @typedef {string | number | boolean | null} JsonPrimitive */ @@ -288,19 +288,22 @@ const { /** @typedef {JsonPrimitive | JsonObject | JsonArray} JsonValue */ /** @typedef {{[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined}} JsonObject */ +// eslint-disable-next-line jsdoc/require-property +/** @typedef {object} Context */ + /** - * @typedef {Object} BaseResolveRequest - * @property {string | false} path - * @property {object=} context - * @property {string=} descriptionFilePath - * @property {string=} descriptionFileRoot - * @property {JsonObject=} descriptionFileData - * @property {string=} relativePath - * @property {boolean=} ignoreSymlinks - * @property {boolean=} fullySpecified - * @property {string=} __innerRequest - * @property {string=} __innerRequest_request - * @property {string=} __innerRequest_relativePath + * @typedef {object} BaseResolveRequest + * @property {string | false} path path + * @property {Context=} context content + * @property {string=} descriptionFilePath description file path + * @property {string=} descriptionFileRoot description file root + * @property {JsonObject=} descriptionFileData description file data + * @property {string=} relativePath relative path + * @property {boolean=} ignoreSymlinks true when need to ignore symlinks, otherwise false + * @property {boolean=} fullySpecified true when full specified, otherwise false + * @property {string=} __innerRequest inner request for internal usage + * @property {string=} __innerRequest_request inner request for internal usage + * @property {string=} __innerRequest_relativePath inner relative path for internal usage */ /** @typedef {BaseResolveRequest & Partial} ResolveRequest */ @@ -315,27 +318,27 @@ const { * @typedef {{ add: (item: T) => void }} WriteOnlySet */ -/** @typedef {(function (ResolveRequest): void)} ResolveContextYield */ +/** @typedef {(request: ResolveRequest) => void} ResolveContextYield */ /** * Resolve context - * @typedef {Object} ResolveContext - * @property {WriteOnlySet=} contextDependencies + * @typedef {object} ResolveContext + * @property {WriteOnlySet=} contextDependencies directories that was found on file system * @property {WriteOnlySet=} fileDependencies files that was found on file system * @property {WriteOnlySet=} missingDependencies dependencies that was not found on file system * @property {Set=} stack set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`, - * @property {(function(string): void)=} log log function + * @property {((str: string) => void)=} log log function * @property {ResolveContextYield=} yield yield result, if provided plugins can return several results */ /** @typedef {AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest | null>} ResolveStepHook */ /** - * @typedef {Object} KnownHooks - * @property {SyncHook<[ResolveStepHook, ResolveRequest], void>} resolveStep - * @property {SyncHook<[ResolveRequest, Error]>} noResolve - * @property {ResolveStepHook} resolve - * @property {AsyncSeriesHook<[ResolveRequest, ResolveContext]>} result + * @typedef {object} KnownHooks + * @property {SyncHook<[ResolveStepHook, ResolveRequest], void>} resolveStep resolve step hook + * @property {SyncHook<[ResolveRequest, Error]>} noResolve no resolve hook + * @property {ResolveStepHook} resolve resolve hook + * @property {AsyncSeriesHook<[ResolveRequest, ResolveContext]>} result result hook */ /** @@ -357,17 +360,11 @@ class Resolver { * @returns {StackEntry} stack entry */ static createStackEntry(hook, request) { - return ( - hook.name + - ": (" + - request.path + - ") " + - (request.request || "") + - (request.query || "") + - (request.fragment || "") + - (request.directory ? " directory" : "") + - (request.module ? " module" : "") - ); + return `${hook.name}: (${request.path}) ${request.request || ""}${ + request.query || "" + }${request.fragment || ""}${ + request.directory ? " directory" : "" + }${request.module ? " module" : ""}`; } /** @@ -383,9 +380,9 @@ class Resolver { noResolve: new SyncHook(["request", "error"], "noResolve"), resolve: new AsyncSeriesBailHook( ["request", "resolveContext"], - "resolve" + "resolve", ), - result: new AsyncSeriesHook(["result", "resolveContext"], "result") + result: new AsyncSeriesHook(["result", "resolveContext"], "result"), }; } @@ -398,17 +395,17 @@ class Resolver { return name; } name = toCamelCase(name); - if (/^before/.test(name)) { + if (name.startsWith("before")) { return /** @type {ResolveStepHook} */ ( this.ensureHook(name[6].toLowerCase() + name.slice(7)).withOptions({ - stage: -10 + stage: -10, }) ); } - if (/^after/.test(name)) { + if (name.startsWith("after")) { return /** @type {ResolveStepHook} */ ( this.ensureHook(name[5].toLowerCase() + name.slice(6)).withOptions({ - stage: 10 + stage: 10, }) ); } @@ -418,7 +415,7 @@ class Resolver { /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name] = new AsyncSeriesBailHook( ["request", "resolveContext"], - name + name, ); return /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; @@ -435,17 +432,17 @@ class Resolver { return name; } name = toCamelCase(name); - if (/^before/.test(name)) { + if (name.startsWith("before")) { return /** @type {ResolveStepHook} */ ( this.getHook(name[6].toLowerCase() + name.slice(7)).withOptions({ - stage: -10 + stage: -10, }) ); } - if (/^after/.test(name)) { + if (name.startsWith("after")) { return /** @type {ResolveStepHook} */ ( this.getHook(name[5].toLowerCase() + name.slice(6)).withOptions({ - stage: 10 + stage: 10, }) ); } @@ -465,18 +462,18 @@ class Resolver { */ resolveSync(context, path, request) { /** @type {Error | null | undefined} */ - let err = undefined; + let err; /** @type {string | false | undefined} */ - let result = undefined; + let result; let sync = false; - this.resolve(context, path, request, {}, (e, r) => { - err = e; + this.resolve(context, path, request, {}, (_err, r) => { + err = _err; result = r; sync = true; }); if (!sync) { throw new Error( - "Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!" + "Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!", ); } if (err) throw err; @@ -493,20 +490,24 @@ class Resolver { * @returns {void} */ resolve(context, path, request, resolveContext, callback) { - if (!context || typeof context !== "object") + if (!context || typeof context !== "object") { return callback(new Error("context argument is not an object")); - if (typeof path !== "string") + } + if (typeof path !== "string") { return callback(new Error("path argument is not a string")); - if (typeof request !== "string") + } + if (typeof request !== "string") { return callback(new Error("request argument is not a string")); - if (!resolveContext) + } + if (!resolveContext) { return callback(new Error("resolveContext argument is not set")); + } /** @type {ResolveRequest} */ const obj = { - context: context, - path: path, - request: request + context, + path, + request, }; /** @type {ResolveContextYield | undefined} */ @@ -541,17 +542,16 @@ class Resolver { * @param {ResolveRequest} result result * @returns {void} */ - const finishResolved = (result) => { - return callback( + const finishResolved = (result) => + callback( null, result.path === false ? false : `${result.path.replace(/#/g, "\0#")}${ result.query ? result.query.replace(/#/g, "\0#") : "" - }${result.fragment || ""}`, - result + }${result.fragment || ""}`, + result, ); - }; /** * @param {string[]} log logs @@ -561,7 +561,7 @@ class Resolver { /** * @type {ErrorWithDetail} */ - const error = new Error("Can't " + message); + const error = new Error(`Can't ${message}`); error.details = log.join("\n"); this.hooks.noResolve.call(obj, error); return callback(error); @@ -585,80 +585,79 @@ class Resolver { fileDependencies: resolveContext.fileDependencies, contextDependencies: resolveContext.contextDependencies, missingDependencies: resolveContext.missingDependencies, - stack: resolveContext.stack + stack: resolveContext.stack, }, (err, result) => { if (err) return callback(err); if (yieldCalled || (result && yield_)) { return /** @type {ResolveContextYield} */ (finishYield)( - /** @type {ResolveRequest} */ (result) + /** @type {ResolveRequest} */ (result), ); } if (result) return finishResolved(result); return finishWithoutResolve(log); - } - ); - } else { - // Try to resolve assuming there is no error - // We don't log stuff in this case - return this.doResolve( - this.hooks.resolve, - obj, - message, - { - log: undefined, - yield: yield_, - fileDependencies: resolveContext.fileDependencies, - contextDependencies: resolveContext.contextDependencies, - missingDependencies: resolveContext.missingDependencies, - stack: resolveContext.stack }, - (err, result) => { - if (err) return callback(err); - - if (yieldCalled || (result && yield_)) { - return /** @type {ResolveContextYield} */ (finishYield)( - /** @type {ResolveRequest} */ (result) - ); - } - - if (result) return finishResolved(result); + ); + } + // Try to resolve assuming there is no error + // We don't log stuff in this case + return this.doResolve( + this.hooks.resolve, + obj, + message, + { + log: undefined, + yield: yield_, + fileDependencies: resolveContext.fileDependencies, + contextDependencies: resolveContext.contextDependencies, + missingDependencies: resolveContext.missingDependencies, + stack: resolveContext.stack, + }, + (err, result) => { + if (err) return callback(err); - // log is missing for the error details - // so we redo the resolving for the log info - // this is more expensive to the success case - // is assumed by default - /** @type {string[]} */ - const log = []; - - return this.doResolve( - this.hooks.resolve, - obj, - message, - { - log: (msg) => log.push(msg), - yield: yield_, - stack: resolveContext.stack - }, - (err, result) => { - if (err) return callback(err); - - // In a case that there is a race condition and yield will be called - if (yieldCalled || (result && yield_)) { - return /** @type {ResolveContextYield} */ (finishYield)( - /** @type {ResolveRequest} */ (result) - ); - } - - return finishWithoutResolve(log); - } + if (yieldCalled || (result && yield_)) { + return /** @type {ResolveContextYield} */ (finishYield)( + /** @type {ResolveRequest} */ (result), ); } - ); - } + + if (result) return finishResolved(result); + + // log is missing for the error details + // so we redo the resolving for the log info + // this is more expensive to the success case + // is assumed by default + /** @type {string[]} */ + const log = []; + + return this.doResolve( + this.hooks.resolve, + obj, + message, + { + log: (msg) => log.push(msg), + yield: yield_, + stack: resolveContext.stack, + }, + (err, result) => { + if (err) return callback(err); + + // In a case that there is a race condition and yield will be called + if (yieldCalled || (result && yield_)) { + return /** @type {ResolveContextYield} */ (finishYield)( + /** @type {ResolveRequest} */ (result), + ); + } + + return finishWithoutResolve(log); + }, + ); + }, + ); } /** @@ -682,12 +681,12 @@ class Resolver { * @type {Error & {recursion?: boolean}} */ const recursionError = new Error( - "Recursion in resolving\nStack:\n " + - Array.from(newStack).join("\n ") + `Recursion in resolving\nStack:\n ${[...newStack].join("\n ")}`, ); recursionError.recursion = true; - if (resolveContext.log) + if (resolveContext.log) { resolveContext.log("abort resolving because of recursion"); + } return callback(recursionError); } newStack.add(stackEntry); @@ -708,18 +707,17 @@ class Resolver { fileDependencies: resolveContext.fileDependencies, contextDependencies: resolveContext.contextDependencies, missingDependencies: resolveContext.missingDependencies, - stack: newStack + stack: newStack, }, - message + message, ); return hook.callAsync(request, innerContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); callback(); }); - } else { - callback(); } + callback(); } /** @@ -734,7 +732,7 @@ class Resolver { module: false, directory: false, file: false, - internal: false + internal: false, }; const parsedIdentifier = parseIdentifier(identifier); diff --git a/lib/ResolverFactory.js b/lib/ResolverFactory.js index 7194271b..42985409 100644 --- a/lib/ResolverFactory.js +++ b/lib/ResolverFactory.js @@ -5,7 +5,7 @@ "use strict"; -const versions = require("process").versions; +const { versions } = require("process"); const Resolver = require("./Resolver"); const { getType, PathType } = require("./util/path"); @@ -46,20 +46,21 @@ const UseFilePlugin = require("./UseFilePlugin"); /** @typedef {import("./Resolver").KnownHooks} KnownHooks */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ +/** @typedef {import("./UnsafeCachePlugin").Cache} Cache */ -/** @typedef {string|string[]|false} AliasOptionNewRequest */ -/** @typedef {{[k: string]: AliasOptionNewRequest}} AliasOptions */ -/** @typedef {{[k: string]: string|string[] }} ExtensionAliasOptions */ +/** @typedef {string | string[] | false} AliasOptionNewRequest */ +/** @typedef {{ [k: string]: AliasOptionNewRequest }} AliasOptions */ +/** @typedef {{ [k: string]: string|string[] }} ExtensionAliasOptions */ /** @typedef {false | 0 | "" | null | undefined} Falsy */ -/** @typedef {{apply: function(Resolver): void} | (function(this: Resolver, Resolver): void) | Falsy} Plugin */ +/** @typedef {{apply: (resolver: Resolver) => void} | ((this: Resolver, resolver: Resolver) => void) | Falsy} Plugin */ /** - * @typedef {Object} UserResolveOptions + * @typedef {object} UserResolveOptions * @property {(AliasOptions | AliasOptionEntry[])=} alias A list of module alias configurations or an object which maps key to value * @property {(AliasOptions | AliasOptionEntry[])=} fallback A list of module alias configurations or an object which maps key to value, applied only after modules option * @property {ExtensionAliasOptions=} extensionAlias An object which maps extension to extension aliases * @property {(string | string[])[]=} aliasFields A list of alias fields in description files - * @property {(function(ResolveRequest): boolean)=} cachePredicate A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. + * @property {((predicate: ResolveRequest) => boolean)=} cachePredicate A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. * @property {boolean=} cacheWithContext Whether or not the unsafeCache should include request context as part of the cache key. * @property {string[]=} descriptionFiles A list of description files to read from * @property {string[]=} conditionNames A list of exports field condition names. @@ -68,12 +69,12 @@ const UseFilePlugin = require("./UseFilePlugin"); * @property {(string | string[])[]=} importsFields A list of imports fields in description files * @property {string[]=} extensions A list of extensions which should be tried for files * @property {FileSystem} fileSystem The file system which should be used - * @property {(object | boolean)=} unsafeCache Use this cache object to unsafely cache the successful requests + * @property {(Cache | boolean)=} unsafeCache Use this cache object to unsafely cache the successful requests * @property {boolean=} symlinks Resolve symlinks to their symlinked location * @property {Resolver=} resolver A prepared Resolver to which the plugins are attached * @property {string[] | string=} modules A list of directories to resolve modules from, can be absolute path or folder name * @property {(string | string[] | {name: string | string[], forceRelative: boolean})[]=} mainFields A list of main fields in description files - * @property {string[]=} mainFiles A list of main files in directories + * @property {string[]=} mainFiles A list of main files in directories * @property {Plugin[]=} plugins A list of additional resolve plugins which should be applied * @property {PnpApi | null=} pnpApi A PnP API that should be used - null is "never", undefined is "auto" * @property {string[]=} roots A list of root paths @@ -86,34 +87,34 @@ const UseFilePlugin = require("./UseFilePlugin"); */ /** - * @typedef {Object} ResolveOptions - * @property {AliasOptionEntry[]} alias - * @property {AliasOptionEntry[]} fallback - * @property {Set} aliasFields - * @property {ExtensionAliasOption[]} extensionAlias - * @property {(function(ResolveRequest): boolean)} cachePredicate - * @property {boolean} cacheWithContext + * @typedef {object} ResolveOptions + * @property {AliasOptionEntry[]} alias alias + * @property {AliasOptionEntry[]} fallback fallback + * @property {Set} aliasFields alias fields + * @property {ExtensionAliasOption[]} extensionAlias extension alias + * @property {(predicate: ResolveRequest) => boolean} cachePredicate cache predicate + * @property {boolean} cacheWithContext cache with context * @property {Set} conditionNames A list of exports field condition names. - * @property {string[]} descriptionFiles - * @property {boolean} enforceExtension - * @property {Set} exportsFields - * @property {Set} importsFields - * @property {Set} extensions - * @property {FileSystem} fileSystem - * @property {object | false} unsafeCache - * @property {boolean} symlinks - * @property {Resolver=} resolver - * @property {Array} modules - * @property {{name: string[], forceRelative: boolean}[]} mainFields - * @property {Set} mainFiles - * @property {Plugin[]} plugins - * @property {PnpApi | null} pnpApi - * @property {Set} roots - * @property {boolean} fullySpecified - * @property {boolean} resolveToContext - * @property {Set} restrictions - * @property {boolean} preferRelative - * @property {boolean} preferAbsolute + * @property {string[]} descriptionFiles description files + * @property {boolean} enforceExtension enforce extension + * @property {Set} exportsFields exports fields + * @property {Set} importsFields imports fields + * @property {Set} extensions extensions + * @property {FileSystem} fileSystem fileSystem + * @property {Cache | false} unsafeCache unsafe cache + * @property {boolean} symlinks symlinks + * @property {Resolver=} resolver resolver + * @property {Array} modules modules + * @property {{ name: string[], forceRelative: boolean }[]} mainFields main fields + * @property {Set} mainFiles main files + * @property {Plugin[]} plugins plugins + * @property {PnpApi | null} pnpApi pnp API + * @property {Set} roots roots + * @property {boolean} fullySpecified fully specified + * @property {boolean} resolveToContext resolve to context + * @property {Set} restrictions restrictions + * @property {boolean} preferRelative prefer relative + * @property {boolean} preferAbsolute prefer absolute */ /** @@ -126,9 +127,9 @@ function processPnpApiOption(option) { /** @type {NodeJS.ProcessVersions & {pnp: string}} */ versions.pnp ) { const _findPnpApi = - /** @type {function(string): PnpApi | null}} */ + /** @type {(issuer: string) => PnpApi | null}} */ ( - // @ts-ignore + // @ts-expect-error maybe nothing require("module").findPnpApi ); @@ -143,7 +144,7 @@ function processPnpApiOption(option) { } return pnpapi.resolveToUnqualified(request, issuer, opts); - } + }, }; } } @@ -167,10 +168,38 @@ function normalizeAlias(alias) { } return obj; - }) + }) : /** @type {Array} */ (alias) || []; } +/** + * Merging filtered elements + * @param {string[]} array source array + * @param {(item: string) => boolean} filter predicate + * @returns {Array} merge result + */ +function mergeFilteredToArray(array, filter) { + /** @type {Array} */ + const result = []; + const set = new Set(array); + + for (const item of set) { + if (filter(item)) { + const lastElement = + result.length > 0 ? result[result.length - 1] : undefined; + if (Array.isArray(lastElement)) { + lastElement.push(item); + } else { + result.push([item]); + } + } else { + result.push(item); + } + } + + return result; +} + /** * @param {UserResolveOptions} options input options * @returns {ResolveOptions} output options @@ -184,17 +213,17 @@ function createOptions(options) { if (typeof item === "string") { mainFields.push({ name: [item], - forceRelative: true + forceRelative: true, }); } else if (Array.isArray(item)) { mainFields.push({ name: item, - forceRelative: true + forceRelative: true, }); } else { mainFields.push({ name: Array.isArray(item.name) ? item.name : [item.name], - forceRelative: item.forceRelative + forceRelative: item.forceRelative, }); } } @@ -205,7 +234,7 @@ function createOptions(options) { aliasFields: new Set(options.aliasFields), cachePredicate: options.cachePredicate || - function () { + function trueFn() { return true; }, cacheWithContext: @@ -215,14 +244,12 @@ function createOptions(options) { exportsFields: new Set(options.exportsFields || ["exports"]), importsFields: new Set(options.importsFields || ["imports"]), conditionNames: new Set(options.conditionNames), - descriptionFiles: Array.from( - new Set(options.descriptionFiles || ["package.json"]) - ), + descriptionFiles: [ + ...new Set(options.descriptionFiles || ["package.json"]), + ], enforceExtension: options.enforceExtension === undefined - ? options.extensions && options.extensions.includes("") - ? true - : false + ? Boolean(options.extensions && options.extensions.includes("")) : options.enforceExtension, extensions: new Set(options.extensions || [".js", ".json", ".node"]), extensionAlias: options.extensionAlias @@ -230,19 +257,19 @@ function createOptions(options) { extension: k, alias: /** @type {ExtensionAliasOptions} */ (options.extensionAlias)[ k - ] - })) + ], + })) : [], fileSystem: options.useSyncFileSystemCalls ? new SyncAsyncFileSystemDecorator( /** @type {SyncFileSystem} */ ( /** @type {unknown} */ (options.fileSystem) - ) - ) + ), + ) : options.fileSystem, unsafeCache: options.unsafeCache && typeof options.unsafeCache !== "object" - ? {} + ? /** @type {Cache} */ ({}) : options.unsafeCache || false, symlinks: typeof options.symlinks !== "undefined" ? options.symlinks : true, resolver: options.resolver, @@ -250,12 +277,12 @@ function createOptions(options) { Array.isArray(options.modules) ? options.modules : options.modules - ? [options.modules] - : ["node_modules"], + ? [options.modules] + : ["node_modules"], (item) => { const type = getType(item); return type === PathType.Normal || type === PathType.Relative; - } + }, ), mainFields, mainFiles: new Set(options.mainFiles || ["index"]), @@ -266,7 +293,7 @@ function createOptions(options) { resolveToContext: options.resolveToContext || false, preferRelative: options.preferRelative || false, preferAbsolute: options.preferAbsolute || false, - restrictions: new Set(options.restrictions) + restrictions: new Set(options.restrictions), }; } @@ -274,7 +301,7 @@ function createOptions(options) { * @param {UserResolveOptions} options resolve options * @returns {Resolver} created resolver */ -exports.createResolver = function (options) { +module.exports.createResolver = function createResolver(options) { const normalizedOptions = createOptions(options); const { @@ -304,16 +331,15 @@ exports.createResolver = function (options) { unsafeCache, resolver: customResolver, restrictions, - roots + roots, } = normalizedOptions; - const plugins = userPlugins.slice(); + const plugins = [...userPlugins]; - const resolver = customResolver - ? customResolver - : new Resolver(fileSystem, normalizedOptions); + const resolver = + customResolver || new Resolver(fileSystem, normalizedOptions); - //// pipeline //// + // // pipeline //// resolver.ensureHook("resolve"); resolver.ensureHook("internalResolve"); @@ -345,13 +371,13 @@ exports.createResolver = function (options) { // TODO remove in next major // cspell:word Interal // Backward-compat - // @ts-ignore + // @ts-expect-error resolver.hooks.newInteralResolve = resolver.hooks.newInternalResolve; // resolve for (const { source, resolveOptions } of [ { source: "resolve", resolveOptions: { fullySpecified } }, - { source: "internal-resolve", resolveOptions: { fullySpecified: false } } + { source: "internal-resolve", resolveOptions: { fullySpecified: false } }, ]) { if (unsafeCache) { plugins.push( @@ -360,11 +386,11 @@ exports.createResolver = function (options) { cachePredicate, /** @type {import("./UnsafeCachePlugin").Cache} */ (unsafeCache), cacheWithContext, - `new-${source}` - ) + `new-${source}`, + ), ); plugins.push( - new ParsePlugin(`new-${source}`, resolveOptions, "parsed-resolve") + new ParsePlugin(`new-${source}`, resolveOptions, "parsed-resolve"), ); } else { plugins.push(new ParsePlugin(source, resolveOptions, "parsed-resolve")); @@ -377,8 +403,8 @@ exports.createResolver = function (options) { "parsed-resolve", descriptionFiles, false, - "described-resolve" - ) + "described-resolve", + ), ); plugins.push(new NextPlugin("after-parsed-resolve", "described-resolve")); @@ -386,7 +412,7 @@ exports.createResolver = function (options) { plugins.push(new NextPlugin("described-resolve", "raw-resolve")); if (fallback.length > 0) { plugins.push( - new AliasPlugin("described-resolve", fallback, "internal-resolve") + new AliasPlugin("described-resolve", fallback, "internal-resolve"), ); } @@ -394,14 +420,14 @@ exports.createResolver = function (options) { if (alias.length > 0) { plugins.push(new AliasPlugin("raw-resolve", alias, "internal-resolve")); } - aliasFields.forEach((item) => { + for (const item of aliasFields) { plugins.push(new AliasFieldPlugin("raw-resolve", item, "internal-resolve")); - }); - extensionAlias.forEach((item) => + } + for (const item of extensionAlias) { plugins.push( - new ExtensionAliasPlugin("raw-resolve", item, "normal-resolve") - ) - ); + new ExtensionAliasPlugin("raw-resolve", item, "normal-resolve"), + ); + } plugins.push(new NextPlugin("raw-resolve", "normal-resolve")); // normal-resolve @@ -414,8 +440,8 @@ exports.createResolver = function (options) { { module: true }, "resolve as module", false, - "raw-module" - ) + "raw-module", + ), ); plugins.push( new ConditionalPlugin( @@ -423,8 +449,8 @@ exports.createResolver = function (options) { { internal: true }, "resolve as internal import", false, - "internal" - ) + "internal", + ), ); if (preferAbsolute) { plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); @@ -437,63 +463,63 @@ exports.createResolver = function (options) { } // internal - importsFields.forEach((importsField) => { + for (const importsField of importsFields) { plugins.push( new ImportsFieldPlugin( "internal", conditionNames, importsField, "relative", - "internal-resolve" - ) + "internal-resolve", + ), ); - }); + } // raw-module - exportsFields.forEach((exportsField) => { + for (const exportsField of exportsFields) { plugins.push( - new SelfReferencePlugin("raw-module", exportsField, "resolve-as-module") + new SelfReferencePlugin("raw-module", exportsField, "resolve-as-module"), ); - }); - modules.forEach((item) => { + } + for (const item of modules) { if (Array.isArray(item)) { if (item.includes("node_modules") && pnpApi) { plugins.push( new ModulesInHierarchicalDirectoriesPlugin( "raw-module", item.filter((i) => i !== "node_modules"), - "module" - ) + "module", + ), ); plugins.push( new PnpPlugin( "raw-module", pnpApi, "undescribed-resolve-in-package", - "alternate-raw-module" - ) + "alternate-raw-module", + ), ); plugins.push( new ModulesInHierarchicalDirectoriesPlugin( "alternate-raw-module", ["node_modules"], - "module" - ) + "module", + ), ); } else { plugins.push( new ModulesInHierarchicalDirectoriesPlugin( "raw-module", item, - "module" - ) + "module", + ), ); } } else { plugins.push(new ModulesInRootPlugin("raw-module", item, "module")); } - }); + } // module plugins.push(new JoinRequestPartPlugin("module", "resolve-as-module")); @@ -506,15 +532,15 @@ exports.createResolver = function (options) { { directory: false, request: "." }, "single file module", true, - "undescribed-raw-file" - ) + "undescribed-raw-file", + ), ); } plugins.push( new DirectoryExistsPlugin( "resolve-as-module", - "undescribed-resolve-in-package" - ) + "undescribed-resolve-in-package", + ), ); // undescribed-resolve-in-package @@ -523,31 +549,34 @@ exports.createResolver = function (options) { "undescribed-resolve-in-package", descriptionFiles, false, - "resolve-in-package" - ) + "resolve-in-package", + ), ); plugins.push( - new NextPlugin("after-undescribed-resolve-in-package", "resolve-in-package") + new NextPlugin( + "after-undescribed-resolve-in-package", + "resolve-in-package", + ), ); // resolve-in-package - exportsFields.forEach((exportsField) => { + for (const exportsField of exportsFields) { plugins.push( new ExportsFieldPlugin( "resolve-in-package", conditionNames, exportsField, - "relative" - ) + "relative", + ), ); - }); + } plugins.push( - new NextPlugin("resolve-in-package", "resolve-in-existing-directory") + new NextPlugin("resolve-in-package", "resolve-in-existing-directory"), ); // resolve-in-existing-directory plugins.push( - new JoinRequestPlugin("resolve-in-existing-directory", "relative") + new JoinRequestPlugin("resolve-in-existing-directory", "relative"), ); // relative @@ -556,8 +585,8 @@ exports.createResolver = function (options) { "relative", descriptionFiles, true, - "described-relative" - ) + "described-relative", + ), ); plugins.push(new NextPlugin("after-relative", "described-relative")); @@ -571,8 +600,8 @@ exports.createResolver = function (options) { { directory: false }, null, true, - "raw-file" - ) + "raw-file", + ), ); plugins.push( new ConditionalPlugin( @@ -580,14 +609,14 @@ exports.createResolver = function (options) { { fullySpecified: false }, "as directory", true, - "directory" - ) + "directory", + ), ); } // directory plugins.push( - new DirectoryExistsPlugin("directory", "undescribed-existing-directory") + new DirectoryExistsPlugin("directory", "undescribed-existing-directory"), ); if (resolveToContext) { @@ -600,34 +629,34 @@ exports.createResolver = function (options) { "undescribed-existing-directory", descriptionFiles, false, - "existing-directory" - ) + "existing-directory", + ), ); - mainFiles.forEach((item) => { + for (const item of mainFiles) { plugins.push( new UseFilePlugin( "undescribed-existing-directory", item, - "undescribed-raw-file" - ) + "undescribed-raw-file", + ), ); - }); + } // described-existing-directory - mainFields.forEach((item) => { + for (const item of mainFields) { plugins.push( new MainFieldPlugin( "existing-directory", item, - "resolve-in-existing-directory" - ) + "resolve-in-existing-directory", + ), ); - }); - mainFiles.forEach((item) => { + } + for (const item of mainFiles) { plugins.push( - new UseFilePlugin("existing-directory", item, "undescribed-raw-file") + new UseFilePlugin("existing-directory", item, "undescribed-raw-file"), ); - }); + } // undescribed-raw-file plugins.push( @@ -635,8 +664,8 @@ exports.createResolver = function (options) { "undescribed-raw-file", descriptionFiles, true, - "raw-file" - ) + "raw-file", + ), ); plugins.push(new NextPlugin("after-undescribed-raw-file", "raw-file")); @@ -647,36 +676,38 @@ exports.createResolver = function (options) { { fullySpecified: true }, null, false, - "file" - ) + "file", + ), ); if (!enforceExtension) { plugins.push(new TryNextPlugin("raw-file", "no extension", "file")); } - extensions.forEach((item) => { + for (const item of extensions) { plugins.push(new AppendPlugin("raw-file", item, "file")); - }); + } // file - if (alias.length > 0) + if (alias.length > 0) { plugins.push(new AliasPlugin("file", alias, "internal-resolve")); - aliasFields.forEach((item) => { + } + for (const item of aliasFields) { plugins.push(new AliasFieldPlugin("file", item, "internal-resolve")); - }); + } plugins.push(new NextPlugin("file", "final-file")); // final-file plugins.push(new FileExistsPlugin("final-file", "existing-file")); // existing-file - if (symlinks) + if (symlinks) { plugins.push(new SymlinkPlugin("existing-file", "existing-file")); + } plugins.push(new NextPlugin("existing-file", "resolved")); } - const resolved = + const { resolved } = /** @type {KnownHooks & EnsuredHooks} */ - (resolver.hooks).resolved; + (resolver.hooks); // resolved if (restrictions.size > 0) { @@ -685,11 +716,11 @@ exports.createResolver = function (options) { plugins.push(new ResultPlugin(resolved)); - //// RESOLVER //// + // // RESOLVER //// for (const plugin of plugins) { if (typeof plugin === "function") { - /** @type {function(this: Resolver, Resolver): void} */ + /** @type {(this: Resolver, resolver: Resolver) => void} */ (plugin).call(resolver, resolver); } else if (plugin) { plugin.apply(resolver); @@ -698,31 +729,3 @@ exports.createResolver = function (options) { return resolver; }; - -/** - * Merging filtered elements - * @param {string[]} array source array - * @param {function(string): boolean} filter predicate - * @returns {Array} merge result - */ -function mergeFilteredToArray(array, filter) { - /** @type {Array} */ - const result = []; - const set = new Set(array); - - for (const item of set) { - if (filter(item)) { - const lastElement = - result.length > 0 ? result[result.length - 1] : undefined; - if (Array.isArray(lastElement)) { - lastElement.push(item); - } else { - result.push([item]); - } - } else { - result.push(item); - } - } - - return result; -} diff --git a/lib/RestrictionsPlugin.js b/lib/RestrictionsPlugin.js index e52ca9d5..6faaa26b 100644 --- a/lib/RestrictionsPlugin.js +++ b/lib/RestrictionsPlugin.js @@ -42,13 +42,13 @@ module.exports = class RestrictionsPlugin { .getHook(this.source) .tapAsync("RestrictionsPlugin", (request, resolveContext, callback) => { if (typeof request.path === "string") { - const path = request.path; + const { path } = request; for (const rule of this.restrictions) { if (typeof rule === "string") { if (!isInside(path, rule)) { if (resolveContext.log) { resolveContext.log( - `${path} is not inside of the restriction ${rule}` + `${path} is not inside of the restriction ${rule}`, ); } return callback(null, null); @@ -56,7 +56,7 @@ module.exports = class RestrictionsPlugin { } else if (!rule.test(path)) { if (resolveContext.log) { resolveContext.log( - `${path} doesn't match the restriction ${rule}` + `${path} doesn't match the restriction ${rule}`, ); } return callback(null, null); diff --git a/lib/ResultPlugin.js b/lib/ResultPlugin.js index 2a93c3af..57dbdddc 100644 --- a/lib/ResultPlugin.js +++ b/lib/ResultPlugin.js @@ -25,8 +25,9 @@ module.exports = class ResultPlugin { "ResultPlugin", (request, resolverContext, callback) => { const obj = { ...request }; - if (resolverContext.log) - resolverContext.log("reporting result " + obj.path); + if (resolverContext.log) { + resolverContext.log(`reporting result ${obj.path}`); + } resolver.hooks.result.callAsync(obj, resolverContext, (err) => { if (err) return callback(err); if (typeof resolverContext.yield === "function") { @@ -36,7 +37,7 @@ module.exports = class ResultPlugin { callback(null, obj); } }); - } + }, ); } }; diff --git a/lib/RootsPlugin.js b/lib/RootsPlugin.js index 1d299113..ce5b3147 100644 --- a/lib/RootsPlugin.js +++ b/lib/RootsPlugin.js @@ -18,7 +18,7 @@ class RootsPlugin { * @param {string | ResolveStepHook} target target hook */ constructor(source, roots, target) { - this.roots = Array.from(roots); + this.roots = [...roots]; this.source = source; this.target = target; } @@ -50,17 +50,17 @@ class RootsPlugin { const obj = { ...request, path, - relativePath: request.relativePath && path + relativePath: request.relativePath && path, }; resolver.doResolve( target, obj, `root path ${root}`, resolveContext, - callback + callback, ); }, - callback + callback, ); }); } diff --git a/lib/SelfReferencePlugin.js b/lib/SelfReferencePlugin.js index a8dc1484..af8e5b23 100644 --- a/lib/SelfReferencePlugin.js +++ b/lib/SelfReferencePlugin.js @@ -43,13 +43,13 @@ module.exports = class SelfReferencePlugin { // Feature is only enabled when an exports field is present const exportsField = DescriptionFileUtils.getField( /** @type {JsonObject} */ (request.descriptionFileData), - this.fieldName + this.fieldName, ); if (!exportsField) return callback(); const name = DescriptionFileUtils.getField( /** @type {JsonObject} */ (request.descriptionFileData), - "name" + "name", ); if (typeof name !== "string") return callback(); @@ -64,7 +64,7 @@ module.exports = class SelfReferencePlugin { ...request, request: remainingRequest, path: /** @type {string} */ (request.descriptionFileRoot), - relativePath: "." + relativePath: ".", }; resolver.doResolve( @@ -72,7 +72,7 @@ module.exports = class SelfReferencePlugin { obj, "self reference", resolveContext, - callback + callback, ); } else { return callback(); diff --git a/lib/SymlinkPlugin.js b/lib/SymlinkPlugin.js index 7adab548..50b689a8 100644 --- a/lib/SymlinkPlugin.js +++ b/lib/SymlinkPlugin.js @@ -36,7 +36,7 @@ module.exports = class SymlinkPlugin { if (request.ignoreSymlinks) return callback(); const pathsResult = getPaths(/** @type {string} */ (request.path)); const pathSegments = pathsResult.segments; - const paths = pathsResult.paths; + const { paths } = pathsResult; let containsSymlink = false; let idx = -1; @@ -49,8 +49,9 @@ module.exports = class SymlinkPlugin { */ (path, callback) => { idx++; - if (resolveContext.fileDependencies) + if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(path); + } fs.readlink(path, (err, result) => { if (!err && result) { pathSegments[idx] = /** @type {string} */ (result); @@ -68,8 +69,8 @@ module.exports = class SymlinkPlugin { }); }, /** - * @param {null|Error} [err] error - * @param {null|number} [idx] result + * @param {(null | Error)=} err error + * @param {(null|number)=} idx result * @returns {void} */ (err, idx) => { @@ -77,23 +78,23 @@ module.exports = class SymlinkPlugin { const resultSegments = typeof idx === "number" ? pathSegments.slice(0, idx + 1) - : pathSegments.slice(); - const result = resultSegments.reduceRight((a, b) => { - return resolver.join(a, b); - }); + : [...pathSegments]; + const result = resultSegments.reduceRight((a, b) => + resolver.join(a, b), + ); /** @type {ResolveRequest} */ const obj = { ...request, - path: result + path: result, }; resolver.doResolve( target, obj, - "resolved symlink to " + result, + `resolved symlink to ${result}`, resolveContext, - callback + callback, ); - } + }, ); }); } diff --git a/lib/SyncAsyncFileSystemDecorator.js b/lib/SyncAsyncFileSystemDecorator.js index 0931765c..e707bb27 100644 --- a/lib/SyncAsyncFileSystemDecorator.js +++ b/lib/SyncAsyncFileSystemDecorator.js @@ -10,6 +10,11 @@ /** @typedef {import("./Resolver").StringCallback} StringCallback */ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ +// eslint-disable-next-line jsdoc/no-restricted-syntax +/** @typedef {Function} SyncOrAsyncFunction */ +// eslint-disable-next-line jsdoc/no-restricted-syntax +/** @typedef {any} ResultOfSyncOrAsyncFunction */ + /** * @param {SyncFileSystem} fs file system implementation * @constructor @@ -19,7 +24,7 @@ function SyncAsyncFileSystemDecorator(fs) { this.lstat = undefined; this.lstatSync = undefined; - const lstatSync = fs.lstatSync; + const { lstatSync } = fs; if (lstatSync) { this.lstat = /** @type {FileSystem["lstat"]} */ @@ -27,16 +32,21 @@ function SyncAsyncFileSystemDecorator(fs) { (arg, options, callback) => { let result; try { - result = /** @type {Function | undefined} */ (callback) + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? lstatSync.call(fs, arg, options) : lstatSync.call(fs, arg); - } catch (e) { + } catch (err) { return (callback || options)( - /** @type {NodeJS.ErrnoException | null} */ (e) + /** @type {NodeJS.ErrnoException | null} */ + (err), ); } - (callback || options)(null, /** @type {any} */ (result)); + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); } ); this.lstatSync = @@ -50,16 +60,21 @@ function SyncAsyncFileSystemDecorator(fs) { (arg, options, callback) => { let result; try { - result = /** @type {Function | undefined} */ (callback) + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? fs.statSync(arg, options) : fs.statSync(arg); - } catch (e) { + } catch (err) { return (callback || options)( - /** @type {NodeJS.ErrnoException | null} */ (e) + /** @type {NodeJS.ErrnoException | null} */ + (err), ); } - (callback || options)(null, /** @type {any} */ (result)); + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); } ); this.statSync = @@ -72,20 +87,25 @@ function SyncAsyncFileSystemDecorator(fs) { (arg, options, callback) => { let result; try { - result = /** @type {Function | undefined} */ (callback) + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? fs.readdirSync( arg, /** @type {Exclude[1], ReaddirStringCallback>} */ - (options) - ) + (options), + ) : fs.readdirSync(arg); - } catch (e) { + } catch (err) { return (callback || options)( - /** @type {NodeJS.ErrnoException | null} */ (e) + /** @type {NodeJS.ErrnoException | null} */ + (err), ); } - (callback || options)(null, /** @type {any} */ (result)); + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); } ); this.readdirSync = @@ -94,7 +114,7 @@ function SyncAsyncFileSystemDecorator(fs) { (arg, options) => fs.readdirSync( arg, - /** @type {Parameters[1]} */ (options) + /** @type {Parameters[1]} */ (options), ) ); @@ -104,16 +124,21 @@ function SyncAsyncFileSystemDecorator(fs) { (arg, options, callback) => { let result; try { - result = /** @type {Function | undefined} */ (callback) + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? fs.readFileSync(arg, options) : fs.readFileSync(arg); - } catch (e) { + } catch (err) { return (callback || options)( - /** @type {NodeJS.ErrnoException | null} */ (e) + /** @type {NodeJS.ErrnoException | null} */ + (err), ); } - (callback || options)(null, /** @type {any} */ (result)); + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); } ); this.readFileSync = @@ -126,20 +151,25 @@ function SyncAsyncFileSystemDecorator(fs) { (arg, options, callback) => { let result; try { - result = /** @type {Function | undefined} */ (callback) + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? fs.readlinkSync( arg, /** @type {Exclude[1], StringCallback>} */ - (options) - ) + (options), + ) : fs.readlinkSync(arg); - } catch (e) { + } catch (err) { return (callback || options)( - /** @type {NodeJS.ErrnoException | null} */ (e) + /** @type {NodeJS.ErrnoException | null} */ + (err), ); } - (callback || options)(null, /** @type {any} */ (result)); + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); } ); this.readlinkSync = @@ -148,13 +178,15 @@ function SyncAsyncFileSystemDecorator(fs) { (arg, options) => fs.readlinkSync( arg, - /** @type {Parameters[1]} */ (options) + /** @type {Parameters[1]} */ ( + options + ), ) ); this.readJson = undefined; this.readJsonSync = undefined; - const readJsonSync = fs.readJsonSync; + const { readJsonSync } = fs; if (readJsonSync) { this.readJson = /** @type {FileSystem["readJson"]} */ @@ -163,9 +195,9 @@ function SyncAsyncFileSystemDecorator(fs) { let result; try { result = readJsonSync.call(fs, arg); - } catch (e) { + } catch (err) { return callback( - /** @type {NodeJS.ErrnoException | Error | null} */ (e) + /** @type {NodeJS.ErrnoException | Error | null} */ (err), ); } @@ -179,7 +211,7 @@ function SyncAsyncFileSystemDecorator(fs) { this.realpath = undefined; this.realpathSync = undefined; - const realpathSync = fs.realpathSync; + const { realpathSync } = fs; if (realpathSync) { this.realpath = /** @type {FileSystem["realpath"]} */ @@ -187,21 +219,26 @@ function SyncAsyncFileSystemDecorator(fs) { (arg, options, callback) => { let result; try { - result = /** @type {Function | undefined} */ (callback) + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? realpathSync.call( fs, arg, /** @type {Exclude>[1], StringCallback>} */ - (options) - ) + (options), + ) : realpathSync.call(fs, arg); - } catch (e) { + } catch (err) { return (callback || options)( - /** @type {NodeJS.ErrnoException | null} */ (e) + /** @type {NodeJS.ErrnoException | null} */ + (err), ); } - (callback || options)(null, /** @type {any} */ (result)); + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); } ); this.realpathSync = @@ -212,9 +249,10 @@ function SyncAsyncFileSystemDecorator(fs) { fs, arg, /** @type {Parameters>[1]} */ - (options) + (options), ) ); } } + module.exports = SyncAsyncFileSystemDecorator; diff --git a/lib/TryNextPlugin.js b/lib/TryNextPlugin.js index 1b70bef0..4b467871 100644 --- a/lib/TryNextPlugin.js +++ b/lib/TryNextPlugin.js @@ -34,7 +34,7 @@ module.exports = class TryNextPlugin { request, this.message, resolveContext, - callback + callback, ); }); } diff --git a/lib/UnsafeCachePlugin.js b/lib/UnsafeCachePlugin.js index e16c4a90..56c62171 100644 --- a/lib/UnsafeCachePlugin.js +++ b/lib/UnsafeCachePlugin.js @@ -9,7 +9,7 @@ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./Resolver").ResolveContextYield} ResolveContextYield */ -/** @typedef {{[k: string]: ResolveRequest | ResolveRequest[] | undefined}} Cache */ +/** @typedef {{ [k: string]: undefined | ResolveRequest | ResolveRequest[] }} Cache */ /** * @param {string} type type of cache @@ -24,14 +24,14 @@ function getCacheId(type, request, withContext) { path: request.path, query: request.query, fragment: request.fragment, - request: request.request + request: request.request, }); } module.exports = class UnsafeCachePlugin { /** * @param {string | ResolveStepHook} source source - * @param {function(ResolveRequest): boolean} filterPredicate filterPredicate + * @param {(request: ResolveRequest) => boolean} filterPredicate filterPredicate * @param {Cache} cache cache * @param {boolean} withContext withContext * @param {string | ResolveStepHook} target target @@ -58,12 +58,14 @@ module.exports = class UnsafeCachePlugin { const cacheId = getCacheId( isYield ? "yield" : "default", request, - this.withContext + this.withContext, ); const cacheEntry = this.cache[cacheId]; if (cacheEntry) { if (isYield) { - const yield_ = /** @type {Function} */ (resolveContext.yield); + const yield_ = + /** @type {ResolveContextYield} */ + (resolveContext.yield); if (Array.isArray(cacheEntry)) { for (const result of cacheEntry) yield_(result); } else { @@ -74,9 +76,9 @@ module.exports = class UnsafeCachePlugin { return callback(null, /** @type {ResolveRequest} */ (cacheEntry)); } - /** @type {ResolveContextYield|undefined} */ + /** @type {ResolveContextYield | undefined} */ let yieldFn; - /** @type {ResolveContextYield|undefined} */ + /** @type {ResolveContextYield | undefined} */ let yield_; /** @type {ResolveRequest[]} */ const yieldResult = []; @@ -105,7 +107,7 @@ module.exports = class UnsafeCachePlugin { } if (result) return callback(null, (this.cache[cacheId] = result)); callback(); - } + }, ); }); } diff --git a/lib/UseFilePlugin.js b/lib/UseFilePlugin.js index 14aebdd4..f81c27f5 100644 --- a/lib/UseFilePlugin.js +++ b/lib/UseFilePlugin.js @@ -32,7 +32,7 @@ module.exports = class UseFilePlugin { .tapAsync("UseFilePlugin", (request, resolveContext, callback) => { const filePath = resolver.join( /** @type {string} */ (request.path), - this.filename + this.filename, ); /** @type {ResolveRequest} */ @@ -41,14 +41,14 @@ module.exports = class UseFilePlugin { path: filePath, relativePath: request.relativePath && - resolver.join(request.relativePath, this.filename) + resolver.join(request.relativePath, this.filename), }; resolver.doResolve( target, obj, - "using path: " + filePath, + `using path: ${filePath}`, resolveContext, - callback + callback, ); }); } diff --git a/lib/createInnerContext.js b/lib/createInnerContext.js index 4250a653..2ce53f58 100644 --- a/lib/createInnerContext.js +++ b/lib/createInnerContext.js @@ -14,7 +14,7 @@ */ module.exports = function createInnerContext(options, message) { let messageReported = false; - let innerLog = undefined; + let innerLog; if (options.log) { if (message) { /** @@ -22,13 +22,13 @@ module.exports = function createInnerContext(options, message) { */ innerLog = (msg) => { if (!messageReported) { - /** @type {(function(string): void)} */ + /** @type {((str: string) => void)} */ (options.log)(message); messageReported = true; } - /** @type {(function(string): void)} */ - (options.log)(" " + msg); + /** @type {((str: string) => void)} */ + (options.log)(` ${msg}`); }; } else { innerLog = options.log; @@ -41,6 +41,6 @@ module.exports = function createInnerContext(options, message) { fileDependencies: options.fileDependencies, contextDependencies: options.contextDependencies, missingDependencies: options.missingDependencies, - stack: options.stack + stack: options.stack, }; }; diff --git a/lib/forEachBail.js b/lib/forEachBail.js index 32a7250a..6dc4d1ee 100644 --- a/lib/forEachBail.js +++ b/lib/forEachBail.js @@ -31,7 +31,7 @@ module.exports = function forEachBail(array, iterator, callback) { let i = 0; const next = () => { /** @type {boolean|undefined} */ - let loop = undefined; + let loop; iterator( array[i++], (err, result) => { @@ -41,7 +41,7 @@ module.exports = function forEachBail(array, iterator, callback) { if (loop === false) while (next()); loop = true; }, - i + i, ); if (!loop) loop = false; return loop; diff --git a/lib/getInnerRequest.js b/lib/getInnerRequest.js index c34c10f2..58b1474c 100644 --- a/lib/getInnerRequest.js +++ b/lib/getInnerRequest.js @@ -18,8 +18,9 @@ module.exports = function getInnerRequest(resolver, request) { typeof request.__innerRequest === "string" && request.__innerRequest_request === request.request && request.__innerRequest_relativePath === request.relativePath - ) + ) { return request.__innerRequest; + } /** @type {string|undefined} */ let innerRequest; if (request.request) { @@ -30,7 +31,9 @@ module.exports = function getInnerRequest(resolver, request) { } else { innerRequest = request.relativePath; } + // eslint-disable-next-line camelcase request.__innerRequest_request = request.request; + // eslint-disable-next-line camelcase request.__innerRequest_relativePath = request.relativePath; return (request.__innerRequest = /** @type {string} */ (innerRequest)); }; diff --git a/lib/getPaths.js b/lib/getPaths.js index d5835b0d..cf0c9ca1 100644 --- a/lib/getPaths.js +++ b/lib/getPaths.js @@ -15,19 +15,19 @@ module.exports = function getPaths(path) { const paths = [path]; const segments = [parts[parts.length - 1]]; let part = parts[parts.length - 1]; - path = path.substring(0, path.length - part.length - 1); + path = path.slice(0, Math.max(0, path.length - part.length - 1)); for (let i = parts.length - 2; i > 2; i -= 2) { paths.push(path); part = parts[i]; - path = path.substring(0, path.length - part.length) || "/"; + path = path.slice(0, Math.max(0, path.length - part.length)) || "/"; segments.push(part.slice(0, -1)); } - part = parts[1]; + [, part] = parts; segments.push(part); paths.push(part); return { - paths: paths, - segments: segments + paths, + segments, }; }; @@ -36,10 +36,10 @@ module.exports = function getPaths(path) { * @returns {string|null} basename or null */ module.exports.basename = function basename(path) { - const i = path.lastIndexOf("/"), - j = path.lastIndexOf("\\"); - const p = i < 0 ? j : j < 0 ? i : i < j ? j : i; - if (p < 0) return null; - const s = path.slice(p + 1); - return s; + const i = path.lastIndexOf("/"); + const j = path.lastIndexOf("\\"); + const resolvedPath = i < 0 ? j : j < 0 ? i : i < j ? j : i; + if (resolvedPath < 0) return null; + const basename = path.slice(resolvedPath + 1); + return basename; }; diff --git a/lib/index.js b/lib/index.js index 1367f6d6..e119445d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -19,14 +19,16 @@ const ResolverFactory = require("./ResolverFactory"); /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./ResolverFactory").Plugin} Plugin */ /** @typedef {import("./ResolverFactory").UserResolveOptions} ResolveOptions */ -/** @typedef {{ +/** + * @typedef {{ * (context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void; * (context: object, path: string, request: string, callback: ResolveCallback): void; * (path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void; * (path: string, request: string, callback: ResolveCallback): void; * }} ResolveFunctionAsync */ -/** @typedef {{ +/** + * @typedef {{ * (context: object, path: string, request: string): string|false; * (path: string, request: string): string|false; * }} ResolveFunction @@ -35,13 +37,13 @@ const ResolverFactory = require("./ResolverFactory"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const nodeContext = { - environments: ["node+es3+es5+process+native"] + environments: ["node+es3+es5+process+native"], }; const asyncResolver = ResolverFactory.createResolver({ conditionNames: ["node"], extensions: [".js", ".json", ".node"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); /** @@ -49,11 +51,11 @@ const asyncResolver = ResolverFactory.createResolver({ */ const resolve = /** - * @param {object|string} context - * @param {string} path - * @param {string|ResolveContext|ResolveCallback} request - * @param {ResolveContext|ResolveCallback=} resolveContext - * @param {ResolveCallback=} callback + * @param {object | string} context context + * @param {string} path path + * @param {string | ResolveContext | ResolveCallback} request request + * @param {ResolveContext | ResolveCallback=} resolveContext resolve context + * @param {ResolveCallback=} callback callback */ (context, path, request, resolveContext, callback) => { if (typeof context === "string") { @@ -71,7 +73,7 @@ const resolve = path, /** @type {string} */ (request), /** @type {ResolveContext} */ (resolveContext), - /** @type {ResolveCallback} */ (callback) + /** @type {ResolveCallback} */ (callback), ); }; @@ -79,7 +81,7 @@ const syncResolver = ResolverFactory.createResolver({ conditionNames: ["node"], extensions: [".js", ".json", ".node"], useSyncFileSystemCalls: true, - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); /** @@ -87,9 +89,10 @@ const syncResolver = ResolverFactory.createResolver({ */ const resolveSync = /** - * @param {object|string} context - * @param {string} path - * @param {string=} request + * @param {object|string} context context + * @param {string} path path + * @param {string=} request request + * @returns {string | false} result */ (context, path, request) => { if (typeof context === "string") { @@ -100,7 +103,7 @@ const resolveSync = return syncResolver.resolveSync( context, path, - /** @type {string} */ (request) + /** @type {string} */ (request), ); }; @@ -113,7 +116,7 @@ const resolveSync = function create(options) { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, - ...options + ...options, }); /** * @param {object|string} context Custom context @@ -122,7 +125,7 @@ function create(options) { * @param {ResolveContext|ResolveCallback=} resolveContext Resolve context * @param {ResolveCallback=} callback Result callback */ - return function (context, path, request, resolveContext, callback) { + return function create(context, path, request, resolveContext, callback) { if (typeof context === "string") { callback = /** @type {ResolveCallback} */ (resolveContext); resolveContext = /** @type {ResolveContext} */ (request); @@ -138,7 +141,7 @@ function create(options) { path, /** @type {string} */ (request), /** @type {ResolveContext} */ (resolveContext), - callback + callback, ); }; } @@ -151,15 +154,15 @@ function createSync(options) { const resolver = ResolverFactory.createResolver({ useSyncFileSystemCalls: true, fileSystem: nodeFileSystem, - ...options + ...options, }); /** - * @param {object|string} context custom context + * @param {object | string} context custom context * @param {string} path base path * @param {string=} request request to resolve - * @returns {string|false} Resolved path or false + * @returns {string | false} Resolved path or false */ - return function (context, path, request) { + return function createSync(context, path, request) { if (typeof context === "string") { request = path; path = context; @@ -189,7 +192,7 @@ module.exports = mergeExports(resolve, { create: mergeExports(create, { get sync() { return createSync; - } + }, }), ResolverFactory, CachedInputFileSystem, @@ -201,5 +204,5 @@ module.exports = mergeExports(resolve, { }, get forEachBail() { return require("./forEachBail"); - } + }, }); diff --git a/lib/util/entrypoints.js b/lib/util/entrypoints.js index 3f356b53..55f018c1 100644 --- a/lib/util/entrypoints.js +++ b/lib/util/entrypoints.js @@ -5,6 +5,8 @@ "use strict"; +const { parseIdentifier } = require("./identifier"); + /** @typedef {string|(string|ConditionalMapping)[]} DirectMapping */ /** @typedef {{[k: string]: MappingValue}} ConditionalMapping */ /** @typedef {ConditionalMapping|DirectMapping|null} MappingValue */ @@ -72,190 +74,11 @@ Conditional mapping nested in another conditional mapping is called nested mappi */ -const { parseIdentifier } = require("./identifier"); const slashCode = "/".charCodeAt(0); const dotCode = ".".charCodeAt(0); const hashCode = "#".charCodeAt(0); const patternRegEx = /\*/g; -/** - * @param {ExportsField} exportsField the exports field - * @returns {FieldProcessor} process callback - */ -module.exports.processExportsField = function processExportsField( - exportsField -) { - return createFieldProcessor( - buildExportsField(exportsField), - (request) => (request.length === 0 ? "." : "./" + request), - assertExportsFieldRequest, - assertExportTarget - ); -}; - -/** - * @param {ImportsField} importsField the exports field - * @returns {FieldProcessor} process callback - */ -module.exports.processImportsField = function processImportsField( - importsField -) { - return createFieldProcessor( - importsField, - (request) => "#" + request, - assertImportsFieldRequest, - assertImportTarget - ); -}; - -/** - * @param {ExportsField | ImportsField} field root - * @param {(s: string) => string} normalizeRequest Normalize request, for `imports` field it adds `#`, for `exports` field it adds `.` or `./` - * @param {(s: string) => string} assertRequest assertRequest - * @param {(s: string, f: boolean) => void} assertTarget assertTarget - * @returns {FieldProcessor} field processor - */ -function createFieldProcessor( - field, - normalizeRequest, - assertRequest, - assertTarget -) { - return function fieldProcessor(request, conditionNames) { - request = assertRequest(request); - - const match = findMatch(normalizeRequest(request), field); - - if (match === null) return [[], null]; - - const [mapping, remainingRequest, isSubpathMapping, isPattern, usedField] = - match; - - /** @type {DirectMapping|null} */ - let direct = null; - - if (isConditionalMapping(mapping)) { - direct = conditionalMapping( - /** @type {ConditionalMapping} */ (mapping), - conditionNames - ); - - // matching not found - if (direct === null) return [[], null]; - } else { - direct = /** @type {DirectMapping} */ (mapping); - } - - return [ - directMapping( - remainingRequest, - isPattern, - isSubpathMapping, - direct, - conditionNames, - assertTarget - ), - usedField - ]; - }; -} - -/** - * @param {string} request request - * @returns {string} updated request - */ -function assertExportsFieldRequest(request) { - if (request.charCodeAt(0) !== dotCode) { - throw new Error('Request should be relative path and start with "."'); - } - if (request.length === 1) return ""; - if (request.charCodeAt(1) !== slashCode) { - throw new Error('Request should be relative path and start with "./"'); - } - if (request.charCodeAt(request.length - 1) === slashCode) { - throw new Error("Only requesting file allowed"); - } - - return request.slice(2); -} - -/** - * @param {string} request request - * @returns {string} updated request - */ -function assertImportsFieldRequest(request) { - if (request.charCodeAt(0) !== hashCode) { - throw new Error('Request should start with "#"'); - } - if (request.length === 1) { - throw new Error("Request should have at least 2 characters"); - } - if (request.charCodeAt(1) === slashCode) { - throw new Error('Request should not start with "#/"'); - } - if (request.charCodeAt(request.length - 1) === slashCode) { - throw new Error("Only requesting file allowed"); - } - - return request.slice(1); -} - -/** - * @param {string} exp export target - * @param {boolean} expectFolder is folder expected - */ -function assertExportTarget(exp, expectFolder) { - const parsedIdentifier = parseIdentifier(exp); - - if (!parsedIdentifier) { - return; - } - - const [relativePath] = parsedIdentifier; - const isFolder = - relativePath.charCodeAt(relativePath.length - 1) === slashCode; - - if (isFolder !== expectFolder) { - throw new Error( - expectFolder - ? `Expecting folder to folder mapping. ${JSON.stringify( - exp - )} should end with "/"` - : `Expecting file to file mapping. ${JSON.stringify( - exp - )} should not end with "/"` - ); - } -} - -/** - * @param {string} imp import target - * @param {boolean} expectFolder is folder expected - */ -function assertImportTarget(imp, expectFolder) { - const parsedIdentifier = parseIdentifier(imp); - - if (!parsedIdentifier) { - return; - } - - const [relativePath] = parsedIdentifier; - const isFolder = - relativePath.charCodeAt(relativePath.length - 1) === slashCode; - - if (isFolder !== expectFolder) { - throw new Error( - expectFolder - ? `Expecting folder to folder mapping. ${JSON.stringify( - imp - )} should end with "/"` - : `Expecting file to file mapping. ${JSON.stringify( - imp - )} should not end with "/"` - ); - } -} - /** * @param {string} a first string * @param {string} b second string @@ -317,7 +140,7 @@ function findMatch(request, field) { bestMatch = key; bestMatchSubpath = request.slice( patternIndex, - request.length - patternTrailer.length + request.length - patternTrailer.length, ); } } @@ -343,12 +166,12 @@ function findMatch(request, field) { /** @type {string} */ (bestMatchSubpath), isSubpathMapping, isPattern, - bestMatch + bestMatch, ]; } /** - * @param {ConditionalMapping|DirectMapping|null} mapping mapping + * @param {ConditionalMapping | DirectMapping|null} mapping mapping * @returns {boolean} is conditional mapping */ function isConditionalMapping(mapping) { @@ -357,6 +180,99 @@ function isConditionalMapping(mapping) { ); } +/** + * @param {ConditionalMapping} conditionalMapping_ conditional mapping + * @param {Set} conditionNames condition names + * @returns {DirectMapping | null} direct mapping if found + */ +function conditionalMapping(conditionalMapping_, conditionNames) { + /** @type {[ConditionalMapping, string[], number][]} */ + const lookup = [[conditionalMapping_, Object.keys(conditionalMapping_), 0]]; + + loop: while (lookup.length > 0) { + const [mapping, conditions, j] = lookup[lookup.length - 1]; + + for (let i = j; i < conditions.length; i++) { + const condition = conditions[i]; + + if (condition === "default") { + const innerMapping = mapping[condition]; + // is nested + if (isConditionalMapping(innerMapping)) { + const conditionalMapping = /** @type {ConditionalMapping} */ ( + innerMapping + ); + lookup[lookup.length - 1][2] = i + 1; + lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); + continue loop; + } + + return /** @type {DirectMapping} */ (innerMapping); + } + + if (conditionNames.has(condition)) { + const innerMapping = mapping[condition]; + // is nested + if (isConditionalMapping(innerMapping)) { + const conditionalMapping = /** @type {ConditionalMapping} */ ( + innerMapping + ); + lookup[lookup.length - 1][2] = i + 1; + lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); + continue loop; + } + + return /** @type {DirectMapping} */ (innerMapping); + } + } + + lookup.pop(); + } + + return null; +} + +/** + * @param {string | undefined} remainingRequest remaining request when folder mapping, undefined for file mappings + * @param {boolean} isPattern true, if mapping is a pattern (contains "*") + * @param {boolean} isSubpathMapping true, for subpath mappings + * @param {string} mappingTarget direct export + * @param {(d: string, f: boolean) => void} assert asserting direct value + * @returns {string} mapping result + */ +function targetMapping( + remainingRequest, + isPattern, + isSubpathMapping, + mappingTarget, + assert, +) { + if (remainingRequest === undefined) { + assert(mappingTarget, false); + + return mappingTarget; + } + + if (isSubpathMapping) { + assert(mappingTarget, true); + + return mappingTarget + remainingRequest; + } + + assert(mappingTarget, false); + + let result = mappingTarget; + + if (isPattern) { + result = result.replace( + patternRegEx, + remainingRequest.replace(/\$/g, "$$"), + ); + } + + return result; +} + /** * @param {string|undefined} remainingRequest remaining request when folder mapping, undefined for file mappings * @param {boolean} isPattern true, if mapping is a pattern (contains "*") @@ -372,7 +288,7 @@ function directMapping( isSubpathMapping, mappingTarget, conditionNames, - assert + assert, ) { if (mappingTarget === null) return []; @@ -383,8 +299,8 @@ function directMapping( isPattern, isSubpathMapping, mappingTarget, - assert - ) + assert, + ), ]; } @@ -399,8 +315,8 @@ function directMapping( isPattern, isSubpathMapping, exp, - assert - ) + assert, + ), ); continue; } @@ -413,7 +329,7 @@ function directMapping( isSubpathMapping, mapping, conditionNames, - assert + assert, ); for (const innerExport of innerExports) { targets.push(innerExport); @@ -424,96 +340,74 @@ function directMapping( } /** - * @param {string|undefined} remainingRequest remaining request when folder mapping, undefined for file mappings - * @param {boolean} isPattern true, if mapping is a pattern (contains "*") - * @param {boolean} isSubpathMapping true, for subpath mappings - * @param {string} mappingTarget direct export - * @param {(d: string, f: boolean) => void} assert asserting direct value - * @returns {string} mapping result + * @param {ExportsField | ImportsField} field root + * @param {(s: string) => string} normalizeRequest Normalize request, for `imports` field it adds `#`, for `exports` field it adds `.` or `./` + * @param {(s: string) => string} assertRequest assertRequest + * @param {(s: string, f: boolean) => void} assertTarget assertTarget + * @returns {FieldProcessor} field processor */ -function targetMapping( - remainingRequest, - isPattern, - isSubpathMapping, - mappingTarget, - assert +function createFieldProcessor( + field, + normalizeRequest, + assertRequest, + assertTarget, ) { - if (remainingRequest === undefined) { - assert(mappingTarget, false); + return function fieldProcessor(request, conditionNames) { + request = assertRequest(request); - return mappingTarget; - } + const match = findMatch(normalizeRequest(request), field); - if (isSubpathMapping) { - assert(mappingTarget, true); + if (match === null) return [[], null]; - return mappingTarget + remainingRequest; - } + const [mapping, remainingRequest, isSubpathMapping, isPattern, usedField] = + match; - assert(mappingTarget, false); + /** @type {DirectMapping | null} */ + let direct = null; - let result = mappingTarget; + if (isConditionalMapping(mapping)) { + direct = conditionalMapping( + /** @type {ConditionalMapping} */ (mapping), + conditionNames, + ); - if (isPattern) { - result = result.replace( - patternRegEx, - remainingRequest.replace(/\$/g, "$$") - ); - } + // matching not found + if (direct === null) return [[], null]; + } else { + direct = /** @type {DirectMapping} */ (mapping); + } - return result; + return [ + directMapping( + remainingRequest, + isPattern, + isSubpathMapping, + direct, + conditionNames, + assertTarget, + ), + usedField, + ]; + }; } /** - * @param {ConditionalMapping} conditionalMapping_ conditional mapping - * @param {Set} conditionNames condition names - * @returns {DirectMapping|null} direct mapping if found + * @param {string} request request + * @returns {string} updated request */ -function conditionalMapping(conditionalMapping_, conditionNames) { - /** @type {[ConditionalMapping, string[], number][]} */ - let lookup = [[conditionalMapping_, Object.keys(conditionalMapping_), 0]]; - - loop: while (lookup.length > 0) { - const [mapping, conditions, j] = lookup[lookup.length - 1]; - - for (let i = j; i < conditions.length; i++) { - const condition = conditions[i]; - - if (condition === "default") { - const innerMapping = mapping[condition]; - // is nested - if (isConditionalMapping(innerMapping)) { - const conditionalMapping = /** @type {ConditionalMapping} */ ( - innerMapping - ); - lookup[lookup.length - 1][2] = i + 1; - lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); - continue loop; - } - - return /** @type {DirectMapping} */ (innerMapping); - } - - if (conditionNames.has(condition)) { - const innerMapping = mapping[condition]; - // is nested - if (isConditionalMapping(innerMapping)) { - const conditionalMapping = /** @type {ConditionalMapping} */ ( - innerMapping - ); - lookup[lookup.length - 1][2] = i + 1; - lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); - continue loop; - } - - return /** @type {DirectMapping} */ (innerMapping); - } - } - - lookup.pop(); +function assertExportsFieldRequest(request) { + if (request.charCodeAt(0) !== dotCode) { + throw new Error('Request should be relative path and start with "."'); + } + if (request.length === 1) return ""; + if (request.charCodeAt(1) !== slashCode) { + throw new Error('Request should be relative path and start with "./"'); + } + if (request.charCodeAt(request.length - 1) === slashCode) { + throw new Error("Only requesting file allowed"); } - return null; + return request.slice(2); } /** @@ -539,8 +433,8 @@ function buildExportsField(field) { if (charCode === dotCode || charCode === slashCode) { throw new Error( `Exports field key should be relative path and start with "." (key: ${JSON.stringify( - key - )})` + key, + )})`, ); } i++; @@ -551,8 +445,8 @@ function buildExportsField(field) { throw new Error( `Exports field key should be relative path and start with "." (key: ${JSON.stringify( - key - )})` + key, + )})`, ); } @@ -563,11 +457,118 @@ function buildExportsField(field) { if (key.charCodeAt(1) !== slashCode) { throw new Error( `Exports field key should be relative path and start with "./" (key: ${JSON.stringify( - key - )})` + key, + )})`, ); } } return field; } + +/** + * @param {string} exp export target + * @param {boolean} expectFolder is folder expected + */ +function assertExportTarget(exp, expectFolder) { + const parsedIdentifier = parseIdentifier(exp); + + if (!parsedIdentifier) { + return; + } + + const [relativePath] = parsedIdentifier; + const isFolder = + relativePath.charCodeAt(relativePath.length - 1) === slashCode; + + if (isFolder !== expectFolder) { + throw new Error( + expectFolder + ? `Expecting folder to folder mapping. ${JSON.stringify( + exp, + )} should end with "/"` + : `Expecting file to file mapping. ${JSON.stringify( + exp, + )} should not end with "/"`, + ); + } +} + +/** + * @param {ExportsField} exportsField the exports field + * @returns {FieldProcessor} process callback + */ +module.exports.processExportsField = function processExportsField( + exportsField, +) { + return createFieldProcessor( + buildExportsField(exportsField), + (request) => (request.length === 0 ? "." : `./${request}`), + assertExportsFieldRequest, + assertExportTarget, + ); +}; + +/** + * @param {string} request request + * @returns {string} updated request + */ +function assertImportsFieldRequest(request) { + if (request.charCodeAt(0) !== hashCode) { + throw new Error('Request should start with "#"'); + } + if (request.length === 1) { + throw new Error("Request should have at least 2 characters"); + } + if (request.charCodeAt(1) === slashCode) { + throw new Error('Request should not start with "#/"'); + } + if (request.charCodeAt(request.length - 1) === slashCode) { + throw new Error("Only requesting file allowed"); + } + + return request.slice(1); +} + +/** + * @param {string} imp import target + * @param {boolean} expectFolder is folder expected + */ +function assertImportTarget(imp, expectFolder) { + const parsedIdentifier = parseIdentifier(imp); + + if (!parsedIdentifier) { + return; + } + + const [relativePath] = parsedIdentifier; + const isFolder = + relativePath.charCodeAt(relativePath.length - 1) === slashCode; + + if (isFolder !== expectFolder) { + throw new Error( + expectFolder + ? `Expecting folder to folder mapping. ${JSON.stringify( + imp, + )} should end with "/"` + : `Expecting file to file mapping. ${JSON.stringify( + imp, + )} should not end with "/"`, + ); + } +} + +/** + * @param {ImportsField} importsField the exports field + * @returns {FieldProcessor} process callback + */ +module.exports.processImportsField = function processImportsField( + importsField, +) { + return createFieldProcessor( + importsField, + (request) => `#${request}`, + assertImportsFieldRequest, + assertImportTarget, + ); +}; diff --git a/lib/util/identifier.js b/lib/util/identifier.js index ab3c2f88..be06d0fb 100644 --- a/lib/util/identifier.js +++ b/lib/util/identifier.js @@ -34,7 +34,7 @@ function parseIdentifier(identifier) { return [ identifier.slice(0, queryStart), identifier.slice(queryStart), - "" + "", ]; } @@ -43,7 +43,7 @@ function parseIdentifier(identifier) { return [ identifier.slice(0, fragmentStart), "", - identifier.slice(fragmentStart) + identifier.slice(fragmentStart), ]; } @@ -51,7 +51,7 @@ function parseIdentifier(identifier) { return [ identifier.slice(0, queryStart), identifier.slice(queryStart, fragmentStart), - identifier.slice(fragmentStart) + identifier.slice(fragmentStart), ]; } @@ -62,7 +62,7 @@ function parseIdentifier(identifier) { return [ match[1].replace(ZERO_ESCAPE_REGEXP, "$1"), match[2] ? match[2].replace(ZERO_ESCAPE_REGEXP, "$1") : "", - match[3] || "" + match[3] || "", ]; } diff --git a/lib/util/path.js b/lib/util/path.js index 098ac1a0..8e3be823 100644 --- a/lib/util/path.js +++ b/lib/util/path.js @@ -29,28 +29,31 @@ const PathType = Object.freeze({ Relative: 2, AbsoluteWin: 3, AbsolutePosix: 4, - Internal: 5 + Internal: 5, }); -exports.PathType = PathType; + +module.exports.PathType = PathType; const invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; -exports.invalidSegmentRegEx = invalidSegmentRegEx; + +module.exports.invalidSegmentRegEx = invalidSegmentRegEx; const deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; -exports.deprecatedInvalidSegmentRegEx = deprecatedInvalidSegmentRegEx; + +module.exports.deprecatedInvalidSegmentRegEx = deprecatedInvalidSegmentRegEx; /** - * @param {string} p a path + * @param {string} maybePath a path * @returns {PathType} type of path */ -const getType = (p) => { - switch (p.length) { +const getType = (maybePath) => { + switch (maybePath.length) { case 0: return PathType.Empty; case 1: { - const c0 = p.charCodeAt(0); + const c0 = maybePath.charCodeAt(0); switch (c0) { case CHAR_DOT: return PathType.Relative; @@ -62,10 +65,10 @@ const getType = (p) => { return PathType.Normal; } case 2: { - const c0 = p.charCodeAt(0); + const c0 = maybePath.charCodeAt(0); switch (c0) { case CHAR_DOT: { - const c1 = p.charCodeAt(1); + const c1 = maybePath.charCodeAt(1); switch (c1) { case CHAR_DOT: case CHAR_SLASH: @@ -78,27 +81,26 @@ const getType = (p) => { case CHAR_HASH: return PathType.Internal; } - const c1 = p.charCodeAt(1); - if (c1 === CHAR_COLON) { - if ( - (c0 >= CHAR_A && c0 <= CHAR_Z) || - (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z) - ) { - return PathType.AbsoluteWin; - } + const c1 = maybePath.charCodeAt(1); + if ( + c1 === CHAR_COLON && + ((c0 >= CHAR_A && c0 <= CHAR_Z) || + (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z)) + ) { + return PathType.AbsoluteWin; } return PathType.Normal; } } - const c0 = p.charCodeAt(0); + const c0 = maybePath.charCodeAt(0); switch (c0) { case CHAR_DOT: { - const c1 = p.charCodeAt(1); + const c1 = maybePath.charCodeAt(1); switch (c1) { case CHAR_SLASH: return PathType.Relative; case CHAR_DOT: { - const c2 = p.charCodeAt(2); + const c2 = maybePath.charCodeAt(2); if (c2 === CHAR_SLASH) return PathType.Relative; return PathType.Normal; } @@ -110,9 +112,9 @@ const getType = (p) => { case CHAR_HASH: return PathType.Internal; } - const c1 = p.charCodeAt(1); + const c1 = maybePath.charCodeAt(1); if (c1 === CHAR_COLON) { - const c2 = p.charCodeAt(2); + const c2 = maybePath.charCodeAt(2); if ( (c2 === CHAR_BACKSLASH || c2 === CHAR_SLASH) && ((c0 >= CHAR_A && c0 <= CHAR_Z) || @@ -123,26 +125,28 @@ const getType = (p) => { } return PathType.Normal; }; -exports.getType = getType; + +module.exports.getType = getType; /** - * @param {string} p a path + * @param {string} maybePath a path * @returns {string} the normalized path */ -const normalize = (p) => { - switch (getType(p)) { +const normalize = (maybePath) => { + switch (getType(maybePath)) { case PathType.Empty: - return p; + return maybePath; case PathType.AbsoluteWin: - return winNormalize(p); + return winNormalize(maybePath); case PathType.Relative: { - const r = posixNormalize(p); + const r = posixNormalize(maybePath); return getType(r) === PathType.Relative ? r : `./${r}`; } } - return posixNormalize(p); + return posixNormalize(maybePath); }; -exports.normalize = normalize; + +module.exports.normalize = normalize; /** * @param {string} rootPath the root path @@ -176,7 +180,8 @@ const join = (rootPath, request) => { } return posixNormalize(rootPath); }; -exports.join = join; + +module.exports.join = join; /** @type {Map>} */ const joinCache = new Map(); @@ -200,4 +205,5 @@ const cachedJoin = (rootPath, request) => { cache.set(request, cacheEntry); return cacheEntry; }; -exports.cachedJoin = cachedJoin; + +module.exports.cachedJoin = cachedJoin; diff --git a/lib/util/process-browser.js b/lib/util/process-browser.js index a99141fd..694334c8 100644 --- a/lib/util/process-browser.js +++ b/lib/util/process-browser.js @@ -10,13 +10,16 @@ module.exports = { * @type {Record} */ versions: {}, + // eslint-disable-next-line jsdoc/no-restricted-syntax /** - * @param {function} fn function + * @param {Function} fn function */ nextTick(fn) { + // eslint-disable-next-line prefer-rest-params const args = Array.prototype.slice.call(arguments, 1); - Promise.resolve().then(function () { + Promise.resolve().then(() => { + // eslint-disable-next-line prefer-spread fn.apply(null, args); }); - } + }, }; diff --git a/package.json b/package.json index 4cb87814..2e679a37 100644 --- a/package.json +++ b/package.json @@ -18,21 +18,30 @@ }, "license": "MIT", "devDependencies": { + "@eslint/js": ">= 9.28.0", + "@eslint/markdown": ">= 6.5.0", "@types/graceful-fs": "^4.1.6", "@types/jest": "^27.5.1", "@types/node": "20.9.5", + "@stylistic/eslint-plugin": ">= 4.4.1", "cspell": "4.2.8", - "eslint": "^7.9.0", - "eslint-config-prettier": "^6.11.0", - "eslint-plugin-jsdoc": "^30.5.1", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^3.1.4", + "eslint": "^9.28.0", + "eslint-config-prettier": "^10.1.5", + "eslint-config-webpack": "^4.0.2", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-jest": "^28.13.0", + "eslint-plugin-jsdoc": "^50.7.1", + "eslint-plugin-n": "^17.19.0", + "eslint-plugin-prettier": "^5.4.1", + "eslint-plugin-unicorn": "^59.0.1", + "globals": "^16.2.0", "husky": "^6.0.0", "jest": "^27.5.1", "lint-staged": "^10.4.0", "memfs": "^3.2.0", - "prettier": "^2.1.2", - "tooling": "webpack/tooling#v1.23.9", + "prettier": "^3.5.3", + "prettier-2": "npm:prettier@^2", + "tooling": "webpack/tooling#v1.23.10", "typescript": "^5.3.3" }, "engines": { diff --git a/test/CachedInputFileSystem.test.js b/test/CachedInputFileSystem.test.js index 56d1e4d9..84e806bc 100644 --- a/test/CachedInputFileSystem.test.js +++ b/test/CachedInputFileSystem.test.js @@ -1,14 +1,16 @@ +"use strict"; + const { CachedInputFileSystem } = require("../"); const path = require("path"); const url = require("url"); -describe("CachedInputFileSystem OperationMergerBackend ('stat' and 'statSync')", () => { +describe("cachedInputFileSystem OperationMergerBackend ('stat' and 'statSync')", () => { let fs; beforeEach(() => { fs = new CachedInputFileSystem( { - stat: function (path, options, callback) { + stat(path, options, callback) { if (!callback) { callback = options; options = undefined; @@ -17,58 +19,59 @@ describe("CachedInputFileSystem OperationMergerBackend ('stat' and 'statSync')", () => callback(null, { path, - options + options, }), - 100 + 100, ); }, - // @ts-ignore - statSync: function (path, options) { + // @ts-expect-error for tests + statSync(path, options) { return { path, - options + options, }; - } + }, }, - 0 + 0, ); }); + afterEach(() => { fs.purge(); }); - it("should join accesses", function (done) { - fs.stat("a", function (err, result) { + it("should join accesses", (done) => { + fs.stat("a", (err, result) => { expect(result).toBeDefined(); result.a = true; }); - fs.stat("a", function (err, result) { + fs.stat("a", (err, result) => { expect(result).toBeDefined(); expect(result.a).toBeDefined(); done(); }); }); - it("should not join accesses with options", function (done) { - fs.stat("a", function (err, result) { + it("should not join accesses with options", (done) => { + fs.stat("a", (err, result) => { expect(result).toBeDefined(); result.a = true; - expect(result.path).toEqual("a"); + expect(result.path).toBe("a"); expect(result.options).toBeUndefined(); }); - fs.stat("a", { options: true }, function (err, result) { + fs.stat("a", { options: true }, (err, result) => { expect(result).toBeDefined(); expect(result.a).toBeUndefined(); - expect(result.path).toEqual("a"); + expect(result.path).toBe("a"); expect(result.options).toMatchObject({ options: true }); done(); }); }); - it("should not cache accesses", function (done) { - fs.stat("a", function (err, result) { + it("should not cache accesses", (done) => { + fs.stat("a", (err, result) => { result.a = true; - fs.stat("a", function (err, result) { + fs.stat("a", (err, result) => { expect(result.a).toBeUndefined(); done(); }); @@ -84,13 +87,13 @@ describe("CachedInputFileSystem OperationMergerBackend ('stat' and 'statSync')", }); }); -describe("CachedInputFileSystem OperationMergerBackend ('lstat' and 'lstatSync')", () => { +describe("cachedInputFileSystem OperationMergerBackend ('lstat' and 'lstatSync')", () => { let fs; beforeEach(() => { fs = new CachedInputFileSystem( { - lstat: function (path, options, callback) { + lstat(path, options, callback) { if (!callback) { callback = options; options = undefined; @@ -99,61 +102,62 @@ describe("CachedInputFileSystem OperationMergerBackend ('lstat' and 'lstatSync') () => callback(null, { path, - options + options, }), - 100 + 100, ); }, - // @ts-ignore - lstatSync: function (path, options) { + // @ts-expect-error for tests + lstatSync(path, options) { return { path, - options + options, }; - } + }, }, - 0 + 0, ); }); + afterEach(() => { fs.purge(); }); - it("should join accesses", function (done) { - fs.lstat("a", function (err, result) { + it("should join accesses", (done) => { + fs.lstat("a", (err, result) => { expect(result).toBeDefined(); result.a = true; }); - fs.lstat("a", function (err, result) { + fs.lstat("a", (err, result) => { expect(result).toBeDefined(); expect(result.a).toBeDefined(); done(); }); }); - it("should not join accesses with options", function (done) { - fs.lstat("a", function (err, result) { + it("should not join accesses with options", (done) => { + fs.lstat("a", (err, result) => { expect(result).toBeDefined(); result.a = true; expect(result).toBeDefined(); - expect(result.path).toEqual("a"); + expect(result.path).toBe("a"); expect(result.options).toBeUndefined(); }); - fs.lstat("a", { options: true }, function (err, result) { + fs.lstat("a", { options: true }, (err, result) => { expect(result).toBeDefined(); expect(result.a).toBeUndefined(); - expect(result.path).toEqual("a"); + expect(result.path).toBe("a"); expect(result.options).toMatchObject({ options: true }); done(); }); }); - it("should not cache accesses", function (done) { - fs.lstat("a", function (err, result) { + it("should not cache accesses", (done) => { + fs.lstat("a", (err, result) => { result.a = true; - fs.lstat("a", function (err, result) { + fs.lstat("a", (err, result) => { expect(result.a).toBeUndefined(); done(); }); @@ -169,13 +173,13 @@ describe("CachedInputFileSystem OperationMergerBackend ('lstat' and 'lstatSync') }); }); -describe("CachedInputFileSystem OperationMergerBackend ('realpath' and 'realpathSync')", () => { +describe("cachedInputFileSystem OperationMergerBackend ('realpath' and 'realpathSync')", () => { let fs; beforeEach(() => { fs = new CachedInputFileSystem( { - realpath: function (path, options, callback) { + realpath(path, options, callback) { if (!callback) { callback = options; options = undefined; @@ -184,61 +188,62 @@ describe("CachedInputFileSystem OperationMergerBackend ('realpath' and 'realpath () => callback(null, { path, - options + options, }), - 100 + 100, ); }, - // @ts-ignore - realpathSync: function (path, options) { + // @ts-expect-error for tests + realpathSync(path, options) { return { path, - options + options, }; - } + }, }, - 0 + 0, ); }); + afterEach(() => { fs.purge(); }); - it("should join accesses", function (done) { - fs.realpath("a", function (err, result) { + it("should join accesses", (done) => { + fs.realpath("a", (err, result) => { expect(result).toBeDefined(); result.a = true; }); - fs.realpath("a", function (err, result) { + fs.realpath("a", (err, result) => { expect(result).toBeDefined(); expect(result.a).toBeDefined(); done(); }); }); - it("should not join accesses with options", function (done) { - fs.realpath("a", function (err, result) { + it("should not join accesses with options", (done) => { + fs.realpath("a", (err, result) => { expect(result).toBeDefined(); result.a = true; expect(result).toBeDefined(); - expect(result.path).toEqual("a"); + expect(result.path).toBe("a"); expect(result.options).toBeUndefined(); }); - fs.realpath("a", { options: true }, function (err, result) { + fs.realpath("a", { options: true }, (err, result) => { expect(result).toBeDefined(); expect(result.a).toBeUndefined(); - expect(result.path).toEqual("a"); + expect(result.path).toBe("a"); expect(result.options).toMatchObject({ options: true }); done(); }); }); - it("should not cache accesses", function (done) { - fs.realpath("a", function (err, result) { + it("should not cache accesses", (done) => { + fs.realpath("a", (err, result) => { result.a = true; - fs.realpath("a", function (err, result) { + fs.realpath("a", (err, result) => { expect(result.a).toBeUndefined(); done(); }); @@ -254,14 +259,14 @@ describe("CachedInputFileSystem OperationMergerBackend ('realpath' and 'realpath }); }); -describe("CachedInputFileSystem CacheBackend", () => { +describe("cachedInputFileSystem CacheBackend", () => { let fs; beforeEach(() => { let counter = 0; fs = new CachedInputFileSystem( { - stat: function (path, options, callback) { + stat(path, options, callback) { if (!callback) { callback = options; options = undefined; @@ -269,42 +274,43 @@ describe("CachedInputFileSystem CacheBackend", () => { setTimeout( callback.bind(null, null, { path, - options + options, }), - 100 + 100, ); }, - // @ts-ignore - statSync: function (path, options) { + // @ts-expect-error for tests + statSync(path, options) { return { path, - options + options, }; }, - readdir: function (path, callback) { + readdir(path, callback) { callback(null, [`${counter++}`]); - } + }, }, - 1000 + 1000, ); }); + afterEach(() => { fs.purge(); }); - it("should join accesses", function (done) { - fs.stat("a", function (err, result) { + it("should join accesses", (done) => { + fs.stat("a", (err, result) => { result.a = true; }); - fs.stat("a", function (err, result) { + fs.stat("a", (err, result) => { expect(result.a).toBeDefined(); done(); }); }); - it("should not call callback twice when combining sync and async calls", function (done) { + it("should not call callback twice when combining sync and async calls", (done) => { let called = false; - fs.stat("a", function (err, result) { + fs.stat("a", (err, result) => { if (called) return done(new Error("callback was called twice")); called = true; expect(result).toBeDefined(); @@ -317,36 +323,36 @@ describe("CachedInputFileSystem CacheBackend", () => { expect(syncResult.a).toBeDefined(); }); - it("should not join accesses with options", function (done) { - fs.stat("a", function (err, result) { + it("should not join accesses with options", (done) => { + fs.stat("a", (err, result) => { result.a = true; - expect(result.path).toEqual("a"); + expect(result.path).toBe("a"); expect(result.options).toBeUndefined(); }); - fs.stat("a", { options: true }, function (err, result) { + fs.stat("a", { options: true }, (err, result) => { expect(result.a).toBeUndefined(); - expect(result.path).toEqual("a"); + expect(result.path).toBe("a"); expect(result.options).toMatchObject({ options: true }); done(); }); }); - it("should cache accesses", function (done) { - fs.stat("a", function (err, result) { + it("should cache accesses", (done) => { + fs.stat("a", (err, result) => { result.a = true; - var sync = true; - fs.stat("a", function (err, result) { + let sync = true; + fs.stat("a", (err, result) => { expect(result.a).toBeDefined(); - expect(sync).toEqual(true); + expect(sync).toBe(true); setTimeout(() => { - fs.stat("a", function (err, result) { + fs.stat("a", (err, result) => { expect(result.a).toBeUndefined(); result.b = true; - var sync2 = true; - fs.stat("a", function (err, result) { + let sync2 = true; + fs.stat("a", (err, result) => { expect(result.b).toBeDefined(); expect(result.a).toBeUndefined(); - expect(sync2).toEqual(true); + expect(sync2).toBe(true); done(); }); setTimeout(() => { @@ -371,18 +377,18 @@ describe("CachedInputFileSystem CacheBackend", () => { expect(result3.options).toMatchObject({ options: true }); }); - it("should recover after passive periods", function (done) { - fs.stat("a", function (err, result) { + it("should recover after passive periods", (done) => { + fs.stat("a", (err, result) => { result.a = true; setTimeout(() => { - fs.stat("a", function (err, result) { + fs.stat("a", (err, result) => { expect(result.a).toBeDefined(); setTimeout(() => { - fs.stat("a", function (err, result) { + fs.stat("a", (err, result) => { expect(result.a).toBeUndefined(); result.b = true; setTimeout(() => { - fs.stat("a", function (err, result) { + fs.stat("a", (err, result) => { expect(result.b).toBeDefined(); expect(result.a).toBeUndefined(); done(); @@ -395,15 +401,15 @@ describe("CachedInputFileSystem CacheBackend", () => { }); }); - it("should restart after timeout", function (done) { - fs.stat("a", function (err, result) { + it("should restart after timeout", (done) => { + fs.stat("a", (err, result) => { result.a = true; setTimeout(() => { - fs.stat("a", function (err, result) { + fs.stat("a", (err, result) => { expect(result.a).toBeUndefined(); result.b = true; setTimeout(() => { - fs.stat("a", function (err, result) { + fs.stat("a", (err, result) => { expect(result.b).toBeDefined(); expect(result.a).toBeUndefined(); done(); @@ -414,35 +420,36 @@ describe("CachedInputFileSystem CacheBackend", () => { }); }); - it("should cache undefined value", function (done) { - fs.stat(undefined, function (err, result) { + it("should cache undefined value", (done) => { + fs.stat(undefined, (_err, result) => { + expect(result).toBeUndefined(); fs.purge("a"); fs.purge(); done(); }); }); - it("should purge readdir correctly", function (done) { + it("should purge readdir correctly", (done) => { fs.readdir("/test/path", (err, r) => { - expect(r[0]).toEqual("0"); + expect(r[0]).toBe("0"); fs.purge(["/test/path/sub/path"]); fs.readdir("/test/path", (err, r) => { - expect(r[0]).toEqual("0"); + expect(r[0]).toBe("0"); fs.purge(["/test/path/sub"]); fs.readdir("/test/path", (err, r) => { - expect(r[0]).toEqual("1"); + expect(r[0]).toBe("1"); fs.purge(["/test/path"]); fs.readdir("/test/path", (err, r) => { - expect(r[0]).toEqual("2"); + expect(r[0]).toBe("2"); fs.purge([url.pathToFileURL("/test/path")]); fs.readdir("/test/path", (err, r) => { - expect(r[0]).toEqual("2"); + expect(r[0]).toBe("2"); fs.purge(Buffer.from("/test/path")); fs.readdir("/test/path", (err, r) => { - expect(r[0]).toEqual("3"); + expect(r[0]).toBe("3"); fs.purge([Buffer.from("/test/path")]); fs.readdir("/test/path", (err, r) => { - expect(r[0]).toEqual("4"); + expect(r[0]).toBe("4"); done(); }); }); @@ -456,7 +463,8 @@ describe("CachedInputFileSystem CacheBackend", () => { it("should not stack overflow when resolving in an async loop", (done) => { let i = 10000; const next = () => { - fs.stat(__dirname, (err, result) => { + fs.stat(__dirname, (_err, result) => { + expect(result).toBeDefined(); if (i-- > 0) { next(); } else { @@ -468,7 +476,7 @@ describe("CachedInputFileSystem CacheBackend", () => { }); }); -describe("CachedInputFileSystem CacheBackend and Node.JS filesystem", () => { +describe("cachedInputFileSystem CacheBackend and Node.JS filesystem", () => { let fs; beforeEach(() => { @@ -477,56 +485,56 @@ describe("CachedInputFileSystem CacheBackend and Node.JS filesystem", () => { const file = path.resolve(__dirname, "./fixtures/abc.txt"); - it("should work with string async", function (done) { + it("should work with string async", (done) => { fs.readFile(file, (err, r) => { if (err) { done(err); return; } - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); done(); }); }); - it("should work with string sync", function () { + it("should work with string sync", () => { const r = fs.readFileSync(file); - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); }); - it("should work with Buffer async", function (done) { + it("should work with Buffer async", (done) => { fs.readFile(Buffer.from(file), (err, r) => { if (err) { done(err); return; } - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); done(); }); }); - it("should work with Buffer sync", function () { + it("should work with Buffer sync", () => { const r = fs.readFileSync(Buffer.from(file)); - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); }); - it("should work with URL async", function (done) { + it("should work with URL async", (done) => { fs.readFile(url.pathToFileURL(file), (err, r) => { if (err) { done(err); return; } - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); done(); }); }); - it("should work with URL sync", function () { + it("should work with URL sync", () => { const r = fs.readFileSync(url.pathToFileURL(file)); - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); }); }); -describe("CachedInputFileSystem OperationMergerBackend and Node.JS filesystem", () => { +describe("cachedInputFileSystem OperationMergerBackend and Node.JS filesystem", () => { let fs; beforeEach(() => { @@ -535,51 +543,51 @@ describe("CachedInputFileSystem OperationMergerBackend and Node.JS filesystem", const file = path.resolve(__dirname, "./fixtures/abc.txt"); - it("should work with string async", function (done) { + it("should work with string async", (done) => { fs.readFile(file, (err, r) => { if (err) { done(err); return; } - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); done(); }); }); - it("should work with string sync", function () { + it("should work with string sync", () => { const r = fs.readFileSync(file); - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); }); - it("should work with Buffer async", function (done) { + it("should work with Buffer async", (done) => { fs.readFile(Buffer.from(file), (err, r) => { if (err) { done(err); return; } - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); done(); }); }); - it("should work with Buffer sync", function () { + it("should work with Buffer sync", () => { const r = fs.readFileSync(Buffer.from(file)); - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); }); - it("should work with URL async", function (done) { + it("should work with URL async", (done) => { fs.readFile(url.pathToFileURL(file), (err, r) => { if (err) { done(err); return; } - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); done(); }); }); - it("should work with URL sync", function () { + it("should work with URL sync", () => { const r = fs.readFileSync(url.pathToFileURL(file)); - expect(r.toString()).toEqual("abc"); + expect(r.toString()).toBe("abc"); }); }); diff --git a/test/SyncAsyncFileSystemDecorator.test.js b/test/SyncAsyncFileSystemDecorator.test.js index b9ace3f7..b9b2a5c1 100644 --- a/test/SyncAsyncFileSystemDecorator.test.js +++ b/test/SyncAsyncFileSystemDecorator.test.js @@ -4,75 +4,75 @@ const fs = require("fs"); const path = require("path"); const SyncAsyncFileSystemDecorator = require("../lib/SyncAsyncFileSystemDecorator"); -describe("SyncAsyncFileSystemDecorator stat", function () { - it("should use options when they're provided", function (done) { +describe("syncAsyncFileSystemDecorator stat", () => { + it("should use options when they're provided", (done) => { const decoratedFs = new SyncAsyncFileSystemDecorator(fs); decoratedFs.stat( path.join(__dirname, "fixtures", "decorated-fs", "exists.js"), { bigint: true }, - function (error, result) { + (error, result) => { expect(error).toBeNull(); expect(result).toHaveProperty("size"); expect(result).toHaveProperty("birthtime"); expect( - typeof (/** @type {import("fs").BigIntStats} */ (result).size) - ).toEqual("bigint"); + typeof (/** @type {import("fs").BigIntStats} */ (result).size), + ).toBe("bigint"); done(); - } + }, ); }); - it("should work correctly when no options provided", function (done) { + it("should work correctly when no options provided", (done) => { const decoratedFs = new SyncAsyncFileSystemDecorator(fs); decoratedFs.stat( path.join(__dirname, "fixtures", "decorated-fs", "exists.js"), - function (error, result) { + (error, result) => { expect(error).toBeNull(); expect(result).toHaveProperty("size"); expect(result).toHaveProperty("birthtime"); - expect( - typeof (/** @type {import("fs").Stats} */ (result).size) - ).toEqual("number"); + expect(typeof (/** @type {import("fs").Stats} */ (result).size)).toBe( + "number", + ); done(); - } + }, ); }); }); -describe("SyncAsyncFileSystemDecorator lstat", function () { - it("should use options when they're provided", function (done) { +describe("syncAsyncFileSystemDecorator lstat", () => { + it("should use options when they're provided", (done) => { const decoratedFs = new SyncAsyncFileSystemDecorator(fs); if (decoratedFs.lstat) { decoratedFs.lstat( path.join(__dirname, "fixtures", "decorated-fs", "exists.js"), { bigint: true }, - function (error, result) { + (error, result) => { expect(error).toBeNull(); expect(result).toHaveProperty("size"); expect(result).toHaveProperty("birthtime"); expect( - typeof (/** @type {import("fs").BigIntStats} */ (result).size) - ).toEqual("bigint"); + typeof (/** @type {import("fs").BigIntStats} */ (result).size), + ).toBe("bigint"); done(); - } + }, ); } }); - it("should work correctly when no options provided", function (done) { + it("should work correctly when no options provided", (done) => { const decoratedFs = new SyncAsyncFileSystemDecorator(fs); if (decoratedFs.lstat) { decoratedFs.lstat( path.join(__dirname, "fixtures", "decorated-fs", "exists.js"), - function (error, result) { + (error, result) => { expect(error).toBeNull(); expect(result).toHaveProperty("size"); expect(result).toHaveProperty("birthtime"); - expect( - typeof (/** @type {import("fs").Stats} */ (result).size) - ).toEqual("number"); + expect(typeof (/** @type {import("fs").Stats} */ (result).size)).toBe( + "number", + ); done(); - } + }, ); } }); diff --git a/test/__snapshots__/exportsField.test.js.snap b/test/__snapshots__/exportsField.test.js.snap index eae41b10..df4570ec 100644 --- a/test/__snapshots__/exportsField.test.js.snap +++ b/test/__snapshots__/exportsField.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ExportsFieldPlugin should log the correct info 1`] = ` +exports[`exportsFieldPlugin should log the correct info 1`] = ` Array [ "resolve 'exports-field/dist/browser.js' in '...'", " Parsed request is a module", diff --git a/test/__snapshots__/importsField.test.js.snap b/test/__snapshots__/importsField.test.js.snap index aff48610..4d329939 100644 --- a/test/__snapshots__/importsField.test.js.snap +++ b/test/__snapshots__/importsField.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ImportsFieldPlugin should log the correct info 1`] = ` +exports[`importsFieldPlugin should log the correct info 1`] = ` Array [ "resolve '#a/dist/index.js' in '...'", " using description file: .../package.json (relative path: .)", diff --git a/test/alias.test.js b/test/alias.test.js index 7a0a265c..cf19f5f6 100644 --- a/test/alias.test.js +++ b/test/alias.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const { Volume } = require("memfs"); const { ResolverFactory } = require("../"); @@ -24,9 +26,9 @@ describe("alias", () => { "/d/dir/.empty": "", "/e/index": "", "/e/anotherDir/index": "", - "/e/dir/file": "" + "/e/dir/file": "", }, - "/" + "/", ); resolver = ResolverFactory.createResolver({ alias: { @@ -43,100 +45,103 @@ describe("alias", () => { "@*": "/*", "@e*": "/e/*", "@e*file": "/e*file", - ignored: false + ignored: false, }, modules: "/", useSyncFileSystemCalls: true, - //@ts-ignore - fileSystem: fileSystem + // @ts-expect-error for tests + fileSystem, }); }); it("should resolve a not aliased module", () => { - expect(resolver.resolveSync({}, "/", "a")).toEqual("/a/index"); - expect(resolver.resolveSync({}, "/", "a/index")).toEqual("/a/index"); - expect(resolver.resolveSync({}, "/", "a/dir")).toEqual("/a/dir/index"); - expect(resolver.resolveSync({}, "/", "a/dir/index")).toEqual( - "/a/dir/index" - ); + expect(resolver.resolveSync({}, "/", "a")).toBe("/a/index"); + expect(resolver.resolveSync({}, "/", "a/index")).toBe("/a/index"); + expect(resolver.resolveSync({}, "/", "a/dir")).toBe("/a/dir/index"); + expect(resolver.resolveSync({}, "/", "a/dir/index")).toBe("/a/dir/index"); }); + it("should resolve an aliased module", () => { - expect(resolver.resolveSync({}, "/", "aliasA")).toEqual("/a/index"); - expect(resolver.resolveSync({}, "/", "aliasA/index")).toEqual("/a/index"); - expect(resolver.resolveSync({}, "/", "aliasA/dir")).toEqual("/a/dir/index"); - expect(resolver.resolveSync({}, "/", "aliasA/dir/index")).toEqual( - "/a/dir/index" + expect(resolver.resolveSync({}, "/", "aliasA")).toBe("/a/index"); + expect(resolver.resolveSync({}, "/", "aliasA/index")).toBe("/a/index"); + expect(resolver.resolveSync({}, "/", "aliasA/dir")).toBe("/a/dir/index"); + expect(resolver.resolveSync({}, "/", "aliasA/dir/index")).toBe( + "/a/dir/index", ); }); + it('should resolve "#" alias', () => { - expect(resolver.resolveSync({}, "/", "#")).toEqual("/c/dir/index"); - expect(resolver.resolveSync({}, "/", "#/index")).toEqual("/c/dir/index"); + expect(resolver.resolveSync({}, "/", "#")).toBe("/c/dir/index"); + expect(resolver.resolveSync({}, "/", "#/index")).toBe("/c/dir/index"); }); + it('should resolve "@" alias', () => { - expect(resolver.resolveSync({}, "/", "@")).toEqual("/c/dir/index"); - expect(resolver.resolveSync({}, "/", "@/index")).toEqual("/c/dir/index"); + expect(resolver.resolveSync({}, "/", "@")).toBe("/c/dir/index"); + expect(resolver.resolveSync({}, "/", "@/index")).toBe("/c/dir/index"); }); it("should resolve wildcard alias", () => { - expect(resolver.resolveSync({}, "/", "@a")).toEqual("/a/index"); - expect(resolver.resolveSync({}, "/", "@a/dir")).toEqual("/a/dir/index"); - expect(resolver.resolveSync({}, "/", "@e/dir/file")).toEqual("/e/dir/file"); - expect(resolver.resolveSync({}, "/", "@e/anotherDir")).toEqual( - "/e/anotherDir/index" + expect(resolver.resolveSync({}, "/", "@a")).toBe("/a/index"); + expect(resolver.resolveSync({}, "/", "@a/dir")).toBe("/a/dir/index"); + expect(resolver.resolveSync({}, "/", "@e/dir/file")).toBe("/e/dir/file"); + expect(resolver.resolveSync({}, "/", "@e/anotherDir")).toBe( + "/e/anotherDir/index", ); - expect(resolver.resolveSync({}, "/", "@e/dir/file")).toEqual("/e/dir/file"); + expect(resolver.resolveSync({}, "/", "@e/dir/file")).toBe("/e/dir/file"); }); + it("should resolve an ignore module", () => { - expect(resolver.resolveSync({}, "/", "ignored")).toEqual(false); + expect(resolver.resolveSync({}, "/", "ignored")).toBe(false); }); + it("should resolve a recursive aliased module", () => { - expect(resolver.resolveSync({}, "/", "recursive")).toEqual( - "/recursive/dir/index" + expect(resolver.resolveSync({}, "/", "recursive")).toBe( + "/recursive/dir/index", ); - expect(resolver.resolveSync({}, "/", "recursive/index")).toEqual( - "/recursive/dir/index" + expect(resolver.resolveSync({}, "/", "recursive/index")).toBe( + "/recursive/dir/index", ); - expect(resolver.resolveSync({}, "/", "recursive/dir")).toEqual( - "/recursive/dir/index" + expect(resolver.resolveSync({}, "/", "recursive/dir")).toBe( + "/recursive/dir/index", ); - expect(resolver.resolveSync({}, "/", "recursive/dir/index")).toEqual( - "/recursive/dir/index" + expect(resolver.resolveSync({}, "/", "recursive/dir/index")).toBe( + "/recursive/dir/index", ); }); + it("should resolve a file aliased module", () => { - expect(resolver.resolveSync({}, "/", "b")).toEqual("/a/index"); - expect(resolver.resolveSync({}, "/", "c")).toEqual("/a/index"); + expect(resolver.resolveSync({}, "/", "b")).toBe("/a/index"); + expect(resolver.resolveSync({}, "/", "c")).toBe("/a/index"); }); + it("should resolve a file aliased module with a query", () => { - expect(resolver.resolveSync({}, "/", "b?query")).toEqual("/a/index?query"); - expect(resolver.resolveSync({}, "/", "c?query")).toEqual("/a/index?query"); + expect(resolver.resolveSync({}, "/", "b?query")).toBe("/a/index?query"); + expect(resolver.resolveSync({}, "/", "c?query")).toBe("/a/index?query"); }); + it("should resolve a path in a file aliased module", () => { - expect(resolver.resolveSync({}, "/", "b/index")).toEqual("/b/index"); - expect(resolver.resolveSync({}, "/", "b/dir")).toEqual("/b/dir/index"); - expect(resolver.resolveSync({}, "/", "b/dir/index")).toEqual( - "/b/dir/index" - ); - expect(resolver.resolveSync({}, "/", "c/index")).toEqual("/c/index"); - expect(resolver.resolveSync({}, "/", "c/dir")).toEqual("/c/dir/index"); - expect(resolver.resolveSync({}, "/", "c/dir/index")).toEqual( - "/c/dir/index" - ); + expect(resolver.resolveSync({}, "/", "b/index")).toBe("/b/index"); + expect(resolver.resolveSync({}, "/", "b/dir")).toBe("/b/dir/index"); + expect(resolver.resolveSync({}, "/", "b/dir/index")).toBe("/b/dir/index"); + expect(resolver.resolveSync({}, "/", "c/index")).toBe("/c/index"); + expect(resolver.resolveSync({}, "/", "c/dir")).toBe("/c/dir/index"); + expect(resolver.resolveSync({}, "/", "c/dir/index")).toBe("/c/dir/index"); }); + it("should resolve a file aliased file", () => { - expect(resolver.resolveSync({}, "/", "d")).toEqual("/c/index"); - expect(resolver.resolveSync({}, "/", "d/dir/index")).toEqual( - "/c/dir/index" - ); + expect(resolver.resolveSync({}, "/", "d")).toBe("/c/index"); + expect(resolver.resolveSync({}, "/", "d/dir/index")).toBe("/c/dir/index"); }); + it("should resolve a file in multiple aliased dirs", () => { - expect(resolver.resolveSync({}, "/", "multiAlias/dir/file")).toEqual( - "/e/dir/file" + expect(resolver.resolveSync({}, "/", "multiAlias/dir/file")).toBe( + "/e/dir/file", ); - expect(resolver.resolveSync({}, "/", "multiAlias/anotherDir")).toEqual( - "/e/anotherDir/index" + expect(resolver.resolveSync({}, "/", "multiAlias/anotherDir")).toBe( + "/e/anotherDir/index", ); }); + it("should log the correct info", (done) => { const log = []; resolver.resolve( @@ -147,26 +152,26 @@ describe("alias", () => { (err, result) => { if (err) return done(err); - expect(result).toEqual("/a/dir/index"); + expect(result).toBe("/a/dir/index"); expect(log).toMatchSnapshot(); done(); - } + }, ); }); it("should work with absolute paths", (done) => { const resolver = ResolverFactory.createResolver({ alias: { - [path.resolve(__dirname, "fixtures", "foo")]: false + [path.resolve(__dirname, "fixtures", "foo")]: false, }, modules: path.resolve(__dirname, "fixtures"), - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); resolver.resolve({}, __dirname, "foo/index", {}, (err, result) => { if (err) done(err); - expect(result).toEqual(false); + expect(result).toBe(false); done(); }); }); diff --git a/test/browserField.test.js b/test/browserField.test.js index a77c49c7..4b7a8ae6 100644 --- a/test/browserField.test.js +++ b/test/browserField.test.js @@ -1,14 +1,17 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); const { ResolverFactory } = require("../"); const browserModule = path.join(__dirname, "fixtures", "browser-module"); -function p() { - return path.join.apply( - path, - [browserModule].concat(Array.prototype.slice.call(arguments)) - ); +/** + * @param {string[]} args args + * @returns {string} path + */ +function p(...args) { + return path.join(browserModule, ...args); } describe("browserField", () => { @@ -20,73 +23,73 @@ describe("browserField", () => { "browser", ["innerBrowser1", "field2", "browser"], // not presented ["innerBrowser1", "field", "browser"], - ["innerBrowser2", "browser"] + ["innerBrowser2", "browser"], ], useSyncFileSystemCalls: true, - fileSystem: fs + fileSystem: fs, }); }); - it("should ignore", function (done) { - resolver.resolve({}, p(), "./lib/ignore", {}, function (err, result) { + it("should ignore", (done) => { + resolver.resolve({}, p(), "./lib/ignore", {}, (err, result) => { if (err) throw err; - expect(result).toEqual(false); + expect(result).toBe(false); done(); }); }); - it("should ignore", () => { - expect(resolver.resolveSync({}, p(), "./lib/ignore")).toEqual(false); - expect(resolver.resolveSync({}, p(), "./lib/ignore.js")).toEqual(false); - expect(resolver.resolveSync({}, p("lib"), "./ignore")).toEqual(false); - expect(resolver.resolveSync({}, p("lib"), "./ignore.js")).toEqual(false); + it("should ignore #2", () => { + expect(resolver.resolveSync({}, p(), "./lib/ignore")).toBe(false); + expect(resolver.resolveSync({}, p(), "./lib/ignore.js")).toBe(false); + expect(resolver.resolveSync({}, p("lib"), "./ignore")).toBe(false); + expect(resolver.resolveSync({}, p("lib"), "./ignore.js")).toBe(false); }); it("should replace a file", () => { expect(resolver.resolveSync({}, p(), "./lib/replaced")).toEqual( - p("lib", "browser.js") + p("lib", "browser.js"), ); expect(resolver.resolveSync({}, p(), "./lib/replaced.js")).toEqual( - p("lib", "browser.js") + p("lib", "browser.js"), ); expect(resolver.resolveSync({}, p("lib"), "./replaced")).toEqual( - p("lib", "browser.js") + p("lib", "browser.js"), ); expect(resolver.resolveSync({}, p("lib"), "./replaced.js")).toEqual( - p("lib", "browser.js") + p("lib", "browser.js"), ); }); it("should replace a module with a file", () => { expect(resolver.resolveSync({}, p(), "module-a")).toEqual( - p("browser", "module-a.js") + p("browser", "module-a.js"), ); expect(resolver.resolveSync({}, p("lib"), "module-a")).toEqual( - p("browser", "module-a.js") + p("browser", "module-a.js"), ); }); it("should replace a module with a module", () => { expect(resolver.resolveSync({}, p(), "module-b")).toEqual( - p("node_modules", "module-c.js") + p("node_modules", "module-c.js"), ); expect(resolver.resolveSync({}, p("lib"), "module-b")).toEqual( - p("node_modules", "module-c.js") + p("node_modules", "module-c.js"), ); }); it("should resolve in nested property", () => { expect(resolver.resolveSync({}, p(), "./lib/main1.js")).toEqual( - p("lib", "main.js") + p("lib", "main.js"), ); expect(resolver.resolveSync({}, p(), "./lib/main2.js")).toEqual( - p("lib", "browser.js") + p("lib", "browser.js"), ); }); it("should check only alias field properties", () => { expect(resolver.resolveSync({}, p(), "./toString")).toEqual( - p("lib", "toString.js") + p("lib", "toString.js"), ); }); }); diff --git a/test/dependencies.test.js b/test/dependencies.test.js index 8e8aa2e9..086079b5 100644 --- a/test/dependencies.test.js +++ b/test/dependencies.test.js @@ -1,26 +1,28 @@ +"use strict"; + const { Volume } = require("memfs"); const resolve = require("../"); -describe("dependencies", function () { +describe("dependencies", () => { let resolver; - beforeEach(function () { + beforeEach(() => { const fileSystem = Volume.fromJSON( { "/a/b/node_modules/some-module/index.js": "", "/a/node_modules/module/package.json": JSON.stringify({ - main: "entry.js" + main: "entry.js", }), "/a/node_modules/module/file.js": JSON.stringify({ main: "entry.js" }), - "/modules/other-module/file.js": "" + "/modules/other-module/file.js": "", }, - "/" + "/", ); resolver = resolve.create({ extensions: [".json", ".js"], modules: ["/modules", "node_modules"], - // @ts-ignore - fileSystem: fileSystem + // @ts-expect-error for tests + fileSystem, }); }); @@ -38,7 +40,7 @@ describe("dependencies", function () { "/a/node_modules/module", "/a/node_modules", "/a", - "/" + "/", ], missingDependencies: [ // missing package.jsons @@ -53,8 +55,8 @@ describe("dependencies", function () { "/a/b/node_modules/module", // missing files with alterative extensions "/a/node_modules/module/file", - "/a/node_modules/module/file.json" - ] + "/a/node_modules/module/file.json", + ], }, { name: "fast found module request", @@ -66,7 +68,7 @@ describe("dependencies", function () { "/modules/other-module/file.js", "/modules/other-module", "/modules", - "/" + "/", ], missingDependencies: [ // missing package.jsons @@ -75,9 +77,9 @@ describe("dependencies", function () { "/a/package.json", "/package.json", "/modules/other-module/package.json", - "/modules/package.json" - ] - } + "/modules/package.json", + ], + }, ]; for (const testCase of testCases) { @@ -90,20 +92,20 @@ describe("dependencies", function () { testCase.request, { fileDependencies, - missingDependencies + missingDependencies, }, (err, result) => { if (err) return done(err); expect(result).toEqual(testCase.result); - expect(Array.from(fileDependencies).sort()).toEqual( - testCase.fileDependencies.sort() + expect([...fileDependencies].sort()).toEqual( + testCase.fileDependencies.sort(), ); - expect(Array.from(missingDependencies).sort()).toEqual( - testCase.missingDependencies.sort() + expect([...missingDependencies].sort()).toEqual( + testCase.missingDependencies.sort(), ); done(); - } + }, ); }); } diff --git a/test/exportsField.test.js b/test/exportsField.test.js index f0ec2cdd..50229fb1 100644 --- a/test/exportsField.test.js +++ b/test/exportsField.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); const { processExportsField } = require("../lib/util/entrypoints"); @@ -13,13 +15,13 @@ const fixture4 = path.resolve(__dirname, "fixtures", "exports-field-error"); const fixture5 = path.resolve( __dirname, "fixtures", - "exports-field-invalid-package-target" + "exports-field-invalid-package-target", ); -describe("Process exports field", function exportsField() { +describe("process exports field", () => { /** @type {Array<{name: string, expect: string[]|Error, suite: [ExportsField, string, string[]]}>} */ const testCases = [ - //#region Samples + // #region Samples { name: "sample #1", expect: ["./dist/test/file.js", "./src/test/file.js"], @@ -27,13 +29,13 @@ describe("Process exports field", function exportsField() { { "./foo/": { import: ["./dist/", "./src/"], - webpack: "./wp/" + webpack: "./wp/", }, - ".": "./main.js" + ".": "./main.js", }, "./foo/test/file.js", - ["import", "webpack"] - ] + ["import", "webpack"], + ], }, { name: "sample #1 (wildcard)", @@ -42,35 +44,35 @@ describe("Process exports field", function exportsField() { { "./foo/*": { import: ["./dist/*", "./src/*"], - webpack: "./wp/*" + webpack: "./wp/*", }, - ".": "./main.js" + ".": "./main.js", }, "./foo/test/file.js", - ["import", "webpack"] - ] + ["import", "webpack"], + ], }, { name: "sample #2", expect: ["./data/timezones/pdt.mjs"], suite: [ { - "./timezones/": "./data/timezones/" + "./timezones/": "./data/timezones/", }, "./timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "sample #2 (wildcard)", expect: ["./data/timezones/pdt.mjs"], suite: [ { - "./timezones/*": "./data/timezones/*" + "./timezones/*": "./data/timezones/*", }, "./timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "sample #3", @@ -78,11 +80,11 @@ describe("Process exports field", function exportsField() { expect: ["./data/timezones/timezones/pdt.mjs"], suite: [ { - "./": "./data/timezones/" + "./": "./data/timezones/", }, "./timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "sample #3 (wildcard)", @@ -90,11 +92,11 @@ describe("Process exports field", function exportsField() { expect: ["./data/timezones/timezones/pdt.mjs"], suite: [ { - "./*": "./data/timezones/*.mjs" + "./*": "./data/timezones/*.mjs", }, "./timezones/pdt", - [] - ] + [], + ], }, { name: "sample #4", @@ -102,15 +104,15 @@ describe("Process exports field", function exportsField() { suite: [ { "./lib/": { - browser: ["./browser/"] + browser: ["./browser/"], }, "./dist/index.js": { - node: "./index.js" - } + node: "./index.js", + }, }, "./dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "sample #4 (wildcard)", @@ -118,15 +120,15 @@ describe("Process exports field", function exportsField() { suite: [ { "./lib/*": { - browser: ["./browser/*"] + browser: ["./browser/*"], }, "./dist/index.js": { - node: "./index.js" - } + node: "./index.js", + }, }, "./dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "sample #5", @@ -134,16 +136,16 @@ describe("Process exports field", function exportsField() { suite: [ { "./lib/": { - browser: ["./browser/"] + browser: ["./browser/"], }, "./dist/index.js": { node: "./index.js", - default: "./browser/index.js" - } + default: "./browser/index.js", + }, }, "./dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "sample #5 (wildcard)", @@ -151,71 +153,71 @@ describe("Process exports field", function exportsField() { suite: [ { "./lib/*": { - browser: ["./browser/*"] + browser: ["./browser/*"], }, "./dist/index.js": { node: "./index.js", - default: "./browser/index.js" - } + default: "./browser/index.js", + }, }, "./dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "sample #6", expect: [], suite: [ { - "./dist/a": "./dist/index.js" + "./dist/a": "./dist/index.js", }, "./dist/aaa", - [] - ] + [], + ], }, { name: "sample #7", expect: [], suite: [ { - "./dist/a/a/": "./dist/index.js" + "./dist/a/a/": "./dist/index.js", }, "./dist/a/a", - [] - ] + [], + ], }, { name: "sample #7 (wildcard)", expect: [], suite: [ { - "./dist/a/a/*": "./dist/index.js" + "./dist/a/a/*": "./dist/index.js", }, "./dist/a/a", - [] - ] + [], + ], }, { name: "sample #8", expect: [], suite: [ { - ".": "./index.js" + ".": "./index.js", }, "./timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "sample #9", expect: ["./main.js"], suite: [ { - "./index.js": "./main.js" + "./index.js": "./main.js", }, "./index.js", - [] - ] + [], + ], }, { name: "sample #10", @@ -228,11 +230,11 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, "./#foo", - [] - ] + [], + ], }, { name: "sample #11", @@ -245,11 +247,11 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, "./bar#foo", - [] - ] + [], + ], }, { name: "sample #12", @@ -262,11 +264,11 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, "./#zapp/ok.js#abc", - [] - ] + [], + ], }, { name: "sample #12", @@ -279,11 +281,11 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, "./#zapp/ok.js#abc", - [] - ] + [], + ], }, { name: "sample #13", @@ -296,11 +298,11 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, "./#zapp/ok.js?abc", - [] - ] + [], + ], }, { name: "sample #14", @@ -313,11 +315,11 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, "./#zapp/🎉.js", - [] - ] + [], + ], }, { name: "sample #15", @@ -330,12 +332,12 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, // "🎉" percent encoded "./#zapp/%F0%9F%8E%89.js", - [] - ] + [], + ], }, { name: "sample #16", @@ -348,11 +350,11 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, "./🎉", - [] - ] + [], + ], }, { name: "sample #17", @@ -365,11 +367,11 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, "./%F0%9F%8E%89", - [] - ] + [], + ], }, { name: "sample #18", @@ -382,11 +384,11 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, "./module", - [] - ] + [], + ], }, { name: "sample #19", @@ -399,11 +401,11 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, "./module#foo", - [] - ] + [], + ], }, { name: "sample #20", @@ -416,11 +418,11 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./zzz*" + "./#zipp*": "./zzz*", }, "./module?foo", - [] - ] + [], + ], }, { name: "sample #21", @@ -433,36 +435,36 @@ describe("Process exports field", function exportsField() { "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", - "./#zipp*": "./z*z*z*" + "./#zipp*": "./z*z*z*", }, "./#zippi", - [] - ] + [], + ], }, { name: "sample #22", expect: ["./d?e?f"], suite: [ { - "./a?b?c/": "./" + "./a?b?c/": "./", }, "./a?b?c/d?e?f", - [] - ] + [], + ], }, - //#endregion + // #endregion - //#region Direct mapping + // #region Direct mapping { name: "Direct mapping #1", expect: ["./dist/index.js"], suite: [ { - ".": "./dist/index.js" + ".": "./dist/index.js", }, ".", - [] - ] + [], + ], }, { name: "Direct mapping #2", @@ -471,11 +473,11 @@ describe("Process exports field", function exportsField() { { "./": "./", "./*": "./*", - "./dist/index.js": "./dist/index.js" + "./dist/index.js": "./dist/index.js", }, ".", - [] - ] + [], + ], }, { name: "Direct mapping #3", @@ -485,11 +487,11 @@ describe("Process exports field", function exportsField() { "./dist/": "./dist/", "./dist/*": "./dist/*", "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" + "./dist/index.js": "./dist/a.js", }, "./dist/index.js", - [] - ] + [], + ], }, { name: "Direct mapping #4", @@ -497,18 +499,18 @@ describe("Process exports field", function exportsField() { suite: [ { "./": { - browser: ["./browser/"] + browser: ["./browser/"], }, "./*": { - browser: ["./browser/*"] + browser: ["./browser/*"], }, "./dist/index.js": { - browser: "./index.js" - } + browser: "./index.js", + }, }, "./dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "Direct mapping #5", @@ -518,18 +520,18 @@ describe("Process exports field", function exportsField() { suite: [ { "./": { - browser: ["./browser/"] + browser: ["./browser/"], }, "./*": { - browser: ["./browser/*"] + browser: ["./browser/*"], }, "./dist/index.js": { - node: "./node.js" - } + node: "./node.js", + }, }, "./dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "Direct mapping #6", @@ -539,12 +541,12 @@ describe("Process exports field", function exportsField() { ".": { browser: "./index.js", node: "./src/node/index.js", - default: "./src/index.js" - } + default: "./src/index.js", + }, }, ".", - ["browser"] - ] + ["browser"], + ], }, { name: "Direct mapping #7", @@ -554,12 +556,12 @@ describe("Process exports field", function exportsField() { ".": { default: "./src/index.js", browser: "./index.js", - node: "./src/node/index.js" - } + node: "./src/node/index.js", + }, }, ".", - ["browser"] - ] + ["browser"], + ], }, { name: "Direct mapping #8", @@ -569,34 +571,34 @@ describe("Process exports field", function exportsField() { ".": { browser: "./index.js", node: "./src/node/index.js", - default: "./src/index.js" - } + default: "./src/index.js", + }, }, ".", - [] - ] + [], + ], }, { name: "Direct mapping #9", expect: ["./index"], // it is fine, file may not have extension suite: [ { - ".": "./index" + ".": "./index", }, ".", - [] - ] + [], + ], }, { name: "Direct mapping #10", expect: ["./index.js"], suite: [ { - "./index": "./index.js" + "./index": "./index.js", }, "./index", - [] - ] + [], + ], }, { name: "Direct mapping #11", @@ -605,11 +607,11 @@ describe("Process exports field", function exportsField() { { "./": "./", "./*": "./*", - "./dist/index.js": "./dist/index.js" + "./dist/index.js": "./dist/index.js", }, "./foo.js", - [] - ] + [], + ], }, { name: "Direct mapping #12", @@ -618,11 +620,11 @@ describe("Process exports field", function exportsField() { { "./": "./", "./*": "./*", - "./dist/index.js": "./dist/index.js" + "./dist/index.js": "./dist/index.js", }, "./foo/bar/baz.js", - [] - ] + [], + ], }, { name: "Direct mapping #13", @@ -630,11 +632,11 @@ describe("Process exports field", function exportsField() { suite: [ { "./": "./", - "./dist/index.js": "./dist/index.js" + "./dist/index.js": "./dist/index.js", }, "./foo/bar/baz.js", - [] - ] + [], + ], }, { name: "Direct mapping #14", @@ -642,15 +644,15 @@ describe("Process exports field", function exportsField() { suite: [ { "./*": "./*", - "./dist/index.js": "./dist/index.js" + "./dist/index.js": "./dist/index.js", }, "./foo/bar/baz.js", - [] - ] + [], + ], }, - //#endregion + // #endregion - //#region Direct and conditional mapping + // #region Direct and conditional mapping { name: "Direct and conditional mapping #1", expect: [], @@ -659,12 +661,12 @@ describe("Process exports field", function exportsField() { ".": [ { browser: "./browser.js" }, { require: "./require.js" }, - { import: "./import.mjs" } - ] + { import: "./import.mjs" }, + ], }, ".", - [] - ] + [], + ], }, { name: "Direct and conditional mapping #2", @@ -674,12 +676,12 @@ describe("Process exports field", function exportsField() { ".": [ { browser: "./browser.js" }, { require: "./require.js" }, - { import: "./import.mjs" } - ] + { import: "./import.mjs" }, + ], }, ".", - ["import"] - ] + ["import"], + ], }, { name: "Direct and conditional mapping #3", @@ -689,12 +691,12 @@ describe("Process exports field", function exportsField() { ".": [ { browser: "./browser.js" }, { require: "./require.js" }, - { import: "./import.mjs" } - ] + { import: "./import.mjs" }, + ], }, ".", - ["import", "require"] - ] + ["import", "require"], + ], }, { name: "Direct and conditional mapping #4", @@ -704,140 +706,144 @@ describe("Process exports field", function exportsField() { ".": [ { browser: "./browser.js" }, { require: ["./require.js"] }, - { import: ["./import.mjs", "./import.js"] } - ] + { import: ["./import.mjs", "./import.js"] }, + ], }, ".", - ["import", "require"] - ] + ["import", "require"], + ], }, - //#endregion + // #endregion - //#region When mapping to a folder root, both the left and right sides must end in slashes + // #region When mapping to a folder root, both the left and right sides must end in slashes { name: "mapping to a folder root #1", expect: [], suite: [ { - "./timezones": "./data/timezones/" + "./timezones": "./data/timezones/", }, "./timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #2", - expect: new Error(), // incorrect export field + expect: new Error( + 'Expecting folder to folder mapping. "./data/timezones" should end with "/"', + ), suite: [ { - "./timezones/": "./data/timezones" + "./timezones/": "./data/timezones", }, "./timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #3", expect: ["./data/timezones/pdt/index.mjs"], suite: [ { - "./timezones/pdt/": "./data/timezones/pdt/" + "./timezones/pdt/": "./data/timezones/pdt/", }, "./timezones/pdt/index.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #3 (wildcard)", expect: ["./data/timezones/pdt/index.mjs"], suite: [ { - "./timezones/pdt/*": "./data/timezones/pdt/*" + "./timezones/pdt/*": "./data/timezones/pdt/*", }, "./timezones/pdt/index.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #4", expect: ["./timezones/pdt.mjs"], suite: [ { - "./": "./timezones/" + "./": "./timezones/", }, "./pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #4 (wildcard)", expect: ["./timezones/pdt.mjs"], suite: [ { - "./*": "./timezones/*" + "./*": "./timezones/*", }, "./pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #5", expect: ["./timezones/pdt.mjs"], suite: [ { - "./": "./" + "./": "./", }, "./timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #5 (wildcard)", expect: ["./timezones/pdt.mjs"], suite: [ { - "./*": "./*" + "./*": "./*", }, "./timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #6", - expect: new Error(), // not a folder mapping + expect: new Error( + 'Expecting folder to folder mapping. "." should end with "/"', + ), suite: [ { - "./": "." + "./": ".", }, "./timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #7", expect: [], // incorrect export field, but value did not processed suite: [ { - ".": "./" + ".": "./", }, "./timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #7 (wildcard)", expect: [], // incorrect export field, but value did not processed suite: [ { - ".": "./*" + ".": "./*", }, "./timezones/pdt.mjs", - [] - ] + [], + ], }, - //#endregion + // #endregion - //#region The longest matching path prefix is prioritized + // #region The longest matching path prefix is prioritized { name: "the longest matching path prefix is prioritized #1", // it does not work same as conditional mapping, @@ -846,11 +852,11 @@ describe("Process exports field", function exportsField() { suite: [ { "./": "./", - "./dist/": "./lib/" + "./dist/": "./lib/", }, "./dist/index.mjs", - [] - ] + [], + ], }, { name: "the longest matching path prefix is prioritized #1 (wildcard)", @@ -860,11 +866,11 @@ describe("Process exports field", function exportsField() { suite: [ { "./*": "./*", - "./dist/*": "./lib/*" + "./dist/*": "./lib/*", }, "./dist/index.mjs", - [] - ] + [], + ], }, { name: "the longest matching path prefix is prioritized #2", @@ -872,11 +878,11 @@ describe("Process exports field", function exportsField() { suite: [ { "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" + "./dist/": "./lib/", }, "./dist/utils/index.js", - [] - ] + [], + ], }, { name: "the longest matching path prefix is prioritized #2 (wildcard)", @@ -884,11 +890,11 @@ describe("Process exports field", function exportsField() { suite: [ { "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" + "./dist/*": "./lib/*", }, "./dist/utils/index.js", - [] - ] + [], + ], }, { name: "the longest matching path prefix is prioritized #3", @@ -900,11 +906,11 @@ describe("Process exports field", function exportsField() { { "./dist/utils/index.js": "./dist/utils/index.js", "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" + "./dist/": "./lib/", }, "./dist/utils/index.js", - [] - ] + [], + ], }, { name: "the longest matching path prefix is prioritized #3 (wildcard)", @@ -916,11 +922,11 @@ describe("Process exports field", function exportsField() { { "./dist/utils/index.js": "./dist/utils/index.js", "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" + "./dist/*": "./lib/*", }, "./dist/utils/index.js", - [] - ] + [], + ], }, { name: "the longest matching path prefix is prioritized #4", @@ -931,13 +937,13 @@ describe("Process exports field", function exportsField() { suite: [ { "./": { - browser: "./browser/" + browser: "./browser/", }, - "./dist/": "./lib/" + "./dist/": "./lib/", }, "./dist/index.mjs", - ["browser"] - ] + ["browser"], + ], }, { name: "the longest matching path prefix is prioritized #4 (wildcard)", @@ -948,17 +954,17 @@ describe("Process exports field", function exportsField() { suite: [ { "./*": { - browser: "./browser/*" + browser: "./browser/*", }, - "./dist/*": "./lib/*" + "./dist/*": "./lib/*", }, "./dist/index.mjs", - ["browser"] - ] + ["browser"], + ], }, - //#endregion + // #endregion - //#region Conditional mapping folder + // #region Conditional mapping folder { name: "conditional mapping folder #1", expect: ["lodash/index.js", "./utils/index.js"], @@ -966,12 +972,12 @@ describe("Process exports field", function exportsField() { { "./utils/": { browser: ["lodash/", "./utils/"], - node: ["./utils-node/"] - } + node: ["./utils-node/"], + }, }, "./utils/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "conditional mapping folder #1 (wildcard)", @@ -980,12 +986,12 @@ describe("Process exports field", function exportsField() { { "./utils/*": { browser: ["lodash/*", "./utils/*"], - node: ["./utils-node/*"] - } + node: ["./utils-node/*"], + }, }, "./utils/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "conditional mapping folder #2", @@ -995,12 +1001,12 @@ describe("Process exports field", function exportsField() { "./utils/": { webpack: "./wpk/", browser: ["lodash/", "./utils/"], - node: ["./node/"] - } + node: ["./node/"], + }, }, "./utils/index.mjs", - [] - ] + [], + ], }, { name: "conditional mapping folder #2 (wildcard)", @@ -1010,12 +1016,12 @@ describe("Process exports field", function exportsField() { "./utils/*": { webpack: "./wpk/*", browser: ["lodash/*", "./utils/*"], - node: ["./node/*"] - } + node: ["./node/*"], + }, }, "./utils/index.mjs", - [] - ] + [], + ], }, { name: "conditional mapping folder #3", @@ -1025,12 +1031,12 @@ describe("Process exports field", function exportsField() { "./utils/": { webpack: "./wpk/", browser: ["lodash/", "./utils/"], - node: ["./utils/"] - } + node: ["./utils/"], + }, }, "./utils/index.mjs", - ["browser", "webpack"] - ] + ["browser", "webpack"], + ], }, { name: "conditional mapping folder #3 (wildcard)", @@ -1040,76 +1046,82 @@ describe("Process exports field", function exportsField() { "./utils/*": { webpack: "./wpk/*", browser: ["lodash/*", "./utils/*"], - node: ["./utils/*"] - } + node: ["./utils/*"], + }, }, "./utils/index.mjs", - ["browser", "webpack"] - ] + ["browser", "webpack"], + ], }, - //#endregion + // #endregion - //#region Incorrect exports field definition + // #region Incorrect exports field definition { name: "incorrect exports field #1", - expect: new Error(), + expect: new Error( + 'Exports field key should be relative path and start with "." (key: "/utils/")', + ), suite: [ { - "/utils/": "./a/" + "/utils/": "./a/", }, "./utils/index.mjs", - [] - ] + [], + ], }, { name: "incorrect exports field #2", - expect: new Error(), + expect: new Error( + 'Exports field key should be relative path and start with "." (key: "/utils/")', + ), suite: [ { "/utils/": { browser: "./a/", - default: "./b/" - } + default: "./b/", + }, }, "./utils/index.mjs", - ["browser"] - ] + ["browser"], + ], }, { name: "incorrect exports field #3 (wildcard)", - expect: new Error(), + expect: new Error( + 'Expecting file to file mapping. "/a/" should not end with "/"', + ), suite: [ { "./utils/*": { browser: "/a/", - default: "/b/" - } + default: "/b/", + }, }, "./utils/index.mjs", - ["browser"] - ] + ["browser"], + ], }, { name: "incorrect exports field #4", expect: [], suite: [ { - "./utils/index": "./a/index.js" + "./utils/index": "./a/index.js", }, "./utils/index.mjs", - [] - ] + [], + ], }, { name: "incorrect exports field #5", expect: [], suite: [ { - "./utils/index.mjs": "./a/index.js" + "./utils/index.mjs": "./a/index.js", }, "./utils/index", - [] - ] + [], + ], }, { name: "incorrect exports field #6", @@ -1118,12 +1130,12 @@ describe("Process exports field", function exportsField() { { "./utils/index": { browser: "./a/index.js", - default: "./b/index.js" - } + default: "./b/index.js", + }, }, "./utils/index.mjs", - ["browser"] - ] + ["browser"], + ], }, { name: "incorrect exports field #7", @@ -1132,138 +1144,142 @@ describe("Process exports field", function exportsField() { { "./utils/index.mjs": { browser: "./a/index.js", - default: "./b/index.js" - } + default: "./b/index.js", + }, }, "./utils/index", - ["browser"] - ] + ["browser"], + ], }, - //#endregion + // #endregion - //#region Incorrect request + // #region Incorrect request { name: "incorrect request #1", - expect: new Error(), + expect: new Error('Request should be relative path and start with "."'), suite: [ { - "./utils/": "./a/" + "./utils/": "./a/", }, "/utils/index.mjs", - [] - ] + [], + ], }, { name: "incorrect request #2", - expect: new Error(), + expect: new Error('Request should be relative path and start with "."'), suite: [ { "./utils/": { browser: "./a/", - default: "./b/" - } + default: "./b/", + }, }, "/utils/index.mjs", - ["browser"] - ] + ["browser"], + ], }, { name: "incorrect request #3", - expect: new Error(), + expect: new Error('Request should be relative path and start with "./"'), suite: [ { "./utils/": { browser: "./a/", - default: "./b/" - } + default: "./b/", + }, }, "../utils/index.mjs", - ["browser"] - ] + ["browser"], + ], }, { name: "incorrect request #4", - expect: new Error(), + expect: new Error('Request should be relative path and start with "."'), suite: [ { "./utils/": { browser: "./a/", - default: "./b/" - } + default: "./b/", + }, }, "/utils/index.mjs/", - ["browser"] - ] + ["browser"], + ], }, - //#endregion + // #endregion - //#region Directory exports targets may not backtrack above the package base + // #region Directory exports targets may not backtrack above the package base { name: "backtracking package base #1", expect: ["./dist/index"], // we don't handle backtracking here suite: [ { - "./../../utils/": "./dist/" + "./../../utils/": "./dist/", }, "./../../utils/index", - [] - ] + [], + ], }, { name: "backtracking package base #1 (wildcard)", expect: ["./dist/index"], // we don't handle backtracking here suite: [ { - "./../../utils/*": "./dist/*" + "./../../utils/*": "./dist/*", }, "./../../utils/index", - [] - ] + [], + ], }, { name: "backtracking package base #2", - expect: new Error(), + expect: new Error( + 'Exports field key should be relative path and start with "./" (key: "../../utils/")', + ), suite: [ { - "../../utils/": "./dist/" + "../../utils/": "./dist/", }, "../../utils/index", - [] - ] + [], + ], }, { name: "backtracking package base #2 (wildcard)", - expect: new Error(), + expect: new Error( + 'Exports field key should be relative path and start with "./" (key: "../../utils/*")', + ), suite: [ { - "../../utils/*": "./dist/*" + "../../utils/*": "./dist/*", }, "../../utils/index", - [] - ] + [], + ], }, { name: "backtracking package base #3", expect: ["./../src/index"], // we don't handle backtracking here suite: [ { - "./utils/": "./../src/" + "./utils/": "./../src/", }, "./utils/index", - [] - ] + [], + ], }, { name: "backtracking package base #3 (wildcard)", expect: ["./../src/index"], // we don't handle backtracking here suite: [ { - "./utils/*": "./../src/*" + "./utils/*": "./../src/*", }, "./utils/index", - [] - ] + [], + ], }, { name: "backtracking package base #4", @@ -1271,11 +1287,11 @@ describe("Process exports field", function exportsField() { expect: ["./src/../index.js"], suite: [ { - "./utils/index": "./src/../index.js" + "./utils/index": "./src/../index.js", }, "./utils/index", - [] - ] + [], + ], }, { name: "backtracking package base #5", @@ -1284,11 +1300,11 @@ describe("Process exports field", function exportsField() { expect: [], suite: [ { - "./utils/../utils/index": "./src/../index.js" + "./utils/../utils/index": "./src/../index.js", }, "./utils/index", - [] - ] + [], + ], }, { name: "backtracking package base #6", @@ -1296,12 +1312,12 @@ describe("Process exports field", function exportsField() { suite: [ { "./utils/": { - browser: "./utils/../" - } + browser: "./utils/../", + }, }, "./utils/index", - ["browser"] - ] + ["browser"], + ], }, { name: "backtracking package base #6 (wildcard)", @@ -1309,12 +1325,12 @@ describe("Process exports field", function exportsField() { suite: [ { "./utils/*": { - browser: "./utils/../*" - } + browser: "./utils/../*", + }, }, "./utils/index", - ["browser"] - ] + ["browser"], + ], }, { name: "backtracking package base #7", @@ -1322,11 +1338,11 @@ describe("Process exports field", function exportsField() { suite: [ { "./": "./src/../../", - "./dist/": "./dist/" + "./dist/": "./dist/", }, "./dist/index", - ["browser"] - ] + ["browser"], + ], }, { name: "backtracking package base #7 (wildcard)", @@ -1334,96 +1350,96 @@ describe("Process exports field", function exportsField() { suite: [ { "./*": "./src/../../*", - "./dist/*": "./dist/*" + "./dist/*": "./dist/*", }, "./dist/index", - ["browser"] - ] + ["browser"], + ], }, - //#endregion + // #endregion - //#region Directory exports subpaths may not backtrack above the target folder + // #region Directory exports subpaths may not backtrack above the target folder { name: "backtracking target folder #1", expect: ["./dist/timezone/../../index"], suite: [ { - "./utils/": "./dist/" + "./utils/": "./dist/", }, "./utils/timezone/../../index", - [] - ] + [], + ], }, { name: "backtracking target folder #1 (wildcard)", expect: ["./dist/timezone/../../index"], suite: [ { - "./utils/*": "./dist/*" + "./utils/*": "./dist/*", }, "./utils/timezone/../../index", - [] - ] + [], + ], }, { name: "backtracking target folder #2", expect: ["./dist/timezone/../index"], suite: [ { - "./utils/": "./dist/" + "./utils/": "./dist/", }, "./utils/timezone/../index", - [] - ] + [], + ], }, { name: "backtracking target folder #2 (wildcard)", expect: ["./dist/timezone/../index"], suite: [ { - "./utils/*": "./dist/*" + "./utils/*": "./dist/*", }, "./utils/timezone/../index", - [] - ] + [], + ], }, { name: "backtracking target folder #3", expect: ["./dist/target/../../index"], suite: [ { - "./utils/": "./dist/target/" + "./utils/": "./dist/target/", }, "./utils/../../index", - [] - ] + [], + ], }, { name: "backtracking target folder #3 (wildcard)", expect: ["./dist/target/../../index"], suite: [ { - "./utils/*": "./dist/target/*" + "./utils/*": "./dist/target/*", }, "./utils/../../index", - [] - ] + [], + ], }, - //#endregion + // #endregion - //#region Exports targets cannot map into a nested node_modules path + // #region Exports targets cannot map into a nested node_modules path { name: "nested node_modules path #1", expect: ["./node_modules/lodash/dist/index.js"], // we don't handle node_modules here suite: [ { "./utils/": { - browser: "./node_modules/" - } + browser: "./node_modules/", + }, }, "./utils/lodash/dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "nested node_modules path #1 (wildcard)", @@ -1431,38 +1447,38 @@ describe("Process exports field", function exportsField() { suite: [ { "./utils/*": { - browser: "./node_modules/*" - } + browser: "./node_modules/*", + }, }, "./utils/lodash/dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "nested node_modules path #2", expect: ["./utils/../node_modules/lodash/dist/index.js"], suite: [ { - "./utils/": "./utils/../node_modules/" + "./utils/": "./utils/../node_modules/", }, "./utils/lodash/dist/index.js", - [] - ] + [], + ], }, { name: "nested node_modules path #2 (wildcard)", expect: ["./utils/../node_modules/lodash/dist/index.js"], suite: [ { - "./utils/*": "./utils/../node_modules/*" + "./utils/*": "./utils/../node_modules/*", }, "./utils/lodash/dist/index.js", - [] - ] + [], + ], }, - //#endregion + // #endregion - //#region Nested mapping + // #region Nested mapping { name: "nested mapping #1", expect: [], @@ -1472,14 +1488,14 @@ describe("Process exports field", function exportsField() { browser: { webpack: "./", default: { - node: "./node/" - } - } - } + node: "./node/", + }, + }, + }, }, "./utils/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "nested mapping #1 (wildcard)", @@ -1490,14 +1506,14 @@ describe("Process exports field", function exportsField() { browser: { webpack: "./*", default: { - node: "./node/*" - } - } - } + node: "./node/*", + }, + }, + }, }, "./utils/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "nested mapping #2", @@ -1508,14 +1524,14 @@ describe("Process exports field", function exportsField() { browser: { webpack: ["./", "./node/"], default: { - node: "./node/" - } - } - } + node: "./node/", + }, + }, + }, }, "./utils/index.js", - ["browser", "webpack"] - ] + ["browser", "webpack"], + ], }, { name: "nested mapping #2 (wildcard)", @@ -1526,14 +1542,14 @@ describe("Process exports field", function exportsField() { browser: { webpack: ["./*", "./node/*"], default: { - node: "./node/*" - } - } - } + node: "./node/*", + }, + }, + }, }, "./utils/index.js", - ["browser", "webpack"] - ] + ["browser", "webpack"], + ], }, { name: "nested mapping #3", @@ -1544,14 +1560,14 @@ describe("Process exports field", function exportsField() { browser: { webpack: ["./", "./node/"], default: { - node: "./node/" - } - } - } + node: "./node/", + }, + }, + }, }, "./utils/index.js", - ["webpack"] - ] + ["webpack"], + ], }, { name: "nested mapping #3 (wildcard)", @@ -1562,14 +1578,14 @@ describe("Process exports field", function exportsField() { browser: { webpack: ["./*", "./node/*"], default: { - node: "./node/*" - } - } - } + node: "./node/*", + }, + }, + }, }, "./utils/index.js", - ["webpack"] - ] + ["webpack"], + ], }, { name: "nested mapping #4", @@ -1580,14 +1596,14 @@ describe("Process exports field", function exportsField() { browser: { webpack: ["./", "./node/"], default: { - node: "./node/" - } - } - } + node: "./node/", + }, + }, + }, }, "./utils/index.js", - ["node", "browser"] - ] + ["node", "browser"], + ], }, { name: "nested mapping #4 (wildcard)", @@ -1598,14 +1614,14 @@ describe("Process exports field", function exportsField() { browser: { webpack: ["./*", "./node/*"], default: { - node: "./node/*" - } - } - } + node: "./node/*", + }, + }, + }, }, "./utils/index.js", - ["node", "browser"] - ] + ["node", "browser"], + ], }, { name: "nested mapping #5", @@ -1617,15 +1633,15 @@ describe("Process exports field", function exportsField() { webpack: ["./", "./node/"], default: { node: { - webpack: ["./wpck/"] - } - } - } - } + webpack: ["./wpck/"], + }, + }, + }, + }, }, "./utils/index.js", - ["browser", "node"] - ] + ["browser", "node"], + ], }, { name: "nested mapping #5 (wildcard)", @@ -1637,15 +1653,15 @@ describe("Process exports field", function exportsField() { webpack: ["./*", "./node/*"], default: { node: { - webpack: ["./wpck/*"] - } - } - } - } + webpack: ["./wpck/*"], + }, + }, + }, + }, }, "./utils/index.js", - ["browser", "node"] - ] + ["browser", "node"], + ], }, { name: "nested mapping #6", @@ -1657,15 +1673,15 @@ describe("Process exports field", function exportsField() { webpack: ["./", "./node/"], default: { node: { - webpack: ["./wpck/"] - } - } - } - } + webpack: ["./wpck/"], + }, + }, + }, + }, }, "./utils/index.js", - ["browser", "node", "webpack"] - ] + ["browser", "node", "webpack"], + ], }, { name: "nested mapping #6 (wildcard)", @@ -1677,15 +1693,15 @@ describe("Process exports field", function exportsField() { webpack: ["./*", "./node/*"], default: { node: { - webpack: ["./wpck/*"] - } - } - } - } + webpack: ["./wpck/*"], + }, + }, + }, + }, }, "./utils/index.js", - ["browser", "node", "webpack"] - ] + ["browser", "node", "webpack"], + ], }, { name: "nested mapping #7", @@ -1694,12 +1710,12 @@ describe("Process exports field", function exportsField() { { "./a.js": { abc: { def: "./x.js" }, - ghi: "./y.js" - } + ghi: "./y.js", + }, }, "./a.js", - ["abc", "ghi"] - ] + ["abc", "ghi"], + ], }, { name: "nested mapping #8", @@ -1708,35 +1724,35 @@ describe("Process exports field", function exportsField() { { "./a.js": { abc: { def: "./x.js", default: [] }, - ghi: "./y.js" - } + ghi: "./y.js", + }, }, "./a.js", - ["abc", "ghi"] - ] + ["abc", "ghi"], + ], }, - //#endregion + // #endregion - //#region Syntax sugar + // #region Syntax sugar { name: "syntax sugar #1", expect: ["./main.js"], - suite: ["./main.js", ".", []] + suite: ["./main.js", ".", []], }, { name: "syntax sugar #2", expect: [], - suite: ["./main.js", "./lib.js", []] + suite: ["./main.js", "./lib.js", []], }, { name: "syntax sugar #3", expect: ["./a.js", "./b.js"], - suite: [["./a.js", "./b.js"], ".", []] + suite: [["./a.js", "./b.js"], ".", []], }, { name: "syntax sugar #4", expect: [], - suite: [["./a.js", "./b.js"], "./lib.js", []] + suite: [["./a.js", "./b.js"], "./lib.js", []], }, { name: "syntax sugar #5", @@ -1744,12 +1760,12 @@ describe("Process exports field", function exportsField() { suite: [ { browser: { - default: "./index.js" - } + default: "./index.js", + }, }, ".", - ["browser"] - ] + ["browser"], + ], }, { name: "syntax sugar #6", @@ -1757,44 +1773,48 @@ describe("Process exports field", function exportsField() { suite: [ { browser: { - default: "./index.js" - } + default: "./index.js", + }, }, "./lib.js", - ["browser"] - ] + ["browser"], + ], }, { name: "syntax sugar #7", - expect: new Error(), + expect: new Error( + 'Exports field key should be relative path and start with "." (key: "browser")', + ), suite: [ { "./node": "./node.js", browser: { - default: "./index.js" - } + default: "./index.js", + }, }, ".", - ["browser"] - ] + ["browser"], + ], }, { name: "syntax sugar #8", - expect: new Error(), + expect: new Error( + 'Exports field key should be relative path and start with "." (key: "browser")', + ), suite: [ { browser: { - default: "./index.js" + default: "./index.js", }, - "./node": "./node.js" + "./node": "./node.js", }, ".", - ["browser"] - ] + ["browser"], + ], }, - //#endregion + // #endregion - //#region Wildcards + // #region Wildcards { name: "wildcard longest #1", expect: ["./abc/d"], @@ -1802,11 +1822,11 @@ describe("Process exports field", function exportsField() { { "./ab*": "./ab/*", "./abc*": "./abc/*", - "./a*": "./a/*" + "./a*": "./a/*", }, "./abcd", - ["browser"] - ] + ["browser"], + ], }, { name: "wildcard longest #2", @@ -1815,11 +1835,11 @@ describe("Process exports field", function exportsField() { { "./ab*": "./ab/*", "./abc*": "./abc/*", - "./a*": "./a/*" + "./a*": "./a/*", }, "./abcd/e", - ["browser"] - ] + ["browser"], + ], }, { name: "wildcard longest #3", @@ -1828,11 +1848,11 @@ describe("Process exports field", function exportsField() { { "./x/ab*": "./ab/*", "./x/abc*": "./abc/*", - "./x/a*": "./a/*" + "./x/a*": "./a/*", }, "./x/abcd", - ["browser"] - ] + ["browser"], + ], }, { name: "wildcard longest #4", @@ -1841,14 +1861,14 @@ describe("Process exports field", function exportsField() { { "./x/ab*": "./ab/*", "./x/abc*": "./abc/*", - "./x/a*": "./a/*" + "./x/a*": "./a/*", }, "./x/abcd/e", - ["browser"] - ] + ["browser"], + ], }, - //#endregion + // #endregion { name: "path tree edge case #1", @@ -1856,11 +1876,11 @@ describe("Process exports field", function exportsField() { suite: [ { "./a/": "./A/", - "./a/b/c": "./c.js" + "./a/b/c": "./c.js", }, "./a/b/d.js", - [] - ] + [], + ], }, { name: "path tree edge case #1 (wildcard)", @@ -1868,11 +1888,11 @@ describe("Process exports field", function exportsField() { suite: [ { "./a/*": "./A/*", - "./a/b/c": "./c.js" + "./a/b/c": "./c.js", }, "./a/b/d.js", - [] - ] + [], + ], }, { name: "path tree edge case #2", @@ -1880,11 +1900,11 @@ describe("Process exports field", function exportsField() { suite: [ { "./a/": "./A/", - "./a/b": "./b.js" + "./a/b": "./b.js", }, "./a/c.js", - [] - ] + [], + ], }, { name: "path tree edge case #2 (wildcard)", @@ -1892,11 +1912,11 @@ describe("Process exports field", function exportsField() { suite: [ { "./a/*": "./A/*", - "./a/b": "./b.js" + "./a/b": "./b.js", }, "./a/c.js", - [] - ] + [], + ], }, { name: "path tree edge case #3", @@ -1904,11 +1924,11 @@ describe("Process exports field", function exportsField() { suite: [ { "./a/": "./A/", - "./a/b/c/d": "./c.js" + "./a/b/c/d": "./c.js", }, "./a/b/d/c.js", - [] - ] + [], + ], }, { name: "path tree edge case #3 (wildcard)", @@ -1916,55 +1936,55 @@ describe("Process exports field", function exportsField() { suite: [ { "./a/*": "./A/*", - "./a/b/c/d": "./c.js" + "./a/b/c/d": "./c.js", }, "./a/b/d/c.js", - [] - ] + [], + ], }, { name: "wildcard pattern #1", expect: ["./A/b.js"], suite: [ { - "./a/*.js": "./A/*.js" + "./a/*.js": "./A/*.js", }, "./a/b.js", - [] - ] + [], + ], }, { name: "wildcard pattern #2", expect: ["./A/b/c.js"], suite: [ { - "./a/*.js": "./A/*.js" + "./a/*.js": "./A/*.js", }, "./a/b/c.js", - [] - ] + [], + ], }, { name: "wildcard pattern #3", expect: ["./A/b/c.js"], suite: [ { - "./a/*/c.js": "./A/*/c.js" + "./a/*/c.js": "./A/*/c.js", }, "./a/b/c.js", - [] - ] + [], + ], }, { name: "wildcard pattern #4", expect: ["./A/b/b.js"], suite: [ { - "./a/*/c.js": "./A/*/*.js" + "./a/*/c.js": "./A/*/*.js", }, "./a/b/c.js", - [] - ] + [], + ], }, { name: "wildcard pattern #5", @@ -1972,16 +1992,16 @@ describe("Process exports field", function exportsField() { suite: [ { "./lib/*": { - browser: ["./browser/*"] + browser: ["./browser/*"], }, "./dist/*.js": { node: "./*.js", - default: "./browser/*.js" - } + default: "./browser/*.js", + }, }, "./dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "wildcard pattern #5", @@ -1989,16 +2009,16 @@ describe("Process exports field", function exportsField() { suite: [ { "./lib/*": { - browser: ["./browser/*"] + browser: ["./browser/*"], }, "./dist/*.js": { node: "./*.js", - default: "./browser/*.js" - } + default: "./browser/*.js", + }, }, "./lib/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "wildcard pattern #6", @@ -2006,16 +2026,16 @@ describe("Process exports field", function exportsField() { suite: [ { "./lib/*/bar.js": { - browser: ["./browser/*/bar.js"] + browser: ["./browser/*/bar.js"], }, "./dist/*/bar.js": { node: "./*.js", - default: "./browser/*.js" - } + default: "./browser/*.js", + }, }, "./lib/foo/bar.js", - ["browser"] - ] + ["browser"], + ], }, { name: "wildcard pattern #6", @@ -2023,16 +2043,16 @@ describe("Process exports field", function exportsField() { suite: [ { "./lib/*/bar.js": { - browser: ["./browser/*/bar.js"] + browser: ["./browser/*/bar.js"], }, "./dist/*/bar.js": { node: "./*.js", - default: "./browser/*.js" - } + default: "./browser/*.js", + }, }, "./dist/foo/bar.js", - ["browser"] - ] + ["browser"], + ], }, { name: "wildcard pattern #7", @@ -2040,131 +2060,132 @@ describe("Process exports field", function exportsField() { suite: [ { "./lib/*/bar.js": { - browser: ["./browser/*/bar.js"] + browser: ["./browser/*/bar.js"], }, "./dist/*/bar.js": { node: "./*.js", - default: "./browser/*/default.js" - } + default: "./browser/*/default.js", + }, }, "./dist/foo/bar.js", - ["default"] - ] + ["default"], + ], }, { name: "wildcard pattern #8", expect: ["./A/b/b/b.js"], suite: [ { - "./a/*/c.js": "./A/*/*/*.js" + "./a/*/c.js": "./A/*/*/*.js", }, "./a/b/c.js", - [] - ] + [], + ], }, { name: "wildcard pattern #9", expect: ["./A/b/b/b.js", "./B/b/b/b.js"], suite: [ { - "./a/*/c.js": ["./A/*/*/*.js", "./B/*/*/*.js"] + "./a/*/c.js": ["./A/*/*/*.js", "./B/*/*/*.js"], }, "./a/b/c.js", - [] - ] + [], + ], }, { name: "wildcard pattern #10", expect: ["./A/b/b/b.js"], suite: [ { - "./a/foo-*/c.js": "./A/*/*/*.js" + "./a/foo-*/c.js": "./A/*/*/*.js", }, "./a/foo-b/c.js", - [] - ] + [], + ], }, { name: "wildcard pattern #11", expect: ["./A/b/b/b.js"], suite: [ { - "./a/*-foo/c.js": "./A/*/*/*.js" + "./a/*-foo/c.js": "./A/*/*/*.js", }, "./a/b-foo/c.js", - [] - ] + [], + ], }, { name: "wildcard pattern #12", expect: ["./A/b/b/b.js"], suite: [ { - "./a/foo-*-foo/c.js": "./A/*/*/*.js" + "./a/foo-*-foo/c.js": "./A/*/*/*.js", }, "./a/foo-b-foo/c.js", - [] - ] + [], + ], }, { name: "wildcard pattern #13", expect: ["./A/b/c/d.js"], suite: [ { - "./a/foo-*-foo/c.js": "./A/b/c/d.js" + "./a/foo-*-foo/c.js": "./A/b/c/d.js", }, "./a/foo-b-foo/c.js", - [] - ] + [], + ], }, { name: "wildcard pattern #13", expect: ["./A/b/c/*.js"], suite: [ { - "./a/foo-foo/c.js": "./A/b/c/*.js" + "./a/foo-foo/c.js": "./A/b/c/*.js", }, "./a/foo-foo/c.js", - [] - ] - } + [], + ], + }, ]; - testCases.forEach((testCase) => { + for (const testCase of testCases) { it(testCase.name, () => { if (testCase.expect instanceof Error) { expect(() => { + // eslint-disable-next-line no-unused-expressions processExportsField(testCase.suite[0])( testCase.suite[1], - new Set(testCase.suite[2]) + new Set(testCase.suite[2]), )[0]; - }).toThrowError(); + }).toThrow(testCase.expect.message); } else { expect( processExportsField(testCase.suite[0])( testCase.suite[1], - new Set(testCase.suite[2]) - )[0] + new Set(testCase.suite[2]), + )[0], ).toEqual(testCase.expect); } }); - }); + } }); -describe("ExportsFieldPlugin", () => { +describe("exportsFieldPlugin", () => { const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, fullySpecified: true, - conditionNames: ["webpack"] + conditionNames: ["webpack"], }); const commonjsResolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, - conditionNames: ["webpack"] + conditionNames: ["webpack"], }); it("resolve root using exports field, not a main field", (done) => { @@ -2172,7 +2193,7 @@ describe("ExportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "node_modules/exports-field/x.js") + path.resolve(fixture, "node_modules/exports-field/x.js"), ); done(); }); @@ -2183,7 +2204,7 @@ describe("ExportsFieldPlugin", () => { aliasFields: ["browser"], conditionNames: ["custom"], extensions: [".js"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); resolver.resolve( @@ -2195,10 +2216,10 @@ describe("ExportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "node_modules/exports-field/lib/lib2/main.js") + path.resolve(fixture, "node_modules/exports-field/lib/lib2/main.js"), ); done(); - } + }, ); }); @@ -2207,7 +2228,7 @@ describe("ExportsFieldPlugin", () => { aliasFields: ["browser"], conditionNames: ["node"], extensions: [".js"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); resolver.resolve( @@ -2219,10 +2240,10 @@ describe("ExportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture2, "node_modules/exports-field/lib/browser.js") + path.resolve(fixture2, "node_modules/exports-field/lib/browser.js"), ); done(); - } + }, ); }); @@ -2237,11 +2258,11 @@ describe("ExportsFieldPlugin", () => { expect(err).toBeInstanceOf(Error); expect(err.message).toMatch(/Can't resolve/); done(); - } + }, ); }); - it("throw error if extension not provided", (done) => { + it("throw error if extension not provided #2", (done) => { resolver.resolve( {}, fixture2, @@ -2252,7 +2273,7 @@ describe("ExportsFieldPlugin", () => { expect(err).toBeInstanceOf(Error); expect(err.message).toMatch(/Can't resolve/); done(); - } + }, ); }); @@ -2266,10 +2287,10 @@ describe("ExportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture2, "node_modules/exports-field/lib/main.js") + path.resolve(fixture2, "node_modules/exports-field/lib/main.js"), ); done(); - } + }, ); }); @@ -2283,10 +2304,10 @@ describe("ExportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "node_modules/exports-field/lib/main.js") + path.resolve(fixture, "node_modules/exports-field/lib/main.js"), ); done(); - } + }, ); }); @@ -2300,10 +2321,10 @@ describe("ExportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture2, "node_modules/exports-field/lib/browser.js") + path.resolve(fixture2, "node_modules/exports-field/lib/browser.js"), ); done(); - } + }, ); }); @@ -2319,11 +2340,11 @@ describe("ExportsFieldPlugin", () => { expect(result).toEqual( path.resolve( fixture2, - "node_modules/exports-field/lib/browser.js?foo" - ) + "node_modules/exports-field/lib/browser.js?foo", + ), ); done(); - } + }, ); }); @@ -2348,11 +2369,11 @@ describe("ExportsFieldPlugin", () => { expect(result).toEqual( path.resolve( fixture2, - "node_modules/exports-field/lib/browser.js#foo" - ) + "node_modules/exports-field/lib/browser.js#foo", + ), ); done(); - } + }, ); }); @@ -2375,10 +2396,10 @@ describe("ExportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "node_modules/exports-field/lib/main.js") + path.resolve(fixture, "node_modules/exports-field/lib/main.js"), ); done(); - } + }, ); }); @@ -2393,7 +2414,7 @@ describe("ExportsFieldPlugin", () => { expect(err).toBeInstanceOf(Error); expect(err.message).toMatch(/Can't resolve/); done(); - } + }, ); }); @@ -2407,10 +2428,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\.\/lib\/lib2\/\.\.\/\.\.\/\.\.\/a\.js" defined for "\.\/dist\/"/ + /Invalid "exports" target "\.\/lib\/lib2\/\.\.\/\.\.\/\.\.\/a\.js" defined for "\.\/dist\/"/, ); done(); - } + }, ); }); @@ -2424,10 +2445,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\.\/\.\.\/\.\.\/a\.js" defined for "\.\/dist\/a\.js"/ + /Invalid "exports" target "\.\/\.\.\/\.\.\/a\.js" defined for "\.\/dist\/a\.js"/, ); done(); - } + }, ); }); @@ -2451,7 +2472,7 @@ describe("ExportsFieldPlugin", () => { expect(err).toBeInstanceOf(Error); expect(err.message).toMatch(/not exported from package/); done(); - } + }, ); }); @@ -2460,14 +2481,14 @@ describe("ExportsFieldPlugin", () => { aliasFields: ["browser"], exportsFields: [["exportsField", "exports"]], extensions: [".js"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); resolver.resolve({}, fixture3, "exports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture3, "node_modules/exports-field/main.js") + path.resolve(fixture3, "node_modules/exports-field/main.js"), ); done(); }); @@ -2478,14 +2499,14 @@ describe("ExportsFieldPlugin", () => { aliasFields: ["browser"], exportsFields: [["exportsField", "exports"], "exports"], extensions: [".js"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); resolver.resolve({}, fixture3, "exports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture3, "node_modules/exports-field/main.js") + path.resolve(fixture3, "node_modules/exports-field/main.js"), ); done(); }); @@ -2496,14 +2517,14 @@ describe("ExportsFieldPlugin", () => { aliasFields: ["browser"], exportsFields: ["exports", ["exportsField", "exports"]], extensions: [".js"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); resolver.resolve({}, fixture3, "exports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture3, "node_modules/exports-field/main.js") + path.resolve(fixture3, "node_modules/exports-field/main.js"), ); done(); }); @@ -2514,14 +2535,14 @@ describe("ExportsFieldPlugin", () => { aliasFields: ["browser"], exportsFields: [["exports"]], extensions: [".js"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); resolver.resolve({}, fixture2, "exports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture2, "node_modules/exports-field/index.js") + path.resolve(fixture2, "node_modules/exports-field/index.js"), ); done(); }); @@ -2532,14 +2553,14 @@ describe("ExportsFieldPlugin", () => { aliasFields: ["browser"], exportsFields: ["ex", ["exportsField", "exports"]], extensions: [".js"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); resolver.resolve({}, fixture3, "exports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture3, "node_modules/exports-field/index") + path.resolve(fixture3, "node_modules/exports-field/index"), ); done(); }); @@ -2577,7 +2598,7 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\.\/a\/\.\.\/b\/\.\.\/\.\.\/pack1\/index\.js" defined for "\."/ + /Invalid "exports" target "\.\/a\/\.\.\/b\/\.\.\/\.\.\/pack1\/index\.js" defined for "\."/, ); done(); }); @@ -2595,7 +2616,7 @@ describe("ExportsFieldPlugin", () => { expect(err.message).toMatch(/should be relative path/); expect(err.message).toMatch(/umd/); done(); - } + }, ); }); @@ -2610,27 +2631,27 @@ describe("ExportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "node_modules/exports-field/lib/browser.js") + path.resolve(fixture, "node_modules/exports-field/lib/browser.js"), ); expect( - log.map((line) => line.replace(fixture, "...").replace(/\\/g, "/")) + log.map((line) => line.replace(fixture, "...").replace(/\\/g, "/")), ).toMatchSnapshot(); done(); - } + }, ); }); it("should resolve with wildcard pattern #1", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/" + "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/features/f.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/m/src/features/f.js") + path.resolve(fixture, "./node_modules/m/src/features/f.js"), ); done(); }); @@ -2639,39 +2660,39 @@ describe("ExportsFieldPlugin", () => { it("should resolve with wildcard pattern #2", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/" + "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/features/y/y.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/m/src/features/y/y.js") + path.resolve(fixture, "./node_modules/m/src/features/y/y.js"), ); done(); }); }); - it("should resolve with wildcard pattern #2", (done) => { + it("should resolve with wildcard pattern #3", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/" + "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/features/y/y.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/m/src/features/y/y.js") + path.resolve(fixture, "./node_modules/m/src/features/y/y.js"), ); done(); }); }); - it("should resolve with wildcard pattern #3", (done) => { + it("should resolve with wildcard pattern #4", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/" + "./fixtures/imports-exports-wildcard/", ); resolver.resolve( @@ -2683,33 +2704,33 @@ describe("ExportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/m/src/features/y/y.js") + path.resolve(fixture, "./node_modules/m/src/features/y/y.js"), ); done(); - } + }, ); }); - it("should resolve with wildcard pattern #4", (done) => { + it("should resolve with wildcard pattern #5", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/" + "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/middle/nested/f.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/m/src/middle/nested/f.js") + path.resolve(fixture, "./node_modules/m/src/middle/nested/f.js"), ); done(); }); }); - it("should resolve with wildcard pattern #5", (done) => { + it("should resolve with wildcard pattern #6", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/" + "./fixtures/imports-exports-wildcard/", ); resolver.resolve( @@ -2721,17 +2742,17 @@ describe("ExportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/m/src/middle-1/nested/f.js") + path.resolve(fixture, "./node_modules/m/src/middle-1/nested/f.js"), ); done(); - } + }, ); }); - it("should resolve with wildcard pattern #6", (done) => { + it("should resolve with wildcard pattern #7", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/" + "./fixtures/imports-exports-wildcard/", ); resolver.resolve( @@ -2743,17 +2764,17 @@ describe("ExportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/m/src/middle-2/nested/f.js") + path.resolve(fixture, "./node_modules/m/src/middle-2/nested/f.js"), ); done(); - } + }, ); }); - it("should resolve with wildcard pattern #7", (done) => { + it("should resolve with wildcard pattern #8", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/" + "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/middle-3/nested/f", {}, (err, result) => { @@ -2762,40 +2783,40 @@ describe("ExportsFieldPlugin", () => { expect(result).toEqual( path.resolve( fixture, - "./node_modules/m/src/middle-3/nested/f/nested/f.js" - ) + "./node_modules/m/src/middle-3/nested/f/nested/f.js", + ), ); done(); }); }); - it("should resolve with wildcard pattern #8", (done) => { + it("should resolve with wildcard pattern #9", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/" + "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/middle-4/f/nested", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/m/src/middle-4/f/f.js") + path.resolve(fixture, "./node_modules/m/src/middle-4/f/f.js"), ); done(); }); }); - it("should resolve with wildcard pattern #9", (done) => { + it("should resolve with wildcard pattern #10", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/" + "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/middle-5/f$/$", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/m/src/middle-5/f$/$.js") + path.resolve(fixture, "./node_modules/m/src/middle-5/f$/$.js"), ); done(); }); @@ -2804,7 +2825,7 @@ describe("ExportsFieldPlugin", () => { it("should throw error if target is 'null'", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/" + "./fixtures/imports-exports-wildcard/", ); resolver.resolve( @@ -2816,10 +2837,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Package path \.\/features\/internal\/file\.js is not exported/ + /Package path \.\/features\/internal\/file\.js is not exported/, ); done(); - } + }, ); }); @@ -2827,22 +2848,22 @@ describe("ExportsFieldPlugin", () => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { - ".js": [".ts", ".js"] + ".js": [".ts", ".js"], }, fileSystem: nodeFileSystem, fullySpecified: true, - conditionNames: ["webpack", "default"] + conditionNames: ["webpack", "default"], }); const fixture = path.resolve( __dirname, - "./fixtures/exports-field-and-extension-alias/" + "./fixtures/exports-field-and-extension-alias/", ); resolver.resolve({}, fixture, "@org/pkg/string.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/@org/pkg/dist/string.js") + path.resolve(fixture, "./node_modules/@org/pkg/dist/string.js"), ); done(); }); @@ -2852,22 +2873,22 @@ describe("ExportsFieldPlugin", () => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { - ".js": [".ts", ".js"] + ".js": [".ts", ".js"], }, fileSystem: nodeFileSystem, fullySpecified: true, - conditionNames: ["webpack", "default"] + conditionNames: ["webpack", "default"], }); const fixture = path.resolve( __dirname, - "./fixtures/exports-field-and-extension-alias/" + "./fixtures/exports-field-and-extension-alias/", ); resolver.resolve({}, fixture, "pkg/string.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/pkg/dist/string.js") + path.resolve(fixture, "./node_modules/pkg/dist/string.js"), ); done(); }); @@ -2877,22 +2898,22 @@ describe("ExportsFieldPlugin", () => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { - ".js": [".foo", ".baz", ".baz", ".ts", ".js"] + ".js": [".foo", ".baz", ".baz", ".ts", ".js"], }, fileSystem: nodeFileSystem, fullySpecified: true, - conditionNames: ["webpack", "default"] + conditionNames: ["webpack", "default"], }); const fixture = path.resolve( __dirname, - "./fixtures/exports-field-and-extension-alias/" + "./fixtures/exports-field-and-extension-alias/", ); resolver.resolve({}, fixture, "pkg/string.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/pkg/dist/string.js") + path.resolve(fixture, "./node_modules/pkg/dist/string.js"), ); done(); }); @@ -2902,22 +2923,22 @@ describe("ExportsFieldPlugin", () => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { - ".js": [".ts"] + ".js": [".ts"], }, fileSystem: nodeFileSystem, fullySpecified: true, - conditionNames: ["webpack", "default"] + conditionNames: ["webpack", "default"], }); const fixture = path.resolve( __dirname, - "./fixtures/exports-field-and-extension-alias/" + "./fixtures/exports-field-and-extension-alias/", ); resolver.resolve({}, fixture, "pkg/string.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Package path \.\/string\.ts is not exported/ + /Package path \.\/string\.ts is not exported/, ); done(); }); @@ -2927,22 +2948,22 @@ describe("ExportsFieldPlugin", () => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { - ".js": ".ts" + ".js": ".ts", }, fileSystem: nodeFileSystem, fullySpecified: true, - conditionNames: ["webpack", "default"] + conditionNames: ["webpack", "default"], }); const fixture = path.resolve( __dirname, - "./fixtures/exports-field-and-extension-alias/" + "./fixtures/exports-field-and-extension-alias/", ); resolver.resolve({}, fixture, "pkg/string.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Package path \.\/string\.ts is not exported/ + /Package path \.\/string\.ts is not exported/, ); done(); }); @@ -2957,9 +2978,9 @@ describe("ExportsFieldPlugin", () => { (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); - expect(result).toEqual(path.resolve(fixture5, "./a.js") + "?foo=../"); + expect(result).toBe(`${path.resolve(fixture5, "./a.js")}?foo=../`); done(); - } + }, ); }); @@ -2972,11 +2993,9 @@ describe("ExportsFieldPlugin", () => { (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); - expect(result).toEqual( - path.resolve(fixture5, "./a.js") + "?foo=../#../" - ); + expect(result).toBe(`${path.resolve(fixture5, "./a.js")}?foo=../#../`); done(); - } + }, ); }); @@ -2990,10 +3009,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "-bad-specifier-" defined for "\.\/bar"/ + /Invalid "exports" target "-bad-specifier-" defined for "\.\/bar"/, ); done(); - } + }, ); }); @@ -3007,10 +3026,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "foo" defined for "\.\/baz-multi"/ + /Invalid "exports" target "foo" defined for "\.\/baz-multi"/, ); done(); - } + }, ); }); @@ -3025,7 +3044,7 @@ describe("ExportsFieldPlugin", () => { if (!result) return done(new Error("No result")); expect(result).toEqual(path.resolve(fixture5, "./a.js")); done(); - } + }, ); }); @@ -3040,7 +3059,7 @@ describe("ExportsFieldPlugin", () => { if (!result) return done(new Error("No result")); expect(result).toEqual(path.resolve(fixture5, "./a.js")); done(); - } + }, ); }); @@ -3055,7 +3074,7 @@ describe("ExportsFieldPlugin", () => { if (!result) return done(new Error("No result")); expect(result).toEqual(path.resolve(fixture5, "./a.js")); done(); - } + }, ); }); @@ -3069,10 +3088,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\/b\/index\.mjs" defined for "\.\/utils\// + /Invalid "exports" target "\/b\/index\.mjs" defined for "\.\/utils\//, ); done(); - } + }, ); }); @@ -3086,10 +3105,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\/a\/index.mjs" defined for "\.\/utils1\/"/ + /Invalid "exports" target "\/a\/index.mjs" defined for "\.\/utils1\/"/, ); done(); - } + }, ); }); @@ -3103,10 +3122,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\.\.\/this\/index" defined for "\.\/utils2\/"/ + /Invalid "exports" target "\.\.\/this\/index" defined for "\.\/utils2\/"/, ); done(); - } + }, ); }); @@ -3120,10 +3139,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\.\.\/this\/index" defined for "\.\/utils3\/\*"/ + /Invalid "exports" target "\.\.\/this\/index" defined for "\.\/utils3\/\*"/, ); done(); - } + }, ); }); @@ -3137,10 +3156,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\.\.\/src\/index" defined for "\.\/utils4\/\*"/ + /Invalid "exports" target "\.\.\/src\/index" defined for "\.\/utils4\/\*"/, ); done(); - } + }, ); }); @@ -3154,10 +3173,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\.\.\/src\/index" defined for "\.\/utils5\/"/ + /Invalid "exports" target "\.\.\/src\/index" defined for "\.\/utils5\/"/, ); done(); - } + }, ); }); @@ -3171,10 +3190,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\." defined for "\.\/\*"/ + /Invalid "exports" target "\." defined for "\.\/\*"/, ); done(); - } + }, ); }); @@ -3188,10 +3207,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Can't resolve '@exports-field\/bad-specifier\/non-existent\.js'/ + /Can't resolve '@exports-field\/bad-specifier\/non-existent\.js'/, ); done(); - } + }, ); }); @@ -3205,10 +3224,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\.\.\/\.\.\/test\/foo" defined for "\.\/dep\/multi1"/ + /Invalid "exports" target "\.\.\/\.\.\/test\/foo" defined for "\.\/dep\/multi1"/, ); done(); - } + }, ); }); @@ -3222,10 +3241,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\.\.\/\.\.\/test" defined for "\.\/dep\/multi2"/ + /Invalid "exports" target "\.\.\/\.\.\/test" defined for "\.\/dep\/multi2"/, ); done(); - } + }, ); }); @@ -3239,10 +3258,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\.\/c\/\.\.\/b\/\.\.\/\.\.\/pack1\/index\.js" defined for "\.\/dep\/multi4"/ + /Invalid "exports" target "\.\/c\/\.\.\/b\/\.\.\/\.\.\/pack1\/index\.js" defined for "\.\/dep\/multi4"/, ); done(); - } + }, ); }); @@ -3256,10 +3275,10 @@ describe("ExportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "exports" target "\.\/a\/\.\.\/b\/\.\.\/\.\.\/pack1\/index\.js" defined for "\.\/dep\/multi5"/ + /Invalid "exports" target "\.\/a\/\.\.\/b\/\.\.\/\.\.\/pack1\/index\.js" defined for "\.\/dep\/multi5"/, ); done(); - } + }, ); }); @@ -3274,7 +3293,7 @@ describe("ExportsFieldPlugin", () => { if (!result) return done(new Error("No result")); expect(result).toEqual(path.resolve(fixture5, "./a.js")); done(); - } + }, ); }); @@ -3289,7 +3308,7 @@ describe("ExportsFieldPlugin", () => { if (!result) return done(new Error("No result")); expect(result).toEqual(path.resolve(fixture5, "./a.js")); done(); - } + }, ); }); @@ -3304,7 +3323,7 @@ describe("ExportsFieldPlugin", () => { if (!result) return done(new Error("No result")); expect(result).toEqual(path.resolve(fixture5, "./a.js")); done(); - } + }, ); }); @@ -3319,7 +3338,7 @@ describe("ExportsFieldPlugin", () => { if (!result) return done(new Error("No result")); expect(result).toEqual(path.resolve(fixture5, "./a.js")); done(); - } + }, ); }); }); diff --git a/test/extension-alias.test.js b/test/extension-alias.test.js index 9969af4e..b48e2d69 100644 --- a/test/extension-alias.test.js +++ b/test/extension-alias.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); @@ -16,8 +18,8 @@ describe("extension-alias", () => { mainFiles: ["index.js"], extensionAlias: { ".js": [".ts", ".js"], - ".mjs": ".mts" - } + ".mjs": ".mts", + }, }); it("should alias fully specified file", (done) => { @@ -53,7 +55,7 @@ describe("extension-alias", () => { }); it("should not allow to fallback to the original extension or add extensions", (done) => { - resolver.resolve({}, fixture, "./index.mjs", {}, (err, result) => { + resolver.resolve({}, fixture, "./index.mjs", {}, (err, _result) => { expect(err).toBeInstanceOf(Error); done(); }); @@ -65,8 +67,8 @@ describe("extension-alias", () => { fileSystem: nodeFileSystem, mainFiles: ["index.js"], extensionAlias: { - ".js": [] - } + ".js": [], + }, }); it("directory", (done) => { diff --git a/test/extensions.test.js b/test/extensions.test.js index 3c851a6f..aef2fc92 100644 --- a/test/extensions.test.js +++ b/test/extensions.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); const { ResolverFactory, CachedInputFileSystem } = require("../"); @@ -6,24 +8,24 @@ const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ extensions: [".ts", ".js"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); const resolver2 = ResolverFactory.createResolver({ extensions: [".ts", "", ".js"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); const resolver3 = ResolverFactory.createResolver({ extensions: [".ts", "", ".js"], enforceExtension: false, - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); const fixture = path.resolve(__dirname, "fixtures", "extensions"); -describe("extensions", function () { - it("should resolve according to order of provided extensions", function (done) { +describe("extensions", () => { + it("should resolve according to order of provided extensions", (done) => { resolver.resolve({}, fixture, "./foo", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); @@ -31,7 +33,8 @@ describe("extensions", function () { done(); }); }); - it("should resolve according to order of provided extensions (dir index)", function (done) { + + it("should resolve according to order of provided extensions (dir index)", (done) => { resolver.resolve({}, fixture, "./dir", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); @@ -39,7 +42,8 @@ describe("extensions", function () { done(); }); }); - it("should resolve according to main field in module root", function (done) { + + it("should resolve according to main field in module root", (done) => { resolver.resolve({}, fixture, ".", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); @@ -47,7 +51,8 @@ describe("extensions", function () { done(); }); }); - it("should resolve single file module before directory", function (done) { + + it("should resolve single file module before directory", (done) => { resolver.resolve({}, fixture, "module", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); @@ -55,38 +60,43 @@ describe("extensions", function () { done(); }); }); - it("should resolve trailing slash directory before single file", function (done) { + + it("should resolve trailing slash directory before single file", (done) => { resolver.resolve({}, fixture, "module/", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "node_modules/module/index.ts") + path.resolve(fixture, "node_modules/module/index.ts"), ); done(); }); }); - it("should not resolve to file when request has a trailing slash (relative)", function (done) { - resolver.resolve({}, fixture, "./foo.js/", {}, (err, result) => { + + it("should not resolve to file when request has a trailing slash (relative)", (done) => { + resolver.resolve({}, fixture, "./foo.js/", {}, (err, _result) => { if (!err) return done(new Error("No error")); expect(err).toBeInstanceOf(Error); done(); }); }); - it("should not resolve to file when request has a trailing slash (module)", function (done) { - resolver.resolve({}, fixture, "module.js/", {}, (err, result) => { + + it("should not resolve to file when request has a trailing slash (module)", (done) => { + resolver.resolve({}, fixture, "module.js/", {}, (err, _result) => { if (!err) return done(new Error("No error")); expect(err).toBeInstanceOf(Error); done(); }); }); - it("should default enforceExtension to true when extensions includes an empty string", function (done) { + + it("should default enforceExtension to true when extensions includes an empty string", (done) => { const missingDependencies = new Set(); resolver2.resolve({}, fixture, "./foo", { missingDependencies }, () => { expect(missingDependencies).not.toContain(path.resolve(fixture, "foo")); done(); }); }); - it("should respect enforceExtension when extensions includes an empty string", function (done) { + + it("should respect enforceExtension when extensions includes an empty string", (done) => { const missingDependencies = new Set(); resolver3.resolve({}, fixture, "./foo", { missingDependencies }, () => { expect(missingDependencies).toContain(path.resolve(fixture, "foo")); diff --git a/test/fallback.test.js b/test/fallback.test.js index 1de04d2b..be0aab9e 100644 --- a/test/fallback.test.js +++ b/test/fallback.test.js @@ -1,10 +1,12 @@ +"use strict"; + const { Volume } = require("memfs"); const { ResolverFactory } = require("../"); -describe("fallback", function () { +describe("fallback", () => { let resolver; - beforeEach(function () { + beforeEach(() => { const fileSystem = Volume.fromJSON( { "/a/index": "", @@ -21,9 +23,9 @@ describe("fallback", function () { "/d/dir/.empty": "", "/e/index": "", "/e/anotherDir/index": "", - "/e/dir/file": "" + "/e/dir/file": "", }, - "/" + "/", ); resolver = ResolverFactory.createResolver({ fallback: { @@ -34,52 +36,57 @@ describe("fallback", function () { recursive: "recursive/dir", "/d/dir": "/c/dir", "/d/index.js": "/c/index", - ignored: false + ignored: false, }, modules: "/", useSyncFileSystemCalls: true, - //@ts-ignore - fileSystem: fileSystem + // @ts-expect-error for test + fileSystem, }); }); - it("should resolve a not aliased module", function () { + it("should resolve a not aliased module", () => { expect(resolver.resolveSync({}, "/", "a")).toBe("/a/index"); expect(resolver.resolveSync({}, "/", "a/index")).toBe("/a/index"); expect(resolver.resolveSync({}, "/", "a/dir")).toBe("/a/dir/index"); expect(resolver.resolveSync({}, "/", "a/dir/index")).toBe("/a/dir/index"); }); - it("should resolve an fallback module", function () { + + it("should resolve an fallback module", () => { expect(resolver.resolveSync({}, "/", "aliasA")).toBe("/a/index"); expect(resolver.resolveSync({}, "/", "aliasA/index")).toBe("/a/index"); expect(resolver.resolveSync({}, "/", "aliasA/dir")).toBe("/a/dir/index"); expect(resolver.resolveSync({}, "/", "aliasA/dir/index")).toBe( - "/a/dir/index" + "/a/dir/index", ); }); + it("should resolve an ignore module", () => { expect(resolver.resolveSync({}, "/", "ignored")).toBe(false); }); - it("should resolve a recursive aliased module", function () { + + it("should resolve a recursive aliased module", () => { expect(resolver.resolveSync({}, "/", "recursive")).toBe("/recursive/index"); expect(resolver.resolveSync({}, "/", "recursive/index")).toBe( - "/recursive/index" + "/recursive/index", ); expect(resolver.resolveSync({}, "/", "recursive/dir")).toBe( - "/recursive/dir/index" + "/recursive/dir/index", ); expect(resolver.resolveSync({}, "/", "recursive/dir/index")).toBe( - "/recursive/dir/index" + "/recursive/dir/index", ); expect(resolver.resolveSync({}, "/", "recursive/file")).toBe( - "/recursive/dir/file" + "/recursive/dir/file", ); }); - it("should resolve a file aliased module with a query", function () { + + it("should resolve a file aliased module with a query", () => { expect(resolver.resolveSync({}, "/", "b?query")).toBe("/b/index?query"); expect(resolver.resolveSync({}, "/", "c?query")).toBe("/c/index?query"); }); - it("should resolve a path in a file aliased module", function () { + + it("should resolve a path in a file aliased module", () => { expect(resolver.resolveSync({}, "/", "b/index")).toBe("/b/index"); expect(resolver.resolveSync({}, "/", "b/dir")).toBe("/b/dir/index"); expect(resolver.resolveSync({}, "/", "b/dir/index")).toBe("/b/dir/index"); @@ -87,14 +94,16 @@ describe("fallback", function () { expect(resolver.resolveSync({}, "/", "c/dir")).toBe("/c/dir/index"); expect(resolver.resolveSync({}, "/", "c/dir/index")).toBe("/c/dir/index"); }); - it("should resolve a file in multiple aliased dirs", function () { + + it("should resolve a file in multiple aliased dirs", () => { expect(resolver.resolveSync({}, "/", "multiAlias/dir/file")).toBe( - "/e/dir/file" + "/e/dir/file", ); expect(resolver.resolveSync({}, "/", "multiAlias/anotherDir")).toBe( - "/e/anotherDir/index" + "/e/anotherDir/index", ); }); + it("should log the correct info", (done) => { const log = []; resolver.resolve( @@ -107,7 +116,7 @@ describe("fallback", function () { expect(result).toBe("/a/dir/index"); expect(log).toMatchSnapshot(); done(); - } + }, ); }); }); diff --git a/test/forEachBail.test.js b/test/forEachBail.test.js index 488f0b85..8a9ce90b 100644 --- a/test/forEachBail.test.js +++ b/test/forEachBail.test.js @@ -1,3 +1,5 @@ +"use strict"; + const { forEachBail } = require("../"); describe("forEachBail", () => { @@ -18,9 +20,10 @@ describe("forEachBail", () => { expect(result).toEqual({ path: "test" }); expect(log).toEqual([0, 1, 2, 3, 4, 5]); done(); - } + }, ); }); + it("should handle empty array", (done) => { forEachBail( [], @@ -31,22 +34,22 @@ describe("forEachBail", () => { expect(err).toBeUndefined(); expect(result).toBeUndefined(); done(); - } + }, ); }); + it("should sync finish with undefined", (done) => { forEachBail( [2, 3, 4, 5, 6], - (value, callback) => { - return callback(); - }, + (value, callback) => callback(), (err, result) => { expect(err).toBeUndefined(); expect(result).toBeUndefined(); done(); - } + }, ); }); + it("should async finish with undefined", (done) => { forEachBail( [2, 3, 4, 5, 6], @@ -57,7 +60,7 @@ describe("forEachBail", () => { expect(err).toBeUndefined(); expect(result).toBeUndefined(); done(); - } + }, ); }); }); diff --git a/test/fullSpecified.test.js b/test/fullSpecified.test.js index e97cb6a7..c8c666b3 100644 --- a/test/fullSpecified.test.js +++ b/test/fullSpecified.test.js @@ -1,54 +1,56 @@ +"use strict"; + const { Volume } = require("memfs"); const { ResolverFactory } = require("../"); -describe("fullSpecified", function () { +describe("fullSpecified", () => { const fileSystem = Volume.fromJSON( { "/a/node_modules/package1/index.js": "", "/a/node_modules/package1/file.js": "", "/a/node_modules/package2/package.json": JSON.stringify({ - main: "a" + main: "a", }), "/a/node_modules/package2/a.js": "", "/a/node_modules/package3/package.json": JSON.stringify({ - main: "dir" + main: "dir", }), "/a/node_modules/package3/dir/index.js": "", "/a/node_modules/package4/package.json": JSON.stringify({ browser: { - "./a.js": "./b" - } + "./a.js": "./b", + }, }), "/a/node_modules/package4/a.js": "", "/a/node_modules/package4/b.js": "", "/a/abc.js": "", "/a/dir/index.js": "", - "/a/index.js": "" + "/a/index.js": "", }, - "/" + "/", ); const resolver = ResolverFactory.createResolver({ alias: { alias1: "/a/abc", - alias2: "/a/" + alias2: "/a/", }, aliasFields: ["browser"], fullySpecified: true, useSyncFileSystemCalls: true, - // @ts-ignore - fileSystem: fileSystem + // @ts-expect-error for test + fileSystem, }); const contextResolver = ResolverFactory.createResolver({ alias: { alias1: "/a/abc", - alias2: "/a/" + alias2: "/a/", }, aliasFields: ["browser"], fullySpecified: true, resolveToContext: true, useSyncFileSystemCalls: true, - // @ts-ignore - fileSystem: fileSystem + // @ts-expect-error for test + fileSystem, }); const failingResolves = { @@ -58,7 +60,7 @@ describe("fullSpecified", function () { "no directories": ".", "no directories 2": "./", "no directories in packages": "package3/dir", - "no extensions in packages 2": "package3/a" + "no extensions in packages 2": "package3/a", }; const pkg = "/a/node_modules/package"; @@ -68,29 +70,31 @@ describe("fullSpecified", function () { "fully relative in package": ["package1/file.js", `${pkg}1/file.js`], "extensions in mainFiles": ["package1", `${pkg}1/index.js`], "extensions in mainFields": ["package2", `${pkg}2/a.js`], - "extensions in alias": ["alias1", `/a/abc.js`], - "directories in alias": ["alias2", `/a/index.js`], + "extensions in alias": ["alias1", "/a/abc.js"], + "directories in alias": ["alias2", "/a/index.js"], "directories in packages": ["package3", `${pkg}3/dir/index.js`], - "extensions in aliasFields": ["package4/a.js", `${pkg}4/b.js`] + "extensions in aliasFields": ["package4/a.js", `${pkg}4/b.js`], }; for (const key of Object.keys(failingResolves)) { const request = failingResolves[key]; + it(`should fail resolving ${key}`, () => { expect(() => { resolver.resolveSync({}, "/a", request); - }).toThrowError(); + }).toThrow(/Can't resolve/); }); } for (const key of Object.keys(successfulResolves)) { const [request, expected] = successfulResolves[key]; + it(`should resolve ${key} successfully`, () => { try { expect(resolver.resolveSync({}, "/a", request)).toEqual(expected); - } catch (e) { - e.message += `\n${e.details}`; - throw e; + } catch (err) { + err.message += `\n${err.details}`; + throw err; } }); } @@ -102,26 +106,27 @@ describe("fullSpecified", function () { "relative directory 2": ["./dir/", "/a/dir"], "relative directory with query and fragment": [ "./dir?123#456", - "/a/dir?123#456" + "/a/dir?123#456", ], "relative directory with query and fragment 2": [ "./dir/?123#456", - "/a/dir?123#456" + "/a/dir?123#456", ], "absolute directory": ["/a/dir", "/a/dir"], - "directory in package": ["package3/dir", `${pkg}3/dir`] + "directory in package": ["package3/dir", `${pkg}3/dir`], }; for (const key of Object.keys(successfulContextResolves)) { const [request, expected] = successfulContextResolves[key]; + it(`should resolve ${key} successfully to an context`, () => { try { expect(contextResolver.resolveSync({}, "/a", request)).toEqual( - expected + expected, ); - } catch (e) { - e.message += `\n${e.details}`; - throw e; + } catch (err) { + err.message += `\n${err.details}`; + throw err; } }); } diff --git a/test/getPaths.test.js b/test/getPaths.test.js index 605cfff7..0e25ad60 100644 --- a/test/getPaths.test.js +++ b/test/getPaths.test.js @@ -1,3 +1,5 @@ +"use strict"; + const getPaths = require("../lib/getPaths"); /** @@ -9,15 +11,17 @@ const cases = [ ["/a/b", { paths: ["/a/b", "/a", "/"], segments: ["b", "a", "/"] }], [ "/a/b/", - { paths: ["/a/b/", "/a/b", "/a", "/"], segments: ["", "b", "a", "/"] } + { paths: ["/a/b/", "/a/b", "/a", "/"], segments: ["", "b", "a", "/"] }, ], - ["/", { paths: ["/"], segments: [""] }] + ["/", { paths: ["/"], segments: [""] }], ]; -cases.forEach((case_) => { - it(case_[0], () => { - const { paths, segments } = getPaths(case_[0]); - expect(paths).toEqual(case_[1].paths); - expect(segments).toEqual(case_[1].segments); - }); +describe("get paths", () => { + for (const case_ of cases) { + it(case_[0], () => { + const { paths, segments } = getPaths(case_[0]); + expect(paths).toEqual(case_[1].paths); + expect(segments).toEqual(case_[1].segments); + }); + } }); diff --git a/test/identifier.test.js b/test/identifier.test.js index 5ef3dcab..e8e3e24d 100644 --- a/test/identifier.test.js +++ b/test/identifier.test.js @@ -1,96 +1,100 @@ +"use strict"; + const { parseIdentifier } = require("../lib/util/identifier"); /** * @typedef {{input: string, expected: [string, string, string]}} TestSuite */ -/** - * @param {TestSuite[]} suites suites - */ -function run(suites) { - suites.forEach(({ input, expected }) => { - it(input, () => { - const parsed = parseIdentifier(input); +describe("identifier", () => { + /** + * @param {TestSuite[]} suites suites + */ + function run(suites) { + for (const { input, expected } of suites) { + it(input, () => { + const parsed = parseIdentifier(input); - if (!parsed) throw new Error("should not be null"); - - expect(parsed).toEqual(expected); - }); - }); -} + if (!parsed) throw new Error("should not be null"); -describe("parse identifier. edge cases", () => { - /** @type {TestSuite[]} */ - const tests = [ - { - input: "path/#", - expected: ["path/", "", "#"] - }, - { - input: "path/as/?", - expected: ["path/as/", "?", ""] - }, - { - input: "path/#/?", - expected: ["path/", "", "#/?"] - }, - { - input: "path/#repo#hash", - expected: ["path/", "", "#repo#hash"] - }, - { - input: "path/#r#hash", - expected: ["path/", "", "#r#hash"] - }, - { - input: "path/#repo/#repo2#hash", - expected: ["path/", "", "#repo/#repo2#hash"] - }, - { - input: "path/#r/#r#hash", - expected: ["path/", "", "#r/#r#hash"] - }, - { - input: "path/#/not/a/hash?not-a-query", - expected: ["path/", "", "#/not/a/hash?not-a-query"] - }, - { - input: "#\0?\0#ab\0\0c?\0#\0\0query#?#\0fragment", - expected: ["#?#ab\0c", "?#\0query", "#?#\0fragment"] + expect(parsed).toEqual(expected); + }); } - ]; + } - run(tests); -}); + describe("parse identifier. edge cases", () => { + /** @type {TestSuite[]} */ + const tests = [ + { + input: "path/#", + expected: ["path/", "", "#"], + }, + { + input: "path/as/?", + expected: ["path/as/", "?", ""], + }, + { + input: "path/#/?", + expected: ["path/", "", "#/?"], + }, + { + input: "path/#repo#hash", + expected: ["path/", "", "#repo#hash"], + }, + { + input: "path/#r#hash", + expected: ["path/", "", "#r#hash"], + }, + { + input: "path/#repo/#repo2#hash", + expected: ["path/", "", "#repo/#repo2#hash"], + }, + { + input: "path/#r/#r#hash", + expected: ["path/", "", "#r/#r#hash"], + }, + { + input: "path/#/not/a/hash?not-a-query", + expected: ["path/", "", "#/not/a/hash?not-a-query"], + }, + { + input: "#\0?\0#ab\0\0c?\0#\0\0query#?#\0fragment", + expected: ["#?#ab\0c", "?#\0query", "#?#\0fragment"], + }, + ]; -describe("parse identifier. Windows-like paths", () => { - /** @type {TestSuite[]} */ - const tests = [ - { - input: "path\\#", - expected: ["path\\", "", "#"] - }, - { - input: "C:path\\as\\?", - expected: ["C:path\\as\\", "?", ""] - }, - { - input: "path\\#\\?", - expected: ["path\\", "", "#\\?"] - }, - { - input: "path\\#repo#hash", - expected: ["path\\", "", "#repo#hash"] - }, - { - input: "path\\#r#hash", - expected: ["path\\", "", "#r#hash"] - }, - { - input: "path\\#/not/a/hash?not-a-query", - expected: ["path\\", "", "#/not/a/hash?not-a-query"] - } - ]; + run(tests); + }); - run(tests); + describe("parse identifier. Windows-like paths", () => { + /** @type {TestSuite[]} */ + const tests = [ + { + input: "path\\#", + expected: ["path\\", "", "#"], + }, + { + input: "C:path\\as\\?", + expected: ["C:path\\as\\", "?", ""], + }, + { + input: "path\\#\\?", + expected: ["path\\", "", "#\\?"], + }, + { + input: "path\\#repo#hash", + expected: ["path\\", "", "#repo#hash"], + }, + { + input: "path\\#r#hash", + expected: ["path\\", "", "#r#hash"], + }, + { + input: "path\\#/not/a/hash?not-a-query", + expected: ["path\\", "", "#/not/a/hash?not-a-query"], + }, + ]; + + run(tests); + }); }); diff --git a/test/importsField.test.js b/test/importsField.test.js index a9a530b9..93cd32bb 100644 --- a/test/importsField.test.js +++ b/test/importsField.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); const { processImportsField } = require("../lib/util/entrypoints"); @@ -9,10 +11,10 @@ const CachedInputFileSystem = require("../lib/CachedInputFileSystem"); const fixture = path.resolve(__dirname, "fixtures", "imports-field"); const fixture1 = path.resolve(__dirname, "fixtures", "imports-field-different"); -describe("Process imports field", function exportsField() { +describe("process imports field", () => { /** @type {Array<{name: string, expect: string[]|Error, suite: [ImportsField, string, string[]]}>} */ const testCases = [ - //#region Samples + // #region Samples { name: "sample #1", expect: ["./dist/test/file.js", "./src/test/file.js"], @@ -20,24 +22,24 @@ describe("Process imports field", function exportsField() { { "#abc/": { import: ["./dist/", "./src/"], - webpack: "./wp/" + webpack: "./wp/", }, - "#abc": "./main.js" + "#abc": "./main.js", }, "#abc/test/file.js", - ["import", "webpack"] - ] + ["import", "webpack"], + ], }, { name: "sample #2", expect: ["./data/timezones/pdt.mjs"], suite: [ { - "#1/timezones/": "./data/timezones/" + "#1/timezones/": "./data/timezones/", }, "#1/timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "sample #3", @@ -46,11 +48,11 @@ describe("Process imports field", function exportsField() { suite: [ { "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" + "#a/": "./data/timezones/", }, "#a/timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "sample #4", @@ -58,15 +60,15 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/lib/": { - browser: ["./browser/"] + browser: ["./browser/"], }, "#a/dist/index.js": { - node: "./index.js" - } + node: "./index.js", + }, }, "#a/dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "sample #5", @@ -74,60 +76,60 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/lib/": { - browser: ["./browser/"] + browser: ["./browser/"], }, "#a/dist/index.js": { node: "./index.js", - default: "./browser/index.js" - } + default: "./browser/index.js", + }, }, "#a/dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "sample #6", expect: [], suite: [ { - "#a/dist/a": "./dist/index.js" + "#a/dist/a": "./dist/index.js", }, "#a/dist/aaa", - [] - ] + [], + ], }, { name: "sample #7", expect: [], suite: [ { - "#a/a/a/": "./dist/index.js" + "#a/a/a/": "./dist/index.js", }, "#a/a/a", - [] - ] + [], + ], }, { name: "sample #8", expect: [], suite: [ { - "#a": "./index.js" + "#a": "./index.js", }, "#a/timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "sample #9", expect: ["./main.js"], suite: [ { - "#a/index.js": "./main.js" + "#a/index.js": "./main.js", }, "#a/index.js", - [] - ] + [], + ], }, { name: "sample #10", @@ -139,11 +141,11 @@ describe("Process imports field", function exportsField() { "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", - "#a/#zapp/": "./" + "#a/#zapp/": "./", }, "#a/#foo", - [] - ] + [], + ], }, { name: "sample #11", @@ -155,11 +157,11 @@ describe("Process imports field", function exportsField() { "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", - "#a/#zapp/": "./" + "#a/#zapp/": "./", }, "#a/bar#foo", - [] - ] + [], + ], }, { name: "sample #12", @@ -171,11 +173,11 @@ describe("Process imports field", function exportsField() { "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", - "#a/#zapp/": "./" + "#a/#zapp/": "./", }, "#a/#zapp/ok.js#abc", - [] - ] + [], + ], }, { name: "sample #13", @@ -187,11 +189,11 @@ describe("Process imports field", function exportsField() { "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", - "#a/#zapp/": "./" + "#a/#zapp/": "./", }, "#a/#zapp/ok.js?abc", - [] - ] + [], + ], }, { name: "sample #14", @@ -203,11 +205,11 @@ describe("Process imports field", function exportsField() { "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", - "#a/#zapp/": "./" + "#a/#zapp/": "./", }, "#a/#zapp/🎉.js", - [] - ] + [], + ], }, { name: "sample #15", @@ -219,12 +221,12 @@ describe("Process imports field", function exportsField() { "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", - "#a/#zapp/": "./" + "#a/#zapp/": "./", }, // "🎉" percent encoded "#a/#zapp/%F0%9F%8E%89.js", - [] - ] + [], + ], }, { name: "sample #16", @@ -236,11 +238,11 @@ describe("Process imports field", function exportsField() { "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", - "#a/#zapp/": "./" + "#a/#zapp/": "./", }, "#a/🎉", - [] - ] + [], + ], }, { name: "sample #17", @@ -252,11 +254,11 @@ describe("Process imports field", function exportsField() { "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", - "#a/#zapp/": "./" + "#a/#zapp/": "./", }, "#a/%F0%9F%8E%89", - [] - ] + [], + ], }, { name: "sample #18", @@ -268,11 +270,11 @@ describe("Process imports field", function exportsField() { "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", - "#a/#zapp/": "./" + "#a/#zapp/": "./", }, "#a/module", - [] - ] + [], + ], }, { name: "sample #19", @@ -284,11 +286,11 @@ describe("Process imports field", function exportsField() { "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", - "#a/#zapp/": "./" + "#a/#zapp/": "./", }, "#a/module#foo", - [] - ] + [], + ], }, { name: "sample #20", @@ -300,33 +302,33 @@ describe("Process imports field", function exportsField() { "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", - "#a/#zapp/": "./" + "#a/#zapp/": "./", }, "#a/module?foo", - [] - ] + [], + ], }, { name: "sample #21", expect: ["./d?e?f"], suite: [ { - "#a/a?b?c/": "./" + "#a/a?b?c/": "./", }, "#a/a?b?c/d?e?f", - [] - ] + [], + ], }, { name: "sample #22", expect: ["/user/a/index"], suite: [ { - "#a/": "/user/a/" + "#a/": "/user/a/", }, "#a/index", - [] - ] + [], + ], }, { name: "path tree edge case #1", @@ -334,11 +336,11 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/": "./A/", - "#a/b/c": "./c.js" + "#a/b/c": "./c.js", }, "#a/b/d.js", - [] - ] + [], + ], }, { name: "path tree edge case #2", @@ -346,11 +348,11 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/": "./A/", - "#a/b": "./b.js" + "#a/b": "./b.js", }, "#a/c.js", - [] - ] + [], + ], }, { name: "path tree edge case #3", @@ -358,36 +360,36 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/": "./A/", - "#a/b/c/d": "./c.js" + "#a/b/c/d": "./c.js", }, "#a/b/c/d.js", - [] - ] + [], + ], }, - //#endregion + // #endregion - //#region Direct mapping + // #region Direct mapping { name: "Direct mapping #1", expect: ["./dist/index.js"], suite: [ { - "#a": "./dist/index.js" + "#a": "./dist/index.js", }, "#a", - [] - ] + [], + ], }, { name: "Direct mapping #2", expect: [], suite: [ { - "#a/": "./" + "#a/": "./", }, "#a", - [] - ] + [], + ], }, { name: "Direct mapping #3", @@ -395,11 +397,11 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/": "./dist/", - "#a/index.js": "./dist/a.js" + "#a/index.js": "./dist/a.js", }, "#a/index.js", - [] - ] + [], + ], }, { name: "Direct mapping #4", @@ -407,15 +409,15 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/": { - browser: ["./browser/"] + browser: ["./browser/"], }, "#a/index.js": { - browser: "./index.js" - } + browser: "./index.js", + }, }, "#a/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "Direct mapping #5", @@ -425,15 +427,15 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/": { - browser: ["./browser/"] + browser: ["./browser/"], }, "#a/index.js": { - node: "./node.js" - } + node: "./node.js", + }, }, "#a/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "Direct mapping #6", @@ -443,12 +445,12 @@ describe("Process imports field", function exportsField() { "#a": { browser: "./index.js", node: "./src/node/index.js", - default: "./src/index.js" - } + default: "./src/index.js", + }, }, "#a", - ["browser"] - ] + ["browser"], + ], }, { name: "Direct mapping #7", @@ -458,12 +460,12 @@ describe("Process imports field", function exportsField() { "#a": { default: "./src/index.js", browser: "./index.js", - node: "./src/node/index.js" - } + node: "./src/node/index.js", + }, }, "#a", - ["browser"] - ] + ["browser"], + ], }, { name: "Direct mapping #8", @@ -473,71 +475,71 @@ describe("Process imports field", function exportsField() { "#a": { browser: "./index.js", node: "./src/node/index.js", - default: "./src/index.js" - } + default: "./src/index.js", + }, }, "#a", - [] - ] + [], + ], }, { name: "Direct mapping #9", expect: ["./index"], // it is fine, file may not have extension suite: [ { - "#a": "./index" + "#a": "./index", }, "#a", - [] - ] + [], + ], }, { name: "Direct mapping #10", expect: ["./index.js"], suite: [ { - "#a/index": "./index.js" + "#a/index": "./index.js", }, "#a/index", - [] - ] + [], + ], }, { name: "Direct mapping #11", expect: ["b"], suite: [ { - "#a": "b" + "#a": "b", }, "#a", - [] - ] + [], + ], }, { name: "Direct mapping #12", expect: ["b/index"], suite: [ { - "#a/": "b/" + "#a/": "b/", }, "#a/index", - [] - ] + [], + ], }, { name: "Direct mapping #13", expect: ["b#anotherhashishere"], suite: [ { - "#a?q=a#hashishere": "b#anotherhashishere" + "#a?q=a#hashishere": "b#anotherhashishere", }, "#a?q=a#hashishere", - [] - ] + [], + ], }, - //#endregion + // #endregion - //#region Direct and conditional mapping + // #region Direct and conditional mapping { name: "Direct and conditional mapping #1", expect: [], @@ -546,12 +548,12 @@ describe("Process imports field", function exportsField() { "#a": [ { browser: "./browser.js" }, { require: "./require.js" }, - { import: "./import.mjs" } - ] + { import: "./import.mjs" }, + ], }, "#a", - [] - ] + [], + ], }, { name: "Direct and conditional mapping #2", @@ -561,12 +563,12 @@ describe("Process imports field", function exportsField() { "#a": [ { browser: "./browser.js" }, { require: "./require.js" }, - { import: "./import.mjs" } - ] + { import: "./import.mjs" }, + ], }, "#a", - ["import"] - ] + ["import"], + ], }, { name: "Direct and conditional mapping #3", @@ -576,12 +578,12 @@ describe("Process imports field", function exportsField() { "#a": [ { browser: "./browser.js" }, { require: "./require.js" }, - { import: "./import.mjs" } - ] + { import: "./import.mjs" }, + ], }, "#a", - ["import", "require"] - ] + ["import", "require"], + ], }, { name: "Direct and conditional mapping #4", @@ -591,96 +593,100 @@ describe("Process imports field", function exportsField() { "#a": [ { browser: "./browser.js" }, { require: ["./require.js"] }, - { import: ["./import.mjs", "#b/import.js"] } - ] + { import: ["./import.mjs", "#b/import.js"] }, + ], }, "#a", - ["import", "require"] - ] + ["import", "require"], + ], }, - //#endregion + // #endregion - //#region When mapping to a folder root, both the left and right sides must end in slashes + // #region When mapping to a folder root, both the left and right sides must end in slashes { name: "mapping to a folder root #1", expect: [], suite: [ { - "#timezones": "./data/timezones/" + "#timezones": "./data/timezones/", }, "#timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #2", - expect: new Error(), // incorrect export field + expect: new Error( + 'Expecting folder to folder mapping. "./data/timezones" should end with "/"', + ), suite: [ { - "#timezones/": "./data/timezones" + "#timezones/": "./data/timezones", }, "#timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #3", expect: ["./data/timezones/pdt/index.mjs"], suite: [ { - "#timezones/pdt/": "./data/timezones/pdt/" + "#timezones/pdt/": "./data/timezones/pdt/", }, "#timezones/pdt/index.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #4", expect: ["./timezones/pdt.mjs"], suite: [ { - "#a/": "./timezones/" + "#a/": "./timezones/", }, "#a/pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #5", expect: ["./timezones/pdt.mjs"], suite: [ { - "#a/": "./" + "#a/": "./", }, "#a/timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #6", - expect: new Error(), // not a folder mapping + expect: new Error( + 'Expecting folder to folder mapping. "." should end with "/"', + ), suite: [ { - "#a/": "." + "#a/": ".", }, "#a/timezones/pdt.mjs", - [] - ] + [], + ], }, { name: "mapping to a folder root #7", expect: [], // incorrect export field, but value did not processed suite: [ { - "#a": "./" + "#a": "./", }, "#a/timezones/pdt.mjs", - [] - ] + [], + ], }, - //#endregion + // #endregion - //#region The longest matching path prefix is prioritized + // #region The longest matching path prefix is prioritized { name: "the longest matching path prefix is prioritized #1", // it does not work same as conditional mapping, @@ -689,11 +695,11 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/": "./", - "#a/dist/": "./lib/" + "#a/dist/": "./lib/", }, "#a/dist/index.mjs", - [] - ] + [], + ], }, { name: "the longest matching path prefix is prioritized #2", @@ -701,11 +707,11 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" + "#a/dist/": "./lib/", }, "#a/dist/utils/index.js", - [] - ] + [], + ], }, { name: "the longest matching path prefix is prioritized #3", @@ -717,11 +723,11 @@ describe("Process imports field", function exportsField() { { "#a/dist/utils/index.js": "./dist/utils/index.js", "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" + "#a/dist/": "./lib/", }, "#a/dist/utils/index.js", - [] - ] + [], + ], }, { name: "the longest matching path prefix is prioritized #4", @@ -732,17 +738,17 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/": { - browser: "./browser/" + browser: "./browser/", }, - "#a/dist/": "./lib/" + "#a/dist/": "./lib/", }, "#a/dist/index.mjs", - ["browser"] - ] + ["browser"], + ], }, - //#endregion + // #endregion - //#region Conditional mapping folder + // #region Conditional mapping folder { name: "conditional mapping folder #1", expect: ["lodash/index.js", "./utils/index.js"], @@ -750,12 +756,12 @@ describe("Process imports field", function exportsField() { { "#a/": { browser: ["lodash/", "./utils/"], - node: ["./utils-node/"] - } + node: ["./utils-node/"], + }, }, "#a/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "conditional mapping folder #2", @@ -765,12 +771,12 @@ describe("Process imports field", function exportsField() { "#a/": { webpack: "./wpk/", browser: ["lodash/", "./utils/"], - node: ["./node/"] - } + node: ["./node/"], + }, }, "#a/index.mjs", - [] - ] + [], + ], }, { name: "conditional mapping folder #3", @@ -780,37 +786,37 @@ describe("Process imports field", function exportsField() { "#a/": { webpack: "./wpk/", browser: ["lodash/", "./utils/"], - node: ["./utils/"] - } + node: ["./utils/"], + }, }, "#a/index.mjs", - ["browser", "webpack"] - ] + ["browser", "webpack"], + ], }, - //#endregion + // #endregion - //#region Incorrect imports field definition + // #region Incorrect imports field definition { name: "incorrect exports field #1", expect: [], suite: [ { - "#a/index": "./a/index.js" + "#a/index": "./a/index.js", }, "#a/index.mjs", - [] - ] + [], + ], }, { name: "incorrect exports field #2", expect: [], suite: [ { - "#a/index.mjs": "./a/index.js" + "#a/index.mjs": "./a/index.js", }, "#a/index", - [] - ] + [], + ], }, { name: "incorrect exports field #3", @@ -819,12 +825,12 @@ describe("Process imports field", function exportsField() { { "#a/index": { browser: "./a/index.js", - default: "./b/index.js" - } + default: "./b/index.js", + }, }, "#a/index.mjs", - ["browser"] - ] + ["browser"], + ], }, { name: "incorrect exports field #4", @@ -833,119 +839,119 @@ describe("Process imports field", function exportsField() { { "#a/index.mjs": { browser: "./a/index.js", - default: "./b/index.js" - } + default: "./b/index.js", + }, }, "#a/index", - ["browser"] - ] + ["browser"], + ], }, - //#endregion + // #endregion - //#region Incorrect request + // #region Incorrect request { name: "incorrect request #1", - expect: new Error(), + expect: new Error('Request should start with "#"'), suite: [ { - "#a/": "./a/" + "#a/": "./a/", }, "/utils/index.mjs", - [] - ] + [], + ], }, { name: "incorrect request #2", - expect: new Error(), + expect: new Error('Request should start with "#"'), suite: [ { "#a/": { browser: "./a/", - default: "./b/" - } + default: "./b/", + }, }, "./utils/index.mjs", - ["browser"] - ] + ["browser"], + ], }, { name: "incorrect request #3", - expect: new Error(), + expect: new Error("Request should have at least 2 characters"), suite: [ { "#a/": { browser: "./a/", - default: "./b/" - } + default: "./b/", + }, }, "#", - ["browser"] - ] + ["browser"], + ], }, { name: "incorrect request #4", - expect: new Error(), + expect: new Error('Request should not start with "#/"'), suite: [ { "#a/": { browser: "./a/", - default: "./b/" - } + default: "./b/", + }, }, "#/", - ["browser"] - ] + ["browser"], + ], }, { name: "incorrect request #5", - expect: new Error(), + expect: new Error("Only requesting file allowed"), suite: [ { "#a/": { browser: "./a/", - default: "./b/" - } + default: "./b/", + }, }, "#a/", - ["browser"] - ] + ["browser"], + ], }, - //#endregion + // #endregion - //#region Directory imports targets may backtrack above the package base + // #region Directory imports targets may backtrack above the package base { name: "backtracking package base #1", expect: ["./dist/index"], // we don't handle backtracking here suite: [ { - "#a/../../utils/": "./dist/" + "#a/../../utils/": "./dist/", }, "#a/../../utils/index", - [] - ] + [], + ], }, { name: "backtracking package base #2", expect: ["./dist/../../utils/index"], suite: [ { - "#a/": "./dist/" + "#a/": "./dist/", }, "#a/../../utils/index", - [] - ] + [], + ], }, { name: "backtracking package base #3", expect: ["../src/index"], suite: [ { - "#a/": "../src/" + "#a/": "../src/", }, "#a/index", - [] - ] + [], + ], }, { name: "backtracking package base #4", @@ -953,43 +959,43 @@ describe("Process imports field", function exportsField() { suite: [ { "#a/": { - browser: "./utils/../../../" - } + browser: "./utils/../../../", + }, }, "#a/index", - ["browser"] - ] + ["browser"], + ], }, - //#endregion + // #endregion - //#region Imports targets cannot map into a nested node_modules path + // #region Imports targets cannot map into a nested node_modules path { name: "nested node_modules path #1", expect: ["moment/node_modules/lodash/dist/index.js"], // we don't handle node_modules here suite: [ { "#a/": { - browser: "moment/node_modules/" - } + browser: "moment/node_modules/", + }, }, "#a/lodash/dist/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "nested node_modules path #2", expect: ["../node_modules/lodash/dist/index.js"], suite: [ { - "#a/": "../node_modules/" + "#a/": "../node_modules/", }, "#a/lodash/dist/index.js", - [] - ] + [], + ], }, - //#endregion + // #endregion - //#region Nested mapping + // #region Nested mapping { name: "nested mapping #1", expect: [], @@ -999,14 +1005,14 @@ describe("Process imports field", function exportsField() { browser: { webpack: "./", default: { - node: "./node/" - } - } - } + node: "./node/", + }, + }, + }, }, "#a/index.js", - ["browser"] - ] + ["browser"], + ], }, { name: "nested mapping #2", @@ -1017,14 +1023,14 @@ describe("Process imports field", function exportsField() { browser: { webpack: ["./", "./node/"], default: { - node: "./node/" - } - } - } + node: "./node/", + }, + }, + }, }, "#a/index.js", - ["browser", "webpack"] - ] + ["browser", "webpack"], + ], }, { name: "nested mapping #3", @@ -1035,14 +1041,14 @@ describe("Process imports field", function exportsField() { browser: { webpack: ["./", "./node/"], default: { - node: "./node/" - } - } - } + node: "./node/", + }, + }, + }, }, "#a/index.js", - ["webpack"] - ] + ["webpack"], + ], }, { name: "nested mapping #4", @@ -1053,14 +1059,14 @@ describe("Process imports field", function exportsField() { browser: { webpack: ["./", "./node/"], default: { - node: "moment/node/" - } - } - } + node: "moment/node/", + }, + }, + }, }, "#a/index.js", - ["node", "browser"] - ] + ["node", "browser"], + ], }, { name: "nested mapping #5", @@ -1072,15 +1078,15 @@ describe("Process imports field", function exportsField() { webpack: ["./", "./node/"], default: { node: { - webpack: ["./wpck/"] - } - } - } - } + webpack: ["./wpck/"], + }, + }, + }, + }, }, "#a/index.js", - ["browser", "node"] - ] + ["browser", "node"], + ], }, { name: "nested mapping #6", @@ -1092,15 +1098,15 @@ describe("Process imports field", function exportsField() { webpack: ["./", "./node/"], default: { node: { - webpack: ["./wpck/"] - } - } - } - } + webpack: ["./wpck/"], + }, + }, + }, + }, }, "#a/index.js", - ["browser", "node", "webpack"] - ] + ["browser", "node", "webpack"], + ], }, { name: "nested mapping #7", @@ -1109,12 +1115,12 @@ describe("Process imports field", function exportsField() { { "#a": { abc: { def: "./x.js" }, - ghi: "./y.js" - } + ghi: "./y.js", + }, }, "#a", - ["abc", "ghi"] - ] + ["abc", "ghi"], + ], }, { name: "nested mapping #8", @@ -1123,45 +1129,45 @@ describe("Process imports field", function exportsField() { { "#a": { abc: { def: "./x.js", default: [] }, - ghi: "./y.js" - } + ghi: "./y.js", + }, }, "#a", - ["abc", "ghi"] - ] - } - //#endregion + ["abc", "ghi"], + ], + }, + // #endregion ]; - testCases.forEach((testCase) => { + for (const testCase of testCases) { it(testCase.name, () => { if (testCase.expect instanceof Error) { expect(() => processImportsField(testCase.suite[0])( testCase.suite[1], - new Set(testCase.suite[2]) - ) - ).toThrowError(); + new Set(testCase.suite[2]), + ), + ).toThrow(testCase.expect.message); } else { expect( processImportsField(testCase.suite[0])( testCase.suite[1], - new Set(testCase.suite[2]) - )[0] + new Set(testCase.suite[2]), + )[0], ).toEqual(testCase.expect); } }); - }); + } }); -describe("ImportsFieldPlugin", () => { +describe("importsFieldPlugin", () => { const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, mainFiles: ["index.js"], - conditionNames: ["webpack"] + conditionNames: ["webpack"], }); it("should resolve using imports field instead of self-referencing", (done) => { @@ -1184,7 +1190,7 @@ describe("ImportsFieldPlugin", () => { if (!result) return done(new Error("No result")); expect(result).toEqual(path.resolve(fixture, "b.js")); done(); - } + }, ); }); @@ -1193,7 +1199,7 @@ describe("ImportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "imports" target "\.\.\/b\.js" defined for "#b"/ + /Invalid "imports" target "\.\.\/b\.js" defined for "#b"/, ); done(); }); @@ -1205,7 +1211,7 @@ describe("ImportsFieldPlugin", () => { fileSystem: nodeFileSystem, mainFiles: ["index.js"], importsFields: [["imports"]], - conditionNames: ["webpack"] + conditionNames: ["webpack"], }); resolver.resolve({}, fixture, "#imports-field", {}, (err, result) => { @@ -1222,7 +1228,7 @@ describe("ImportsFieldPlugin", () => { fileSystem: nodeFileSystem, mainFiles: ["index.js"], importsFields: [["other", "imports"], "imports"], - conditionNames: ["webpack"] + conditionNames: ["webpack"], }); resolver.resolve({}, fixture, "#b", {}, (err, result) => { @@ -1238,7 +1244,7 @@ describe("ImportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "node_modules/a/lib/main.js") + path.resolve(fixture, "node_modules/a/lib/main.js"), ); done(); }); @@ -1304,20 +1310,20 @@ describe("ImportsFieldPlugin", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.join(fixture, "node_modules/a/lib/index.js") + path.join(fixture, "node_modules/a/lib/index.js"), ); expect( - log.map((line) => line.replace(fixture, "...").replace(/\\/g, "/")) + log.map((line) => line.replace(fixture, "...").replace(/\\/g, "/")), ).toMatchSnapshot(); done(); - } + }, ); }); it("should resolve with wildcard pattern", (done) => { const fixture = path.resolve( __dirname, - "./fixtures/imports-exports-wildcard/node_modules/m/" + "./fixtures/imports-exports-wildcard/node_modules/m/", ); resolver.resolve({}, fixture, "#internal/i.js", {}, (err, result) => { if (err) return done(err); @@ -1341,7 +1347,7 @@ describe("ImportsFieldPlugin", () => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Resolving to directories is not possible with the imports field \(request was #dep\/\)/ + /Resolving to directories is not possible with the imports field \(request was #dep\/\)/, ); done(); }); @@ -1351,7 +1357,7 @@ describe("ImportsFieldPlugin", () => { resolver.resolve({}, fixture1, "#dep", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); - expect(result).toEqual(path.resolve(fixture1, "./a.js") + "?foo=../"); + expect(result).toBe(`${path.resolve(fixture1, "./a.js")}?foo=../`); done(); }); }); @@ -1360,7 +1366,7 @@ describe("ImportsFieldPlugin", () => { resolver.resolve({}, fixture1, "#dep/foo/a.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); - expect(result).toEqual(path.resolve(fixture1, "./a.js") + "?foo=../#../"); + expect(result).toBe(`${path.resolve(fixture1, "./a.js")}?foo=../#../`); done(); }); }); @@ -1374,7 +1380,7 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #3", (done) => { + it("should work with invalid imports #4", (done) => { resolver.resolve({}, fixture1, "#dep/baz", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); @@ -1383,7 +1389,7 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #4", (done) => { + it("should work with invalid imports #5", (done) => { resolver.resolve({}, fixture1, "#dep/baz-multi", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); @@ -1392,7 +1398,7 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #5", (done) => { + it("should work with invalid imports #6", (done) => { resolver.resolve({}, fixture1, "#dep/baz-multi", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); @@ -1401,7 +1407,7 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #6", (done) => { + it("should work with invalid imports #7", (done) => { resolver.resolve({}, fixture1, "#dep/pattern/a.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); @@ -1410,7 +1416,7 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #7", (done) => { + it("should work with invalid imports #8", (done) => { resolver.resolve({}, fixture1, "#dep/array", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); @@ -1419,7 +1425,7 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #8", (done) => { + it("should work with invalid imports #9", (done) => { resolver.resolve({}, fixture1, "#dep/array2", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); @@ -1428,7 +1434,7 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #9", (done) => { + it("should work with invalid imports #10", (done) => { resolver.resolve({}, fixture1, "#dep/array3", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); @@ -1437,7 +1443,7 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #10", (done) => { + it("should work with invalid imports #11", (done) => { resolver.resolve({}, fixture1, "#dep/empty", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); @@ -1446,7 +1452,7 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #10", (done) => { + it("should work with invalid imports #12", (done) => { resolver.resolve({}, fixture1, "#dep/with-bad", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); @@ -1455,7 +1461,7 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #10", (done) => { + it("should work with invalid imports #13", (done) => { resolver.resolve({}, fixture1, "#dep/with-bad2", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); @@ -1464,7 +1470,7 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #11", (done) => { + it("should work with invalid imports #14", (done) => { resolver.resolve({}, fixture1, "#timezones/pdt.mjs", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); @@ -1473,45 +1479,45 @@ describe("ImportsFieldPlugin", () => { }); }); - it("should work with invalid imports #12", (done) => { + it("should work with invalid imports #15", (done) => { resolver.resolve({}, fixture1, "#dep/multi1", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "imports" target "\.\.\/\.\.\/test\/foo" defined for "#dep\/multi1"/ + /Invalid "imports" target "\.\.\/\.\.\/test\/foo" defined for "#dep\/multi1"/, ); done(); }); }); - it("should work with invalid imports #13", (done) => { + it("should work with invalid imports #16", (done) => { resolver.resolve({}, fixture1, "#dep/multi2", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "imports" target "\.\.\/\.\.\/test" defined for "#dep\/multi2"/ + /Invalid "imports" target "\.\.\/\.\.\/test" defined for "#dep\/multi2"/, ); done(); }); }); - it("should work with invalid imports #13", (done) => { + it("should work with invalid imports #17", (done) => { resolver.resolve({}, fixture1, "#dep/multi1", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "imports" target "\.\.\/\.\.\/test\/foo" defined for "#dep\/multi1"/ + /Invalid "imports" target "\.\.\/\.\.\/test\/foo" defined for "#dep\/multi1"/, ); done(); }); }); - it("should work with invalid imports #14", (done) => { + it("should work with invalid imports #18", (done) => { resolver.resolve({}, fixture1, "#dep/multi2", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); expect(err).toBeInstanceOf(Error); expect(err.message).toMatch( - /Invalid "imports" target "\.\.\/\.\.\/test" defined for "#dep\/multi2"/ + /Invalid "imports" target "\.\.\/\.\.\/test" defined for "#dep\/multi2"/, ); done(); }); diff --git a/test/incorrect-description-file.test.js b/test/incorrect-description-file.test.js index 9173086b..3a43d780 100644 --- a/test/incorrect-description-file.test.js +++ b/test/incorrect-description-file.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); const { CachedInputFileSystem, ResolverFactory } = require("../"); @@ -5,17 +7,18 @@ const { CachedInputFileSystem, ResolverFactory } = require("../"); const fixtures = path.join(__dirname, "fixtures", "incorrect-package"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); -function p() { - return path.join.apply( - path, - [fixtures].concat(Array.prototype.slice.call(arguments)) - ); +/** + * @param {string[]} args args + * @returns {string} paths + */ +function p(...args) { + return path.join(fixtures, ...args); } describe("incorrect description file", () => { const resolver = ResolverFactory.createResolver({ useSyncFileSystemCalls: true, - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); it("should not resolve main in incorrect description file #1", (done) => { @@ -24,14 +27,12 @@ describe("incorrect description file", () => { fileDependencies: new Set(), log: () => { called = true; - } + }, }; - resolver.resolve({}, p("pack1"), ".", ctx, function (err, result) { + resolver.resolve({}, p("pack1"), ".", ctx, (err, _result) => { if (!err) return done(new Error("No error")); expect(err).toBeInstanceOf(Error); - expect(ctx.fileDependencies.has(p("pack1", "package.json"))).toEqual( - true - ); + expect(ctx.fileDependencies.has(p("pack1", "package.json"))).toBe(true); expect(called).toBe(true); done(); }); @@ -43,20 +44,18 @@ describe("incorrect description file", () => { fileDependencies: new Set(), log: () => { called = true; - } + }, }; - resolver.resolve({}, p("pack2"), ".", ctx, function (err, result) { + resolver.resolve({}, p("pack2"), ".", ctx, (err, _result) => { if (!err) return done(new Error("No error")); - expect(ctx.fileDependencies.has(p("pack2", "package.json"))).toEqual( - true - ); + expect(ctx.fileDependencies.has(p("pack2", "package.json"))).toBe(true); expect(called).toBe(true); done(); }); }); it("should not resolve main in incorrect description file #3", (done) => { - resolver.resolve({}, p("pack2"), ".", {}, function (err, result) { + resolver.resolve({}, p("pack2"), ".", {}, (err, _result) => { if (!err) return done(new Error("No error")); expect(err).toBeInstanceOf(Error); done(); diff --git a/test/missing.test.js b/test/missing.test.js index 58640107..6d93d7dc 100644 --- a/test/missing.test.js +++ b/test/missing.test.js @@ -1,7 +1,9 @@ +"use strict"; + const path = require("path"); const resolve = require("../"); -describe("missing", function () { +describe("missing", () => { /** * @type {Array<[string, string, Array]>} */ @@ -12,24 +14,24 @@ describe("missing", function () { [ path.join(__dirname, "fixtures", "missing-file"), path.join(__dirname, "fixtures", "missing-file.js"), - path.join(__dirname, "fixtures", "missing-file.node") - ] + path.join(__dirname, "fixtures", "missing-file.node"), + ], ], [ path.join(__dirname, "fixtures"), "missing-module", [ path.join(__dirname, "fixtures", "node_modules", "missing-module"), - path.join(__dirname, "..", "node_modules", "missing-module") - ] + path.join(__dirname, "..", "node_modules", "missing-module"), + ], ], [ path.join(__dirname, "fixtures"), "missing-module/missing-file", [ path.join(__dirname, "fixtures", "node_modules", "missing-module"), - path.join(__dirname, "..", "node_modules", "missing-module") - ] + path.join(__dirname, "..", "node_modules", "missing-module"), + ], ], [ path.join(__dirname, "fixtures"), @@ -41,17 +43,17 @@ describe("missing", function () { "fixtures", "node_modules", "m1", - "missing-file.js" + "missing-file.js", ), path.join( __dirname, "fixtures", "node_modules", "m1", - "missing-file.node" + "missing-file.node", ), - path.join(__dirname, "..", "node_modules", "m1") - ] + path.join(__dirname, "..", "node_modules", "m1"), + ], ], [ path.join(__dirname, "fixtures"), @@ -60,45 +62,51 @@ describe("missing", function () { path.join(__dirname, "fixtures", "node_modules", "m1", "index"), path.join(__dirname, "fixtures", "node_modules", "m1", "index.js"), path.join(__dirname, "fixtures", "node_modules", "m1", "index.json"), - path.join(__dirname, "fixtures", "node_modules", "m1", "index.node") - ] + path.join(__dirname, "fixtures", "node_modules", "m1", "index.node"), + ], ], [ path.join(__dirname, "fixtures"), "m1/a", - [path.join(__dirname, "fixtures", "node_modules", "m1", "a")] - ] + [path.join(__dirname, "fixtures", "node_modules", "m1", "a")], + ], ]; - testCases.forEach(function (testCase) { - it( - "should tell about missing file when trying to resolve " + testCase[1], - (done) => { - const callback = function (err, filename) { - expect(Array.from(missingDependencies).sort()).toEqual( - expect.arrayContaining(testCase[2].sort()) - ); - done(); - }; - const missingDependencies = new Set(); - resolve(testCase[0], testCase[1], { missingDependencies }, callback); + for (const testCase of testCases) { + it(`should tell about missing file when trying to resolve ${testCase[1]}`, (done) => { + const missingDependencies = new Set(); + /** + * @param {Error | null} _err err + * @param {string} _filename _filename + */ + function callback(_err, _filename) { + expect([...missingDependencies].sort()).toEqual( + expect.arrayContaining(testCase[2].sort()), + ); + done(); } - ); - it( - "should report error details exactly once when trying to resolve " + - testCase[1], - (done) => { - const callback = function (err, filename) { - if (err) { - const details = err.details.split("\n"); - const firstDetail = details.shift(); + resolve(testCase[0], testCase[1], { missingDependencies }, callback); + }); + + it(`should report error details exactly once when trying to resolve ${ + testCase[1] + }`, (done) => { + /** + * @param {Error & { details: string } | null} err err + * @param {string} _filename _filename + */ + function callback(err, _filename) { + if (err) { + const details = err.details.split("\n"); + const firstDetail = details.shift(); - expect(firstDetail).toContain(testCase[1]); - expect(details).not.toContain(firstDetail); - } - done(); - }; - resolve(testCase[0], testCase[1], callback); + expect(firstDetail).toContain(testCase[1]); + expect(details).not.toContain(firstDetail); + } + + done(); } - ); - }); + + resolve(testCase[0], testCase[1], callback); + }); + } }); diff --git a/test/plugins.test.js b/test/plugins.test.js index 19c10ab4..9168e13d 100644 --- a/test/plugins.test.js +++ b/test/plugins.test.js @@ -3,16 +3,16 @@ const path = require("path"); const { ResolverFactory, CloneBasenamePlugin } = require("../"); -describe("plugins", function () { +describe("plugins", () => { it("should resolve with the CloneBasenamePlugin", (done) => { const resolver = ResolverFactory.createResolver({ fileSystem: require("fs"), plugins: [ new CloneBasenamePlugin( "after-existing-directory", - "undescribed-raw-file" - ) - ] + "undescribed-raw-file", + ), + ], }); resolver.resolve( @@ -20,17 +20,17 @@ describe("plugins", function () { __dirname, "./fixtures/directory-default", {}, - function (err, result) { + (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( path.resolve( __dirname, - "fixtures/directory-default/directory-default.js" - ) + "fixtures/directory-default/directory-default.js", + ), ); done(); - } + }, ); }); @@ -52,9 +52,9 @@ describe("plugins", function () { falsy && new FailedPlugin(), new CloneBasenamePlugin( "after-existing-directory", - "undescribed-raw-file" - ) - ] + "undescribed-raw-file", + ), + ], }); resolver.resolve( @@ -62,17 +62,17 @@ describe("plugins", function () { __dirname, "./fixtures/directory-default", {}, - function (err, result) { + (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( path.resolve( __dirname, - "fixtures/directory-default/directory-default.js" - ) + "fixtures/directory-default/directory-default.js", + ), ); done(); - } + }, ); }); }); diff --git a/test/pnp.test.js b/test/pnp.test.js index 2dc915cc..7d7e8aa9 100644 --- a/test/pnp.test.js +++ b/test/pnp.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); const { ResolverFactory, CachedInputFileSystem } = require("../"); @@ -10,12 +12,12 @@ let isAdmin = false; try { fs.symlinkSync("dir", path.resolve(fixture, "pkg/symlink"), "dir"); isAdmin = true; -} catch (e) { +} catch (_err) { // ignore } try { fs.unlinkSync(path.resolve(fixture, "pkg/symlink")); -} catch (e) { +} catch (_err) { isAdmin = false; // ignore } @@ -24,15 +26,15 @@ describe("pnp", () => { let pnpApi; let resolverFuzzy; let resolver; + if (isAdmin) { beforeAll(() => { fs.symlinkSync("dir", path.resolve(fixture, "pkg/symlink"), "dir"); }); - afterAll(() => { - fs.unlinkSync(path.resolve(fixture, "pkg/symlink")); - }); } + beforeEach(() => { + // eslint-disable-next-line jsdoc/no-restricted-syntax pnpApi = /** @type {any} */ ({ mocks: new Map(), ignoredIssuers: new Set(), @@ -41,39 +43,47 @@ describe("pnp", () => { return null; } else if (pnpApi.mocks.has(request)) { return pnpApi.mocks.get(request); - } else { - const err = /** @type {any} */ (new Error(`No way`)); - err.code = "MODULE_NOT_FOUND"; - err.pnpCode = "UNDECLARED_DEPENDENCY"; - throw err; } - } + const err = + /** @type {Error & { code: string, pnpCode: string }} */ + (new Error("No way")); + err.code = "MODULE_NOT_FOUND"; + err.pnpCode = "UNDECLARED_DEPENDENCY"; + throw err; + }, }); resolverFuzzy = ResolverFactory.createResolver({ extensions: [".ts", ".js"], aliasFields: ["browser"], fileSystem: nodeFileSystem, alias: { - alias: path.resolve(fixture, "pkg") + alias: path.resolve(fixture, "pkg"), }, pnpApi, - modules: ["node_modules", path.resolve(fixture, "../pnp-a")] + modules: ["node_modules", path.resolve(fixture, "../pnp-a")], }); resolver = ResolverFactory.createResolver({ aliasFields: ["browser"], fileSystem: nodeFileSystem, fullySpecified: true, alias: { - alias: path.resolve(fixture, "pkg") + alias: path.resolve(fixture, "pkg"), }, pnpApi, modules: [ "alternative-modules", "node_modules", - path.resolve(fixture, "../pnp-a") - ] + path.resolve(fixture, "../pnp-a"), + ], }); }); + + if (isAdmin) { + afterAll(() => { + fs.unlinkSync(path.resolve(fixture, "pkg/symlink")); + }); + } + it("should resolve by going through the pnp api", (done) => { pnpApi.mocks.set("pkg", path.resolve(fixture, "pkg")); resolver.resolve({}, __dirname, "pkg/dir/index.js", {}, (err, result) => { @@ -82,13 +92,15 @@ describe("pnp", () => { done(); }); }); + it("should not resolve a not fully specified request when fullySpecified is set", (done) => { pnpApi.mocks.set("pkg", path.resolve(fixture, "pkg")); - resolver.resolve({}, __dirname, "pkg/dir/index", {}, (err, result) => { + resolver.resolve({}, __dirname, "pkg/dir/index", {}, (err, _result) => { expect(err).toBeInstanceOf(Error); done(); }); }); + it("should track dependency to the pnp api", (done) => { pnpApi.mocks.set("pkg", path.resolve(fixture, "pkg")); pnpApi.mocks.set("pnpapi", path.resolve(fixture, ".pnp.js")); @@ -101,13 +113,14 @@ describe("pnp", () => { (err, result) => { if (err) return done(err); expect(result).toEqual(path.resolve(fixture, "pkg/dir/index.js")); - expect(Array.from(fileDependencies)).toContainEqual( - path.resolve(fixture, ".pnp.js") + expect([...fileDependencies]).toContainEqual( + path.resolve(fixture, ".pnp.js"), ); done(); - } + }, ); }); + it("should resolve module names with package.json", (done) => { pnpApi.mocks.set("pkg", path.resolve(fixture, "pkg")); resolver.resolve({}, __dirname, "pkg", {}, (err, result) => { @@ -116,6 +129,7 @@ describe("pnp", () => { done(); }); }); + it("should resolve namespaced module names", (done) => { pnpApi.mocks.set("@user/pkg", path.resolve(fixture, "pkg")); resolver.resolve({}, __dirname, "@user/pkg", {}, (err, result) => { @@ -124,6 +138,7 @@ describe("pnp", () => { done(); }); }); + it( "should not resolve symlinks", isAdmin @@ -137,14 +152,15 @@ describe("pnp", () => { (err, result) => { if (err) return done(err); expect(result).toEqual( - path.resolve(fixture, "pkg/symlink/index.js") + path.resolve(fixture, "pkg/symlink/index.js"), ); done(); - } + }, ); - } - : undefined + } + : undefined, ); + it("should properly deal with other extensions", (done) => { pnpApi.mocks.set("@user/pkg", path.resolve(fixture, "pkg")); resolverFuzzy.resolve( @@ -155,12 +171,13 @@ describe("pnp", () => { (err, result) => { if (err) return done(err); expect(result).toEqual( - path.resolve(fixture, "pkg/typescript/index.ts") + path.resolve(fixture, "pkg/typescript/index.ts"), ); done(); - } + }, ); }); + it("should properly deal package.json alias", (done) => { pnpApi.mocks.set("pkg", path.resolve(fixture, "pkg")); resolverFuzzy.resolve( @@ -171,12 +188,13 @@ describe("pnp", () => { (err, result) => { if (err) return done(err); expect(result).toEqual( - path.resolve(fixture, "pkg/package-alias/browser.js") + path.resolve(fixture, "pkg/package-alias/browser.js"), ); done(); - } + }, ); }); + it("should prefer pnp resolves over normal modules", (done) => { pnpApi.mocks.set("m1", path.resolve(fixture, "../node_modules/m2")); resolver.resolve( @@ -187,12 +205,13 @@ describe("pnp", () => { (err, result) => { if (err) return done(err); expect(result).toEqual( - path.resolve(fixture, "../node_modules/m2/b.js") + path.resolve(fixture, "../node_modules/m2/b.js"), ); done(); - } + }, ); }); + it("should prefer alternative module directories over pnp", (done) => { pnpApi.mocks.set("m1", path.resolve(fixture, "../node_modules/m2")); resolver.resolve( @@ -205,13 +224,14 @@ describe("pnp", () => { expect(result).toEqual( path.resolve( __dirname, - "fixtures/prefer-pnp/alternative-modules/m1/b.js" - ) + "fixtures/prefer-pnp/alternative-modules/m1/b.js", + ), ); done(); - } + }, ); }); + it("should prefer alias over pnp resolves", (done) => { pnpApi.mocks.set("alias", path.resolve(fixture, "pkg/dir")); resolver.resolve( @@ -223,9 +243,10 @@ describe("pnp", () => { if (err) return done(err); expect(result).toEqual(path.resolve(fixture, "pkg/index.js")); done(); - } + }, ); }); + it("should prefer pnp over modules after node_modules", (done) => { pnpApi.mocks.set("m2", path.resolve(fixture, "pkg")); resolver.resolve( @@ -237,9 +258,10 @@ describe("pnp", () => { if (err) return done(err); expect(result).toEqual(path.resolve(fixture, "pkg/index.js")); done(); - } + }, ); }); + it("should fallback to alternatives when pnp resolving fails", (done) => { resolver.resolve( {}, @@ -250,11 +272,12 @@ describe("pnp", () => { if (err) return done(err); expect(result).toEqual(path.resolve(fixture, "../pnp-a/m2/a.js")); done(); - } + }, ); }); + it("should fallback to alternatives when pnp doesn't manage the issuer", (done) => { - pnpApi.ignoredIssuers.add(path.resolve(__dirname, "fixtures") + "/"); + pnpApi.ignoredIssuers.add(`${path.resolve(__dirname, "fixtures")}/`); // Add the wrong path on purpose to make sure the issuer is ignored pnpApi.mocks.set("m2", path.resolve(fixture, "pkg")); resolver.resolve( @@ -265,12 +288,13 @@ describe("pnp", () => { (err, result) => { if (err) return done(err); expect(result).toEqual( - path.resolve(__dirname, "fixtures/node_modules/m2/b.js") + path.resolve(__dirname, "fixtures/node_modules/m2/b.js"), ); done(); - } + }, ); }); + it("should handle the exports field when using PnP", (done) => { pnpApi.mocks.set("m1", path.resolve(fixture, "pkg3")); resolver.resolve( @@ -282,9 +306,10 @@ describe("pnp", () => { if (err) return done(err); expect(result).toEqual(path.resolve(fixture, "pkg3/a.js")); done(); - } + }, ); }); + it("should handle the exports field when using PnP (with sub path)", (done) => { pnpApi.mocks.set("@user/m1", path.resolve(fixture, "pkg3")); resolver.resolve( @@ -296,7 +321,7 @@ describe("pnp", () => { if (err) return done(err); expect(result).toEqual(path.resolve(fixture, "pkg3/a.js")); done(); - } + }, ); }); }); diff --git a/test/pr-53.test.js b/test/pr-53.test.js index c11db008..3e7b4293 100644 --- a/test/pr-53.test.js +++ b/test/pr-53.test.js @@ -1,17 +1,19 @@ +"use strict"; + const { CachedInputFileSystem } = require("../"); describe("pr-53", () => { it("should allow to readJsonSync in CachedInputFileSystem", () => { - var cfs = new CachedInputFileSystem( + const cfs = new CachedInputFileSystem( { - // @ts-ignore - readFileSync: function (path) { - return JSON.stringify("abc" + path); - } + // @ts-expect-error for tests + readFileSync(path) { + return JSON.stringify(`abc${path}`); + }, }, - 1000 + 1000, ); if (!cfs.readJsonSync) throw new Error("readJsonSync must be available"); - expect(cfs.readJsonSync("xyz")).toEqual("abcxyz"); + expect(cfs.readJsonSync("xyz")).toBe("abcxyz"); }); }); diff --git a/test/resolve.test.js b/test/resolve.test.js index dfb9f23f..d7c86561 100644 --- a/test/resolve.test.js +++ b/test/resolve.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const resolve = require("../"); @@ -5,23 +7,30 @@ const fixtures = path.join(__dirname, "fixtures"); const asyncContextResolve = resolve.create({ extensions: [".js", ".json", ".node"], - resolveToContext: true + resolveToContext: true, }); const syncContextResolve = resolve.create.sync({ extensions: [".js", ".json", ".node"], - resolveToContext: true + resolveToContext: true, }); const issue238Resolve = resolve.create({ extensions: [".js", ".jsx", ".ts", ".tsx"], - modules: ["src/a", "src/b", "src/common", "node_modules"] + modules: ["src/a", "src/b", "src/common", "node_modules"], }); const preferRelativeResolve = resolve.create({ - preferRelative: true + preferRelative: true, }); +/** + * @param {string} name name + * @param {string} context context + * @param {string} moduleName module name + * @param {string} result result + * @returns {void} + */ function testResolve(name, context, moduleName, result) { describe(name, () => { it("should resolve sync correctly", () => { @@ -29,8 +38,9 @@ function testResolve(name, context, moduleName, result) { expect(filename).toBeDefined(); expect(filename).toEqual(result); }); - it("should resolve async correctly", function (done) { - resolve(context, moduleName, function (err, filename) { + + it("should resolve async correctly", (done) => { + resolve(context, moduleName, (err, filename) => { if (err) return done(err); expect(filename).toBeDefined(); expect(filename).toEqual(result); @@ -40,16 +50,24 @@ function testResolve(name, context, moduleName, result) { }); } +/** + * @param {string} name name + * @param {string} context context + * @param {string} moduleName module name + * @param {string} result result + * @returns {void} + */ function testResolveContext(name, context, moduleName, result) { describe(name, () => { - it("should resolve async correctly", function (done) { - asyncContextResolve(context, moduleName, function (err, filename) { + it("should resolve async correctly", (done) => { + asyncContextResolve(context, moduleName, (err, filename) => { if (err) done(err); expect(filename).toBeDefined(); expect(filename).toEqual(result); done(); }); }); + it("should resolve sync correctly", () => { const filename = syncContextResolve(context, moduleName); expect(filename).toBeDefined(); @@ -57,129 +75,130 @@ function testResolveContext(name, context, moduleName, result) { }); }); } + describe("resolve", () => { testResolve( "absolute path", fixtures, path.join(fixtures, "main1.js"), - path.join(fixtures, "main1.js") + path.join(fixtures, "main1.js"), ); testResolve( "file with .js", fixtures, "./main1.js", - path.join(fixtures, "main1.js") + path.join(fixtures, "main1.js"), ); testResolve( "file without extension", fixtures, "./main1", - path.join(fixtures, "main1.js") + path.join(fixtures, "main1.js"), ); testResolve( "another file with .js", fixtures, "./a.js", - path.join(fixtures, "a.js") + path.join(fixtures, "a.js"), ); testResolve( "another file without extension", fixtures, "./a", - path.join(fixtures, "a.js") + path.join(fixtures, "a.js"), ); testResolve( "file in module with .js", fixtures, "m1/a.js", - path.join(fixtures, "node_modules", "m1", "a.js") + path.join(fixtures, "node_modules", "m1", "a.js"), ); testResolve( "file in module without extension", fixtures, "m1/a", - path.join(fixtures, "node_modules", "m1", "a.js") + path.join(fixtures, "node_modules", "m1", "a.js"), ); testResolve( "another file in module without extension", fixtures, "complexm/step1", - path.join(fixtures, "node_modules", "complexm", "step1.js") + path.join(fixtures, "node_modules", "complexm", "step1.js"), ); testResolve( "from submodule to file in sibling module", path.join(fixtures, "node_modules", "complexm"), "m2/b.js", - path.join(fixtures, "node_modules", "m2", "b.js") + path.join(fixtures, "node_modules", "m2", "b.js"), ); testResolve( "from submodule to file in sibling of parent module", path.join(fixtures, "node_modules", "complexm", "web_modules", "m1"), "m2/b.js", - path.join(fixtures, "node_modules", "m2", "b.js") + path.join(fixtures, "node_modules", "m2", "b.js"), ); testResolve( "from nested directory to overwritten file in module", path.join(fixtures, "multiple_modules"), "m1/a.js", - path.join(fixtures, "multiple_modules", "node_modules", "m1", "a.js") + path.join(fixtures, "multiple_modules", "node_modules", "m1", "a.js"), ); testResolve( "from nested directory to not overwritten file in module", path.join(fixtures, "multiple_modules"), "m1/b.js", - path.join(fixtures, "node_modules", "m1", "b.js") + path.join(fixtures, "node_modules", "m1", "b.js"), ); testResolve( "file with query", fixtures, "./main1.js?query", - path.join(fixtures, "main1.js") + "?query" + `${path.join(fixtures, "main1.js")}?query`, ); testResolve( "file with fragment", fixtures, "./main1.js#fragment", - path.join(fixtures, "main1.js") + "#fragment" + `${path.join(fixtures, "main1.js")}#fragment`, ); testResolve( "file with fragment and query", fixtures, "./main1.js#fragment?query", - path.join(fixtures, "main1.js") + "#fragment?query" + `${path.join(fixtures, "main1.js")}#fragment?query`, ); testResolve( "file with query and fragment", fixtures, "./main1.js?#fragment", - path.join(fixtures, "main1.js") + "?#fragment" + `${path.join(fixtures, "main1.js")}?#fragment`, ); testResolve( "file in module with query", fixtures, "m1/a?query", - path.join(fixtures, "node_modules", "m1", "a.js") + "?query" + `${path.join(fixtures, "node_modules", "m1", "a.js")}?query`, ); testResolve( "file in module with fragment", fixtures, "m1/a#fragment", - path.join(fixtures, "node_modules", "m1", "a.js") + "#fragment" + `${path.join(fixtures, "node_modules", "m1", "a.js")}#fragment`, ); testResolve( "file in module with fragment and query", fixtures, "m1/a#fragment?query", - path.join(fixtures, "node_modules", "m1", "a.js") + "#fragment?query" + `${path.join(fixtures, "node_modules", "m1", "a.js")}#fragment?query`, ); testResolve( "file in module with query and fragment", fixtures, "m1/a?#fragment", - path.join(fixtures, "node_modules", "m1", "a.js") + "?#fragment" + `${path.join(fixtures, "node_modules", "m1", "a.js")}?#fragment`, ); testResolveContext("context for fixtures", fixtures, "./", fixtures); @@ -187,96 +206,96 @@ describe("resolve", () => { "context for fixtures/lib", fixtures, "./lib", - path.join(fixtures, "lib") + path.join(fixtures, "lib"), ); testResolveContext( "context for fixtures with ..", fixtures, "./lib/../../fixtures/./lib/..", - fixtures + fixtures, ); testResolveContext( "context for fixtures with query", fixtures, "./?query", - fixtures + "?query" + `${fixtures}?query`, ); testResolve( "differ between directory and file, resolve file", fixtures, "./dirOrFile", - path.join(fixtures, "dirOrFile.js") + path.join(fixtures, "dirOrFile.js"), ); testResolve( "differ between directory and file, resolve directory", fixtures, "./dirOrFile/", - path.join(fixtures, "dirOrFile", "index.js") + path.join(fixtures, "dirOrFile", "index.js"), ); testResolve( "find node_modules outside of node_modules", path.join(fixtures, "browser-module", "node_modules"), "m1/a", - path.join(fixtures, "node_modules", "m1", "a.js") + path.join(fixtures, "node_modules", "m1", "a.js"), ); testResolve( "don't crash on main field pointing to self", fixtures, "./main-field-self", - path.join(fixtures, "main-field-self", "index.js") + path.join(fixtures, "main-field-self", "index.js"), ); testResolve( "don't crash on main field pointing to self", fixtures, "./main-field-self2", - path.join(fixtures, "main-field-self2", "index.js") + path.join(fixtures, "main-field-self2", "index.js"), ); testResolve( "handle fragment edge case (no fragment)", fixtures, "./no#fragment/#/#", - path.join(fixtures, "no\0#fragment/\0#", "\0#.js") + path.join(fixtures, "no\0#fragment/\0#", "\0#.js"), ); testResolve( "handle fragment edge case (fragment)", fixtures, "./no#fragment/#/", - path.join(fixtures, "no.js") + "#fragment/#/" + `${path.join(fixtures, "no.js")}#fragment/#/`, ); testResolve( "handle fragment escaping", fixtures, "./no\0#fragment/\0#/\0##fragment", - path.join(fixtures, "no\0#fragment/\0#", "\0#.js") + "#fragment" + `${path.join(fixtures, "no\0#fragment/\0#", "\0#.js")}#fragment`, ); - it("should correctly resolve", function (done) { + it("should correctly resolve", (done) => { const issue238 = path.resolve(fixtures, "issue-238"); issue238Resolve( path.resolve(issue238, "./src/common"), "config/myObjectFile", - function (err, filename) { + (err, filename) => { if (err) done(err); expect(filename).toBeDefined(); expect(filename).toEqual( - path.resolve(issue238, "./src/common/config/myObjectFile.js") + path.resolve(issue238, "./src/common/config/myObjectFile.js"), ); done(); - } + }, ); }); - it("should correctly resolve with preferRelative", function (done) { - preferRelativeResolve(fixtures, "main1.js", function (err, filename) { + it("should correctly resolve with preferRelative", (done) => { + preferRelativeResolve(fixtures, "main1.js", (err, filename) => { if (err) done(err); expect(filename).toBeDefined(); expect(filename).toEqual(path.join(fixtures, "main1.js")); @@ -284,12 +303,12 @@ describe("resolve", () => { }); }); - it("should correctly resolve with preferRelative", function (done) { - preferRelativeResolve(fixtures, "m1/a.js", function (err, filename) { + it("should correctly resolve with preferRelative #2", (done) => { + preferRelativeResolve(fixtures, "m1/a.js", (err, filename) => { if (err) done(err); expect(filename).toBeDefined(); expect(filename).toEqual( - path.join(fixtures, "node_modules", "m1", "a.js") + path.join(fixtures, "node_modules", "m1", "a.js"), ); done(); }); diff --git a/test/restrictions.test.js b/test/restrictions.test.js index 65dfbad4..ea59bf20 100644 --- a/test/restrictions.test.js +++ b/test/restrictions.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); const ResolverFactory = require("../lib/ResolverFactory"); @@ -11,7 +13,7 @@ describe("restrictions", () => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, - restrictions: [/\.(sass|scss|css)$/] + restrictions: [/\.(sass|scss|css)$/], }); resolver.resolve({}, fixture, "pck1", {}, (err, result) => { @@ -26,14 +28,14 @@ describe("restrictions", () => { extensions: [".js", ".css"], fileSystem: nodeFileSystem, mainFiles: ["index"], - restrictions: [/\.(sass|scss|css)$/] + restrictions: [/\.(sass|scss|css)$/], }); resolver.resolve({}, fixture, "pck1", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "node_modules/pck1/index.css") + path.resolve(fixture, "node_modules/pck1/index.css"), ); done(); }); @@ -43,7 +45,7 @@ describe("restrictions", () => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, - restrictions: [fixture] + restrictions: [fixture], }); resolver.resolve({}, fixture, "pck2", {}, (err, result) => { @@ -58,14 +60,14 @@ describe("restrictions", () => { extensions: [".js"], fileSystem: nodeFileSystem, mainFields: ["main", "style"], - restrictions: [fixture, /\.(sass|scss|css)$/] + restrictions: [fixture, /\.(sass|scss|css)$/], }); resolver.resolve({}, fixture, "pck2", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "node_modules/pck2/index.css") + path.resolve(fixture, "node_modules/pck2/index.css"), ); done(); }); @@ -76,7 +78,7 @@ describe("restrictions", () => { extensions: [".js"], fileSystem: nodeFileSystem, mainFields: ["main", "module", "style"], - restrictions: [fixture, /\.(sass|scss|css)$/] + restrictions: [fixture, /\.(sass|scss|css)$/], }); const log = []; @@ -90,18 +92,18 @@ describe("restrictions", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "node_modules/pck2/index.css") + path.resolve(fixture, "node_modules/pck2/index.css"), ); expect( log.map((line) => line .replace(path.resolve(__dirname, ".."), "...") .replace(path.resolve(__dirname, ".."), "...") - .replace(/\\/g, "/") - ) + .replace(/\\/g, "/"), + ), ).toMatchSnapshot(); done(); - } + }, ); }); }); diff --git a/test/roots.test.js b/test/roots.test.js index e1d7225c..4f99b32e 100644 --- a/test/roots.test.js +++ b/test/roots.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); const ResolverFactory = require("../lib/ResolverFactory"); @@ -9,16 +11,16 @@ describe("roots", () => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], alias: { - foo: "/fixtures" + foo: "/fixtures", }, roots: [__dirname, fixtures], - fileSystem + fileSystem, }); const resolverPreferAbsolute = ResolverFactory.createResolver({ extensions: [".js"], alias: { - foo: "/fixtures" + foo: "/fixtures", }, roots: [__dirname, fixtures], fileSystem, @@ -27,18 +29,19 @@ describe("roots", () => { { apply(resolver) { resolver.hooks.file.tap("Test", (request) => { - if (/test.fixtures.*test.fixtures/.test(request.path)) + if (/test.fixtures.*test.fixtures/.test(request.path)) { throw new Error("Simulate a fatal error in root path"); + } }); - } - } - ] + }, + }, + ], }); const contextResolver = ResolverFactory.createResolver({ roots: [__dirname], fileSystem, - resolveToContext: true + resolveToContext: true, }); it("should respect roots option", (done) => { @@ -78,10 +81,10 @@ describe("roots", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixtures, "extensions/dir/index.js") + path.resolve(fixtures, "extensions/dir/index.js"), ); done(); - } + }, ); }); @@ -105,7 +108,7 @@ describe("roots", () => { if (!result) return done(new Error("No result")); expect(result).toEqual(path.resolve(fixtures, "lib")); done(); - } + }, ); }); @@ -128,7 +131,7 @@ describe("roots", () => { if (!result) return done(new Error("No result")); expect(result).toEqual(path.resolve(fixtures, "b.js")); done(); - } + }, ); }); }); diff --git a/test/scoped-packages.test.js b/test/scoped-packages.test.js index 57a1170a..0c86f9d5 100644 --- a/test/scoped-packages.test.js +++ b/test/scoped-packages.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); const { CachedInputFileSystem, ResolverFactory } = require("../"); @@ -8,7 +10,7 @@ const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ aliasFields: ["browser"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); describe("scoped-packages", () => { @@ -17,7 +19,7 @@ describe("scoped-packages", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/@scope/pack1/main.js") + path.resolve(fixture, "./node_modules/@scope/pack1/main.js"), ); done(); }); @@ -28,7 +30,7 @@ describe("scoped-packages", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/@scope/pack2/main.js") + path.resolve(fixture, "./node_modules/@scope/pack2/main.js"), ); done(); }); @@ -39,7 +41,7 @@ describe("scoped-packages", () => { if (err) return done(err); if (!result) return done(new Error("No result")); expect(result).toEqual( - path.resolve(fixture, "./node_modules/@scope/pack2/lib/index.js") + path.resolve(fixture, "./node_modules/@scope/pack2/lib/index.js"), ); done(); }); diff --git a/test/simple.test.js b/test/simple.test.js index 22d439df..a28add40 100644 --- a/test/simple.test.js +++ b/test/simple.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const resolve = require("../"); @@ -9,29 +11,31 @@ describe("simple", () => { [ path.join(__dirname, "..", ".."), "./enhanced-resolve/lib/index", - "in module" - ] + "in module", + ], ]; - pathsToIt.forEach(function (pathToIt) { - it("should resolve itself " + pathToIt[2], function (done) { - resolve(pathToIt[0], pathToIt[1], function (err, filename) { - if (err) + for (const pathToIt of pathsToIt) { + it(`should resolve itself ${pathToIt[2]}`, (done) => { + resolve(pathToIt[0], pathToIt[1], (err, filename) => { + if (err) { return done( - new Error([err.message, err.stack, err.details].join("\n")) + new Error([err.message, err.stack, err.details].join("\n")), ); + } expect(filename).toBeDefined(); - expect(typeof filename).toEqual("string"); + expect(typeof filename).toBe("string"); expect(filename).toEqual(path.join(__dirname, "..", "lib", "index.js")); done(); }); }); - it("should resolve itself sync " + pathToIt[2], () => { + + it(`should resolve itself sync ${pathToIt[2]}`, () => { const filename = resolve.sync(pathToIt[0], pathToIt[1]); expect(filename).toBeDefined(); - expect(typeof filename).toEqual("string"); + expect(typeof filename).toBe("string"); expect(filename).toEqual(path.join(__dirname, "..", "lib", "index.js")); }); - }); + } }); diff --git a/test/symlink.test.js b/test/symlink.test.js index b90755c4..5e32b556 100644 --- a/test/symlink.test.js +++ b/test/symlink.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); const { platform } = require("os"); @@ -12,29 +14,29 @@ describe("symlink", () => { fs.symlinkSync( path.join(__dirname, "..", "lib", "index.js"), path.join(tempPath, "test"), - "file" + "file", ); fs.symlinkSync( path.join(__dirname, "..", "lib"), path.join(tempPath, "test2"), - "dir" + "dir", ); - } catch (e) { + } catch (_err) { isAdmin = false; } try { fs.unlinkSync(path.join(tempPath, "test")); - } catch (e) { + } catch (_err) { isAdmin = false; } try { fs.unlinkSync(path.join(tempPath, "test2")); - } catch (e) { + } catch (_err) { isAdmin = false; } try { fs.rmdirSync(tempPath); - } catch (e) { + } catch (_err) { isAdmin = false; } @@ -50,38 +52,38 @@ describe("symlink", () => { fs.symlinkSync( path.join(__dirname, "..", "lib", "index.js"), path.join(tempPath, "index.js"), - "file" + "file", ); fs.symlinkSync( path.join(__dirname, "..", "lib"), path.join(tempPath, "lib"), - "dir" + "dir", ); fs.symlinkSync( path.join(__dirname, ".."), path.join(tempPath, "this"), - "dir" + "dir", ); fs.symlinkSync( path.join(tempPath, "this"), path.join(tempPath, "that"), - "dir" + "dir", ); fs.symlinkSync( path.join("..", "..", "lib", "index.js"), path.join(tempPath, "node.relative.js"), - "file" + "file", ); fs.symlinkSync( path.join(".", "node.relative.js"), path.join(tempPath, "node.relative.sym.js"), - "file" + "file", ); // PR #150: Set the current working directory so that tests will fail if changes get reverted. if (isWindows) { process.chdir(path.join(tempPath, "that")); } - } catch (e) { + } catch (_err) { // ignore the failure } }); @@ -101,135 +103,132 @@ describe("symlink", () => { }); const resolveWithoutSymlinks = resolve.create({ - symlinks: false + symlinks: false, }); const resolveSyncWithoutSymlinks = resolve.create.sync({ - symlinks: false + symlinks: false, }); - [ + for (const pathToIt of [ [tempPath, "./index.js", "with a symlink to a file"], [tempPath, "./node.relative.js", "with a relative symlink to a file"], [ tempPath, "./node.relative.sym.js", - "with a relative symlink to a symlink to a file" + "with a relative symlink to a symlink to a file", ], [tempPath, "./lib/index.js", "with a symlink to a directory 1"], [tempPath, "./this/lib/index.js", "with a symlink to a directory 2"], [ tempPath, "./this/test/temp/index.js", - "with multiple symlinks in the path 1" + "with multiple symlinks in the path 1", ], [ tempPath, "./this/test/temp/lib/index.js", - "with multiple symlinks in the path 2" + "with multiple symlinks in the path 2", ], [ tempPath, "./this/test/temp/this/lib/index.js", - "with multiple symlinks in the path 3" + "with multiple symlinks in the path 3", ], [ tempPath, "./that/lib/index.js", - "with a symlink to a directory 2 (chained)" + "with a symlink to a directory 2 (chained)", ], [ tempPath, "./that/test/temp/index.js", - "with multiple symlinks in the path 1 (chained)" + "with multiple symlinks in the path 1 (chained)", ], [ tempPath, "./that/test/temp/lib/index.js", - "with multiple symlinks in the path 2 (chained)" + "with multiple symlinks in the path 2 (chained)", ], [ tempPath, "./that/test/temp/that/lib/index.js", - "with multiple symlinks in the path 3 (chained)" + "with multiple symlinks in the path 3 (chained)", ], [ path.join(tempPath, "lib"), "./index.js", - "with symlinked directory as context 1" + "with symlinked directory as context 1", ], [ path.join(tempPath, "this"), "./lib/index.js", - "with symlinked directory as context 2" + "with symlinked directory as context 2", ], [ path.join(tempPath, "this"), "./test/temp/lib/index.js", - "with symlinked directory as context and in path" + "with symlinked directory as context and in path", ], [ path.join(tempPath, "this", "lib"), "./index.js", - "with symlinked directory in context path" + "with symlinked directory in context path", ], [ path.join(tempPath, "this", "test"), "./temp/index.js", - "with symlinked directory in context path and symlinked file" + "with symlinked directory in context path and symlinked file", ], [ path.join(tempPath, "this", "test"), "./temp/lib/index.js", - "with symlinked directory in context path and symlinked directory" + "with symlinked directory in context path and symlinked directory", ], [ path.join(tempPath, "that"), "./lib/index.js", - "with symlinked directory as context 2 (chained)" + "with symlinked directory as context 2 (chained)", ], [ path.join(tempPath, "that"), "./test/temp/lib/index.js", - "with symlinked directory as context and in path (chained)" + "with symlinked directory as context and in path (chained)", ], [ path.join(tempPath, "that", "lib"), "./index.js", - "with symlinked directory in context path (chained)" + "with symlinked directory in context path (chained)", ], [ path.join(tempPath, "that", "test"), "./temp/index.js", - "with symlinked directory in context path and symlinked file (chained)" + "with symlinked directory in context path and symlinked file (chained)", ], [ path.join(tempPath, "that", "test"), "./temp/lib/index.js", - "with symlinked directory in context path and symlinked directory (chained)" - ] - ].forEach(function (pathToIt) { - it("should resolve symlink to itself " + pathToIt[2], function (done) { - resolve(pathToIt[0], pathToIt[1], function (err, filename) { + "with symlinked directory in context path and symlinked directory (chained)", + ], + ]) { + it(`should resolve symlink to itself ${pathToIt[2]}`, (done) => { + resolve(pathToIt[0], pathToIt[1], (err, filename) => { if (err) return done(err); expect(filename).toBeDefined(); expect(typeof filename).toBe("string"); expect(filename).toEqual( - path.join(__dirname, "..", "lib", "index.js") + path.join(__dirname, "..", "lib", "index.js"), ); - resolveWithoutSymlinks( - pathToIt[0], - pathToIt[1], - function (err, filename) { - if (err) return done(err); - expect(typeof filename).toBe("string"); - expect(filename).toEqual(path.resolve(pathToIt[0], pathToIt[1])); - done(); - } - ); + resolveWithoutSymlinks(pathToIt[0], pathToIt[1], (err, filename) => { + if (err) return done(err); + expect(typeof filename).toBe("string"); + expect(filename).toEqual(path.resolve(pathToIt[0], pathToIt[1])); + done(); + }); }); }); - it("should resolve symlink to itself sync " + pathToIt[2], () => { + + it(`should resolve symlink to itself sync ${pathToIt[2]}`, () => { let filename = resolve.sync(pathToIt[0], pathToIt[1]); expect(filename).toBeDefined(); expect(typeof filename).toBe("string"); @@ -240,8 +239,11 @@ describe("symlink", () => { expect(typeof filename).toBe("string"); expect(filename).toEqual(path.resolve(pathToIt[0], pathToIt[1])); }); - }); + } } else { - it("cannot test symlinks because we have no permission to create them"); + // eslint-disable-next-line jest/expect-expect + it("cannot test symlinks because we have no permission to create them", () => { + // Nothing + }); } }); diff --git a/test/unsafe-cache.test.js b/test/unsafe-cache.test.js index 664f83b7..8d2e13cc 100644 --- a/test/unsafe-cache.test.js +++ b/test/unsafe-cache.test.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const resolve = require("../"); @@ -9,10 +11,10 @@ describe("unsafe-cache", () => { beforeEach(() => { context = { - some: "context" + some: "context", }; otherContext = { - someOther: "context" + someOther: "context", }; }); @@ -20,81 +22,84 @@ describe("unsafe-cache", () => { beforeEach(() => { cache = {}; cachedResolve = resolve.create({ - unsafeCache: cache + unsafeCache: cache, }); }); + it("should cache request", (done) => { cachedResolve( path.join(__dirname, "fixtures"), "m2/b", - function (err, result) { + (err, _result) => { if (err) return done(err); expect(Object.keys(cache)).toHaveLength(1); - Object.keys(cache).forEach(function (key) { + for (const key of Object.keys(cache)) { cache[key] = { - path: "yep" + path: "yep", }; - }); + } cachedResolve( path.join(__dirname, "fixtures"), "m2/b", - function (err, result) { + (err, result) => { if (err) return done(err); - expect(result).toEqual("yep"); + expect(result).toBe("yep"); done(); - } + }, ); - } + }, ); }); + it("should not return from cache if context does not match", (done) => { cachedResolve( context, path.join(__dirname, "fixtures"), "m2/b", - function (err, result) { + (err, _result) => { if (err) return done(err); expect(Object.keys(cache)).toHaveLength(1); - Object.keys(cache).forEach(function (key) { + for (const key of Object.keys(cache)) { cache[key] = { - path: "yep" + path: "yep", }; - }); + } cachedResolve( otherContext, path.join(__dirname, "fixtures"), "m2/b", - function (err, result) { + (err, result) => { if (err) return done(err); - expect(result).not.toEqual("yep"); + expect(result).not.toBe("yep"); done(); - } + }, ); - } + }, ); }); + it("should not return from cache if query does not match", (done) => { cachedResolve( path.join(__dirname, "fixtures"), "m2/b?query", - function (err, result) { + (err, _result) => { if (err) return done(err); expect(Object.keys(cache)).toHaveLength(1); - Object.keys(cache).forEach(function (key) { + for (const key of Object.keys(cache)) { cache[key] = { - path: "yep" + path: "yep", }; - }); + } cachedResolve( path.join(__dirname, "fixtures"), "m2/b?query2", - function (err, result) { + (err, result) => { if (err) return done(err); - expect(result).not.toEqual("yep"); + expect(result).not.toBe("yep"); done(); - } + }, ); - } + }, ); }); }); @@ -104,59 +109,61 @@ describe("unsafe-cache", () => { cache = {}; cachedResolve = resolve.create({ unsafeCache: cache, - cacheWithContext: false + cacheWithContext: false, }); }); + it("should cache request", (done) => { cachedResolve( context, path.join(__dirname, "fixtures"), "m2/b", - function (err, result) { + (err, _result) => { if (err) return done(err); expect(Object.keys(cache)).toHaveLength(1); - Object.keys(cache).forEach(function (key) { + for (const key of Object.keys(cache)) { cache[key] = { - path: "yep" + path: "yep", }; - }); + } cachedResolve( context, path.join(__dirname, "fixtures"), "m2/b", - function (err, result) { + (err, result) => { if (err) return done(err); - expect(result).toEqual("yep"); + expect(result).toBe("yep"); done(); - } + }, ); - } + }, ); }); + it("should return from cache even if context does not match", (done) => { cachedResolve( context, path.join(__dirname, "fixtures"), "m2/b", - function (err, result) { + (err, _result) => { if (err) return done(err); expect(Object.keys(cache)).toHaveLength(1); - Object.keys(cache).forEach(function (key) { + for (const key of Object.keys(cache)) { cache[key] = { - path: "yep" + path: "yep", }; - }); + } cachedResolve( otherContext, path.join(__dirname, "fixtures"), "m2/b", - function (err, result) { + (err, result) => { if (err) return done(err); - expect(result).toEqual("yep"); + expect(result).toBe("yep"); done(); - } + }, ); - } + }, ); }); }); diff --git a/test/yield.test.js b/test/yield.test.js index 23added0..94554092 100644 --- a/test/yield.test.js +++ b/test/yield.test.js @@ -1,10 +1,14 @@ +"use strict"; + const path = require("path"); const fs = require("fs"); const { ResolverFactory } = require("../"); const CachedInputFileSystem = require("../lib/CachedInputFileSystem"); +/** @typedef {import("../lib/Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("../lib/Resolver").ResolveContext} ResolveContext */ +/** @typedef {import("../lib/UnsafeCachePlugin").Cache} Cache */ /** @typedef {ResolveContext & Required>} StrictResolveContext */ const nodeFileSystem = new CachedInputFileSystem(fs, 4000); @@ -12,14 +16,14 @@ const fixtures = path.resolve(__dirname, "fixtures", "yield"); const makeFixturePaths = (paths) => paths.map((pth) => (pth ? path.join(fixtures, pth) : pth)); const contextifyDependencies = (paths) => - Array.from(paths) + [...paths] .filter((pth) => pth.startsWith(fixtures)) .map((pth) => pth.slice(fixtures.length).split(path.sep).join("/")) .sort(); const beatifyLogs = (logs) => logs.map((l) => { const match = /^(\s+)using description file.+(\(relative path:.+\))$/.exec( - l + l, ); if (match) return `${match[1]}using description file ${match[2]}`; while (l.includes(fixtures)) l = l.replace(fixtures, "fixtures"); @@ -31,15 +35,15 @@ describe("should resolve all aliases", () => { extensions: [".js"], alias: { index: makeFixturePaths(["/a/foo", "/a/foo-2"]), - foo: false + foo: false, }, aliasFields: ["browser"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); const modulesResolver = ResolverFactory.createResolver({ extensions: [".js"], modules: makeFixturePaths(["a", "b"]), - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); it("should yield all b files", (done) => { @@ -53,11 +57,11 @@ describe("should resolve all aliases", () => { yield: yield_, fileDependencies, contextDependencies, - missingDependencies + missingDependencies, }; resolver.resolve({}, fixtures, "index/b", context, (err, result) => { - expect(err).toEqual(null); + expect(err).toBeNull(); expect(result).toBeUndefined(); expect(paths).toEqual(makeFixturePaths(["/a/foo/b", "/a/foo-2/b"])); expect(contextifyDependencies(fileDependencies)).toEqual([ @@ -66,7 +70,7 @@ describe("should resolve all aliases", () => { "/a/foo", "/a/foo-2", "/a/foo-2/b", - "/a/foo/b" + "/a/foo/b", ]); expect(contextifyDependencies(missingDependencies)).toEqual([ "/a/foo-2/b", @@ -76,9 +80,9 @@ describe("should resolve all aliases", () => { "/a/foo/b.js", "/a/foo/package.json", "/a/package.json", - "/package.json" + "/package.json", ]); - expect(Array.from(contextDependencies).sort()).toEqual([]); + expect([...contextDependencies].sort()).toEqual([]); done(); }); }); @@ -94,11 +98,11 @@ describe("should resolve all aliases", () => { yield: yield_, fileDependencies, contextDependencies, - missingDependencies + missingDependencies, }; modulesResolver.resolve({}, fixtures, "foo/a", context, (err, result) => { - expect(err).toEqual(null); + expect(err).toBeNull(); expect(result).toBeUndefined(); expect(paths).toEqual(makeFixturePaths(["/a/foo/a", "/b/foo/a"])); expect(contextifyDependencies(fileDependencies)).toEqual([ @@ -108,7 +112,7 @@ describe("should resolve all aliases", () => { "/a/foo/a", "/b", "/b/foo", - "/b/foo/a" + "/b/foo/a", ]); expect(contextifyDependencies(missingDependencies)).toEqual([ "/a/foo/a", @@ -119,9 +123,9 @@ describe("should resolve all aliases", () => { "/b/foo/a.js", "/b/foo/package.json", "/b/package.json", - "/package.json" + "/package.json", ]); - expect(Array.from(contextDependencies).sort()).toEqual([]); + expect([...contextDependencies].sort()).toEqual([]); done(); }); }); @@ -131,11 +135,11 @@ describe("should resolve all aliases", () => { const yield_ = ({ path }) => paths.push(path); /** @type {ResolveContext} */ const context = { - yield: yield_ + yield: yield_, }; resolver.resolve({}, fixtures, "index/c", context, (err, result) => { - expect(err).toEqual(null); + expect(err).toBeNull(); expect(result).toBeUndefined(); expect(paths).toEqual(makeFixturePaths(["/a/foo-2/c"])); done(); @@ -153,19 +157,19 @@ describe("should resolve all aliases", () => { yield: yield_, fileDependencies, contextDependencies, - missingDependencies + missingDependencies, }; resolver.resolve({}, fixtures, "foo", context, (err, result) => { - expect(err).toEqual(null); + expect(err).toBeNull(); expect(result).toBeUndefined(); expect(paths).toEqual([false]); expect(contextifyDependencies(fileDependencies)).toEqual([]); expect(contextifyDependencies(missingDependencies)).toEqual([ "/node_modules", - "/package.json" + "/package.json", ]); - expect(Array.from(contextDependencies).sort()).toEqual([]); + expect([...contextDependencies].sort()).toEqual([]); done(); }); }); @@ -181,12 +185,12 @@ describe("should resolve all aliases", () => { yield: yield_, fileDependencies, contextDependencies, - missingDependencies + missingDependencies, }; resolver.resolve({}, fixtures, "index/unknown", context, (err, result) => { - expect(err).not.toEqual(null); - expect(err).not.toBeUndefined(); + expect(err).not.toBeNull(); + expect(err).toBeDefined(); expect(result).toBeUndefined(); expect(paths).toEqual([]); expect(contextifyDependencies(fileDependencies)).toEqual([]); @@ -198,9 +202,9 @@ describe("should resolve all aliases", () => { "/a/foo/unknown", "/a/foo/unknown.js", "/a/package.json", - "/package.json" + "/package.json", ]); - expect(Array.from(contextDependencies).sort()).toEqual([]); + expect([...contextDependencies].sort()).toEqual([]); done(); }); }); @@ -210,10 +214,10 @@ describe("should resolve all aliases", () => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], alias: { - index: makeFixturePaths(["/c/foo"]) + index: makeFixturePaths(["/c/foo"]), }, aliasFields: ["browser"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); let calls = 0; const paths = []; @@ -230,42 +234,42 @@ describe("should resolve all aliases", () => { fileDependencies, contextDependencies, missingDependencies, - log: (l) => logs.push(l) + log: (l) => logs.push(l), }; resolver.resolve({}, fixtures, "index/a", context, (err, result) => { calls++; - expect(calls).toEqual(1); - expect(err).toEqual(null); + expect(calls).toBe(1); + expect(err).toBeNull(); expect(result).toBeUndefined(); expect(paths).toEqual([false]); expect(contextifyDependencies(fileDependencies)).toEqual([ - "/c/foo/package.json" + "/c/foo/package.json", ]); expect(contextifyDependencies(missingDependencies)).toEqual([ "/c/foo/a", "/c/foo/a.js", - "/package.json" + "/package.json", ]); - expect(Array.from(contextDependencies).sort()).toEqual([]); + expect([...contextDependencies].sort()).toEqual([]); expect(beatifyLogs(logs)).toEqual([ "resolve 'index/a' in 'fixtures'", " Parsed request is a module", " using description file (relative path: ./test/fixtures/yield)", ` aliased with mapping 'index': '${["fixtures", "c", "foo"].join( - path.sep + path.sep, )}' to '${["fixtures", "c", "foo"].join(path.sep)}/a'`, " using description file (relative path: ./test/fixtures/yield)", " using description file (relative path: ./a)", " .js", ` ${["fixtures", "c", "foo", "a.js"].join( - path.sep + path.sep, )} doesn't exist`, " as directory", ` ${["fixtures", "c", "foo", "a"].join( - path.sep - )} is not a directory` + path.sep, + )} is not a directory`, ]); done(); @@ -277,80 +281,55 @@ describe("should resolve all aliases", () => { ResolverFactory.createResolver({ extensions: [".js"], alias: { - index: makeFixturePaths(aliases) + index: makeFixturePaths(aliases), }, aliasFields: ["browser"], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); const cLog = [ ` aliased with mapping 'index': '${["fixtures", "c", "foo"].join( - path.sep + path.sep, )}' to '${["fixtures", "c", "foo"].join(path.sep)}/a'`, " using description file (relative path: ./test/fixtures/yield)", " using description file (relative path: ./a)", " .js", ` ${["fixtures", "c", "foo", "a.js"].join( - path.sep + path.sep, )} doesn't exist`, " as directory", ` ${["fixtures", "c", "foo", "a"].join( - path.sep - )} is not a directory` + path.sep, + )} is not a directory`, ]; const aLog = [ ` aliased with mapping 'index': '${["fixtures", "a", "foo"].join( - path.sep + path.sep, )}' to '${["fixtures", "a", "foo"].join(path.sep)}/a'`, " using description file (relative path: ./test/fixtures/yield)", " using description file (relative path: ./test/fixtures/yield/a/foo/a)", " no extension", ` existing file: ${["fixtures", "a", "foo", "a"].join( - path.sep + path.sep, )}`, ` reporting result ${["fixtures", "a", "foo", "a"].join( - path.sep + path.sep, )}`, " .js", ` ${["fixtures", "a", "foo", "a.js"].join( - path.sep + path.sep, )} doesn't exist`, " as directory", ` ${["fixtures", "a", "foo", "a"].join( - path.sep - )} is not a directory` + path.sep, + )} is not a directory`, ]; let resolver; - it("default order", (done) => { - resolver = createResolver(["/c/foo", "/a/foo"]); - run( - done, - [false, "/a/foo/a"], - [ - "resolve 'index/a' in 'fixtures'", - " Parsed request is a module", - " using description file (relative path: ./test/fixtures/yield)", - ...cLog, - ...aLog - ] - ); - }); - - it("reverse order", (done) => { - resolver = createResolver(["/a/foo", "/c/foo"]); - run( - done, - ["/a/foo/a", false], - [ - "resolve 'index/a' in 'fixtures'", - " Parsed request is a module", - " using description file (relative path: ./test/fixtures/yield)", - ...aLog, - ...cLog - ] - ); - }); - + /** + * @param {(err?: null) => void} done done + * @param {(string | false)[]} expectedResult expected result + * @param {string[]} expectedLogs expected logs + */ function run(done, expectedResult, expectedLogs) { let calls = 0; const paths = []; @@ -365,13 +344,13 @@ describe("should resolve all aliases", () => { fileDependencies, contextDependencies, missingDependencies, - log: (l) => logs.push(l) + log: (l) => logs.push(l), }; resolver.resolve({}, fixtures, "index/a", context, (err, result) => { calls++; - expect(calls).toEqual(1); - expect(err).toEqual(null); + expect(calls).toBe(1); + expect(err).toBeNull(); expect(result).toBeUndefined(); expect(paths).toEqual(makeFixturePaths(expectedResult)); expect(contextifyDependencies(fileDependencies)).toEqual([ @@ -379,7 +358,7 @@ describe("should resolve all aliases", () => { "/a", "/a/foo", "/a/foo/a", - "/c/foo/package.json" + "/c/foo/package.json", ]); expect(contextifyDependencies(missingDependencies)).toEqual([ "/a/foo/a", @@ -388,14 +367,46 @@ describe("should resolve all aliases", () => { "/a/package.json", "/c/foo/a", "/c/foo/a.js", - "/package.json" + "/package.json", ]); - expect(Array.from(contextDependencies).sort()).toEqual([]); + expect([...contextDependencies].sort()).toEqual([]); expect(beatifyLogs(logs)).toEqual(expectedLogs); done(); }); } + + // eslint-disable-next-line jest/expect-expect + it("default order", (done) => { + resolver = createResolver(["/c/foo", "/a/foo"]); + run( + done, + [false, "/a/foo/a"], + [ + "resolve 'index/a' in 'fixtures'", + " Parsed request is a module", + " using description file (relative path: ./test/fixtures/yield)", + ...cLog, + ...aLog, + ], + ); + }); + + // eslint-disable-next-line jest/expect-expect + it("reverse order", (done) => { + resolver = createResolver(["/a/foo", "/c/foo"]); + run( + done, + ["/a/foo/a", false], + [ + "resolve 'index/a' in 'fixtures'", + " Parsed request is a module", + " using description file (relative path: ./test/fixtures/yield)", + ...aLog, + ...cLog, + ], + ); + }); }); describe("custom plugins", () => { @@ -403,7 +414,7 @@ describe("should resolve all aliases", () => { ResolverFactory.createResolver({ extensions: [".js"], plugins: [plugin], - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); it("should correctly handle resolve in callback", (done) => { @@ -416,13 +427,13 @@ describe("should resolve all aliases", () => { "MyResolverPlugin", (request, resolveContext, callback) => { callback(null, getResult(request)); - } + }, ); - } + }, }); const paths = []; const context = { - yield: (obj) => paths.push(obj.path) + yield: (obj) => paths.push(obj.path), }; resolver.resolve({}, fixtures, "unknown", context, (err, result) => { if (err) done(err); @@ -439,17 +450,17 @@ describe("should resolve all aliases", () => { resolver .getHook("described-resolve") .tapAsync("MyResolverPlugin", (_, __, callback) => - callback(new Error("error")) + callback(new Error("error")), ); - } + }, }); const paths = []; const context = { - yield: (obj) => paths.push(obj.path) + yield: (obj) => paths.push(obj.path), }; resolver.resolve({}, fixtures, "unknown", context, (err, result) => { if (!err) return done(new Error("error expected")); - expect(err).not.toBe(null); + expect(err).not.toBeNull(); expect(err.message).toBe("error"); expect(result).toBeUndefined(); expect(paths).toEqual([]); @@ -461,14 +472,14 @@ describe("should resolve all aliases", () => { describe("unsafe cache", () => { // same case as in "should yield all b files" it("should return result from cache", (done) => { - const cache = {}; + const cache = /** @type {Cache} */ ({}); const resolver = ResolverFactory.createResolver({ extensions: [".js"], alias: { - index: makeFixturePaths(["/a/foo", "/a/foo-2"]) + index: makeFixturePaths(["/a/foo", "/a/foo-2"]), }, unsafeCache: cache, - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); resolver.resolve( {}, @@ -485,40 +496,45 @@ describe("should resolve all aliases", () => { "index/b", { yield: (obj) => paths.push(obj.path) }, (err, result) => { - expect(err).toBe(null); + expect(err).toBeNull(); expect(result).toBeUndefined(); expect(paths).toEqual( - makeFixturePaths(["/a/foo/b", "/a/foo-2/b"]) + makeFixturePaths(["/a/foo/b", "/a/foo-2/b"]), ); // original + 2 aliases expect(Object.keys(cache)).toHaveLength(3); - const cacheId = Object.keys(cache).find((id) => { - const { request } = JSON.parse(id); - return request === "index/b"; - }); - expect(cacheId).not.toBeUndefined(); + const cacheId = + /** @type {string} */ + ( + Object.keys(cache).find((id) => { + const { request } = JSON.parse(id); + return request === "index/b"; + }) + ); + expect(cacheId).toBeDefined(); expect(Array.isArray(cache[cacheId])).toBe(true); - expect(cache[cacheId].map((o) => o.path)).toEqual( - makeFixturePaths(["/a/foo/b", "/a/foo-2/b"]) - ); + expect( + /** @type {ResolveRequest[]} */ + (cache[cacheId]).map((o) => o.path), + ).toEqual(makeFixturePaths(["/a/foo/b", "/a/foo-2/b"])); done(); - } + }, ); - } + }, ); }); // same as "should handle false in alias field" it("should return ignore result from cache", (done) => { - const cache = {}; + const cache = /** @type {Cache} */ ({}); const resolver = ResolverFactory.createResolver({ extensions: [".js"], alias: { - foo: false + foo: false, }, unsafeCache: cache, - fileSystem: nodeFileSystem + fileSystem: nodeFileSystem, }); resolver.resolve({}, fixtures, "foo", { yield: () => {} }, (err) => { if (err) done(err); @@ -530,19 +546,22 @@ describe("should resolve all aliases", () => { "foo", { yield: (obj) => paths.push(obj.path) }, (err, result) => { - expect(err).toBe(null); + expect(err).toBeNull(); expect(result).toBeUndefined(); expect(paths).toEqual([false]); // original + 0 aliases expect(Object.keys(cache)).toHaveLength(1); - const cacheId = Object.keys(cache)[0]; - expect(cacheId).not.toBeUndefined(); + const [cacheId] = Object.keys(cache); + expect(cacheId).toBeDefined(); expect(Array.isArray(cache[cacheId])).toBe(true); - expect(cache[cacheId].map((o) => o.path)).toEqual([false]); + expect( + /** @type {ResolveRequest[]} */ + (cache[cacheId]).map((o) => o.path), + ).toEqual([false]); done(); - } + }, ); }); }); diff --git a/tooling/format-file-header.js b/tooling/format-file-header.js deleted file mode 100644 index b5f4bd70..00000000 --- a/tooling/format-file-header.js +++ /dev/null @@ -1,186 +0,0 @@ -const path = require("path"); -const fs = require("fs"); - -// When --write is set, files will be written in place -// Otherwise it only prints outdated files -const doWrite = process.argv.includes("--write"); - -const allFiles = new Set(); -const findFiles = (p) => { - const s = fs.statSync(p); - if (s.isDirectory()) { - for (const name of fs.readdirSync(p)) { - if (name.startsWith(".")) continue; - findFiles(path.join(p, name)); - } - } else if (s.isFile()) { - allFiles.add(p); - } -}; -findFiles(path.resolve(__dirname, "../lib")); - -let canUpdateWithWrite = false; - -const sortImport = (a, b) => { - if (!a.key.startsWith(".") && b.key.startsWith(".")) return -1; - if (a.key.startsWith(".") && !b.key.startsWith(".")) return 1; - if (a.key < b.key) return -1; - if (a.key > b.key) return 1; - return 0; -}; - -const execToArray = (content, regexp) => { - const items = []; - let match = regexp.exec(content); - while (match) { - items.push({ - content: match[0], - key: match[1] + match[2] - }); - match = regexp.exec(content); - } - return items; -}; - -const schema = [ - { - title: "license comment", - regexp: - /\/\*\n\s*MIT License http:\/\/www\.opensource\.org\/licenses\/mit-license\.php\n\s*(?:(Authors? .+)\n)?\s*\*\/\n/g, - updateMessage: "update the license comment", - update(content, author) { - return ( - [ - "/*", - "\tMIT License http://www.opensource.org/licenses/mit-license.php", - author && `\t${author}`, - "*/" - ] - .filter(Boolean) - .join("\n") + "\n" - ); - } - }, - { - title: "new line after license comment", - regexp: /\n?/g, - updateMessage: "insert a new line after the license comment", - update() { - return "\n"; - } - }, - { - title: "strict mode", - regexp: /"use strict";\n/g - }, - { - title: "new line after strict mode", - regexp: /\n?/g, - updateMessage: 'insert a new line after "use strict"', - update() { - return "\n"; - } - }, - { - title: "imports", - regexp: - /(const (\{\s+\w+(?::\s+\w+)?(,\s+\w+(?::\s+\w+)?)*\s+\}|\w+) = (\/\*\* @type \{TODO\} \*\/\s\()?require\("[^"]+"\)\)?(\.\w+)*;\n)+\n/g, - updateMessage: "sort imports alphabetically", - update(content) { - const items = execToArray( - content, - /const (?:\{\s+\w+(?::\s+\w+)?(?:,\s+\w+(?::\s+\w+)?)*\s+\}|\w+) = (?:\/\*\* @type \{TODO\} \*\/\s\()?require\("([^"]+)"\)\)?((?:\.\w+)*);\n/g - ); - items.sort(sortImport); - return items.map((item) => item.content).join("") + "\n"; - }, - optional: true, - repeat: true - }, - { - title: "type imports", - regexp: - /(\/\*\* (?:@template \w+ )*@typedef \{import\("[^"]+"\)(\.\w+)*(?:<(?:(?:\w\.)*\w+, )*(?:\w\.)*\w+>)?\} \w+(?:<(?:(?:\w\.)*\w+, )*(?:\w\.)*\w+>)? \*\/\n)+\n/g, - updateMessage: "sort type imports alphabetically", - update(content) { - const items = execToArray( - content, - /\/\*\* (?:@template \w+ )*@typedef \{import\("([^"]+)"\)((?:\.\w+)*(?:<(?:(?:\w\.)*\w+, )*(?:\w\.)*\w+>)?)\} \w+(?:<(?:(?:\w\.)*\w+, )*(?:\w\.)*\w+>)? \*\/\n/g - ); - items.sort(sortImport); - return items.map((item) => item.content).join("") + "\n"; - }, - optional: true, - repeat: true - } -]; - -for (const filePath of allFiles) { - let content = fs.readFileSync(filePath, "utf-8"); - const nl = /(\r?\n)/.exec(content); - content = content.replace(/\r?\n/g, "\n"); - let newContent = content; - - let state = 0; - let pos = 0; - // eslint-disable-next-line no-constant-condition - while (true) { - const current = schema[state]; - if (!current) break; - current.regexp.lastIndex = pos; - const match = current.regexp.exec(newContent); - if (!match) { - if (current.optional) { - state++; - continue; - } - console.log(`${filePath}: Missing ${current.title} at ${pos}`); - process.exitCode = 1; - break; - } - if (match.index !== pos) { - console.log( - `${filePath}: Unexpected code at ${pos}-${match.index}, expected ${current.title}` - ); - process.exitCode = 1; - pos = match.index; - } - if (!current.repeat) { - state++; - } - if (current.update) { - const update = current.update(...match); - if (update !== match[0]) { - newContent = - newContent.slice(0, pos) + - update + - newContent.slice(pos + match[0].length); - pos += update.length; - if (!doWrite) { - const updateMessage = - current.updateMessage || `${current.title} need to be updated`; - console.log(`${filePath}: ${updateMessage}`); - } - continue; - } - } - pos += match[0].length; - } - - if (newContent !== content) { - if (doWrite) { - if (nl) { - newContent = newContent.replace(/\n/g, nl[0]); - } - fs.writeFileSync(filePath, newContent, "utf-8"); - console.log(filePath); - } else { - canUpdateWithWrite = true; - process.exitCode = 1; - } - } -} - -if (canUpdateWithWrite) { - console.log("Run 'yarn fix' to try to fix the problem automatically"); -} diff --git a/tsconfig.types.test.json b/tsconfig.types.test.json index bcd0c03d..5b80b786 100644 --- a/tsconfig.types.test.json +++ b/tsconfig.types.test.json @@ -7,7 +7,6 @@ "checkJs": true, "noEmit": true, "strict": false, - "noImplicitThis": true, "alwaysStrict": true, "strictNullChecks": true, "types": ["node", "jest"], diff --git a/types.d.ts b/types.d.ts index 2d4a7b2c..53c1112b 100644 --- a/types.d.ts +++ b/types.d.ts @@ -26,16 +26,59 @@ declare interface AliasOptions { } type BaseFileSystem = FileSystem & SyncFileSystem; declare interface BaseResolveRequest { + /** + * path + */ path: string | false; + + /** + * content + */ context?: object; + + /** + * description file path + */ descriptionFilePath?: string; + + /** + * description file root + */ descriptionFileRoot?: string; + + /** + * description file data + */ descriptionFileData?: JsonObject; + + /** + * relative path + */ relativePath?: string; + + /** + * true when need to ignore symlinks, otherwise false + */ ignoreSymlinks?: boolean; + + /** + * true when full specified, otherwise false + */ fullySpecified?: boolean; + + /** + * inner request for internal usage + */ __innerRequest?: string; + + /** + * inner request for internal usage + */ __innerRequest_request?: string; + + /** + * inner relative path for internal usage + */ __innerRequest_relativePath?: string; } type BufferEncoding = @@ -52,6 +95,9 @@ type BufferEncoding = | "binary" | "hex"; type BufferEncodingOption = "buffer" | { encoding: "buffer" }; +declare interface Cache { + [index: string]: undefined | ResolveRequest | ResolveRequest[]; +} declare class CachedInputFileSystem { constructor(fileSystem: BaseFileSystem, duration: number); fileSystem: BaseFileSystem; @@ -64,13 +110,13 @@ declare class CachedInputFileSystem { readFile: ReadFile; readFileSync: ReadFileSync; readJson?: ( - arg0: PathOrFileDescriptor, - arg1: ( - arg0: null | Error | NodeJS.ErrnoException, - arg1?: JsonObject - ) => void + pathOrFileDescription: PathOrFileDescriptor, + callback: ( + err: null | Error | NodeJS.ErrnoException, + result?: JsonObject, + ) => void, ) => void; - readJsonSync?: (arg0: PathOrFileDescriptor) => JsonObject; + readJsonSync?: (pathOrFileDescription: PathOrFileDescriptor) => JsonObject; readlink: Readlink; readlinkSync: ReadlinkSync; realpath?: RealPath; @@ -82,7 +128,7 @@ declare class CachedInputFileSystem { | Buffer | URL_url | (string | number | Buffer | URL_url)[] - | Set + | Set, ): void; } declare class CloneBasenamePlugin { @@ -98,7 +144,7 @@ declare class CloneBasenamePlugin { | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest - > + >, ); source: | string @@ -115,14 +161,49 @@ declare class CloneBasenamePlugin { apply(resolver: Resolver): void; } declare interface Dirent { + /** + * true when is file, otherwise false + */ isFile: () => boolean; + + /** + * true when is directory, otherwise false + */ isDirectory: () => boolean; + + /** + * true when is block device, otherwise false + */ isBlockDevice: () => boolean; + + /** + * true when is character device, otherwise false + */ isCharacterDevice: () => boolean; + + /** + * true when is symbolic link, otherwise false + */ isSymbolicLink: () => boolean; + + /** + * true when is FIFO, otherwise false + */ isFIFO: () => boolean; + + /** + * true when is socket, otherwise false + */ isSocket: () => boolean; + + /** + * name + */ name: string; + + /** + * path + */ path: string; } type EncodingOption = @@ -150,18 +231,45 @@ declare interface ExtensionAliasOptions { [index: string]: string | string[]; } declare interface FileSystem { + /** + * read file method + */ readFile: ReadFile; + + /** + * readdir method + */ readdir: Readdir; + + /** + * read json method + */ readJson?: ( - arg0: PathOrFileDescriptor, - arg1: ( - arg0: null | Error | NodeJS.ErrnoException, - arg1?: JsonObject - ) => void + pathOrFileDescription: PathOrFileDescriptor, + callback: ( + err: null | Error | NodeJS.ErrnoException, + result?: JsonObject, + ) => void, ) => void; + + /** + * read link method + */ readlink: Readlink; + + /** + * lstat method + */ lstat?: LStat; + + /** + * stat method + */ stat: Stat; + + /** + * realpath method + */ realpath?: RealPath; } type IBigIntStats = IStatsBase & { @@ -171,64 +279,262 @@ type IBigIntStats = IStatsBase & { birthtimeNs: bigint; }; declare interface IStats { + /** + * is file + */ isFile: () => boolean; + + /** + * is directory + */ isDirectory: () => boolean; + + /** + * is block device + */ isBlockDevice: () => boolean; + + /** + * is character device + */ isCharacterDevice: () => boolean; + + /** + * is symbolic link + */ isSymbolicLink: () => boolean; + + /** + * is FIFO + */ isFIFO: () => boolean; + + /** + * is socket + */ isSocket: () => boolean; + + /** + * dev + */ dev: number; + + /** + * ino + */ ino: number; + + /** + * mode + */ mode: number; + + /** + * nlink + */ nlink: number; + + /** + * uid + */ uid: number; + + /** + * gid + */ gid: number; + + /** + * rdev + */ rdev: number; + + /** + * size + */ size: number; + + /** + * blksize + */ blksize: number; + + /** + * blocks + */ blocks: number; + + /** + * atime ms + */ atimeMs: number; + + /** + * mtime ms + */ mtimeMs: number; + + /** + * ctime ms + */ ctimeMs: number; + + /** + * birthtime ms + */ birthtimeMs: number; + + /** + * atime + */ atime: Date; + + /** + * mtime + */ mtime: Date; + + /** + * ctime + */ ctime: Date; + + /** + * birthtime + */ birthtime: Date; } declare interface IStatsBase { + /** + * is file + */ isFile: () => boolean; + + /** + * is directory + */ isDirectory: () => boolean; + + /** + * is block device + */ isBlockDevice: () => boolean; + + /** + * is character device + */ isCharacterDevice: () => boolean; + + /** + * is symbolic link + */ isSymbolicLink: () => boolean; + + /** + * is FIFO + */ isFIFO: () => boolean; + + /** + * is socket + */ isSocket: () => boolean; + + /** + * dev + */ dev: T; + + /** + * ino + */ ino: T; + + /** + * mode + */ mode: T; + + /** + * nlink + */ nlink: T; + + /** + * uid + */ uid: T; + + /** + * gid + */ gid: T; + + /** + * rdev + */ rdev: T; + + /** + * size + */ size: T; + + /** + * blksize + */ blksize: T; + + /** + * blocks + */ blocks: T; + + /** + * atime ms + */ atimeMs: T; + + /** + * mtime ms + */ mtimeMs: T; + + /** + * ctime ms + */ ctimeMs: T; + + /** + * birthtime ms + */ birthtimeMs: T; + + /** + * atime + */ atime: Date; + + /** + * mtime + */ mtime: Date; + + /** + * ctime + */ ctime: Date; + + /** + * birthtime + */ birthtime: Date; } declare interface Iterator { ( item: T, callback: (err?: null | Error, result?: null | Z) => void, - i: number + i: number, ): void; } type JsonObject = { [index: string]: JsonValue } & { @@ -243,66 +549,84 @@ type JsonObject = { [index: string]: JsonValue } & { }; type JsonValue = null | string | number | boolean | JsonObject | JsonValue[]; declare interface KnownHooks { + /** + * resolve step hook + */ resolveStep: SyncHook< [ AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >, - ResolveRequest + ResolveRequest, ] >; + + /** + * no resolve hook + */ noResolve: SyncHook<[ResolveRequest, Error]>; + + /** + * resolve hook + */ resolve: AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >; + + /** + * result hook + */ result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>; } declare interface LStat { ( path: PathLike, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, ): void; ( path: PathLike, options: undefined | (StatOptions & { bigint?: false }), - callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, ): void; ( path: PathLike, options: StatOptions & { bigint: true }, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void + callback: ( + err: null | NodeJS.ErrnoException, + result?: IBigIntStats, + ) => void, ): void; ( path: PathLike, options: undefined | StatOptions, callback: ( - arg0: null | NodeJS.ErrnoException, - arg1?: IStats | IBigIntStats - ) => void + err: null | NodeJS.ErrnoException, + result?: IStats | IBigIntStats, + ) => void, ): void; } declare interface LStatSync { (path: PathLike, options?: undefined): IStats; ( path: PathLike, - options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false } + options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }, ): undefined | IStats; ( path: PathLike, - options: StatSyncOptions & { bigint: true; throwIfNoEntry: false } + options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }, ): undefined | IBigIntStats; (path: PathLike, options?: StatSyncOptions & { bigint?: false }): IStats; (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats; ( path: PathLike, - options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false } + options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }, ): IStats | IBigIntStats; - (path: PathLike, options?: StatSyncOptions): - | undefined - | IStats - | IBigIntStats; + ( + path: PathLike, + options?: StatSyncOptions, + ): undefined | IStats | IBigIntStats; } declare class LogInfoPlugin { constructor( @@ -311,7 +635,7 @@ declare class LogInfoPlugin { | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest - > + >, ); source: | string @@ -322,6 +646,9 @@ declare class LogInfoPlugin { apply(resolver: Resolver): void; } declare interface ObjectEncodingOptions { + /** + * encoding + */ encoding?: | null | "ascii" @@ -338,12 +665,39 @@ declare interface ObjectEncodingOptions { | "hex"; } declare interface ParsedIdentifier { + /** + * request + */ request: string; + + /** + * query + */ query: string; + + /** + * fragment + */ fragment: string; + + /** + * is directory + */ directory: boolean; + + /** + * is module + */ module: boolean; + + /** + * is file + */ file: boolean; + + /** + * is internal + */ internal: boolean; } type PathLike = string | Buffer | URL_url; @@ -354,13 +708,16 @@ type Plugin = | false | "" | 0 - | { apply: (arg0: Resolver) => void } - | ((this: Resolver, arg1: Resolver) => void); + | { apply: (this: Resolver, resolver: Resolver) => void } + | ((this: Resolver, resolver: Resolver) => void); declare interface PnpApi { + /** + * resolve to unqualified + */ resolveToUnqualified: ( - arg0: string, - arg1: string, - arg2: object + packageName: string, + issuer: string, + options: { considerBuiltins: boolean }, ) => null | string; } declare interface ReadFile { @@ -370,7 +727,7 @@ declare interface ReadFile { | undefined | null | ({ encoding?: null; flag?: string } & Abortable), - callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, ): void; ( path: PathOrFileDescriptor, @@ -388,7 +745,7 @@ declare interface ReadFile { | "latin1" | "binary" | "hex", - callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + callback: (err: null | NodeJS.ErrnoException, result?: string) => void, ): void; ( path: PathOrFileDescriptor, @@ -409,19 +766,19 @@ declare interface ReadFile { | "hex" | (ObjectEncodingOptions & { flag?: string } & Abortable), callback: ( - arg0: null | NodeJS.ErrnoException, - arg1?: string | Buffer - ) => void + err: null | NodeJS.ErrnoException, + result?: string | Buffer, + ) => void, ): void; ( path: PathOrFileDescriptor, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, ): void; } declare interface ReadFileSync { ( path: PathOrFileDescriptor, - options?: null | { encoding?: null; flag?: string } + options?: null | { encoding?: null; flag?: string }, ): Buffer; ( path: PathOrFileDescriptor, @@ -438,7 +795,7 @@ declare interface ReadFileSync { | "latin1" | "binary" | "hex" - | { encoding: BufferEncoding; flag?: string } + | { encoding: BufferEncoding; flag?: string }, ): string; ( path: PathOrFileDescriptor, @@ -456,7 +813,7 @@ declare interface ReadFileSync { | "latin1" | "binary" | "hex" - | (ObjectEncodingOptions & { flag?: string }) + | (ObjectEncodingOptions & { flag?: string }), ): string | Buffer; } declare interface Readdir { @@ -495,18 +852,18 @@ declare interface Readdir { withFileTypes?: false; recursive?: boolean; }, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void + callback: (err: null | NodeJS.ErrnoException, result?: string[]) => void, ): void; ( path: PathLike, options: | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean } | "buffer", - callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void + callback: (err: null | NodeJS.ErrnoException, result?: Buffer[]) => void, ): void; ( path: PathLike, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void + callback: (err: null | NodeJS.ErrnoException, result?: string[]) => void, ): void; ( path: PathLike, @@ -530,9 +887,9 @@ declare interface Readdir { recursive?: boolean; }), callback: ( - arg0: null | NodeJS.ErrnoException, - arg1?: string[] | Buffer[] - ) => void + err: null | NodeJS.ErrnoException, + result?: string[] | Buffer[], + ) => void, ): void; ( path: PathLike, @@ -540,7 +897,7 @@ declare interface Readdir { withFileTypes: true; recursive?: boolean; }, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void + callback: (err: null | NodeJS.ErrnoException, result?: Dirent[]) => void, ): void; } declare interface ReaddirSync { @@ -577,13 +934,13 @@ declare interface ReaddirSync { | "hex"; withFileTypes?: false; recursive?: boolean; - } + }, ): string[]; ( path: PathLike, options: | "buffer" - | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean } + | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean }, ): Buffer[]; ( path: PathLike, @@ -601,38 +958,41 @@ declare interface ReaddirSync { | "latin1" | "binary" | "hex" - | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean }) + | (ObjectEncodingOptions & { + withFileTypes?: false; + recursive?: boolean; + }), ): string[] | Buffer[]; ( path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true; recursive?: boolean; - } + }, ): Dirent[]; } declare interface Readlink { ( path: PathLike, options: EncodingOption, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + callback: (err: null | NodeJS.ErrnoException, result?: string) => void, ): void; ( path: PathLike, options: BufferEncodingOption, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, ): void; ( path: PathLike, options: EncodingOption, callback: ( - arg0: null | NodeJS.ErrnoException, - arg1?: string | Buffer - ) => void + err: null | NodeJS.ErrnoException, + result?: string | Buffer, + ) => void, ): void; ( path: PathLike, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + callback: (err: null | NodeJS.ErrnoException, result?: string) => void, ): void; } declare interface ReadlinkSync { @@ -644,24 +1004,24 @@ declare interface RealPath { ( path: PathLike, options: EncodingOption, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + callback: (err: null | NodeJS.ErrnoException, result?: string) => void, ): void; ( path: PathLike, options: BufferEncodingOption, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, ): void; ( path: PathLike, options: EncodingOption, callback: ( - arg0: null | NodeJS.ErrnoException, - arg1?: string | Buffer - ) => void + err: null | NodeJS.ErrnoException, + result?: string | Buffer, + ) => void, ): void; ( path: PathLike, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + callback: (err: null | NodeJS.ErrnoException, result?: string) => void, ): void; } declare interface RealPathSync { @@ -670,6 +1030,9 @@ declare interface RealPathSync { (path: PathLike, options?: EncodingOption): string | Buffer; } declare interface ResolveContext { + /** + * directories that was found on file system + */ contextDependencies?: WriteOnlySet; /** @@ -690,12 +1053,12 @@ declare interface ResolveContext { /** * log function */ - log?: (arg0: string) => void; + log?: (str: string) => void; /** * yield result, if provided plugins can return several results */ - yield?: (arg0: ResolveRequest) => void; + yield?: (request: ResolveRequest) => void; } declare interface ResolveFunction { (context: object, path: string, request: string): string | false; @@ -710,8 +1073,8 @@ declare interface ResolveFunctionAsync { callback: ( err: null | ErrorWithDetail, res?: string | false, - req?: ResolveRequest - ) => void + req?: ResolveRequest, + ) => void, ): void; ( context: object, @@ -720,8 +1083,8 @@ declare interface ResolveFunctionAsync { callback: ( err: null | ErrorWithDetail, res?: string | false, - req?: ResolveRequest - ) => void + req?: ResolveRequest, + ) => void, ): void; ( path: string, @@ -730,8 +1093,8 @@ declare interface ResolveFunctionAsync { callback: ( err: null | ErrorWithDetail, res?: string | false, - req?: ResolveRequest - ) => void + req?: ResolveRequest, + ) => void, ): void; ( path: string, @@ -739,8 +1102,8 @@ declare interface ResolveFunctionAsync { callback: ( err: null | ErrorWithDetail, res?: string | false, - req?: ResolveRequest - ) => void + req?: ResolveRequest, + ) => void, ): void; } type ResolveOptionsOptionalFS = Omit< @@ -749,36 +1112,139 @@ type ResolveOptionsOptionalFS = Omit< > & Partial>; declare interface ResolveOptionsResolverFactoryObject_1 { + /** + * alias + */ alias: AliasOption[]; + + /** + * fallback + */ fallback: AliasOption[]; + + /** + * alias fields + */ aliasFields: Set; + + /** + * extension alias + */ extensionAlias: ExtensionAliasOption[]; - cachePredicate: (arg0: ResolveRequest) => boolean; + + /** + * cache predicate + */ + cachePredicate: (predicate: ResolveRequest) => boolean; + + /** + * cache with context + */ cacheWithContext: boolean; /** * A list of exports field condition names. */ conditionNames: Set; + + /** + * description files + */ descriptionFiles: string[]; + + /** + * enforce extension + */ enforceExtension: boolean; + + /** + * exports fields + */ exportsFields: Set; + + /** + * imports fields + */ importsFields: Set; + + /** + * extensions + */ extensions: Set; + + /** + * fileSystem + */ fileSystem: FileSystem; - unsafeCache: false | object; + + /** + * unsafe cache + */ + unsafeCache: false | Cache; + + /** + * symlinks + */ symlinks: boolean; + + /** + * resolver + */ resolver?: Resolver; + + /** + * modules + */ modules: (string | string[])[]; + + /** + * main fields + */ mainFields: { name: string[]; forceRelative: boolean }[]; + + /** + * main files + */ mainFiles: Set; + + /** + * plugins + */ plugins: Plugin[]; + + /** + * pnp API + */ pnpApi: null | PnpApi; + + /** + * roots + */ roots: Set; + + /** + * fully specified + */ fullySpecified: boolean; + + /** + * resolve to context + */ resolveToContext: boolean; + + /** + * restrictions + */ restrictions: Set; + + /** + * prefer relative + */ preferRelative: boolean; + + /** + * prefer absolute + */ preferAbsolute: boolean; } declare interface ResolveOptionsResolverFactoryObject_2 { @@ -805,7 +1271,7 @@ declare interface ResolveOptionsResolverFactoryObject_2 { /** * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. */ - cachePredicate?: (arg0: ResolveRequest) => boolean; + cachePredicate?: (predicate: ResolveRequest) => boolean; /** * Whether or not the unsafeCache should include request context as part of the cache key. @@ -850,7 +1316,7 @@ declare interface ResolveOptionsResolverFactoryObject_2 { /** * Use this cache object to unsafely cache the successful requests */ - unsafeCache?: boolean | object; + unsafeCache?: boolean | Cache; /** * Resolve symlinks to their symlinked location @@ -937,7 +1403,7 @@ declare abstract class Resolver { | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest - > + >, ): AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest @@ -948,7 +1414,7 @@ declare abstract class Resolver { | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest - > + >, ): AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest @@ -962,8 +1428,8 @@ declare abstract class Resolver { callback: ( err: null | ErrorWithDetail, res?: string | false, - req?: ResolveRequest - ) => void + req?: ResolveRequest, + ) => void, ): void; doResolve( hook: AsyncSeriesBailHook< @@ -973,7 +1439,7 @@ declare abstract class Resolver { request: ResolveRequest, message: null | string, resolveContext: ResolveContext, - callback: (err?: null | Error, result?: ResolveRequest) => void + callback: (err?: null | Error, result?: ResolveRequest) => void, ): void; parse(identifier: string): ParsedIdentifier; isModule(path: string): boolean; @@ -985,62 +1451,102 @@ declare abstract class Resolver { declare interface Stat { ( path: PathLike, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, ): void; ( path: PathLike, options: undefined | (StatOptions & { bigint?: false }), - callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, ): void; ( path: PathLike, options: StatOptions & { bigint: true }, - callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void + callback: ( + err: null | NodeJS.ErrnoException, + result?: IBigIntStats, + ) => void, ): void; ( path: PathLike, options: undefined | StatOptions, callback: ( - arg0: null | NodeJS.ErrnoException, - arg1?: IStats | IBigIntStats - ) => void + err: null | NodeJS.ErrnoException, + result?: IStats | IBigIntStats, + ) => void, ): void; } declare interface StatOptions { + /** + * need bigint values + */ bigint?: boolean; } declare interface StatSync { (path: PathLike, options?: undefined): IStats; ( path: PathLike, - options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false } + options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }, ): undefined | IStats; ( path: PathLike, - options: StatSyncOptions & { bigint: true; throwIfNoEntry: false } + options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }, ): undefined | IBigIntStats; (path: PathLike, options?: StatSyncOptions & { bigint?: false }): IStats; (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats; ( path: PathLike, - options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false } + options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }, ): IStats | IBigIntStats; - (path: PathLike, options?: StatSyncOptions): - | undefined - | IStats - | IBigIntStats; + ( + path: PathLike, + options?: StatSyncOptions, + ): undefined | IStats | IBigIntStats; } declare interface StatSyncOptions { + /** + * need bigint values + */ bigint?: boolean; + + /** + * throw if no entry + */ throwIfNoEntry?: boolean; } declare interface SyncFileSystem { + /** + * read file sync method + */ readFileSync: ReadFileSync; + + /** + * read dir sync method + */ readdirSync: ReaddirSync; - readJsonSync?: (arg0: PathOrFileDescriptor) => JsonObject; + + /** + * read json sync method + */ + readJsonSync?: (pathOrFileDescription: PathOrFileDescriptor) => JsonObject; + + /** + * read link sync method + */ readlinkSync: ReadlinkSync; + + /** + * lstat sync method + */ lstatSync?: LStatSync; + + /** + * stat sync method + */ statSync: StatSync; + + /** + * real path sync method + */ realpathSync?: RealPathSync; } @@ -1060,8 +1566,8 @@ declare function exports( callback: ( err: null | ErrorWithDetail, res?: string | false, - req?: ResolveRequest - ) => void + req?: ResolveRequest, + ) => void, ): void; declare function exports( context: object, @@ -1070,8 +1576,8 @@ declare function exports( callback: ( err: null | ErrorWithDetail, res?: string | false, - req?: ResolveRequest - ) => void + req?: ResolveRequest, + ) => void, ): void; declare function exports( path: string, @@ -1080,8 +1586,8 @@ declare function exports( callback: ( err: null | ErrorWithDetail, res?: string | false, - req?: ResolveRequest - ) => void + req?: ResolveRequest, + ) => void, ): void; declare function exports( path: string, @@ -1089,31 +1595,31 @@ declare function exports( callback: ( err: null | ErrorWithDetail, res?: string | false, - req?: ResolveRequest - ) => void + req?: ResolveRequest, + ) => void, ): void; declare namespace exports { export const sync: ResolveFunction; export function create( - options: ResolveOptionsOptionalFS + options: ResolveOptionsOptionalFS, ): ResolveFunctionAsync; export namespace create { export const sync: (options: ResolveOptionsOptionalFS) => ResolveFunction; } export namespace ResolverFactory { export let createResolver: ( - options: ResolveOptionsResolverFactoryObject_2 + options: ResolveOptionsResolverFactoryObject_2, ) => Resolver; } export const forEachBail: ( array: T[], iterator: Iterator, - callback: (err?: null | Error, result?: null | Z, i?: number) => void + callback: (err?: null | Error, result?: null | Z, i?: number) => void, ) => void; export type ResolveCallback = ( err: null | ErrorWithDetail, res?: string | false, - req?: ResolveRequest + req?: ResolveRequest, ) => void; export { CachedInputFileSystem, @@ -1130,7 +1636,7 @@ declare namespace exports { Plugin, ResolveOptionsResolverFactoryObject_2 as ResolveOptions, ResolveFunctionAsync, - ResolveFunction + ResolveFunction, }; } diff --git a/yarn.lock b/yarn.lock index 234459e1..01f3197a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20,13 +20,6 @@ call-me-maybe "^1.0.1" js-yaml "^4.1.0" -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.21.4": version "7.21.4" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.21.4.tgz#d0fa9e4413aca81f2b23b9442797bda1826edb39" @@ -191,6 +184,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== +"@babel/helper-validator-identifier@^7.25.9": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8" + integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow== + "@babel/helper-validator-option@^7.21.0": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" @@ -205,7 +203,7 @@ "@babel/traverse" "^7.21.5" "@babel/types" "^7.21.5" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.18.6": +"@babel/highlight@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== @@ -546,34 +544,138 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-typescript/-/dict-typescript-1.0.20.tgz#2a28bb94a06490b25bbb9180b875d6f16ebb8400" integrity sha512-yIuGeeZtQA2gqpGefGjZqBl8iGJpIYWz0QzDqsscNi2qfSnLsbjM0RkRbTehM8y9gGGe7xfgUP5adxceJa5Krg== -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== +"@es-joy/jsdoccomment@~0.50.2": + version "0.50.2" + resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.50.2.tgz#707768f0cb62abe0703d51aa9086986d230a5d5c" + integrity sha512-YAdE/IJSpwbOTiaURNCKECdAwqrJuFiZhylmesBcIRawtYKnBR2wxPhoIewMg+Yu+QuYvHfJNReWpoxGBKOChA== + dependencies: + "@types/estree" "^1.0.6" + "@typescript-eslint/types" "^8.11.0" + comment-parser "1.4.1" + esquery "^1.6.0" + jsdoc-type-pratt-parser "~4.1.0" + +"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.5.0", "@eslint-community/eslint-utils@^4.5.1", "@eslint-community/eslint-utils@^4.7.0": + version "4.7.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz#607084630c6c033992a082de6e6fbc1a8b52175a" + integrity sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw== + dependencies: + eslint-visitor-keys "^3.4.3" + +"@eslint-community/regexpp@^4.11.0", "@eslint-community/regexpp@^4.12.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" + integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== + +"@eslint/config-array@^0.20.0": + version "0.20.0" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.20.0.tgz#7a1232e82376712d3340012a2f561a2764d1988f" + integrity sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ== + dependencies: + "@eslint/object-schema" "^2.1.6" + debug "^4.3.1" + minimatch "^3.1.2" + +"@eslint/config-helpers@^0.2.1": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.2.2.tgz#3779f76b894de3a8ec4763b79660e6d54d5b1010" + integrity sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg== + +"@eslint/core@^0.13.0": + version "0.13.0" + resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.13.0.tgz#bf02f209846d3bf996f9e8009db62df2739b458c" + integrity sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw== + dependencies: + "@types/json-schema" "^7.0.15" + +"@eslint/core@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.14.0.tgz#326289380968eaf7e96f364e1e4cf8f3adf2d003" + integrity sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg== + dependencies: + "@types/json-schema" "^7.0.15" + +"@eslint/eslintrc@^3.3.1": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.3.1.tgz#e55f7f1dd400600dd066dbba349c4c0bac916964" + integrity sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ== dependencies: ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" - globals "^13.9.0" - ignore "^4.0.6" + debug "^4.3.2" + espree "^10.0.1" + globals "^14.0.0" + ignore "^5.2.0" import-fresh "^3.2.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" + js-yaml "^4.1.0" + minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== +"@eslint/js@9.28.0", "@eslint/js@>= 9.28.0": + version "9.28.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.28.0.tgz#7822ccc2f8cae7c3cd4f902377d520e9ae03f844" + integrity sha512-fnqSjGWd/CoIp4EXIxWVK/sHA6DOHN4+8Ix2cX5ycOY7LG0UY8nHCU5pIp2eaE1Mc7Qd8kHspYNzYXT2ojPLzg== + +"@eslint/markdown@>= 6.5.0": + version "6.5.0" + resolved "https://registry.yarnpkg.com/@eslint/markdown/-/markdown-6.5.0.tgz#7574b190f77ed60219b17cf87355c5f42c0cd826" + integrity sha512-oSkF0p8X21vKEEAGTZASi7q3tbdTvlGduQ02Xz2A1AFncUP4RLVcNz27XurxVW4fs1JXuh0xBtvokXdtp/nN+Q== + dependencies: + "@eslint/core" "^0.14.0" + "@eslint/plugin-kit" "^0.3.1" + mdast-util-from-markdown "^2.0.2" + mdast-util-frontmatter "^2.0.1" + mdast-util-gfm "^3.0.0" + micromark-extension-frontmatter "^2.0.0" + micromark-extension-gfm "^3.0.0" + +"@eslint/object-schema@^2.1.6": + version "2.1.6" + resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.6.tgz#58369ab5b5b3ca117880c0f6c0b0f32f6950f24f" + integrity sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA== + +"@eslint/plugin-kit@^0.2.7": + version "0.2.8" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz#47488d8f8171b5d4613e833313f3ce708e3525f8" + integrity sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA== + dependencies: + "@eslint/core" "^0.13.0" + levn "^0.4.1" + +"@eslint/plugin-kit@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.3.1.tgz#b71b037b2d4d68396df04a8c35a49481e5593067" + integrity sha512-0J+zgWxHN+xXONWIyPWKFMgVuJoZuGiIFu8yxk7RJjxkzpGmyja5wRFqZIVtjDVOQpV+Rw0iOAjYPE2eQyjr0w== dependencies: - "@humanwhocodes/object-schema" "^1.2.0" - debug "^4.1.1" - minimatch "^3.0.4" + "@eslint/core" "^0.14.0" + levn "^0.4.1" -"@humanwhocodes/object-schema@^1.2.0": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" - integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@humanfs/core@^0.19.1": + version "0.19.1" + resolved "https://registry.yarnpkg.com/@humanfs/core/-/core-0.19.1.tgz#17c55ca7d426733fe3c561906b8173c336b40a77" + integrity sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA== + +"@humanfs/node@^0.16.6": + version "0.16.6" + resolved "https://registry.yarnpkg.com/@humanfs/node/-/node-0.16.6.tgz#ee2a10eaabd1131987bf0488fd9b820174cd765e" + integrity sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw== + dependencies: + "@humanfs/core" "^0.19.1" + "@humanwhocodes/retry" "^0.3.0" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/retry@^0.3.0": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.1.tgz#c72a5c76a9fbaf3488e231b13dc52c0da7bab42a" + integrity sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA== + +"@humanwhocodes/retry@^0.4.2": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.3.tgz#c2b9d2e374ee62c586d3adbea87199b1d7a7a6ba" + integrity sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -810,6 +912,37 @@ resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@pkgr/core@^0.2.4": + version "0.2.7" + resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.7.tgz#eb5014dfd0b03e7f3ba2eeeff506eed89b028058" + integrity sha512-YLT9Zo3oNPJoBjBc4q8G2mjU4tqIbf5CEOORbUUr48dCD9q3umJ3IPlVqOqDakPfd2HuwccBaqlGhN4Gmr5OWg== + +"@rtsao/scc@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" + integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== + "@sinonjs/commons@^1.7.0": version "1.8.6" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" @@ -824,6 +957,17 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@stylistic/eslint-plugin@>= 4.4.1": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@stylistic/eslint-plugin/-/eslint-plugin-4.4.1.tgz#410ac332887fb3d61cad1df4e6b55ae35d87c632" + integrity sha512-CEigAk7eOLyHvdgmpZsKFwtiqS2wFwI1fn4j09IU9GmD4euFM4jEBAViWeCqaNLlbX2k2+A/Fq9cje4HQBXuJQ== + dependencies: + "@typescript-eslint/utils" "^8.32.1" + eslint-visitor-keys "^4.2.0" + espree "^10.3.0" + estraverse "^5.3.0" + picomatch "^4.0.2" + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -862,6 +1006,18 @@ dependencies: "@babel/types" "^7.3.0" +"@types/debug@^4.0.0": + version "4.1.12" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917" + integrity sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ== + dependencies: + "@types/ms" "*" + +"@types/estree@^1.0.6": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" + integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== + "@types/graceful-fs@^4.1.2", "@types/graceful-fs@^4.1.6": version "4.1.6" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" @@ -896,11 +1052,33 @@ jest-matcher-utils "^27.0.0" pretty-format "^27.0.0" +"@types/json-schema@^7.0.15": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.6": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + +"@types/mdast@^4.0.0": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.4.tgz#7ccf72edd2f1aa7dd3437e180c64373585804dd6" + integrity sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA== + dependencies: + "@types/unist" "*" + +"@types/ms@*": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@types/ms/-/ms-2.1.0.tgz#052aa67a48eccc4309d7f0191b7e41434b90bb78" + integrity sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA== + "@types/node@*": version "20.1.7" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.1.7.tgz#ce10c802f7731909d0a44ac9888e8b3a9125eb62" @@ -928,6 +1106,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== +"@types/unist@*", "@types/unist@^3.0.0": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.3.tgz#acaab0f919ce69cce629c2d4ed2eb4adc1b6c20c" + integrity sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q== + "@types/yargs-parser@*": version "21.0.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" @@ -940,6 +1123,67 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/project-service@8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.34.0.tgz#449119b72fe9fae185013a6bdbaf1ffbfee6bcaf" + integrity sha512-iEgDALRf970/B2YExmtPMPF54NenZUf4xpL3wsCRx/lgjz6ul/l13R81ozP/ZNuXfnLCS+oPmG7JIxfdNYKELw== + dependencies: + "@typescript-eslint/tsconfig-utils" "^8.34.0" + "@typescript-eslint/types" "^8.34.0" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.34.0.tgz#9fedaec02370cf79c018a656ab402eb00dc69e67" + integrity sha512-9Ac0X8WiLykl0aj1oYQNcLZjHgBojT6cW68yAgZ19letYu+Hxd0rE0veI1XznSSst1X5lwnxhPbVdwjDRIomRw== + dependencies: + "@typescript-eslint/types" "8.34.0" + "@typescript-eslint/visitor-keys" "8.34.0" + +"@typescript-eslint/tsconfig-utils@8.34.0", "@typescript-eslint/tsconfig-utils@^8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.34.0.tgz#97d0a24e89a355e9308cebc8e23f255669bf0979" + integrity sha512-+W9VYHKFIzA5cBeooqQxqNriAP0QeQ7xTiDuIOr71hzgffm3EL2hxwWBIIj4GuofIbKxGNarpKqIq6Q6YrShOA== + +"@typescript-eslint/types@8.34.0", "@typescript-eslint/types@^8.11.0", "@typescript-eslint/types@^8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.34.0.tgz#18000f205c59c9aff7f371fc5426b764cf2890fb" + integrity sha512-9V24k/paICYPniajHfJ4cuAWETnt7Ssy+R0Rbcqo5sSFr3QEZ/8TSoUi9XeXVBGXCaLtwTOKSLGcInCAvyZeMA== + +"@typescript-eslint/typescript-estree@8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.34.0.tgz#c9f3feec511339ef64e9e4884516c3e558f1b048" + integrity sha512-rOi4KZxI7E0+BMqG7emPSK1bB4RICCpF7QD3KCLXn9ZvWoESsOMlHyZPAHyG04ujVplPaHbmEvs34m+wjgtVtg== + dependencies: + "@typescript-eslint/project-service" "8.34.0" + "@typescript-eslint/tsconfig-utils" "8.34.0" + "@typescript-eslint/types" "8.34.0" + "@typescript-eslint/visitor-keys" "8.34.0" + debug "^4.3.4" + fast-glob "^3.3.2" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^2.1.0" + +"@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/utils@^8.26.1", "@typescript-eslint/utils@^8.32.1": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.34.0.tgz#7844beebc1153b4d3ec34135c2da53a91e076f8d" + integrity sha512-8L4tWatGchV9A1cKbjaavS6mwYwp39jql8xUmIIKJdm+qiaeHy5KMKlBrf30akXAWBzn2SqKsNOtSENWUwg7XQ== + dependencies: + "@eslint-community/eslint-utils" "^4.7.0" + "@typescript-eslint/scope-manager" "8.34.0" + "@typescript-eslint/types" "8.34.0" + "@typescript-eslint/typescript-estree" "8.34.0" + +"@typescript-eslint/visitor-keys@8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.34.0.tgz#c7a149407be31d755dba71980617d638a40ac099" + integrity sha512-qHV7pW7E85A0x6qyrFn+O+q1k1p3tQCsqIZ1KZ5ESLXY57aTvUd3/a4rdPTeXisvhXn2VQG0VSKUqs8KHF2zcA== + dependencies: + "@typescript-eslint/types" "8.34.0" + eslint-visitor-keys "^4.2.0" + "@yarnpkg/lockfile@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" @@ -958,7 +1202,7 @@ acorn-globals@^6.0.0: acorn "^7.1.1" acorn-walk "^7.1.1" -acorn-jsx@^5.3.1: +acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== @@ -968,7 +1212,7 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn@^7.1.1, acorn@^7.4.0: +acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== @@ -978,6 +1222,11 @@ acorn@^8.14.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.1.tgz#721d5dc10f7d5b5609a891773d47731796935dfb" integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg== +acorn@^8.15.0: + version "8.15.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816" + integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== + acorn@^8.2.4: version "8.8.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" @@ -998,7 +1247,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^6.10.0, ajv@^6.12.4: +ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1008,7 +1257,7 @@ ajv@^6.10.0, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.1, ajv@^8.1.0: +ajv@^8.1.0: version "8.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== @@ -1067,6 +1316,11 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" +are-docs-informative@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/are-docs-informative/-/are-docs-informative-0.0.2.tgz#387f0e93f5d45280373d387a59d34c96db321963" + integrity sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1079,16 +1333,89 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +array-buffer-byte-length@^1.0.1, array-buffer-byte-length@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz#384d12a37295aec3769ab022ad323a18a51ccf8b" + integrity sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw== + dependencies: + call-bound "^1.0.3" + is-array-buffer "^3.0.5" + +array-includes@^3.1.8: + version "3.1.9" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.9.tgz#1f0ccaa08e90cdbc3eb433210f903ad0f17c3f3a" + integrity sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.4" + define-properties "^1.2.1" + es-abstract "^1.24.0" + es-object-atoms "^1.1.1" + get-intrinsic "^1.3.0" + is-string "^1.1.1" + math-intrinsics "^1.1.0" + array-timsort@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/array-timsort/-/array-timsort-1.0.3.tgz#3c9e4199e54fb2b9c3fe5976396a21614ef0d926" integrity sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ== +array.prototype.findlastindex@^1.2.5: + version "1.2.6" + resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz#cfa1065c81dcb64e34557c9b81d012f6a421c564" + integrity sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.4" + define-properties "^1.2.1" + es-abstract "^1.23.9" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + es-shim-unscopables "^1.1.0" + +array.prototype.flat@^1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz#534aaf9e6e8dd79fb6b9a9917f839ef1ec63afe5" + integrity sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg== + dependencies: + call-bind "^1.0.8" + define-properties "^1.2.1" + es-abstract "^1.23.5" + es-shim-unscopables "^1.0.2" + +array.prototype.flatmap@^1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz#712cc792ae70370ae40586264629e33aab5dd38b" + integrity sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg== + dependencies: + call-bind "^1.0.8" + define-properties "^1.2.1" + es-abstract "^1.23.5" + es-shim-unscopables "^1.0.2" + +arraybuffer.prototype.slice@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz#9d760d84dbdd06d0cbf92c8849615a1a7ab3183c" + integrity sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ== + dependencies: + array-buffer-byte-length "^1.0.1" + call-bind "^1.0.8" + define-properties "^1.2.1" + es-abstract "^1.23.5" + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + is-array-buffer "^3.0.4" + astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +async-function@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-function/-/async-function-1.0.0.tgz#509c9fca60eaf85034c6829838188e4e4c8ffb2b" + integrity sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA== + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1099,6 +1426,13 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== +available-typed-arrays@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" + integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== + dependencies: + possible-typed-array-names "^1.0.0" + babel-jest@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" @@ -1173,6 +1507,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" @@ -1195,6 +1536,16 @@ browserslist@^4.21.3: node-releases "^2.0.8" update-browserslist-db "^1.0.10" +browserslist@^4.25.0: + version "4.25.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.25.0.tgz#986aa9c6d87916885da2b50d8eb577ac8d133b2c" + integrity sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA== + dependencies: + caniuse-lite "^1.0.30001718" + electron-to-chromium "^1.5.160" + node-releases "^2.0.19" + update-browserslist-db "^1.1.3" + bser@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -1207,6 +1558,37 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +builtin-modules@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-5.0.0.tgz#9be95686dedad2e9eed05592b07733db87dcff1a" + integrity sha512-bkXY9WsVpY7CvMhKSR6pZilZu9Ln5WDrKVBUXf2S443etkmEO4V58heTecXcUIsNsi4Rx8JUO4NfX1IcQl4deg== + +call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + +call-bind@^1.0.7, call-bind@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" + integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== + dependencies: + call-bind-apply-helpers "^1.0.0" + es-define-property "^1.0.0" + get-intrinsic "^1.2.4" + set-function-length "^1.2.2" + +call-bound@^1.0.2, call-bound@^1.0.3, call-bound@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" + integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== + dependencies: + call-bind-apply-helpers "^1.0.2" + get-intrinsic "^1.3.0" + call-me-maybe@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa" @@ -1232,6 +1614,16 @@ caniuse-lite@^1.0.30001449: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001488.tgz#d19d7b6e913afae3e98f023db97c19e9ddc5e91f" integrity sha512-NORIQuuL4xGpIy6iCCQGN4iFjlBXtfKWIenlUuyZJumLRIindLb7wXM+GO8erEhb7vXfcnf4BAg2PrSDN5TNLQ== +caniuse-lite@^1.0.30001718: + version "1.0.30001721" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001721.tgz#36b90cd96901f8c98dd6698bf5c8af7d4c6872d7" + integrity sha512-cOuvmUVtKrtEaoKiO0rSc29jcjwMwX5tOHDy4MgVFEWiUXj4uBMJkwI8MDySkgXidpMiHUcviogAvFi4pA2hDQ== + +ccount@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" + integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== + chalk@^2.0.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -1254,16 +1646,33 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== +character-entities@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.2.tgz#2d09c2e72cd9523076ccb21157dff66ad43fcc22" + integrity sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ== + ci-info@^3.2.0: version "3.8.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== +ci-info@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-4.2.0.tgz#cbd21386152ebfe1d56f280a3b5feccbd96764c7" + integrity sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg== + cjs-module-lexer@^1.0.0: version "1.2.2" resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== +clean-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clean-regexp/-/clean-regexp-1.0.0.tgz#8df7c7aae51fd36874e8f8d05b9180bc11a3fed7" + integrity sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw== + dependencies: + escape-string-regexp "^1.0.5" + clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" @@ -1376,10 +1785,10 @@ comment-json@^4.0.6, comment-json@^4.1.0: has-own-prop "^2.0.0" repeat-string "^1.6.1" -comment-parser@^0.7.6: - version "0.7.6" - resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-0.7.6.tgz#0e743a53c8e646c899a1323db31f6cd337b10f12" - integrity sha512-GKNxVA7/iuTnAqGADlTWX4tkhzxZKXp5fLJqKTlQLHkE65XDUKutZ3BHaJC5IGcper2tT3QRD1xr4o3jNpgXXg== +comment-parser@1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-1.4.1.tgz#bdafead37961ac079be11eb7ec65c4d021eaf9cc" + integrity sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg== commondir@^1.0.1: version "1.0.1" @@ -1408,6 +1817,13 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== +core-js-compat@^3.41.0: + version "3.43.0" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.43.0.tgz#055587369c458795ef316f65e0aabb808fb15840" + integrity sha512-2GML2ZsCc5LR7hZYz4AXmjQw8zuy2T//2QntwdnpuYI7jteT6GVYJL7F6C2C57R7gSYrcqVW3lAALefdbhBLDA== + dependencies: + browserslist "^4.25.0" + core-util-is@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" @@ -1424,7 +1840,7 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.3, cross-spawn@^7.0.6: version "7.0.6" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== @@ -1565,18 +1981,66 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1: +data-view-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.2.tgz#211a03ba95ecaf7798a8c7198d79536211f88570" + integrity sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + is-data-view "^1.0.2" + +data-view-byte-length@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz#9e80f7ca52453ce3e93d25a35318767ea7704735" + integrity sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + is-data-view "^1.0.2" + +data-view-byte-offset@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz#068307f9b71ab76dbbe10291389e020856606191" + integrity sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + is-data-view "^1.0.1" + +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +debug@^4.0.0, debug@^4.3.2, debug@^4.3.4, debug@^4.4.1: + version "4.4.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.1.tgz#e5a8bc6cbc4c6cd3e64308b0693a3d4fa550189b" + integrity sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ== + dependencies: + ms "^2.1.3" + decimal.js@^10.2.1: version "10.4.3" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== +decode-named-character-reference@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/decode-named-character-reference/-/decode-named-character-reference-1.1.0.tgz#5d6ce68792808901210dac42a8e9853511e2b8bf" + integrity sha512-Wy+JTSbFThEOXQIR2L6mxJvEs+veIzpmqD7ynWxMXGpnk3smkHQOp6forLdHsKpAMW9iJpaBBIxz285t1n1C3w== + dependencies: + character-entities "^2.0.0" + dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" @@ -1592,25 +2056,55 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== +define-data-property@^1.0.1, define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + +define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== +dequal@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" + integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== + detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== +devlop@^1.0.0, devlop@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/devlop/-/devlop-1.1.0.tgz#4db7c2ca4dc6e0e834c30be70c94bbc976dc7018" + integrity sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA== + dependencies: + dequal "^2.0.0" + diff-sequences@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== dependencies: esutils "^2.0.2" @@ -1628,11 +2122,25 @@ dot-prop@^5.2.0: dependencies: is-obj "^2.0.0" +dunder-proto@^1.0.0, dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + electron-to-chromium@^1.4.284: version "1.4.397" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.397.tgz#82a7e26c657538d59bb713b97ac22f97ea3a90ea" integrity sha512-jwnPxhh350Q/aMatQia31KAIQdhEsYS0fFZ0BQQlN9tfvOEwShu6ZNwI4kL/xBabjcB/nTy6lSt17kNIluJZ8Q== +electron-to-chromium@^1.5.160: + version "1.5.166" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.166.tgz#3fff386ed473cc2169dbe2d3ace9592262601114" + integrity sha512-QPWqHL0BglzPYyJJ1zSSmwFFL6MFXhbACOCcsCdUMCkzPdS9/OIBVxg516X/Ado2qwAq8k0nJJ7phQPCqiaFAw== + emittery@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" @@ -1650,7 +2158,15 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enquirer@^2.3.5, enquirer@^2.3.6: +enhanced-resolve@^5.17.1: + version "5.18.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz#728ab082f8b7b6836de51f1637aab5d3b9568faf" + integrity sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + +enquirer@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== @@ -1664,6 +2180,109 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-abstract@^1.23.2, es-abstract@^1.23.5, es-abstract@^1.23.9, es-abstract@^1.24.0: + version "1.24.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.24.0.tgz#c44732d2beb0acc1ed60df840869e3106e7af328" + integrity sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg== + dependencies: + array-buffer-byte-length "^1.0.2" + arraybuffer.prototype.slice "^1.0.4" + available-typed-arrays "^1.0.7" + call-bind "^1.0.8" + call-bound "^1.0.4" + data-view-buffer "^1.0.2" + data-view-byte-length "^1.0.2" + data-view-byte-offset "^1.0.1" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + es-set-tostringtag "^2.1.0" + es-to-primitive "^1.3.0" + function.prototype.name "^1.1.8" + get-intrinsic "^1.3.0" + get-proto "^1.0.1" + get-symbol-description "^1.1.0" + globalthis "^1.0.4" + gopd "^1.2.0" + has-property-descriptors "^1.0.2" + has-proto "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + internal-slot "^1.1.0" + is-array-buffer "^3.0.5" + is-callable "^1.2.7" + is-data-view "^1.0.2" + is-negative-zero "^2.0.3" + is-regex "^1.2.1" + is-set "^2.0.3" + is-shared-array-buffer "^1.0.4" + is-string "^1.1.1" + is-typed-array "^1.1.15" + is-weakref "^1.1.1" + math-intrinsics "^1.1.0" + object-inspect "^1.13.4" + object-keys "^1.1.1" + object.assign "^4.1.7" + own-keys "^1.0.1" + regexp.prototype.flags "^1.5.4" + safe-array-concat "^1.1.3" + safe-push-apply "^1.0.0" + safe-regex-test "^1.1.0" + set-proto "^1.0.0" + stop-iteration-iterator "^1.1.0" + string.prototype.trim "^1.2.10" + string.prototype.trimend "^1.0.9" + string.prototype.trimstart "^1.0.8" + typed-array-buffer "^1.0.3" + typed-array-byte-length "^1.0.3" + typed-array-byte-offset "^1.0.4" + typed-array-length "^1.0.7" + unbox-primitive "^1.1.0" + which-typed-array "^1.1.19" + +es-define-property@^1.0.0, es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + +es-shim-unscopables@^1.0.2, es-shim-unscopables@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz#438df35520dac5d105f3943d927549ea3b00f4b5" + integrity sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw== + dependencies: + hasown "^2.0.2" + +es-to-primitive@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.3.0.tgz#96c89c82cc49fd8794a24835ba3e1ff87f214e18" + integrity sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g== + dependencies: + is-callable "^1.2.7" + is-date-object "^1.0.5" + is-symbol "^1.0.4" + es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@^0.10.61, es5-ext@^0.10.62, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: version "0.10.63" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.63.tgz#9c222a63b6a332ac80b1e373b426af723b895bd6" @@ -1706,6 +2325,11 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1721,6 +2345,11 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +escape-string-regexp@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" + integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== + escodegen@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" @@ -1733,123 +2362,203 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -eslint-config-prettier@^6.11.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9" - integrity sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw== - dependencies: - get-stdin "^6.0.0" - -eslint-plugin-es@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz#75a7cdfdccddc0589934aeeb384175f221c57893" - integrity sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ== +eslint-compat-utils@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz#7fc92b776d185a70c4070d03fd26fde3d59652e4" + integrity sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q== dependencies: - eslint-utils "^2.0.0" - regexpp "^3.0.0" + semver "^7.5.4" -eslint-plugin-jsdoc@^30.5.1: - version "30.7.13" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.7.13.tgz#52e5c74fb806d3bbeb51d04a0c829508c3c6b563" - integrity sha512-YM4WIsmurrp0rHX6XiXQppqKB8Ne5ATiZLJe2+/fkp9l9ExXFr43BbAbjZaVrpCT+tuPYOZ8k1MICARHnURUNQ== - dependencies: - comment-parser "^0.7.6" - debug "^4.3.1" - jsdoctypeparser "^9.0.0" - lodash "^4.17.20" - regextras "^0.7.1" - semver "^7.3.4" - spdx-expression-parse "^3.0.1" - -eslint-plugin-node@^11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" - integrity sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g== - dependencies: - eslint-plugin-es "^3.0.0" - eslint-utils "^2.0.0" - ignore "^5.1.1" - minimatch "^3.0.4" - resolve "^1.10.1" - semver "^6.1.0" +eslint-config-prettier@^10.1.5: + version "10.1.5" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz#00c18d7225043b6fbce6a665697377998d453782" + integrity sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw== -eslint-plugin-prettier@^3.1.4: - version "3.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz#e9ddb200efb6f3d05ffe83b1665a716af4a387e5" - integrity sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g== +eslint-config-webpack@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-webpack/-/eslint-config-webpack-4.0.2.tgz#d1a081b812dee62412105bdd91f8888da8b8474d" + integrity sha512-gVT0dasb2qaCBJpepABBiTH10Eu1VDxCQKHqypqojStWh5TZBuk+nV3gEkR3d257b9QTmSJM3jHku1y+h16MjA== + dependencies: + semver "^7.7.2" + +eslint-import-resolver-node@^0.3.9: + version "0.3.9" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" + integrity sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== + dependencies: + debug "^3.2.7" + is-core-module "^2.13.0" + resolve "^1.22.4" + +eslint-module-utils@^2.12.0: + version "2.12.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz#fe4cfb948d61f49203d7b08871982b65b9af0b0b" + integrity sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg== + dependencies: + debug "^3.2.7" + +eslint-plugin-es-x@^7.8.0: + version "7.8.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-es-x/-/eslint-plugin-es-x-7.8.0.tgz#a207aa08da37a7923f2a9599e6d3eb73f3f92b74" + integrity sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ== + dependencies: + "@eslint-community/eslint-utils" "^4.1.2" + "@eslint-community/regexpp" "^4.11.0" + eslint-compat-utils "^0.5.1" + +eslint-plugin-import@^2.31.0: + version "2.31.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz#310ce7e720ca1d9c0bb3f69adfd1c6bdd7d9e0e7" + integrity sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A== + dependencies: + "@rtsao/scc" "^1.1.0" + array-includes "^3.1.8" + array.prototype.findlastindex "^1.2.5" + array.prototype.flat "^1.3.2" + array.prototype.flatmap "^1.3.2" + debug "^3.2.7" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.9" + eslint-module-utils "^2.12.0" + hasown "^2.0.2" + is-core-module "^2.15.1" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.fromentries "^2.0.8" + object.groupby "^1.0.3" + object.values "^1.2.0" + semver "^6.3.1" + string.prototype.trimend "^1.0.8" + tsconfig-paths "^3.15.0" + +eslint-plugin-jest@^28.13.0: + version "28.13.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-28.13.0.tgz#f215195915cefe3ed14145f841b6e7c90d60a672" + integrity sha512-4AuBcFWOriOeEqy6s4Zup/dQ7E1EPTyyfDaMYmM2YP9xEWPWwK3yYifH1dzY6aHRvyx7y53qMSIyT5s+jrorsQ== + dependencies: + "@typescript-eslint/utils" "^6.0.0 || ^7.0.0 || ^8.0.0" + +eslint-plugin-jsdoc@^50.7.1: + version "50.7.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.7.1.tgz#f3475c5545473f1d3e5fb272ad2f3988283b42e5" + integrity sha512-XBnVA5g2kUVokTNUiE1McEPse5n9/mNUmuJcx52psT6zBs2eVcXSmQBvjfa7NZdfLVSy3u1pEDDUxoxpwy89WA== + dependencies: + "@es-joy/jsdoccomment" "~0.50.2" + are-docs-informative "^0.0.2" + comment-parser "1.4.1" + debug "^4.4.1" + escape-string-regexp "^4.0.0" + espree "^10.3.0" + esquery "^1.6.0" + parse-imports-exports "^0.2.4" + semver "^7.7.2" + spdx-expression-parse "^4.0.0" + +eslint-plugin-n@^17.19.0: + version "17.19.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-17.19.0.tgz#3c198306c2eb9ea950c7458cff9c9a6426d02c58" + integrity sha512-qxn1NaDHtizbhVAPpbMT8wWFaLtPnwhfN/e+chdu2i6Vgzmo/tGM62tcJ1Hf7J5Ie4dhse3DOPMmDxduzfifzw== + dependencies: + "@eslint-community/eslint-utils" "^4.5.0" + "@typescript-eslint/utils" "^8.26.1" + enhanced-resolve "^5.17.1" + eslint-plugin-es-x "^7.8.0" + get-tsconfig "^4.8.1" + globals "^15.11.0" + ignore "^5.3.2" + minimatch "^9.0.5" + semver "^7.6.3" + ts-declaration-location "^1.0.6" + +eslint-plugin-prettier@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.4.1.tgz#99b55d7dd70047886b2222fdd853665f180b36af" + integrity sha512-9dF+KuU/Ilkq27A8idRP7N2DH8iUR6qXcjF3FR2wETY21PZdBrIjwCau8oboyGj9b7etWmTGEeM8e7oOed6ZWg== dependencies: prettier-linter-helpers "^1.0.0" - -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + synckit "^0.11.7" + +eslint-plugin-unicorn@^59.0.1: + version "59.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-59.0.1.tgz#e76ca18f6b92633440973e5442923a36544a1422" + integrity sha512-EtNXYuWPUmkgSU2E7Ttn57LbRREQesIP1BiLn7OZLKodopKfDXfBUkC/0j6mpw2JExwf43Uf3qLSvrSvppgy8Q== + dependencies: + "@babel/helper-validator-identifier" "^7.25.9" + "@eslint-community/eslint-utils" "^4.5.1" + "@eslint/plugin-kit" "^0.2.7" + ci-info "^4.2.0" + clean-regexp "^1.0.0" + core-js-compat "^3.41.0" + esquery "^1.6.0" + find-up-simple "^1.0.1" + globals "^16.0.0" + indent-string "^5.0.0" + is-builtin-module "^5.0.0" + jsesc "^3.1.0" + pluralize "^8.0.0" + regexp-tree "^0.1.27" + regjsparser "^0.12.0" + semver "^7.7.1" + strip-indent "^4.0.0" + +eslint-scope@^8.3.0: + version "8.4.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.4.0.tgz#88e646a207fad61436ffa39eb505147200655c82" + integrity sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg== dependencies: esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-utils@^2.0.0, eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + estraverse "^5.2.0" -eslint-visitor-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== - -eslint@^7.9.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== - dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" - ajv "^6.10.0" +eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== + +eslint-visitor-keys@^4.2.0, eslint-visitor-keys@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz#4cfea60fe7dd0ad8e816e1ed026c1d5251b512c1" + integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ== + +eslint@^9.28.0: + version "9.28.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.28.0.tgz#b0bcbe82a16945a40906924bea75e8b4980ced7d" + integrity sha512-ocgh41VhRlf9+fVpe7QKzwLj9c92fDiqOj8Y3Sd4/ZmVA4Btx4PlUYPq4pp9JDyupkf1upbEXecxL2mwNV7jPQ== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.12.1" + "@eslint/config-array" "^0.20.0" + "@eslint/config-helpers" "^0.2.1" + "@eslint/core" "^0.14.0" + "@eslint/eslintrc" "^3.3.1" + "@eslint/js" "9.28.0" + "@eslint/plugin-kit" "^0.3.1" + "@humanfs/node" "^0.16.6" + "@humanwhocodes/module-importer" "^1.0.1" + "@humanwhocodes/retry" "^0.4.2" + "@types/estree" "^1.0.6" + "@types/json-schema" "^7.0.15" + ajv "^6.12.4" chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.0.1" - doctrine "^3.0.0" - enquirer "^2.3.5" + cross-spawn "^7.0.6" + debug "^4.3.2" escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" - esquery "^1.4.0" + eslint-scope "^8.3.0" + eslint-visitor-keys "^4.2.0" + espree "^10.3.0" + esquery "^1.5.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" - globals "^13.6.0" - ignore "^4.0.6" - import-fresh "^3.0.0" + file-entry-cache "^8.0.0" + find-up "^5.0.0" + glob-parent "^6.0.2" + ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" lodash.merge "^4.6.2" - minimatch "^3.0.4" + minimatch "^3.1.2" natural-compare "^1.4.0" - optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" - strip-json-comments "^3.1.0" - table "^6.0.9" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" + optionator "^0.9.3" esniff@^2.0.1: version "2.0.1" @@ -1861,24 +2570,24 @@ esniff@^2.0.1: event-emitter "^0.3.5" type "^2.7.2" -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== +espree@^10.0.1, espree@^10.3.0: + version "10.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.4.0.tgz#d54f4949d4629005a1fa168d937c3ff1f7e2a837" + integrity sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ== dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" + acorn "^8.15.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^4.2.1" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.4.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" - integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== +esquery@^1.5.0, esquery@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7" + integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== dependencies: estraverse "^5.1.0" @@ -1889,12 +2598,7 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0, estraverse@^5.2.0: +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== @@ -1974,6 +2678,17 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== +fast-glob@^3.3.2: + version "3.3.3" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818" + integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.8" + fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -1984,6 +2699,20 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== +fastq@^1.6.0: + version "1.19.1" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.19.1.tgz#d50eaba803c8846a883c16492821ebcd2cda55f5" + integrity sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ== + dependencies: + reusify "^1.0.4" + +fault@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fault/-/fault-2.0.1.tgz#d47ca9f37ca26e4bd38374a7c500b5a384755b6c" + integrity sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ== + dependencies: + format "^0.2.0" + fb-watchman@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" @@ -1991,12 +2720,12 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== +file-entry-cache@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" + integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== dependencies: - flat-cache "^3.0.4" + flat-cache "^4.0.0" fill-range@^7.1.1: version "7.1.1" @@ -2005,6 +2734,11 @@ fill-range@^7.1.1: dependencies: to-regex-range "^5.0.1" +find-up-simple@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/find-up-simple/-/find-up-simple-1.0.1.tgz#18fb90ad49e45252c4d7fca56baade04fa3fca1e" + integrity sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ== + find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" @@ -2013,18 +2747,33 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== dependencies: - flatted "^3.1.0" - rimraf "^3.0.2" + locate-path "^6.0.0" + path-exists "^4.0.0" -flatted@^3.1.0: - version "3.2.7" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" - integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +flat-cache@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" + integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw== + dependencies: + flatted "^3.2.9" + keyv "^4.5.4" + +flatted@^3.2.9: + version "3.3.3" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358" + integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== + +for-each@^0.3.3, for-each@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.5.tgz#d650688027826920feeb0af747ee7b9421a41d47" + integrity sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg== + dependencies: + is-callable "^1.2.7" form-data@^3.0.0: version "3.0.1" @@ -2035,6 +2784,11 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +format@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" + integrity sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww== + fs-extra@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -2065,10 +2819,27 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +function.prototype.name@^1.1.6, function.prototype.name@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.8.tgz#e68e1df7b259a5c949eeef95cdbde53edffabb78" + integrity sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.3" + define-properties "^1.2.1" + functions-have-names "^1.2.3" + hasown "^2.0.2" + is-callable "^1.2.7" + +functions-have-names@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== gensequence@^3.1.1: version "3.1.1" @@ -2085,6 +2856,22 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.2.4, get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@^1.2.7, get-intrinsic@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== + dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + function-bind "^1.1.2" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + get-own-enumerable-property-symbols@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" @@ -2095,10 +2882,13 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== -get-stdin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" - integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== +get-proto@^1.0.0, get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" get-stdin@^8.0.0: version "8.0.0" @@ -2117,6 +2907,22 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +get-symbol-description@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.1.0.tgz#7bdd54e0befe8ffc9f3b4e203220d9f1e881b6ee" + integrity sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + +get-tsconfig@^4.8.1: + version "4.10.1" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.10.1.tgz#d34c1c01f47d65a606c37aa7a177bc3e56ab4b2e" + integrity sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ== + dependencies: + resolve-pkg-maps "^1.0.0" + glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -2124,6 +2930,13 @@ glob-parent@^5.1.2: dependencies: is-glob "^4.0.1" +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -2148,18 +2961,44 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.6.0, globals@^13.9.0: - version "13.20.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" - integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== +globals@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" + integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== + +globals@^15.11.0: + version "15.15.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-15.15.0.tgz#7c4761299d41c32b075715a4ce1ede7897ff72a8" + integrity sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg== + +globals@^16.0.0, globals@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-16.2.0.tgz#19efcd1ddde2bd5efce128e5c2e441df1abc6f7c" + integrity sha512-O+7l9tPdHCU320IigZZPj5zmRCFG9xHmx9cU8FqU2Rp+JN714seHV+2S9+JslCpY4gJwU2vOGox0wzgae/MCEg== + +globalthis@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" + integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== dependencies: - type-fest "^0.20.2" + define-properties "^1.2.1" + gopd "^1.0.1" + +gopd@^1.0.1, gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== +has-bigints@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.1.0.tgz#28607e965ac967e03cd2a2c70a2636a1edad49fe" + integrity sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -2175,6 +3014,32 @@ has-own-prop@^2.0.0: resolved "https://registry.yarnpkg.com/has-own-prop/-/has-own-prop-2.0.0.tgz#f0f95d58f65804f5d218db32563bb85b8e0417af" integrity sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ== +has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + +has-proto@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.2.0.tgz#5de5a6eabd95fdffd9818b43055e8065e39fe9d5" + integrity sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ== + dependencies: + dunder-proto "^1.0.0" + +has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -2182,6 +3047,13 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + html-encoding-sniffer@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" @@ -2240,17 +3112,12 @@ iconv-lite@^0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -ignore@^5.1.1: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== +ignore@^5.2.0, ignore@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== -import-fresh@^3.0.0, import-fresh@^3.2.1: +import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -2276,6 +3143,11 @@ indent-string@^4.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== +indent-string@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-5.0.0.tgz#4fd2980fccaf8622d14c64d694f4cf33c81951a5" + integrity sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg== + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -2294,11 +3166,67 @@ ini@^1.3.4: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== +internal-slot@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.1.0.tgz#1eac91762947d2f7056bc838d93e13b2e9604961" + integrity sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw== + dependencies: + es-errors "^1.3.0" + hasown "^2.0.2" + side-channel "^1.1.0" + +is-array-buffer@^3.0.4, is-array-buffer@^3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.5.tgz#65742e1e687bd2cc666253068fd8707fe4d44280" + integrity sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.3" + get-intrinsic "^1.2.6" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== +is-async-function@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-async-function/-/is-async-function-2.1.1.tgz#3e69018c8e04e73b738793d020bfe884b9fd3523" + integrity sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ== + dependencies: + async-function "^1.0.0" + call-bound "^1.0.3" + get-proto "^1.0.1" + has-tostringtag "^1.0.2" + safe-regex-test "^1.1.0" + +is-bigint@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.1.0.tgz#dda7a3445df57a42583db4228682eba7c4170672" + integrity sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ== + dependencies: + has-bigints "^1.0.2" + +is-boolean-object@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.2.2.tgz#7067f47709809a393c71ff5bb3e135d8a9215d9e" + integrity sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A== + dependencies: + call-bound "^1.0.3" + has-tostringtag "^1.0.2" + +is-builtin-module@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-5.0.0.tgz#19df4b9c7451149b68176b0e06d18646db6308dd" + integrity sha512-f4RqJKBUe5rQkJ2eJEJBXSticB3hGbN9j0yxxMQFqIW89Jp9WYFtzfTcRlstDKVUTRzSOTLKRfO9vIztenwtxA== + dependencies: + builtin-modules "^5.0.0" + +is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + is-core-module@^2.11.0: version "2.12.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" @@ -2306,11 +3234,42 @@ is-core-module@^2.11.0: dependencies: has "^1.0.3" +is-core-module@^2.13.0, is-core-module@^2.15.1, is-core-module@^2.16.0: + version "2.16.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" + integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== + dependencies: + hasown "^2.0.2" + +is-data-view@^1.0.1, is-data-view@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-data-view/-/is-data-view-1.0.2.tgz#bae0a41b9688986c2188dda6657e56b8f9e63b8e" + integrity sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw== + dependencies: + call-bound "^1.0.2" + get-intrinsic "^1.2.6" + is-typed-array "^1.1.13" + +is-date-object@^1.0.5, is-date-object@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.1.0.tgz#ad85541996fc7aa8b2729701d27b7319f95d82f7" + integrity sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg== + dependencies: + call-bound "^1.0.2" + has-tostringtag "^1.0.2" + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== +is-finalizationregistry@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz#eefdcdc6c94ddd0674d9c85887bf93f944a97c90" + integrity sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg== + dependencies: + call-bound "^1.0.3" + is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -2321,13 +3280,41 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^4.0.0, is-glob@^4.0.1: +is-generator-function@^1.0.10: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.1.0.tgz#bf3eeda931201394f57b5dba2800f91a238309ca" + integrity sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ== + dependencies: + call-bound "^1.0.3" + get-proto "^1.0.0" + has-tostringtag "^1.0.2" + safe-regex-test "^1.1.0" + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" +is-map@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" + integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw== + +is-negative-zero@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.3.tgz#ced903a027aca6381b777a5743069d7376a49747" + integrity sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw== + +is-number-object@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.1.1.tgz#144b21e95a1bc148205dcc2814a9134ec41b2541" + integrity sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw== + dependencies: + call-bound "^1.0.3" + has-tostringtag "^1.0.2" + is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" @@ -2353,16 +3340,62 @@ is-promise@^2.2.2: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== +is-regex@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.2.1.tgz#76d70a3ed10ef9be48eb577887d74205bf0cad22" + integrity sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g== + dependencies: + call-bound "^1.0.2" + gopd "^1.2.0" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" integrity sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA== +is-set@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.3.tgz#8ab209ea424608141372ded6e0cb200ef1d9d01d" + integrity sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg== + +is-shared-array-buffer@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz#9b67844bd9b7f246ba0708c3a93e34269c774f6f" + integrity sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A== + dependencies: + call-bound "^1.0.3" + is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== +is-string@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.1.1.tgz#92ea3f3d5c5b6e039ca8677e5ac8d07ea773cbb9" + integrity sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA== + dependencies: + call-bound "^1.0.3" + has-tostringtag "^1.0.2" + +is-symbol@^1.0.4, is-symbol@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.1.1.tgz#f47761279f532e2b05a7024a7506dbbedacd0634" + integrity sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w== + dependencies: + call-bound "^1.0.2" + has-symbols "^1.1.0" + safe-regex-test "^1.1.0" + +is-typed-array@^1.1.13, is-typed-array@^1.1.14, is-typed-array@^1.1.15: + version "1.1.15" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.15.tgz#4bfb4a45b61cee83a5a46fba778e4e8d59c0ce0b" + integrity sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ== + dependencies: + which-typed-array "^1.1.16" + is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -2373,6 +3406,31 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== +is-weakmap@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.2.tgz#bf72615d649dfe5f699079c54b83e47d1ae19cfd" + integrity sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w== + +is-weakref@^1.0.2, is-weakref@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.1.1.tgz#eea430182be8d64174bd96bffbc46f21bf3f9293" + integrity sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew== + dependencies: + call-bound "^1.0.3" + +is-weakset@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.4.tgz#c9f5deb0bc1906c6d6f1027f284ddf459249daca" + integrity sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ== + dependencies: + call-bound "^1.0.3" + get-intrinsic "^1.2.6" + +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -2850,10 +3908,10 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsdoctypeparser@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz#8c97e2fb69315eb274b0f01377eaa5c940bd7b26" - integrity sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw== +jsdoc-type-pratt-parser@~4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz#ff6b4a3f339c34a6c188cbf50a16087858d22113" + integrity sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg== jsdom@^16.6.0: version "16.7.0" @@ -2893,6 +3951,21 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +jsesc@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" + integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== + +jsesc@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" + integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== + +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" @@ -2943,6 +4016,13 @@ json-stringify-safe@^5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== +json5@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== + dependencies: + minimist "^1.2.0" + json5@^2.2.2: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" @@ -2957,6 +4037,13 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" +keyv@^4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -3030,17 +4117,19 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" - integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== - -lodash@^4.17.15, lodash@^4.17.20, lodash@^4.7.0: +lodash@^4.17.15, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -3063,6 +4152,11 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" +longest-streak@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.1.0.tgz#62fa67cd958742a1574af9f39866364102d90cd4" + integrity sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -3098,6 +4192,151 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" +markdown-table@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-3.0.4.tgz#fe44d6d410ff9d6f2ea1797a3f60aa4d2b631c2a" + integrity sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw== + +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + +mdast-util-find-and-replace@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz#70a3174c894e14df722abf43bc250cbae44b11df" + integrity sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg== + dependencies: + "@types/mdast" "^4.0.0" + escape-string-regexp "^5.0.0" + unist-util-is "^6.0.0" + unist-util-visit-parents "^6.0.0" + +mdast-util-from-markdown@^2.0.0, mdast-util-from-markdown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz#4850390ca7cf17413a9b9a0fbefcd1bc0eb4160a" + integrity sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA== + dependencies: + "@types/mdast" "^4.0.0" + "@types/unist" "^3.0.0" + decode-named-character-reference "^1.0.0" + devlop "^1.0.0" + mdast-util-to-string "^4.0.0" + micromark "^4.0.0" + micromark-util-decode-numeric-character-reference "^2.0.0" + micromark-util-decode-string "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + unist-util-stringify-position "^4.0.0" + +mdast-util-frontmatter@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-frontmatter/-/mdast-util-frontmatter-2.0.1.tgz#f5f929eb1eb36c8a7737475c7eb438261f964ee8" + integrity sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA== + dependencies: + "@types/mdast" "^4.0.0" + devlop "^1.0.0" + escape-string-regexp "^5.0.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + micromark-extension-frontmatter "^2.0.0" + +mdast-util-gfm-autolink-literal@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz#abd557630337bd30a6d5a4bd8252e1c2dc0875d5" + integrity sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ== + dependencies: + "@types/mdast" "^4.0.0" + ccount "^2.0.0" + devlop "^1.0.0" + mdast-util-find-and-replace "^3.0.0" + micromark-util-character "^2.0.0" + +mdast-util-gfm-footnote@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz#7778e9d9ca3df7238cc2bd3fa2b1bf6a65b19403" + integrity sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ== + dependencies: + "@types/mdast" "^4.0.0" + devlop "^1.1.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + +mdast-util-gfm-strikethrough@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz#d44ef9e8ed283ac8c1165ab0d0dfd058c2764c16" + integrity sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg== + dependencies: + "@types/mdast" "^4.0.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-gfm-table@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz#7a435fb6223a72b0862b33afbd712b6dae878d38" + integrity sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg== + dependencies: + "@types/mdast" "^4.0.0" + devlop "^1.0.0" + markdown-table "^3.0.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-gfm-task-list-item@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz#e68095d2f8a4303ef24094ab642e1047b991a936" + integrity sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ== + dependencies: + "@types/mdast" "^4.0.0" + devlop "^1.0.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-gfm@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz#2cdf63b92c2a331406b0fb0db4c077c1b0331751" + integrity sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ== + dependencies: + mdast-util-from-markdown "^2.0.0" + mdast-util-gfm-autolink-literal "^2.0.0" + mdast-util-gfm-footnote "^2.0.0" + mdast-util-gfm-strikethrough "^2.0.0" + mdast-util-gfm-table "^2.0.0" + mdast-util-gfm-task-list-item "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-phrasing@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz#7cc0a8dec30eaf04b7b1a9661a92adb3382aa6e3" + integrity sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w== + dependencies: + "@types/mdast" "^4.0.0" + unist-util-is "^6.0.0" + +mdast-util-to-markdown@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz#f910ffe60897f04bb4b7e7ee434486f76288361b" + integrity sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA== + dependencies: + "@types/mdast" "^4.0.0" + "@types/unist" "^3.0.0" + longest-streak "^3.0.0" + mdast-util-phrasing "^4.0.0" + mdast-util-to-string "^4.0.0" + micromark-util-classify-character "^2.0.0" + micromark-util-decode-string "^2.0.0" + unist-util-visit "^5.0.0" + zwitch "^2.0.0" + +mdast-util-to-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz#7a5121475556a04e7eddeb67b264aae79d312814" + integrity sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg== + dependencies: + "@types/mdast" "^4.0.0" + memfs@^3.2.0: version "3.5.1" resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.5.1.tgz#f0cd1e2bfaef58f6fe09bfb9c2288f07fea099ec" @@ -3124,7 +4363,295 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -micromatch@^4.0.2, micromatch@^4.0.4: +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromark-core-commonmark@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz#c691630e485021a68cf28dbc2b2ca27ebf678cd4" + integrity sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg== + dependencies: + decode-named-character-reference "^1.0.0" + devlop "^1.0.0" + micromark-factory-destination "^2.0.0" + micromark-factory-label "^2.0.0" + micromark-factory-space "^2.0.0" + micromark-factory-title "^2.0.0" + micromark-factory-whitespace "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-classify-character "^2.0.0" + micromark-util-html-tag-name "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-resolve-all "^2.0.0" + micromark-util-subtokenize "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-frontmatter@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-frontmatter/-/micromark-extension-frontmatter-2.0.0.tgz#651c52ffa5d7a8eeed687c513cd869885882d67a" + integrity sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg== + dependencies: + fault "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-autolink-literal@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz#6286aee9686c4462c1e3552a9d505feddceeb935" + integrity sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-sanitize-uri "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-footnote@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz#4dab56d4e398b9853f6fe4efac4fc9361f3e0750" + integrity sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw== + dependencies: + devlop "^1.0.0" + micromark-core-commonmark "^2.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-sanitize-uri "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-strikethrough@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz#86106df8b3a692b5f6a92280d3879be6be46d923" + integrity sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw== + dependencies: + devlop "^1.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-classify-character "^2.0.0" + micromark-util-resolve-all "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-table@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz#fac70bcbf51fe65f5f44033118d39be8a9b5940b" + integrity sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg== + dependencies: + devlop "^1.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-tagfilter@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz#f26d8a7807b5985fba13cf61465b58ca5ff7dc57" + integrity sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg== + dependencies: + micromark-util-types "^2.0.0" + +micromark-extension-gfm-task-list-item@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz#bcc34d805639829990ec175c3eea12bb5b781f2c" + integrity sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw== + dependencies: + devlop "^1.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz#3e13376ab95dd7a5cfd0e29560dfe999657b3c5b" + integrity sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w== + dependencies: + micromark-extension-gfm-autolink-literal "^2.0.0" + micromark-extension-gfm-footnote "^2.0.0" + micromark-extension-gfm-strikethrough "^2.0.0" + micromark-extension-gfm-table "^2.0.0" + micromark-extension-gfm-tagfilter "^2.0.0" + micromark-extension-gfm-task-list-item "^2.0.0" + micromark-util-combine-extensions "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-destination@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz#8fef8e0f7081f0474fbdd92deb50c990a0264639" + integrity sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-label@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz#5267efa97f1e5254efc7f20b459a38cb21058ba1" + integrity sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg== + dependencies: + devlop "^1.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-space@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz#36d0212e962b2b3121f8525fc7a3c7c029f334fc" + integrity sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-title@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz#237e4aa5d58a95863f01032d9ee9b090f1de6e94" + integrity sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw== + dependencies: + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-whitespace@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz#06b26b2983c4d27bfcc657b33e25134d4868b0b1" + integrity sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ== + dependencies: + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-character@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-2.1.1.tgz#2f987831a40d4c510ac261e89852c4e9703ccda6" + integrity sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q== + dependencies: + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-chunked@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz#47fbcd93471a3fccab86cff03847fc3552db1051" + integrity sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-classify-character@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz#d399faf9c45ca14c8b4be98b1ea481bced87b629" + integrity sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-combine-extensions@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz#2a0f490ab08bff5cc2fd5eec6dd0ca04f89b30a9" + integrity sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg== + dependencies: + micromark-util-chunked "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-decode-numeric-character-reference@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz#fcf15b660979388e6f118cdb6bf7d79d73d26fe5" + integrity sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-decode-string@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz#6cb99582e5d271e84efca8e61a807994d7161eb2" + integrity sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ== + dependencies: + decode-named-character-reference "^1.0.0" + micromark-util-character "^2.0.0" + micromark-util-decode-numeric-character-reference "^2.0.0" + micromark-util-symbol "^2.0.0" + +micromark-util-encode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz#0d51d1c095551cfaac368326963cf55f15f540b8" + integrity sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw== + +micromark-util-html-tag-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz#e40403096481986b41c106627f98f72d4d10b825" + integrity sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA== + +micromark-util-normalize-identifier@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz#c30d77b2e832acf6526f8bf1aa47bc9c9438c16d" + integrity sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-resolve-all@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz#e1a2d62cdd237230a2ae11839027b19381e31e8b" + integrity sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg== + dependencies: + micromark-util-types "^2.0.0" + +micromark-util-sanitize-uri@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz#ab89789b818a58752b73d6b55238621b7faa8fd7" + integrity sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-encode "^2.0.0" + micromark-util-symbol "^2.0.0" + +micromark-util-subtokenize@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz#d8ade5ba0f3197a1cf6a2999fbbfe6357a1a19ee" + integrity sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA== + dependencies: + devlop "^1.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-symbol@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz#e5da494e8eb2b071a0d08fb34f6cefec6c0a19b8" + integrity sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q== + +micromark-util-types@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-2.0.2.tgz#f00225f5f5a0ebc3254f96c36b6605c4b393908e" + integrity sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA== + +micromark@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromark/-/micromark-4.0.2.tgz#91395a3e1884a198e62116e33c9c568e39936fdb" + integrity sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA== + dependencies: + "@types/debug" "^4.0.0" + debug "^4.0.0" + decode-named-character-reference "^1.0.0" + devlop "^1.0.0" + micromark-core-commonmark "^2.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-combine-extensions "^2.0.0" + micromark-util-decode-numeric-character-reference "^2.0.0" + micromark-util-encode "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-resolve-all "^2.0.0" + micromark-util-sanitize-uri "^2.0.0" + micromark-util-subtokenize "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== @@ -3149,14 +4676,26 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^3.0.4, minimatch@^3.1.1: +min-indent@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" + integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== + +minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" -minimist@^1.2.5: +minimatch@^9.0.4, minimatch@^9.0.5: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== + dependencies: + brace-expansion "^2.0.1" + +minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -3171,6 +4710,11 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +ms@^2.1.1, ms@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + mz@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" @@ -3195,6 +4739,11 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== +node-releases@^2.0.19: + version "2.0.19" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" + integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== + node-releases@^2.0.8: version "2.0.10" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f" @@ -3222,6 +4771,57 @@ object-assign@^4.0.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== +object-inspect@^1.13.3, object-inspect@^1.13.4: + version "1.13.4" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" + integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== + +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.7: + version "4.1.7" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.7.tgz#8c14ca1a424c6a561b0bb2a22f66f5049a945d3d" + integrity sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.3" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + has-symbols "^1.1.0" + object-keys "^1.1.1" + +object.fromentries@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.8.tgz#f7195d8a9b97bd95cbc1999ea939ecd1a2b00c65" + integrity sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-object-atoms "^1.0.0" + +object.groupby@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.3.tgz#9b125c36238129f6f7b61954a1e7176148d5002e" + integrity sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + +object.values@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.2.1.tgz#deed520a50809ff7f75a7cfd4bc64c7a038c6216" + integrity sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.3" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -3248,17 +4848,26 @@ optionator@^0.8.1: type-check "~0.3.2" word-wrap "~1.2.3" -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== +optionator@^0.9.3: + version "0.9.4" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" + integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== dependencies: deep-is "^0.1.3" fast-levenshtein "^2.0.6" levn "^0.4.1" prelude-ls "^1.2.1" type-check "^0.4.0" - word-wrap "^1.2.3" + word-wrap "^1.2.5" + +own-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/own-keys/-/own-keys-1.0.1.tgz#e4006910a2bf913585289676eebd6f390cf51358" + integrity sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg== + dependencies: + get-intrinsic "^1.2.6" + object-keys "^1.1.1" + safe-push-apply "^1.0.0" p-limit@^2.2.0: version "2.3.0" @@ -3267,6 +4876,13 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -3274,6 +4890,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-map@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" @@ -3293,6 +4916,13 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" +parse-imports-exports@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/parse-imports-exports/-/parse-imports-exports-0.2.4.tgz#e3fb3b5e264cfb55c25b5dfcbe7f410f8dc4e7af" + integrity sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ== + dependencies: + parse-statements "1.0.11" + parse-json@^5.0.0, parse-json@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" @@ -3303,6 +4933,11 @@ parse-json@^5.0.0, parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +parse-statements@1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/parse-statements/-/parse-statements-1.0.11.tgz#8787c5d383ae5746568571614be72b0689584344" + integrity sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA== + parse5@6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" @@ -3338,11 +4973,21 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +picomatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" + integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== + pirates@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" @@ -3362,6 +5007,16 @@ please-upgrade-node@^3.2.0: dependencies: semver-compare "^1.0.0" +pluralize@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" + integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== + +possible-typed-array-names@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz#93e3582bc0e5426586d9d07b79ee40fc841de4ae" + integrity sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg== + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -3372,6 +5027,11 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== +"prettier-2@npm:prettier@^2": + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== + prettier-linter-helpers@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" @@ -3379,11 +5039,16 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.0.5, prettier@^2.1.2: +prettier@^2.0.5: version "2.8.8" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== +prettier@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.5.3.tgz#4fc2ce0d657e7a02e602549f053b239cb7dfe1b5" + integrity sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw== + pretty-format@^27.0.0, pretty-format@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" @@ -3393,11 +5058,6 @@ pretty-format@^27.0.0, pretty-format@^27.5.1: ansi-styles "^5.0.0" react-is "^17.0.1" -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" @@ -3429,20 +5089,53 @@ querystringify@^2.1.1: resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + react-is@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -regexpp@^3.0.0, regexpp@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - -regextras@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/regextras/-/regextras-0.7.1.tgz#be95719d5f43f9ef0b9fa07ad89b7c606995a3b2" - integrity sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w== +reflect.getprototypeof@^1.0.6, reflect.getprototypeof@^1.0.9: + version "1.0.10" + resolved "https://registry.yarnpkg.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz#c629219e78a3316d8b604c765ef68996964e7bf9" + integrity sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw== + dependencies: + call-bind "^1.0.8" + define-properties "^1.2.1" + es-abstract "^1.23.9" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + get-intrinsic "^1.2.7" + get-proto "^1.0.1" + which-builtin-type "^1.2.1" + +regexp-tree@^0.1.27: + version "0.1.27" + resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.27.tgz#2198f0ef54518ffa743fe74d983b56ffd631b6cd" + integrity sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA== + +regexp.prototype.flags@^1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz#1ad6c62d44a259007e55b3970e00f746efbcaa19" + integrity sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA== + dependencies: + call-bind "^1.0.8" + define-properties "^1.2.1" + es-errors "^1.3.0" + get-proto "^1.0.1" + gopd "^1.2.0" + set-function-name "^2.0.2" + +regjsparser@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.12.0.tgz#0e846df6c6530586429377de56e0475583b088dc" + integrity sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ== + dependencies: + jsesc "~3.0.2" repeat-string@^1.6.1: version "1.6.1" @@ -3488,12 +5181,17 @@ resolve-global@^1.0.0: dependencies: global-dirs "^0.1.1" +resolve-pkg-maps@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" + integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== + resolve.exports@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.1.tgz#05cfd5b3edf641571fd46fa608b610dda9ead999" integrity sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ== -resolve@^1.10.1, resolve@^1.20.0: +resolve@^1.20.0: version "1.22.2" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== @@ -3502,6 +5200,15 @@ resolve@^1.10.1, resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@^1.22.4: + version "1.22.10" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39" + integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== + dependencies: + is-core-module "^2.16.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -3510,18 +5217,30 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" +reusify@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.1.0.tgz#0fe13b9522e1473f51b558ee796e08f11f9b489f" + integrity sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw== + rfdc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== -rimraf@^3.0.0, rimraf@^3.0.2: +rimraf@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== dependencies: glob "^7.1.3" +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + rxjs@^7.5.1: version "7.8.1" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" @@ -3529,6 +5248,34 @@ rxjs@^7.5.1: dependencies: tslib "^2.1.0" +safe-array-concat@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.1.3.tgz#c9e54ec4f603b0bbb8e7e5007a5ee7aecd1538c3" + integrity sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.2" + get-intrinsic "^1.2.6" + has-symbols "^1.1.0" + isarray "^2.0.5" + +safe-push-apply@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-push-apply/-/safe-push-apply-1.0.0.tgz#01850e981c1602d398c85081f360e4e6d03d27f5" + integrity sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA== + dependencies: + es-errors "^1.3.0" + isarray "^2.0.5" + +safe-regex-test@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.1.0.tgz#7f87dfb67a3150782eaaf18583ff5d1711ac10c1" + integrity sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + is-regex "^1.2.1" + "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -3546,18 +5293,54 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow== -semver@^6.0.0, semver@^6.1.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.2.1, semver@^7.3.2, semver@^7.3.4: +semver@^7.3.2: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" +semver@^7.5.4, semver@^7.6.0, semver@^7.6.3, semver@^7.7.1, semver@^7.7.2: + version "7.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.2.tgz#67d99fdcd35cec21e6f8b87a7fd515a33f982b58" + integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== + +set-function-length@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + +set-function-name@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" + integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.2" + +set-proto@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/set-proto/-/set-proto-1.0.0.tgz#0760dbcff30b2d7e801fd6e19983e56da337565e" + integrity sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw== + dependencies: + dunder-proto "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -3570,6 +5353,46 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +side-channel-list@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/side-channel-list/-/side-channel-list-1.0.0.tgz#10cb5984263115d3b7a0e336591e290a830af8ad" + integrity sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA== + dependencies: + es-errors "^1.3.0" + object-inspect "^1.13.3" + +side-channel-map@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/side-channel-map/-/side-channel-map-1.0.1.tgz#d6bb6b37902c6fef5174e5f533fab4c732a26f42" + integrity sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" + +side-channel-weakmap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz#11dda19d5368e40ce9ec2bdc1fb0ecbc0790ecea" + integrity sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" + side-channel-map "^1.0.1" + +side-channel@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" + integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== + dependencies: + es-errors "^1.3.0" + object-inspect "^1.13.3" + side-channel-list "^1.0.0" + side-channel-map "^1.0.1" + side-channel-weakmap "^1.0.2" + signal-exit@^3.0.2, signal-exit@^3.0.3: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" @@ -3626,10 +5449,10 @@ spdx-exceptions@^2.1.0: resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== -spdx-expression-parse@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== +spdx-expression-parse@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz#a23af9f3132115465dac215c099303e4ceac5794" + integrity sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ== dependencies: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" @@ -3656,6 +5479,14 @@ stdin@0.0.1: resolved "https://registry.yarnpkg.com/stdin/-/stdin-0.0.1.tgz#d3041981aaec3dfdbc77a1b38d6372e38f5fb71e" integrity sha512-2bacd1TXzqOEsqRa+eEWkRdOSznwptrs4gqFcpMq5tOtmJUGPZd10W5Lam6wQ4YQ/+qjQt4e9u35yXCF6mrlfQ== +stop-iteration-iterator@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz#f481ff70a548f6124d0312c3aa14cbfa7aa542ad" + integrity sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ== + dependencies: + es-errors "^1.3.0" + internal-slot "^1.1.0" + string-argv@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" @@ -3669,7 +5500,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -3678,6 +5509,38 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string.prototype.trim@^1.2.10: + version "1.2.10" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz#40b2dd5ee94c959b4dcfb1d65ce72e90da480c81" + integrity sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.2" + define-data-property "^1.1.4" + define-properties "^1.2.1" + es-abstract "^1.23.5" + es-object-atoms "^1.0.0" + has-property-descriptors "^1.0.2" + +string.prototype.trimend@^1.0.8, string.prototype.trimend@^1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz#62e2731272cd285041b36596054e9f66569b6942" + integrity sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.2" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + +string.prototype.trimstart@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz#7ee834dda8c7c17eff3118472bb35bfedaa34dde" + integrity sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + stringify-object@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" @@ -3694,6 +5557,11 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + strip-bom@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" @@ -3704,7 +5572,14 @@ strip-final-newline@^2.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: +strip-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-4.0.0.tgz#b41379433dd06f5eae805e21d631e07ee670d853" + integrity sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA== + dependencies: + min-indent "^1.0.1" + +strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -3748,16 +5623,12 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -table@^6.0.9: - version "6.8.1" - resolved "https://registry.yarnpkg.com/table/-/table-6.8.1.tgz#ea2b71359fe03b017a5fbc296204471158080bdf" - integrity sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA== +synckit@^0.11.7: + version "0.11.8" + resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.11.8.tgz#b2aaae998a4ef47ded60773ad06e7cb821f55457" + integrity sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A== dependencies: - ajv "^8.0.1" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" + "@pkgr/core" "^0.2.4" tapable@^2.2.0: version "2.2.1" @@ -3791,11 +5662,6 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== - thenify-all@^1.0.0: version "1.6.0" resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" @@ -3845,9 +5711,9 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tooling@webpack/tooling#v1.23.9: - version "1.23.9" - resolved "https://codeload.github.com/webpack/tooling/tar.gz/877a9a9f5ab0bac3d60f595dd0ffc92234356a49" +tooling@webpack/tooling#v1.23.10: + version "1.23.10" + resolved "https://codeload.github.com/webpack/tooling/tar.gz/94a68183eaddff8f27a229a5cc169cf0d24a5a20" dependencies: "@yarnpkg/lockfile" "^1.1.0" ajv "^8.1.0" @@ -3874,6 +5740,28 @@ tr46@^2.1.0: dependencies: punycode "^2.1.1" +ts-api-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.1.0.tgz#595f7094e46eed364c13fd23e75f9513d29baf91" + integrity sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ== + +ts-declaration-location@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/ts-declaration-location/-/ts-declaration-location-1.0.7.tgz#d4068fe9975828b3b453b3ab112b4711d8267688" + integrity sha512-EDyGAwH1gO0Ausm9gV6T2nUvBgXT5kGoCMJPllOaooZ+4VvJiKBdZE7wK18N1deEowhcUptS+5GXZK8U/fvpwA== + dependencies: + picomatch "^4.0.2" + +tsconfig-paths@^3.15.0: + version "3.15.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" + integrity sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + tslib@^2.1.0: version "2.5.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" @@ -3898,11 +5786,6 @@ type-detect@4.0.8: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - type-fest@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" @@ -3918,6 +5801,51 @@ type@^2.7.2: resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== +typed-array-buffer@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz#a72395450a4869ec033fd549371b47af3a2ee536" + integrity sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + is-typed-array "^1.1.14" + +typed-array-byte-length@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz#8407a04f7d78684f3d252aa1a143d2b77b4160ce" + integrity sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg== + dependencies: + call-bind "^1.0.8" + for-each "^0.3.3" + gopd "^1.2.0" + has-proto "^1.2.0" + is-typed-array "^1.1.14" + +typed-array-byte-offset@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz#ae3698b8ec91a8ab945016108aef00d5bff12355" + integrity sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.8" + for-each "^0.3.3" + gopd "^1.2.0" + has-proto "^1.2.0" + is-typed-array "^1.1.15" + reflect.getprototypeof "^1.0.9" + +typed-array-length@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.7.tgz#ee4deff984b64be1e118b0de8c9c877d5ce73d3d" + integrity sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg== + dependencies: + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + is-typed-array "^1.1.13" + possible-typed-array-names "^1.0.0" + reflect.getprototypeof "^1.0.6" + typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -3930,6 +5858,16 @@ typescript@^5.3.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== +unbox-primitive@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.1.0.tgz#8d9d2c9edeea8460c7f35033a88867944934d1e2" + integrity sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw== + dependencies: + call-bound "^1.0.3" + has-bigints "^1.0.2" + has-symbols "^1.1.0" + which-boxed-primitive "^1.1.1" + undici-types@~5.26.4: version "5.26.5" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" @@ -3942,6 +5880,37 @@ unique-string@^2.0.0: dependencies: crypto-random-string "^2.0.0" +unist-util-is@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-6.0.0.tgz#b775956486aff107a9ded971d996c173374be424" + integrity sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw== + dependencies: + "@types/unist" "^3.0.0" + +unist-util-stringify-position@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz#449c6e21a880e0855bf5aabadeb3a740314abac2" + integrity sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ== + dependencies: + "@types/unist" "^3.0.0" + +unist-util-visit-parents@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz#4d5f85755c3b8f0dc69e21eca5d6d82d22162815" + integrity sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw== + dependencies: + "@types/unist" "^3.0.0" + unist-util-is "^6.0.0" + +unist-util-visit@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-5.0.0.tgz#a7de1f31f72ffd3519ea71814cccf5fd6a9217d6" + integrity sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg== + dependencies: + "@types/unist" "^3.0.0" + unist-util-is "^6.0.0" + unist-util-visit-parents "^6.0.0" + universalify@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" @@ -3960,6 +5929,14 @@ update-browserslist-db@^1.0.10: escalade "^3.1.1" picocolors "^1.0.0" +update-browserslist-db@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz#348377dd245216f9e7060ff50b15a1b740b75420" + integrity sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw== + dependencies: + escalade "^3.2.0" + picocolors "^1.1.1" + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -3975,11 +5952,6 @@ url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - v8-to-istanbul@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" @@ -4046,6 +6018,59 @@ whatwg-url@^8.0.0, whatwg-url@^8.5.0: tr46 "^2.1.0" webidl-conversions "^6.1.0" +which-boxed-primitive@^1.1.0, which-boxed-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz#d76ec27df7fa165f18d5808374a5fe23c29b176e" + integrity sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA== + dependencies: + is-bigint "^1.1.0" + is-boolean-object "^1.2.1" + is-number-object "^1.1.1" + is-string "^1.1.1" + is-symbol "^1.1.1" + +which-builtin-type@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/which-builtin-type/-/which-builtin-type-1.2.1.tgz#89183da1b4907ab089a6b02029cc5d8d6574270e" + integrity sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q== + dependencies: + call-bound "^1.0.2" + function.prototype.name "^1.1.6" + has-tostringtag "^1.0.2" + is-async-function "^2.0.0" + is-date-object "^1.1.0" + is-finalizationregistry "^1.1.0" + is-generator-function "^1.0.10" + is-regex "^1.2.1" + is-weakref "^1.0.2" + isarray "^2.0.5" + which-boxed-primitive "^1.1.0" + which-collection "^1.0.2" + which-typed-array "^1.1.16" + +which-collection@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.2.tgz#627ef76243920a107e7ce8e96191debe4b16c2a0" + integrity sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw== + dependencies: + is-map "^2.0.3" + is-set "^2.0.3" + is-weakmap "^2.0.2" + is-weakset "^2.0.3" + +which-typed-array@^1.1.16, which-typed-array@^1.1.19: + version "1.1.19" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.19.tgz#df03842e870b6b88e117524a4b364b6fc689f956" + integrity sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.8" + call-bound "^1.0.4" + for-each "^0.3.5" + get-proto "^1.0.1" + gopd "^1.2.0" + has-tostringtag "^1.0.2" + which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -4053,7 +6078,12 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -word-wrap@^1.2.3, word-wrap@~1.2.3: +word-wrap@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" + integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== + +word-wrap@~1.2.3: version "1.2.4" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f" integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA== @@ -4148,3 +6178,13 @@ yargs@^16.1.1, yargs@^16.2.0: string-width "^4.2.0" y18n "^5.0.5" yargs-parser "^20.2.2" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zwitch@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7" + integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==