diff --git a/.eslintrc.json b/.eslintrc.json index 7f8119e9e1..e0e9198da1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -10,7 +10,8 @@ "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking", "plugin:github/recommended", - "plugin:github/typescript" + "plugin:github/typescript", + "plugin:import/typescript" ], "rules": { "filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"], diff --git a/.gitignore b/.gitignore index 3c6742851f..0449c18109 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /runner/dist/ /runner/node_modules/ +# Ignore for example failing-tests.json from AVA +node_modules/.cache diff --git a/lib/actions-util.js b/lib/actions-util.js index 93cdd410e9..ad17d56336 100644 --- a/lib/actions-util.js +++ b/lib/actions-util.js @@ -526,7 +526,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause } exports.createStatusReportBase = createStatusReportBase; const GENERIC_403_MSG = "The repo on which this action is running is not opted-in to CodeQL code scanning."; -const GENERIC_404_MSG = "Not authorized to used the CodeQL code scanning feature on this repo."; +const GENERIC_404_MSG = "Not authorized to use the CodeQL code scanning feature on this repo."; const OUT_OF_DATE_MSG = "CodeQL Action is out-of-date. Please upgrade to the latest version of codeql-action."; const INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the code scanning endpoint. Please update to a compatible version of codeql-action."; /** diff --git a/lib/actions-util.js.map b/lib/actions-util.js.map index 11c83e0a53..06088a4c07 100644 --- a/lib/actions-util.js.map +++ b/lib/actions-util.js.map @@ -1 +1 @@ -{"version":3,"file":"actions-util.js","sourceRoot":"","sources":["../src/actions-util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AACtC,yEAA2D;AAC3D,kEAAoD;AACpD,8CAAgC;AAEhC,kDAAoC;AACpC,gEAAkD;AAClD,iCAA6E;AAE7E;;;GAGG;AAEH;;;;;;GAMG;AACH,SAAgB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E,EAAE,CAAC,CAAC;AAChD,CAAC;AAFD,kDAEC"} \ No newline at end of file diff --git a/lib/config-utils.test.js b/lib/config-utils.test.js index da35d344f2..62ee1b4bd1 100644 --- a/lib/config-utils.test.js +++ b/lib/config-utils.test.js @@ -117,7 +117,10 @@ function mockListLanguages(languages) { t.true(fs.existsSync(configUtils.getPathToParsedConfigFile(tmpDir))); // And that same newly-initialised config should now be returned by getConfig const config2 = await configUtils.getConfig(tmpDir, logger); - t.deepEqual(config1, config2); + t.not(config2, undefined); + if (config2 !== undefined) { + t.deepEqual(config1, config2); + } }); }); (0, ava_1.default)("load input outside of workspace", async (t) => { @@ -760,28 +763,26 @@ const invalidPaths = ["a/***/b", "a/**b", "a/b**", "**"]; /** * Test macro for ensuring the packs block is valid */ -function parsePacksMacro(t, packsByLanguage, languages, expected) { - t.deepEqual(configUtils.parsePacksFromConfig(packsByLanguage, languages, "/a/b"), expected); -} -parsePacksMacro.title = (providedTitle) => `Parse Packs: ${providedTitle}`; +const parsePacksMacro = ava_1.default.macro({ + exec: (t, packsByLanguage, languages, expected) => t.deepEqual(configUtils.parsePacksFromConfig(packsByLanguage, languages, "/a/b"), expected), + title: (providedTitle = "") => `Parse Packs: ${providedTitle}`, +}); /** * Test macro for testing when the packs block is invalid */ -function parsePacksErrorMacro(t, packsByLanguage, languages, expected) { - t.throws(() => { - configUtils.parsePacksFromConfig(packsByLanguage, languages, "/a/b"); - }, { +const parsePacksErrorMacro = ava_1.default.macro({ + exec: (t, packsByLanguage, languages, expected) => t.throws(() => configUtils.parsePacksFromConfig(packsByLanguage, languages, "/a/b"), { message: expected, - }); -} -parsePacksErrorMacro.title = (providedTitle) => `Parse Packs Error: ${providedTitle}`; + }), + title: (providedTitle = "") => `Parse Packs Error: ${providedTitle}`, +}); /** * Test macro for testing when the packs block is invalid */ -function invalidPackNameMacro(t, name) { - parsePacksErrorMacro(t, { [languages_1.Language.cpp]: [name] }, [languages_1.Language.cpp], new RegExp(`The configuration file "/a/b" is invalid: property "packs" "${name}" is not a valid pack`)); -} -invalidPackNameMacro.title = (_, arg) => `Invalid pack string: ${arg}`; +const invalidPackNameMacro = ava_1.default.macro({ + exec: (t, name) => parsePacksErrorMacro.exec(t, { [languages_1.Language.cpp]: [name] }, [languages_1.Language.cpp], new RegExp(`The configuration file "/a/b" is invalid: property "packs" "${name}" is not a valid pack`)), + title: (_providedTitle, arg) => `Invalid pack string: ${arg}`, +}); (0, ava_1.default)("no packs", parsePacksMacro, {}, [], {}); (0, ava_1.default)("two packs", parsePacksMacro, ["a/b", "c/d@1.2.3"], [languages_1.Language.cpp], { [languages_1.Language.cpp]: [ @@ -870,46 +871,48 @@ parseInputAndConfigErrorMacro.title = (providedTitle) => `Parse Packs input and (0, ava_1.default)("input with two languages", parseInputAndConfigErrorMacro, {}, "c/d", [languages_1.Language.cpp, languages_1.Language.csharp], /multi-language analysis/); (0, ava_1.default)("input with + only", parseInputAndConfigErrorMacro, {}, " + ", [languages_1.Language.cpp], /remove the '\+'/); (0, ava_1.default)("input with invalid pack name", parseInputAndConfigErrorMacro, {}, " xxx", [languages_1.Language.cpp], /"xxx" is not a valid pack/); -async function mlPoweredQueriesMacro(t, codeQLVersion, isMlPoweredQueriesFlagEnabled, queriesInput, shouldRunMlPoweredQueries) { - return await util.withTmpDir(async (tmpDir) => { - const codeQL = (0, codeql_1.setCodeQL)({ - async getVersion() { - return codeQLVersion; - }, - async resolveQueries() { - return { - byLanguage: { - javascript: { "fake-query.ql": {} }, - }, - noDeclaredLanguage: {}, - multipleDeclaredLanguages: {}, - }; - }, - }); - const { packs } = await configUtils.initConfig("javascript", queriesInput, undefined, undefined, undefined, false, "", "", { owner: "github", repo: "example " }, tmpDir, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, feature_flags_1.createFeatureFlags)(isMlPoweredQueriesFlagEnabled - ? [feature_flags_1.FeatureFlag.MlPoweredQueriesEnabled] - : []), (0, logging_1.getRunnerLogger)(true)); - if (shouldRunMlPoweredQueries) { - t.deepEqual(packs, { - [languages_1.Language.javascript]: [ - { - packName: "codeql/javascript-experimental-atm-queries", - version: "~0.0.2", - }, - ], +const mlPoweredQueriesMacro = ava_1.default.macro({ + exec: async (t, codeQLVersion, isMlPoweredQueriesFlagEnabled, queriesInput, shouldRunMlPoweredQueries) => { + return await util.withTmpDir(async (tmpDir) => { + const codeQL = (0, codeql_1.setCodeQL)({ + async getVersion() { + return codeQLVersion; + }, + async resolveQueries() { + return { + byLanguage: { + javascript: { "fake-query.ql": {} }, + }, + noDeclaredLanguage: {}, + multipleDeclaredLanguages: {}, + }; + }, }); - } - else { - t.deepEqual(packs, {}); - } - }); -} -mlPoweredQueriesMacro.title = (_providedTitle, codeQLVersion, isMlPoweredQueriesFlagEnabled, queriesInput, shouldRunMlPoweredQueries) => { - const queriesInputDescription = queriesInput - ? `'queries: ${queriesInput}'` - : "default config"; - return `ML-powered queries ${shouldRunMlPoweredQueries ? "are" : "aren't"} loaded for ${queriesInputDescription} using CLI v${codeQLVersion} when feature flag is ${isMlPoweredQueriesFlagEnabled ? "enabled" : "disabled"}`; -}; + const { packs } = await configUtils.initConfig("javascript", queriesInput, undefined, undefined, undefined, false, "", "", { owner: "github", repo: "example " }, tmpDir, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, feature_flags_1.createFeatureFlags)(isMlPoweredQueriesFlagEnabled + ? [feature_flags_1.FeatureFlag.MlPoweredQueriesEnabled] + : []), (0, logging_1.getRunnerLogger)(true)); + if (shouldRunMlPoweredQueries) { + t.deepEqual(packs, { + [languages_1.Language.javascript]: [ + { + packName: "codeql/javascript-experimental-atm-queries", + version: "~0.0.2", + }, + ], + }); + } + else { + t.deepEqual(packs, {}); + } + }); + }, + title: (_providedTitle, codeQLVersion, isMlPoweredQueriesFlagEnabled, queriesInput, shouldRunMlPoweredQueries) => { + const queriesInputDescription = queriesInput + ? `'queries: ${queriesInput}'` + : "default config"; + return `ML-powered queries ${shouldRunMlPoweredQueries ? "are" : "aren't"} loaded for ${queriesInputDescription} using CLI v${codeQLVersion} when feature flag is ${isMlPoweredQueriesFlagEnabled ? "enabled" : "disabled"}`; + }, +}); // macro, isMlPoweredQueriesFlagEnabled, queriesInput, shouldRunMlPoweredQueries (0, ava_1.default)(mlPoweredQueriesMacro, "2.7.4", true, "security-extended", false); (0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", false, "security-extended", false); diff --git a/lib/config-utils.test.js.map b/lib/config-utils.test.js.map index a3b1c11d80..fe186e3bdd 100644 --- a/lib/config-utils.test.js.map +++ b/lib/config-utils.test.js.map @@ -1 +1 @@ -{"version":3,"file":"config-utils.test.js","sourceRoot":"","sources":["../src/config-utils.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,wDAA0C;AAC1C,8CAA6C;AAC7C,mCAA+B;AAC/B,6CAA+B;AAE/B,kDAAoC;AACpC,qCAAsD;AACtD,4DAA8C;AAC9C,mDAAkE;AAClE,2CAAuC;AACvC,uCAA4C;AAC5C,mDAA6C;AAC7C,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,gBAAgB,EAAE,OAAO;IACzB,GAAG,EAAE,4BAA4B;CAClC,CAAC;AAEF,MAAM,aAAa,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAwB,CAAC;AAEhF,iDAAiD;AACjD,SAAS,gBAAgB,CAAC,iBAAyB,EAAE,MAAc;IACjE,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,cAAc,CAAC;AACxB,CAAC;AAID,SAAS,eAAe,CACtB,OAA4B;IAE5B,kEAAkE;IAClE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Q,CAAC,UAAU,CAAC,EAAE;oBACrB;wBACE,QAAQ,EAAE,4CAA4C;wBACtD,OAAO,EAAE,QAAQ;qBAClB;iBACF;aACF,CAAC,CAAC;SACJ;aAAM;YACL,CAAC,CAAC,SAAS,CAAC,KAAgB,EAAE,EAAE,CAAC,CAAC;SACnC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,qBAAqB,CAAC,KAAK,GAAG,CAC5B,cAAsB,EACtB,aAAqB,EACrB,6BAAsC,EACtC,YAAgC,EAChC,yBAAkC,EAClC,EAAE;IACF,MAAM,uBAAuB,GAAG,YAAY;QAC1C,CAAC,CAAC,aAAa,YAAY,GAAG;QAC9B,CAAC,CAAC,gBAAgB,CAAC;IAErB,OAAO,sBACL,yBAAyB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QACtC,eAAe,uBAAuB,eAAe,aAAa,yBAChE,6BAA6B,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAC9C,EAAE,CAAC;AACL,CAAC,CAAC;AAEF,gFAAgF;AAChF,IAAA,aAAI,EAAC,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACvE,IAAA,aAAI,EAAC,qBAAqB,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACxE,IAAA,aAAI,EAAC,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AAC7D,IAAA,aAAI,EAAC,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;AACtE,IAAA,aAAI,EAAC,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"config-utils.test.js","sourceRoot":"","sources":["../src/config-utils.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;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AAC,KAAgB,EAAE,EAAE,CAAC,CAAC;aACnC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD,KAAK,EAAE,CACL,cAAkC,EAClC,aAAqB,EACrB,6BAAsC,EACtC,YAAgC,EAChC,yBAAkC,EAClC,EAAE;QACF,MAAM,uBAAuB,GAAG,YAAY;YAC1C,CAAC,CAAC,aAAa,YAAY,GAAG;YAC9B,CAAC,CAAC,gBAAgB,CAAC;QAErB,OAAO,sBACL,yBAAyB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QACtC,eAAe,uBAAuB,eAAe,aAAa,yBAChE,6BAA6B,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAC9C,EAAE,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,gFAAgF;AAChF,IAAA,aAAI,EAAC,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACvE,IAAA,aAAI,EAAC,qBAAqB,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACxE,IAAA,aAAI,EAAC,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AAC7D,IAAA,aAAI,EAAC,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;AACtE,IAAA,aAAI,EAAC,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/feature-flags.test.js.map b/lib/feature-flags.test.js.map index 561d816203..782acddb12 100644 --- a/lib/feature-flags.test.js.map +++ b/lib/feature-flags.test.js.map @@ -1 +1 @@ -{"version":3,"file":"feature-flags.test.js","sourceRoot":"","sources":["../src/feature-flags.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AAGvB,mDAAkE;AAClE,uCAA4C;AAC5C,6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AAC,WAAW,CAAC,GAAG,IAAI,CAAC;YACzC,IAAA,0CAA0B,EAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;YAEtD,MAAM,kBAAkB,GAAG;gBACzB,wBAAwB,EAAE,MAAM,YAAY,CAAC,QAAQ,CACnD,2BAAW,CAAC,sBAAsB,CACnC;gBACD,0BAA0B,EAAE,MAAM,YAAY,CAAC,QAAQ,CACrD,2BAAW,CAAC,uBAAuB,CACpC;aACF,CAAC;YAEF,CAAC,CAAC,SAAS,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;CACJ"} \ No newline at end of file +{"version":3,"file":"feature-flags.test.js","sourceRoot":"","sources":["../src/feature-flags.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AAGvB,mDAAkE;AAClE,uCAA4C;AAC5C,6CAAkD;AAClD,mDAMyB;AAEzB,iCAAgF;AAEhF,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,UAAU,CAAC,GAAG,EAAE;IACnB,IAAA,4BAAqB,EAAC,WAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAqB;IACvC,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,oBAAoB;CAC1B,CAAC;AAEF,MAAM,iBAAiB,GAAG,IAAA,+BAAkB,EAAC,gBAAgB,CAAC,CAAC;AAE/D,MAAM,mCAAmC,GAGpC;IACH;QACE,WAAW,EAAE,MAAM;QACnB,aAAa,EAAE,EAAE,IAAI,EAAE,oBAAa,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE;KAC9D;IACD,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,oBAAa,CAAC,IAAI,EAAE,EAAE;CACrE,CAAC;AAEF,KAAK,MAAM,OAAO,IAAI,mCAAmC,EAAE;IAC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,MAAM,WAAW,IAAI,aAAa,EAAE;IACvC,IAAA,aAAI,EAAC,iBAAiB,WAAW,6CAA6C,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QAC1F,MAAM,IAAA,iBAAU,EAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAChC,IAAA,gCAAgB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAEjC,MAAM,YAAY,GAAG,IAAI,kCAAkB,CACzC,EAAE,IAAI,EAAE,oBAAa,CAAC,MAAM,EAAE,EAC9B,cAAc,EACd,iBAAiB,EACjB,IAAA,yBAAe,EAAC,IAAI,CAAC,CACtB,CAAC;YAEF,MAAM,oBAAoB,GAAgC,EAAE,CAAC;YAC7D,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE;gBAC7B,oBAAoB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aACjC;YACD,oBAAoB,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;YACzC,IAAA,0CAA0B,EAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;YAEtD,MAAM,kBAAkB,GAAgC;gBACtD,wBAAwB,EAAE,MAAM,YAAY,CAAC,QAAQ,CACnD,2BAAW,CAAC,sBAAsB,CACnC;gBACD,0BAA0B,EAAE,MAAM,YAAY,CAAC,QAAQ,CACrD,2BAAW,CAAC,uBAAuB,CACpC;aACF,CAAC;YAEF,CAAC,CAAC,SAAS,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;CACJ"} \ No newline at end of file diff --git a/lib/testing-utils.js.map b/lib/testing-utils.js.map index 3d68152948..9f3c293ef9 100644 --- a/lib/testing-utils.js.map +++ b/lib/testing-utils.js.map @@ -1 +1 @@ -{"version":3,"file":"testing-utils.js","sourceRoot":"","sources":["../src/testing-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA0C;AAE1C,6CAA+B;AAE/B,wDAA0C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.test.js index 0f3cd966b1..145039cc12 100644 --- a/lib/tracer-config.test.js +++ b/lib/tracer-config.test.js @@ -162,7 +162,10 @@ function getTestConfig(tmpDir) { javascript: { spec, env: { a: "a", b: "b" } }, python: { spec, env: { b: "c" } }, }, config)); - t.deepEqual(e.message, "Incompatible values in environment parameter b: b and c"); + // If e is undefined, then the previous assertion will fail. + if (e !== undefined) { + t.deepEqual(e.message, "Incompatible values in environment parameter b: b and c"); + } }); }); (0, ava_1.default)("concatTracerConfigs - cpp spec lines come last if present", async (t) => { diff --git a/lib/tracer-config.test.js.map b/lib/tracer-config.test.js.map index c1b08a3da0..49c4539466 100644 --- a/lib/tracer-config.test.js.map +++ b/lib/tracer-config.test.js.map @@ -1 +1 @@ -{"version":3,"file":"tracer-config.test.js","sourceRoot":"","sources":["../src/tracer-config.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,8CAAuB;AAEvB,qCAAqC;AAErC,2CAAuC;AACvC,mDAA6C;AAC7C,mDAIyB;AACzB,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,SAAS,aAAa,CAAC,MAAc;IACnC,OAAO;QACL,SAAS,EAAE,CAAC,oBAAQ,CAAC,IAAI,CAAC;QAC1B,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAE;QACf,KAAK,EAAE,EAAE;QACT,iBAAiB,EAAE,EAAE;QACrB,OAAO,EAAE,MAAM;QACf,YAAY,EAAE,MAAM;QACpB,SAAS,EAAE,EAAE;QACb,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAwB;QACxE,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,kBAAkB,CAAC;QACpD,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,KAAK;QAChB,iBAAiB,EAAE,IAAI,CAAC,2BAA2B;QACnD,iBAAiB,EAAE,IA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AAE;YACvC,WAAW,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,IAAI,CACnC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,EAC9B,OAAO,EACP,SAAS,EACT,gBAAgB,CACjB,CAAC;SACH;QAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;YAChC,WAAW,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,IAAI,CACtC,UAAU,EACV,wBAAwB,CACzB,CAAC;SACH;aAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE;YACxC,WAAW,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,IAAI,CACtC,UAAU,EACV,oBAAoB,CACrB,CAAC;SACH;aAAM;YACL,WAAW,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,IAAI,CACtC,UAAU,EACV,sBAAsB,CACvB,CAAC;SACH;QAED,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC;YACxC,GAAG,EAAE,WAAW;SACjB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/util.test.js.map b/lib/util.test.js.map index 9ec6927ea5..e36904299b 100644 --- a/lib/util.test.js.map +++ b/lib/util.test.js.map @@ -1 +1 @@ -{"version":3,"file":"util.test.js","sourceRoot":"","sources":["../src/util.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,uCAAyB;AACzB,+CAAiC;AAEjC,wDAA0C;AAC1C,8CAA6C;AAC7C,6CAA+B;AAE/B,kDAAoC;AACpC,uCAAoD;AACpD,mDAA6C;AAC7C,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,IAAA,aAAI,EAAC,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE;IACzB,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CAAC;IACF,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,gBAAgB,CAC7B,CAAwB,EACxB,UAAkB,EAClB,QAAgB,EAChB,GAAG,IAAc;IAEjB,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAQ,CAAC;IAChD,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED,KAAK,UAAU,2BAA2B,CACxC,CAA4B,EAC5B,UAAkB,EAClB,GAAG,IAAc;IAEjB,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAQ,CAAC;IAChD,MAAM,CAAC,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAC7B,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CACvD,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/.bin/ava b/node_modules/.bin/ava index 0cb5f1bfa5..cfa66f3739 120000 --- a/node_modules/.bin/ava +++ b/node_modules/.bin/ava @@ -1 +1 @@ -../ava/cli.js \ No newline at end of file +../ava/entrypoints/cli.mjs \ No newline at end of file diff --git a/node_modules/.bin/import-local-fixture b/node_modules/.bin/import-local-fixture deleted file mode 120000 index ff4b104829..0000000000 --- a/node_modules/.bin/import-local-fixture +++ /dev/null @@ -1 +0,0 @@ -../import-local/fixtures/cli.js \ No newline at end of file diff --git a/node_modules/.bin/is-ci b/node_modules/.bin/is-ci deleted file mode 120000 index fe6aca6f50..0000000000 --- a/node_modules/.bin/is-ci +++ /dev/null @@ -1 +0,0 @@ -../is-ci/bin.js \ No newline at end of file diff --git a/node_modules/.bin/rc b/node_modules/.bin/rc deleted file mode 120000 index 48b3cda743..0000000000 --- a/node_modules/.bin/rc +++ /dev/null @@ -1 +0,0 @@ -../rc/cli.js \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index fdd0e676e8..5bb55afb3b 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -88,25 +88,25 @@ } }, "node_modules/@ava/typescript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@ava/typescript/-/typescript-2.0.0.tgz", - "integrity": "sha512-sn+upcMk81AMrlnx/hb/9T7gCGuBfw7hi+p79NPSSQMvY2G64mOB7qRaDExiHiZfZ7FN9j7HwQeFhHZLGD/NWQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@ava/typescript/-/typescript-3.0.1.tgz", + "integrity": "sha512-/JXIUuKsvkaneaiA9ckk3ksFTqvu0mDNlChASrTe2BnDsvMbhQdPWyqQjJ9WRJWVhhs5TWn1/0Pp1G6Rv8Syrw==", "dev": true, "dependencies": { - "escape-string-regexp": "^4.0.0", - "execa": "^5.0.0" + "escape-string-regexp": "^5.0.0", + "execa": "^5.1.1" }, "engines": { - "node": ">=12.22 <13 || >=14.16 <15 || >=15" + "node": ">=12.22 <13 || >=14.17 <15 || >=16.4 <17 || >=17" } }, "node_modules/@ava/typescript/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -148,25 +148,6 @@ "version": "1.0.2", "integrity": "sha512-xImXYK6iJvLEDMevGCs5s05iKoFn3ARFShBswRFeWeHp6P1Z0jlYmKcK5+M2TtDoWuz45ay1unmNvV/8t66F2g==" }, - "node_modules/@concordance/react": { - "version": "2.0.0", - "integrity": "sha512-huLSkUuM2/P+U0uy2WwlKuixMsTODD8p4JVQBI4VKeopkiN0C7M3N9XYVawb4M+4spN5RrO/eLhk7KoQX6nsfA==", - "dev": true, - "dependencies": { - "arrify": "^1.0.1" - }, - "engines": { - "node": ">=6.12.3 <7 || >=8.9.4 <9 || >=10.0.0" - } - }, - "node_modules/@concordance/react/node_modules/arrify": { - "version": "1.0.1", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@eslint/eslintrc": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", @@ -443,15 +424,6 @@ "@octokit/openapi-types": "^9.1.1" } }, - "node_modules/@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -487,18 +459,6 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, - "node_modules/@szmarczak/http-timer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", - "dev": true, - "dependencies": { - "defer-to-connect": "^1.0.1" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@types/color-name": { "version": "1.1.1", "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", @@ -555,11 +515,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.70.tgz", "integrity": "sha512-i5y7HTbvhonZQE+GnUM2rz1Bi8QkzxdQmEv1LKOv4nWyaQk/gdeiTApuQR3PDJHX7WomAbpx2wlWSEpxXGZ/UQ==" }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.0", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", - "dev": true - }, "node_modules/@types/semver": { "version": "7.3.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.8.tgz", @@ -893,15 +848,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-align": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", - "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", - "dev": true, - "dependencies": { - "string-width": "^4.1.0" - } - }, "node_modules/ansi-colors": { "version": "4.1.1", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", @@ -1024,79 +970,76 @@ } }, "node_modules/ava": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/ava/-/ava-3.15.0.tgz", - "integrity": "sha512-HGAnk1SHPk4Sx6plFAUkzV/XC1j9+iQhOzt4vBly18/yo0AV8Oytx7mtJd/CR8igCJ5p160N/Oo/cNJi2uSeWA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/ava/-/ava-4.0.1.tgz", + "integrity": "sha512-+12A/JDWyShBCZAKISEEPyM2dwkUrrAfPILqXi4LI4Aa58d92PzjY829hmuoSeACPNqrn2Wlbnja8c/n7bKV6Q==", "dev": true, "dependencies": { - "@concordance/react": "^2.0.0", - "acorn": "^8.0.4", - "acorn-walk": "^8.0.0", - "ansi-styles": "^5.0.0", + "acorn": "^8.7.0", + "acorn-walk": "^8.2.0", + "ansi-styles": "^6.1.0", "arrgv": "^1.0.2", - "arrify": "^2.0.1", - "callsites": "^3.1.0", - "chalk": "^4.1.0", - "chokidar": "^3.4.3", + "arrify": "^3.0.0", + "callsites": "^4.0.0", + "cbor": "^8.1.0", + "chalk": "^5.0.0", + "chokidar": "^3.5.2", "chunkd": "^2.0.1", - "ci-info": "^2.0.0", + "ci-info": "^3.3.0", "ci-parallel-vars": "^1.0.1", "clean-yaml-object": "^0.1.0", - "cli-cursor": "^3.1.0", - "cli-truncate": "^2.1.0", + "cli-truncate": "^3.1.0", "code-excerpt": "^3.0.0", "common-path-prefix": "^3.0.0", - "concordance": "^5.0.1", - "convert-source-map": "^1.7.0", + "concordance": "^5.0.4", "currently-unhandled": "^0.4.1", - "debug": "^4.3.1", + "debug": "^4.3.3", "del": "^6.0.0", - "emittery": "^0.8.0", - "equal-length": "^1.0.0", - "figures": "^3.2.0", - "globby": "^11.0.1", + "emittery": "^0.10.0", + "figures": "^4.0.0", + "globby": "^12.0.2", "ignore-by-default": "^2.0.0", - "import-local": "^3.0.2", - "indent-string": "^4.0.0", + "indent-string": "^5.0.0", "is-error": "^2.2.2", "is-plain-object": "^5.0.0", "is-promise": "^4.0.0", - "lodash": "^4.17.20", - "matcher": "^3.0.0", - "md5-hex": "^3.0.1", - "mem": "^8.0.0", + "matcher": "^5.0.0", + "mem": "^9.0.1", "ms": "^2.1.3", - "ora": "^5.2.0", - "p-event": "^4.2.0", - "p-map": "^4.0.0", - "picomatch": "^2.2.2", - "pkg-conf": "^3.1.0", - "plur": "^4.0.0", + "p-event": "^5.0.1", + "p-map": "^5.3.0", + "picomatch": "^2.3.0", + "pkg-conf": "^4.0.0", + "plur": "^5.1.0", "pretty-ms": "^7.0.1", - "read-pkg": "^5.2.0", "resolve-cwd": "^3.0.0", "slash": "^3.0.0", - "source-map-support": "^0.5.19", - "stack-utils": "^2.0.3", - "strip-ansi": "^6.0.0", + "stack-utils": "^2.0.5", + "strip-ansi": "^7.0.1", "supertap": "^2.0.0", "temp-dir": "^2.0.0", - "trim-off-newlines": "^1.0.1", - "update-notifier": "^5.0.1", "write-file-atomic": "^3.0.3", - "yargs": "^16.2.0" + "yargs": "^17.3.1" }, "bin": { - "ava": "cli.js" + "ava": "entrypoints/cli.mjs" }, "engines": { - "node": ">=10.18.0 <11 || >=12.14.0 <12.17.0 || >=12.17.0 <13 || >=14.0.0 <15 || >=15" + "node": ">=12.22 <13 || >=14.17 <15 || >=16.4 <17 || >=17" + }, + "peerDependencies": { + "@ava/typescript": "*" + }, + "peerDependenciesMeta": { + "@ava/typescript": { + "optional": true + } } }, "node_modules/ava/node_modules/acorn": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", - "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1105,74 +1048,163 @@ "node": ">=0.4.0" } }, + "node_modules/ava/node_modules/aggregate-error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.0.tgz", + "integrity": "sha512-8DGp7zUt1E9k0NE2q4jlXHk+V3ORErmwolEdRz9iV+LKJ40WhMHh92cxAvhqV2I+zEn/gotIoqoMs0NjF3xofg==", + "dev": true, + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ava/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, "node_modules/ava/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", + "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/ava/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/ava/node_modules/array-union": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-3.0.1.tgz", + "integrity": "sha512-1OvF9IbWwaeiM9VhzYXVQacMibxpXOMYVNIvMtKRyX9SImBXpKcFr8XvFDeEslCyuH/t6KRt7HEO94AlP8Iatw==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "engines": { + "node": ">=12" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ava/node_modules/arrify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz", + "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==", + "dev": true, "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ava/node_modules/callsites": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-4.0.0.tgz", + "integrity": "sha512-y3jRROutgpKdz5vzEhWM34TidDU8vkJppF8dszITeb1PQmSqV3DTxyV8G/lyO/DNvtE1YTedehmw9MPZsCBHxQ==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ava/node_modules/chalk": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.0.tgz", + "integrity": "sha512-/duVOqst+luxCQRKEo4bNxinsOQtMP80ZYm7mMqzuh5PociNL0PvmHFvREJ9ueYL2TxlHjBcmLCdmocx9Vg+IQ==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/ava/node_modules/chalk/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/ava/node_modules/clean-stack": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.1.0.tgz", + "integrity": "sha512-dxXQYI7mfQVcaF12s6sjNFoZ6ZPDQuBBLp3QJ5156k9EvUFClUoZ11fo8HnLQO241DDVntHEug8MOuFO5PSfRg==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "escape-string-regexp": "5.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ava/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/ava/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ava/node_modules/globby": { + "version": "12.2.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-12.2.0.tgz", + "integrity": "sha512-wiSuFQLZ+urS9x2gGPl1H5drc5twabmm4m2gTR27XDFyjUHJUNsS8o/2aKyIF6IoBaR630atdher0XJ5g6OMmA==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "array-union": "^3.0.1", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.7", + "ignore": "^5.1.9", + "merge2": "^1.4.1", + "slash": "^4.0.0" }, "engines": { - "node": ">=7.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ava/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/ava/node_modules/has-flag": { + "node_modules/ava/node_modules/globby/node_modules/slash": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ava/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ava/node_modules/ms": { @@ -1181,51 +1213,40 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/ava/node_modules/source-map-support": { - "version": "0.5.19", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "node_modules/ava/node_modules/p-map": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.3.0.tgz", + "integrity": "sha512-SRbIQFoLYNezHkqZslqeg963HYUtqOrfMCxjNrFOpJ19WTYuq26rQoOXeX8QQiMLUlLqdYV/7PuDsdYJ7hLE1w==", "dev": true, "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "aggregate-error": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ava/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/ava/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/balanced-match": { "version": "1.0.0", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/before-after-hook": { "version": "2.1.0", "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==" @@ -1239,37 +1260,6 @@ "node": ">=8" } }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/bl/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/bl/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/blueimp-md5": { "version": "2.15.0", "integrity": "sha512-Zc6sowqlCWu3+V0bocZwdaPPXlRv14EHtYcQDCOghj9EdyKLMkAOODBh3HHAx5r7QRylDYCOaXa/b/edgBLDpA==", @@ -1279,236 +1269,64 @@ "version": "2.19.5", "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" }, - "node_modules/boxen": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", - "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", - "dev": true, + "node_modules/brace-expansion": { + "version": "1.1.11", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dependencies": { - "ansi-align": "^3.0.0", - "camelcase": "^6.2.0", - "chalk": "^4.1.0", - "cli-boxes": "^2.2.1", - "string-width": "^4.2.2", - "type-fest": "^0.20.2", - "widest-line": "^3.1.0", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/boxen/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, + "node_modules/braces": { + "version": "3.0.2", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dependencies": { - "color-convert": "^2.0.1" + "fill-range": "^7.0.1" }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/boxen/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/boxen/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/callsites": { + "version": "3.1.0", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, "engines": { - "node": ">=7.0.0" + "node": ">=6" } }, - "node_modules/boxen/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/boxen/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/cbor": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz", + "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", "dev": true, + "dependencies": { + "nofilter": "^3.1.0" + }, "engines": { - "node": ">=8" + "node": ">=12.19" } }, - "node_modules/boxen/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, + "node_modules/chalk": { + "version": "2.4.2", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/buffer-from": { - "version": "1.1.1", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "node_modules/cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", - "dev": true, - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cacheable-request/node_modules/normalize-url": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", - "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "engines": { "node": ">=4" @@ -1548,9 +1366,9 @@ "dev": true }, "node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", + "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==", "dev": true }, "node_modules/ci-parallel-vars": { @@ -1574,55 +1392,70 @@ "node": ">=0.10.0" } }, - "node_modules/cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "node_modules/cli-truncate": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", + "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", "dev": true, + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^5.0.0" + }, "engines": { - "node": ">=6" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "node_modules/cli-truncate/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, - "dependencies": { - "restore-cursor": "^3.1.0" - }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/cli-spinners": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", - "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", + "node_modules/cli-truncate/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.0.tgz", + "integrity": "sha512-7x54QnN21P+XL/v8SuNKvfgsUre6PXpN7mc77N3HlZv+f1SBRGmjxtOud2Z6FZ8DmdkD/IdjCaf9XXbnqmTZGQ==", "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, "engines": { - "node": ">=6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cli-truncate": { - "version": "2.1.0", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "node_modules/cli-truncate/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "dependencies": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/cliui": { @@ -1636,24 +1469,6 @@ "wrap-ansi": "^7.0.0" } }, - "node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", - "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" - } - }, "node_modules/code-excerpt": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-3.0.0.tgz", @@ -1713,35 +1528,10 @@ "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14" } }, - "node_modules/configstore": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", - "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", - "dev": true, - "dependencies": { - "dot-prop": "^5.2.0", - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "unique-string": "^2.0.0", - "write-file-atomic": "^3.0.0", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/console-log-level": { "version": "1.4.1", "integrity": "sha512-VZzbIORbP+PPcN/gg3DXClTLPLg5Slwd5fL2MIc+o1qZ4BXBvWyc6QxPk6T/Mkr6IVjRpoAGf32XxP3ZWMVRcQ==" }, - "node_modules/convert-source-map": { - "version": "1.7.0", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, "node_modules/convert-to-spaces": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz", @@ -1778,15 +1568,6 @@ "node": "*" } }, - "node_modules/crypto-random-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", - "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/currently-unhandled": { "version": "0.4.1", "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", @@ -1811,9 +1592,9 @@ } }, "node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -1834,47 +1615,11 @@ "node": ">=0.10" } }, - "node_modules/decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/deep-is": { "version": "0.1.3", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "node_modules/defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "dependencies": { - "clone": "^1.0.2" - } - }, - "node_modules/defer-to-connect": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", - "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", - "dev": true - }, "node_modules/define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -1943,31 +1688,19 @@ "node": ">=0.10.0" } }, - "node_modules/dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "dev": true, - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, "node_modules/emittery": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", - "integrity": "sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.10.0.tgz", + "integrity": "sha512-AGvFfs+d0JKCJQ4o01ASQLGPmSCxgfU9RFXvzPvZdjKK8oscynksuJhWrSTSw7j7Ep/sZct5b5ZhYCi8S/t0HQ==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sindresorhus/emittery?sponsor=1" @@ -1978,15 +1711,6 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "dependencies": { - "once": "^1.4.0" - } - }, "node_modules/enquirer": { "version": "2.3.6", "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", @@ -1998,14 +1722,6 @@ "node": ">=8.6" } }, - "node_modules/equal-length": { - "version": "1.0.1", - "integrity": "sha1-IcoRLUirJLTh5//A5TOdMf38J0w=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/error-ex": { "version": "1.3.2", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", @@ -2070,15 +1786,6 @@ "node": ">=6" } }, - "node_modules/escape-goat": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", - "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/escape-string-regexp": { "version": "1.0.5", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", @@ -2909,18 +2616,18 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.2", - "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", + "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.4" }, "engines": { - "node": ">=8" + "node": ">=8.6.0" } }, "node_modules/fast-json-stable-stringify": { @@ -2942,14 +2649,28 @@ } }, "node_modules/figures": { - "version": "3.2.0", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-4.0.0.tgz", + "integrity": "sha512-VnYcWq6H6F0qDN0QnorznBr0abEovifzUokmnezpKZBUbDmbLAt7LMryOp1TKFVxLxyNYkxEkCEADZR58U9oSw==", "dev": true, "dependencies": { - "escape-string-regexp": "^1.0.5" + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2992,15 +2713,19 @@ } }, "node_modules/find-up": { - "version": "4.1.0", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.2.0.tgz", + "integrity": "sha512-yWHzMzXCaFoABSnFTCPKNFlYoq4mSga9QLRRKOCLSJ33hSkzROB14ITbAWW0QDQDyuzsPQ33S1DsOWQb/oW1yA==", "dev": true, "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "locate-path": "^7.0.0", + "path-exists": "^5.0.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/flat-cache": { @@ -3087,18 +2812,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/github-linguist": { "version": "2.4.4", "resolved": "https://registry.npmjs.org/github-linguist/-/github-linguist-2.4.4.tgz", @@ -3169,21 +2882,6 @@ "node": ">= 6" } }, - "node_modules/global-dirs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", - "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", - "dev": true, - "dependencies": { - "ini": "2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/globals": { "version": "13.10.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz", @@ -3218,28 +2916,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/got": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", - "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/graceful-fs": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", @@ -3285,26 +2961,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-yarn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", - "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/hosted-git-info": { "version": "2.8.9", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, - "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", - "dev": true - }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -3314,29 +2975,10 @@ "node": ">=10.17.0" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/ignore": { - "version": "5.1.4", - "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "engines": { "node": ">= 4" } @@ -3381,30 +3023,6 @@ "node": ">=4" } }, - "node_modules/import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/import-local": { - "version": "3.0.2", - "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", - "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/imurmurhash": { "version": "0.1.4", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", @@ -3432,18 +3050,10 @@ "version": "2.0.3", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, - "node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/irregular-plurals": { - "version": "3.2.0", - "integrity": "sha512-YqTdPLfwP7YFN0SsD3QUVCkm9ZG2VzOXv3DOrw5G5mkMbVwptTwVcFv7/C0vOpBmgTxAeTG19XpUs1E522LW9Q==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.3.0.tgz", + "integrity": "sha512-MVBLKUTangM3EfRPFROhmWQQKRDsrgI83J8GS3jXy+OwYqiR2/aoWndYQ5416jLE3uaGgLH7ncme3X9y09gZ3g==", "dev": true, "engines": { "node": ">=8" @@ -3506,18 +3116,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "dependencies": { - "ci-info": "^2.0.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/is-core-module": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.5.0.tgz", @@ -3572,31 +3170,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-installed-globally": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", - "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", - "dev": true, - "dependencies": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", @@ -3609,18 +3182,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-npm": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", - "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-number": { "version": "7.0.0", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", @@ -3640,15 +3201,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-path-cwd": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", @@ -3741,23 +3293,17 @@ "dev": true }, "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.1.0.tgz", + "integrity": "sha512-lDcxivp8TJpLG75/DpatAqNzOpDPSpED8XNtrpBHTdQ2InQ1PbW78jhwSxyxhhu+xbVSast2X38bwj8atwoUQA==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-yarn-global": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", - "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", - "dev": true - }, "node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -3796,12 +3342,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", - "dev": true - }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", @@ -3866,31 +3406,10 @@ "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, - "node_modules/keyv": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", - "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", - "dev": true, - "dependencies": { - "json-buffer": "3.0.0" - } - }, "node_modules/language-map": { "version": "1.4.0", "integrity": "sha512-5XHMCqKQ/14VXwJTKZX7MZwsVyTrR0bwCsRBwrBq3nP4w7liMJiR0ixXgI29EF/T1/U6be8cYK2y0ibWW9kx2w==" }, - "node_modules/latest-version": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", - "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", - "dev": true, - "dependencies": { - "package-json": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/levn": { "version": "0.4.1", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", @@ -3912,51 +3431,31 @@ "immediate": "~3.0.5" } }, - "node_modules/lines-and-columns": { - "version": "1.1.6", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, "node_modules/load-json-file": { - "version": "5.3.0", - "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.15", - "parse-json": "^4.0.0", - "pify": "^4.0.1", - "strip-bom": "^3.0.0", - "type-fest": "^0.3.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/load-json-file/node_modules/strip-bom": { - "version": "3.0.0", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/load-json-file/node_modules/type-fest": { - "version": "0.3.1", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-7.0.1.tgz", + "integrity": "sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==", "dev": true, "engines": { - "node": ">=6" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/locate-path": { - "version": "5.0.0", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.0.0.tgz", + "integrity": "sha512-+cg2yXqDUKfo4hsFxwa3G1cBJeA+gs1vD8FyV9/odWoUlQe/4syxHQ5DPtKjtfm6gnKbZzjCqzX03kXosvZB1w==", "dev": true, "dependencies": { - "p-locate": "^4.1.0" + "p-locate": "^6.0.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash": { @@ -4012,106 +3511,11 @@ "integrity": "sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984=", "dev": true }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/log-symbols/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/log-symbols/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/log-symbols/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/long": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" }, - "node_modules/lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -4123,30 +3527,6 @@ "node": ">=10" } }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/map-age-cleaner": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", @@ -4160,22 +3540,27 @@ } }, "node_modules/matcher": { - "version": "3.0.0", - "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-5.0.0.tgz", + "integrity": "sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==", "dev": true, "dependencies": { - "escape-string-regexp": "^4.0.0" + "escape-string-regexp": "^5.0.0" }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/matcher/node_modules/escape-string-regexp": { - "version": "4.0.0", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4203,28 +3588,31 @@ } }, "node_modules/mem": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/mem/-/mem-8.1.1.tgz", - "integrity": "sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/mem/-/mem-9.0.2.tgz", + "integrity": "sha512-F2t4YIv9XQUBHt6AOJ0y7lSmP1+cY7Fm1DRh9GClTGzKST7UWLMx6ly9WZdLH/G/ppM5RL4MlQfRT71ri9t19A==", "dev": true, "dependencies": { "map-age-cleaner": "^0.1.3", - "mimic-fn": "^3.1.0" + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=12.20" }, "funding": { "url": "https://github.com/sindresorhus/mem?sponsor=1" } }, "node_modules/mem/node_modules/mimic-fn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", - "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/merge-stream": { @@ -4234,10 +3622,11 @@ "dev": true }, "node_modules/merge2": { - "version": "1.3.0", - "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "engines": { - "node": ">= 6" + "node": ">= 8" } }, "node_modules/micromatch": { @@ -4260,15 +3649,6 @@ "node": ">=6" } }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/minimatch": { "version": "3.0.4", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", @@ -4341,6 +3721,15 @@ } } }, + "node_modules/nofilter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", + "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", + "dev": true, + "engines": { + "node": ">=12.19" + } + }, "node_modules/normalize-package-data": { "version": "2.5.0", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", @@ -4479,108 +3868,6 @@ "node": ">= 0.8.0" } }, - "node_modules/ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", - "dev": true, - "dependencies": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ora/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/ora/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/ora/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/ora/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/ora/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ora/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -4591,49 +3878,48 @@ } }, "node_modules/p-event": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", - "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-5.0.1.tgz", + "integrity": "sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==", "dev": true, "dependencies": { - "p-timeout": "^3.1.0" + "p-timeout": "^5.0.2" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/p-limit": { - "version": "2.2.1", - "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^1.0.0" }, "engines": { - "node": ">=6" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { - "version": "4.1.0", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, "dependencies": { - "p-limit": "^2.2.0" + "p-limit": "^4.0.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-map": { @@ -4650,47 +3936,15 @@ } }, "node_modules/p-timeout": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", - "dev": true, - "dependencies": { - "p-finally": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.0.2.tgz", + "integrity": "sha512-sEmji9Yaq+Tw+STwsGAE56hf7gMy9p0tQfJojIAamB7WHJYJKf1qlsg9jqBWG8q9VCxKPhZaP/AcXwEoBcYQhQ==", "dev": true, "engines": { - "node": ">=6" - } - }, - "node_modules/package-json": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", - "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", - "dev": true, - "dependencies": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" + "node": ">=12" }, - "engines": { - "node": ">=8" - } - }, - "node_modules/package-json/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/pako": { @@ -4741,11 +3995,12 @@ } }, "node_modules/path-exists": { - "version": "4.0.0", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/path-is-absolute": { @@ -4797,14 +4052,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pify": { - "version": "4.0.1", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/pinkie": { "version": "2.0.4", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", @@ -4823,37 +4070,19 @@ } }, "node_modules/pkg-conf": { - "version": "3.1.0", - "integrity": "sha512-m0OTbR/5VPNPqO1ph6Fqbj7Hv6QU7gR/tQW40ZqrL1rjgCU85W6C1bJn0BItuJqnR98PWzw7Z8hHeChD1WrgdQ==", - "dev": true, - "dependencies": { - "find-up": "^3.0.0", - "load-json-file": "^5.2.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-conf/node_modules/find-up": { - "version": "3.0.0", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-4.0.0.tgz", + "integrity": "sha512-7dmgi4UY4qk+4mj5Cd8v/GExPo0K+SlY+hulOSdfZ/T6jVH6//y7NtzZo5WrfhDBxuQ0jCa7fLZmNaNh7EWL/w==", "dev": true, "dependencies": { - "locate-path": "^3.0.0" + "find-up": "^6.0.0", + "load-json-file": "^7.0.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/pkg-up": { @@ -4936,14 +4165,15 @@ } }, "node_modules/plur": { - "version": "4.0.0", - "integrity": "sha512-4UGewrYgqDFw9vV6zNV+ADmPAUAfJPKtGvb/VdpQAx25X5f3xXdGdyOEVFwkl8Hl/tl7+xbeHqSEM+D5/TirUg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-5.1.0.tgz", + "integrity": "sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==", "dev": true, "dependencies": { - "irregular-plurals": "^3.2.0" + "irregular-plurals": "^3.3.0" }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4957,15 +4187,6 @@ "node": ">= 0.8.0" } }, - "node_modules/prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/prettier": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", @@ -5030,18 +4251,8 @@ "version": "2.0.1", "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "engines": { + "node": ">= 8" } }, "node_modules/punycode": { @@ -5053,18 +4264,6 @@ "node": ">=6" } }, - "node_modules/pupa": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", - "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", - "dev": true, - "dependencies": { - "escape-goat": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/query-string": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.0.1.tgz", @@ -5082,41 +4281,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/rc/node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "node_modules/read-pkg": { - "version": "5.2.0", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/read-pkg-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", @@ -5247,28 +4411,6 @@ "node": ">=4" } }, - "node_modules/read-pkg/node_modules/parse-json": { - "version": "5.0.0", - "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg/node_modules/type-fest": { - "version": "0.6.0", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -5313,30 +4455,6 @@ "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/registry-auth-token": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", - "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", - "dev": true, - "dependencies": { - "rc": "^1.2.8" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/registry-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", - "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", - "dev": true, - "dependencies": { - "rc": "^1.2.8" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/removeNPMAbsolutePaths": { "version": "2.0.0", "integrity": "sha512-Hea7U6iJcD0NE/aqBqxBMPKeKaxjqMNyTTajmH2dH9hhafJ9Tem5r4UeJK8+BdE1MK9lqoOYqNM0Sq9rl1OIbQ==", @@ -5389,6 +4507,7 @@ }, "node_modules/resolve-cwd": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, "dependencies": { @@ -5400,34 +4519,13 @@ }, "node_modules/resolve-from": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", - "dev": true, - "dependencies": { - "lowercase-keys": "^1.0.0" - } - }, - "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/reusify": { "version": "1.0.4", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", @@ -5472,27 +4570,6 @@ "node": ">=10" } }, - "node_modules/semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", - "dev": true, - "dependencies": { - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/semver-diff/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/serialize-error": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", @@ -5619,55 +4696,43 @@ } }, "node_modules/slice-ansi": { - "version": "3.0.0", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.2.1", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", + "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==", "dev": true, - "dependencies": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/source-map": { - "version": "0.6.1", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/spdx-correct": { @@ -5817,15 +4882,6 @@ "node": ">=6" } }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/supertap": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supertap/-/supertap-2.0.0.tgz", @@ -6021,15 +5077,6 @@ "rimraf": "bin.js" } }, - "node_modules/to-readable-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", - "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", @@ -6045,15 +5092,6 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, - "node_modules/trim-off-newlines": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.3.tgz", - "integrity": "sha512-kh6Tu6GbeSNMGfrrZh6Bb/4ZEHV1QlB4xNDBeog8Y9/QwFlKTRyWvY3Fs9tRDAMZliVUwieMgEdIeL/FtqjkJg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/tsconfig-paths": { "version": "3.9.0", "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", @@ -6154,18 +5192,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/unique-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", - "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", - "dev": true, - "dependencies": { - "crypto-random-string": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/universal-user-agent": { "version": "6.0.0", "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" @@ -6177,104 +5203,6 @@ "node": ">= 4.0.0" } }, - "node_modules/update-notifier": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", - "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", - "dev": true, - "dependencies": { - "boxen": "^5.0.0", - "chalk": "^4.1.0", - "configstore": "^5.0.1", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.4.0", - "is-npm": "^5.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.1.0", - "pupa": "^2.1.1", - "semver": "^7.3.4", - "semver-diff": "^3.1.1", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/yeoman/update-notifier?sponsor=1" - } - }, - "node_modules/update-notifier/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/update-notifier/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/update-notifier/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/update-notifier/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/update-notifier/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/update-notifier/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -6284,18 +5212,6 @@ "punycode": "^2.1.0" } }, - "node_modules/url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", - "dev": true, - "dependencies": { - "prepend-http": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/util": { "version": "0.10.4", "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", @@ -6331,15 +5247,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, - "dependencies": { - "defaults": "^1.0.3" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -6394,18 +5301,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, - "dependencies": { - "string-width": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/word-wrap": { "version": "1.2.3", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", @@ -6480,15 +5375,6 @@ "typedarray-to-buffer": "^3.1.5" } }, - "node_modules/xdg-basedir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", - "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -6504,30 +5390,42 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", "dev": true, "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/zlib": { diff --git a/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/license b/node_modules/@ava/typescript/LICENSE similarity index 93% rename from node_modules/ava/node_modules/chalk/node_modules/ansi-styles/license rename to node_modules/@ava/typescript/LICENSE index e7af2f7710..27cef47a90 100644 --- a/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/license +++ b/node_modules/@ava/typescript/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Mark Wubben (https://novemberborn.net) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/node_modules/@ava/typescript/README.md b/node_modules/@ava/typescript/README.md index 44660382ee..4c7c1ff14c 100644 --- a/node_modules/@ava/typescript/README.md +++ b/node_modules/@ava/typescript/README.md @@ -1,11 +1,21 @@ # @ava/typescript -Adds [TypeScript](https://www.typescriptlang.org/) support to [AVA](https://avajs.dev). +Adds [TypeScript](https://www.typescriptlang.org/) support to [AVA 4](https://avajs.dev). This is designed to work for projects that precompile TypeScript. It allows AVA to load the compiled JavaScript, while configuring AVA to treat the TypeScript files as test files. In other words, say you have a test file at `src/test.ts`. You've configured TypeScript to output to `build/`. Using `@ava/typescript` you can run the test using `npx ava src/test.ts`. +## For AVA 3 users + +Use version 2: + +```console +npm install --save-dev @ava/typescript@2 +``` + +Note that v2 does not support ES modules. This requires v3 and AVA 4. + ## Enabling TypeScript support Add this package to your project: @@ -39,6 +49,10 @@ Output files are expected to have the `.js` extension. AVA searches your entire project for `*.js`, `*.cjs`, `*.mjs` and `*.ts` files (or other extensions you've configured). It will ignore such files found in the `rewritePaths` targets (e.g. `build/`). If you use more specific paths, for instance `build/main/`, you may need to change AVA's `files` configuration to ignore other directories. +## ES Modules + +If your `package.json` has configured `"type": "module"`, or you've configured AVA to treat the `js` extension as `module`, then `@ava/typescript` will import the output file as an ES module. Note that this is based on the *output file*, not the `ts` extension. + ## Add additional extensions You can configure AVA to recognize additional file extensions. To add (partial†) JSX support: diff --git a/node_modules/@ava/typescript/index.js b/node_modules/@ava/typescript/index.js index 8fc5369662..ad5983ccc5 100644 --- a/node_modules/@ava/typescript/index.js +++ b/node_modules/@ava/typescript/index.js @@ -1,9 +1,10 @@ -'use strict'; -const path = require('path'); -const escapeStringRegexp = require('escape-string-regexp'); -const execa = require('execa'); -const pkg = require('./package.json'); +import fs from 'node:fs'; +import path from 'node:path'; +import {pathToFileURL} from 'node:url'; +import escapeStringRegexp from 'escape-string-regexp'; +import execa from 'execa'; +const pkg = JSON.parse(fs.readFileSync(new URL('package.json', import.meta.url))); const help = `See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md`; function isPlainObject(x) { @@ -44,7 +45,7 @@ const configProperties = { required: true, isValid(compile) { return compile === false || compile === 'tsc'; - } + }, }, rewritePaths: { required: true, @@ -53,23 +54,21 @@ const configProperties = { return false; } - return Object.entries(rewritePaths).every(([from, to]) => { - return from.endsWith('/') && typeof to === 'string' && to.endsWith('/'); - }); - } + return Object.entries(rewritePaths).every(([from, to]) => from.endsWith('/') && typeof to === 'string' && to.endsWith('/')); + }, }, extensions: { required: false, isValid(extensions) { - return Array.isArray(extensions) && - extensions.length > 0 && - extensions.every(ext => typeof ext === 'string' && ext !== '') && - new Set(extensions).size === extensions.length; - } - } + return Array.isArray(extensions) + && extensions.length > 0 + && extensions.every(ext => typeof ext === 'string' && ext !== '') + && new Set(extensions).size === extensions.length; + }, + }, }; -module.exports = ({negotiateProtocol}) => { +export default function typescriptProvider({negotiateProtocol}) { const protocol = negotiateProtocol(['ava-3.2'], {version: pkg.version}); if (protocol === null) { return; @@ -86,12 +85,12 @@ module.exports = ({negotiateProtocol}) => { const { extensions = ['ts'], rewritePaths: relativeRewritePaths, - compile + compile, } = config; const rewritePaths = Object.entries(relativeRewritePaths).map(([from, to]) => [ path.join(protocol.projectDir, from), - path.join(protocol.projectDir, to) + path.join(protocol.projectDir, to), ]); const testFileExtension = new RegExp(`\\.(${extensions.map(ext => escapeStringRegexp(ext)).join('|')})$`); @@ -102,13 +101,13 @@ module.exports = ({negotiateProtocol}) => { } return { - extensions: extensions.slice(), - rewritePaths: rewritePaths.slice() + extensions: [...extensions], + rewritePaths: [...rewritePaths], }; }, get extensions() { - return extensions.slice(); + return [...extensions]; }, ignoreChange(filePath) { @@ -139,18 +138,19 @@ module.exports = ({negotiateProtocol}) => { filePatterns: [ ...filePatterns, '!**/*.d.ts', - ...Object.values(relativeRewritePaths).map(to => `!${to}**`) + ...Object.values(relativeRewritePaths).map(to => `!${to}**`), ], ignoredByWatcherPatterns: [ ...ignoredByWatcherPatterns, - ...Object.values(relativeRewritePaths).map(to => `${to}**/*.js.map`) - ] + ...Object.values(relativeRewritePaths).map(to => `${to}**/*.js.map`), + ], }; - } + }, }; }, worker({extensionsToLoadAsModules, state: {extensions, rewritePaths}}) { + const useImport = extensionsToLoadAsModules.includes('js'); const testFileExtension = new RegExp(`\\.(${extensions.map(ext => escapeStringRegexp(ext)).join('|')})$`); return { @@ -159,18 +159,12 @@ module.exports = ({negotiateProtocol}) => { }, async load(ref, {requireFn}) { - for (const extension of extensionsToLoadAsModules) { - if (ref.endsWith(`.${extension}`)) { - throw new Error('@ava/typescript cannot yet load ESM files'); - } - } - const [from, to] = rewritePaths.find(([from]) => ref.startsWith(from)); // TODO: Support JSX preserve mode — https://www.typescriptlang.org/docs/handbook/jsx.html const rewritten = `${to}${ref.slice(from.length)}`.replace(testFileExtension, '.js'); - return requireFn(rewritten); - } + return useImport ? import(pathToFileURL(rewritten)) : requireFn(rewritten); // eslint-disable-line node/no-unsupported-features/es-syntax + }, }; - } + }, }; -}; +} diff --git a/node_modules/@ava/typescript/node_modules/escape-string-regexp/index.d.ts b/node_modules/@ava/typescript/node_modules/escape-string-regexp/index.d.ts index 7d34edc7c5..e8f928814c 100644 --- a/node_modules/@ava/typescript/node_modules/escape-string-regexp/index.d.ts +++ b/node_modules/@ava/typescript/node_modules/escape-string-regexp/index.d.ts @@ -5,7 +5,7 @@ You can also use this to escape a string that is inserted into the middle of a r @example ``` -import escapeStringRegexp = require('escape-string-regexp'); +import escapeStringRegexp from 'escape-string-regexp'; const escapedString = escapeStringRegexp('How much $ for a 🦄?'); //=> 'How much \\$ for a 🦄\\?' @@ -13,6 +13,4 @@ const escapedString = escapeStringRegexp('How much $ for a 🦄?'); new RegExp(escapedString); ``` */ -declare const escapeStringRegexp: (string: string) => string; - -export = escapeStringRegexp; +export default function escapeStringRegexp(string: string): string; diff --git a/node_modules/@ava/typescript/node_modules/escape-string-regexp/index.js b/node_modules/@ava/typescript/node_modules/escape-string-regexp/index.js index 387c5615a7..9ce9323ff2 100644 --- a/node_modules/@ava/typescript/node_modules/escape-string-regexp/index.js +++ b/node_modules/@ava/typescript/node_modules/escape-string-regexp/index.js @@ -1,13 +1,11 @@ -'use strict'; - -module.exports = string => { +export default function escapeStringRegexp(string) { if (typeof string !== 'string') { throw new TypeError('Expected a string'); } // Escape characters with special meaning either inside or outside character sets. - // Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. + // Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. return string .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') .replace(/-/g, '\\x2d'); -}; +} diff --git a/node_modules/@ava/typescript/node_modules/escape-string-regexp/package.json b/node_modules/@ava/typescript/node_modules/escape-string-regexp/package.json index 053b31334f..4e7d8199b9 100644 --- a/node_modules/@ava/typescript/node_modules/escape-string-regexp/package.json +++ b/node_modules/@ava/typescript/node_modules/escape-string-regexp/package.json @@ -1,6 +1,6 @@ { "name": "escape-string-regexp", - "version": "4.0.0", + "version": "5.0.0", "description": "Escape RegExp special characters", "license": "MIT", "repository": "sindresorhus/escape-string-regexp", @@ -10,8 +10,10 @@ "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, + "type": "module", + "exports": "./index.js", "engines": { - "node": ">=10" + "node": ">=12" }, "scripts": { "test": "xo && ava && tsd" @@ -31,8 +33,8 @@ "characters" ], "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.11.0", - "xo": "^0.28.3" + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" } } \ No newline at end of file diff --git a/node_modules/@ava/typescript/node_modules/escape-string-regexp/readme.md b/node_modules/@ava/typescript/node_modules/escape-string-regexp/readme.md index 2945dfcb23..839df6e51c 100644 --- a/node_modules/@ava/typescript/node_modules/escape-string-regexp/readme.md +++ b/node_modules/@ava/typescript/node_modules/escape-string-regexp/readme.md @@ -1,4 +1,4 @@ -# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) +# escape-string-regexp > Escape RegExp special characters @@ -11,7 +11,7 @@ $ npm install escape-string-regexp ## Usage ```js -const escapeStringRegexp = require('escape-string-regexp'); +import escapeStringRegexp from 'escape-string-regexp'; const escapedString = escapeStringRegexp('How much $ for a 🦄?'); //=> 'How much \\$ for a 🦄\\?' diff --git a/node_modules/@ava/typescript/package.json b/node_modules/@ava/typescript/package.json index 13645b1e20..2dd1688740 100644 --- a/node_modules/@ava/typescript/package.json +++ b/node_modules/@ava/typescript/package.json @@ -1,13 +1,17 @@ { "name": "@ava/typescript", - "version": "2.0.0", + "version": "3.0.1", "description": "TypeScript provider for AVA", "engines": { - "node": ">=12.22 <13 || >=14.16 <15 || >=15" + "node": ">=12.22 <13 || >=14.17 <15 || >=16.4 <17 || >=17" }, "files": [ "index.js" ], + "exports": { + ".": "./index.js" + }, + "type": "module", "author": "Mark Wubben (https://novemberborn.net)", "repository": "avajs/typescript", "license": "MIT", @@ -19,15 +23,15 @@ "test": "xo && c8 ava" }, "dependencies": { - "escape-string-regexp": "^4.0.0", - "execa": "^5.0.0" + "escape-string-regexp": "^5.0.0", + "execa": "^5.1.1" }, "devDependencies": { - "ava": "^3.15.0", - "c8": "^7.7.1", + "ava": "4.0.0-rc.1", + "c8": "^7.10.0", "del": "^6.0.0", - "typescript": "^4.2.4", - "xo": "^0.38.2" + "typescript": "^4.4.4", + "xo": "^0.46.3" }, "c8": { "reporter": [ @@ -40,14 +44,15 @@ "files": [ "!test/broken-fixtures/**" ], + "ignoredByWatcher": [ + "test/fixtures/**", + "test/broken-fixtures/**" + ], "timeout": "60s" }, "xo": { "ignores": [ "test/broken-fixtures" - ], - "rules": { - "import/order": "off" - } + ] } } \ No newline at end of file diff --git a/node_modules/@concordance/react/LICENSE b/node_modules/@concordance/react/LICENSE deleted file mode 100644 index a192d7dbf9..0000000000 --- a/node_modules/@concordance/react/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -ISC License (ISC) -Copyright (c) 2017, Mark Wubben (novemberborn.net) - -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. diff --git a/node_modules/@concordance/react/README.md b/node_modules/@concordance/react/README.md deleted file mode 100644 index ca3ca01694..0000000000 --- a/node_modules/@concordance/react/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# @concordance/react - -React plugin for [Concordance](https://github.com/concordancejs/concordance). - -Allows -[`React.createElement()`](https://facebook.github.io/react/docs/react-api.html#createelement) -objects to be compared, formatted, diffed and serialized. Also supports -`toJSON()` renderings of -[`react-test-renderer`](https://www.npmjs.com/package/react-test-renderer). -These may be compared to `React.createElement()` objects. - -When comparing [React -component](https://facebook.github.io/react/docs/components-and-props.html) -elements, the element type is compared by identity. After deserialization the -element types are compared by function name. - -Component elements are formatted with a ⍟ character after the element -name. Properties and children are formatted by [Concordance](https://github.com/concordancejs/concordance). diff --git a/node_modules/@concordance/react/index.js b/node_modules/@concordance/react/index.js deleted file mode 100644 index 30053ed351..0000000000 --- a/node_modules/@concordance/react/index.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict' - -const pkg = require('./package.json') -const elementFactory = require('./lib/elementFactory') -const testJsonFactory = require('./lib/testJsonFactory') - -// Must be unique across all registered plugins. -exports.name = pkg.name - -// Expected API version to be passed to register(). -exports.apiVersion = 1 - -// Expected minimal version of Concordance. Concordance will increment its API -// version for breaking changes, this is useful if you rely on features or -// patches that were introduced in a specific version of Concordance. -exports.minimalConcordanceVersion = '1.0.0' - -// Plugin-specific version of its serialization output. -exports.serializerVersion = 2 - -exports.theme = { - react: { - functionType: '\u235F', - openTag: { - start: '<', - end: '>', - selfClose: '/', - selfCloseVoid: ' /' - }, - closeTag: { - open: '' - }, - tagName: {open: '', close: ''}, - attribute: { - separator: '=', - value: { - openBracket: '{', - closeBracket: '}', - string: { - line: {open: '"', close: '"', escapeQuote: '"'} - } - } - }, - child: { - openBracket: '{', - closeBracket: '}', - string: { - line: {open: '', close: '', escapeQuote: ''}, - multiline: {start: '', end: '', escapeQuote: ''} - } - } - } -} - -const ELEMENT = Symbol.for('react.element') -const TEST_JSON = Symbol.for('react.test.json') - -function register (api) { - const reactTags = new Set() - const element = elementFactory(api, reactTags) - const testJson = testJsonFactory(api, element) - - api.addDescriptor(0x01, element.tag, element.deserialize) - api.addDescriptor(0x02, testJson.tag, testJson.deserialize) - - reactTags.add(element.tag).add(testJson.tag) - - return value => { - if (value.$$typeof === ELEMENT) return element.describe - if (value.$$typeof === TEST_JSON) return testJson.describe - return null - } -} -exports.register = register diff --git a/node_modules/@concordance/react/lib/diffShallow.js b/node_modules/@concordance/react/lib/diffShallow.js deleted file mode 100644 index 4eeb4d4d33..0000000000 --- a/node_modules/@concordance/react/lib/diffShallow.js +++ /dev/null @@ -1,239 +0,0 @@ -'use strict' - -function diffShallow (api, actual, expected, theme, indent) { - const childBuffer = api.lineBuilder.buffer() - const propertyBuffer = api.lineBuilder.buffer() - - return { - append (formatted, origin) { - if (origin.isItem === true) { - childBuffer.append(formatted) - } else { - propertyBuffer.append(formatted) - } - }, - - finalize: () => { - const namesAreEqual = actual.compareNames(expected) - const actualName = actual.formatName(theme) - const expectedName = expected.formatName(theme) - - const openTag = theme.react.openTag - const innerIndentation = indent.increase() - - const allChildren = childBuffer.withFirstPrefixed(innerIndentation) - const children = allChildren.decompose() - - const allProperties = propertyBuffer.withFirstPrefixed(innerIndentation) - const properties = allProperties.decompose() - // If the first properties are also the last, and either side has no - // children, ensure the properties are treated as being last. This - // leads to a better balanced diff. - if (properties.remaining.isEmpty && (!actual.hasChildren || !expected.hasChildren)) { - properties.last = properties.first - properties.first = {actual: api.lineBuilder.buffer(), expected: api.lineBuilder.buffer()} - } - - const result = api.lineBuilder.buffer() - - // Create a custom diff that is as neat as possible. It's likely - // there's a generic algorithm that can be used, but for expediency's - // sake handles all possible diffs by brute force instead. - if (actual.hasProperties && expected.hasProperties) { - if (namesAreEqual) { - result - .append(api.lineBuilder.first(openTag.start + actualName)) - .append(properties.first.actual.stripFlags()) - .append(properties.first.expected.stripFlags()) - } else { - result - .append(api.lineBuilder.actual.first(openTag.start + actualName)) - .append(properties.first.actual.stripFlags()) - .append(api.lineBuilder.expected.first(openTag.start + expectedName)) - .append(properties.first.expected.stripFlags()) - } - result.append(properties.remaining.stripFlags()) - - if (actual.hasChildren && expected.hasChildren) { - result - .append(properties.last.actual.stripFlags()) - .append(properties.last.expected.stripFlags()) - .append(api.lineBuilder.line(indent + openTag.end)) - - if (namesAreEqual) { - result - .append(allChildren.stripFlags()) - .append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - } else { - result - .append(children.first.actual.stripFlags()) - .append(children.first.expected.stripFlags()) - .append(children.remaining.stripFlags()) - .append(children.last.actual.stripFlags()) - .append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - .append(children.last.expected.stripFlags()) - .append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName))) - } - } else if (actual.hasChildren) { - result - .append(properties.last.actual.stripFlags()) - .append(api.lineBuilder.actual.line(indent + openTag.end)) - .append(allChildren.stripFlags()) - .append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - .append(properties.last.expected.stripFlags()) - .append(api.lineBuilder.expected.last(indent + openTag.selfClose + openTag.end)) - } else if (expected.hasChildren) { - result - .append(properties.last.actual.stripFlags()) - .append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end)) - .append(properties.last.expected.stripFlags()) - .append(api.lineBuilder.expected.line(indent + openTag.end)) - .append(allChildren.stripFlags()) - .append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName))) - } else { - result - .append(properties.last.actual.stripFlags()) - .append(properties.last.expected.stripFlags()) - .append(api.lineBuilder.last(indent + openTag.selfClose + openTag.end)) - } - } else if (actual.hasProperties) { - result - .append(api.lineBuilder.actual.first(openTag.start + actualName)) - .append(allProperties.stripFlags()) - - if (actual.hasChildren && expected.hasChildren) { - result - .append(api.lineBuilder.actual.line(indent + openTag.end)) - .append(children.first.actual.stripFlags()) - .append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end)) - .append(children.first.expected.stripFlags()) - .append(children.remaining.stripFlags()) - - if (namesAreEqual) { - result - .append(children.last.actual.stripFlags()) - .append(children.last.expected.stripFlags()) - .append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - } else { - result - .append(children.last.actual.stripFlags()) - .append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - .append(children.last.expected.stripFlags()) - .append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName))) - } - } else if (actual.hasChildren) { - result - .append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end)) - .append(allChildren.stripFlags()) - .append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - .append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end)) - } else if (expected.hasChildren) { - result - .append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end)) - .append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end)) - .append(allChildren.stripFlags()) - .append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName))) - } else { - result - .append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end)) - .append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end)) - } - } else if (expected.hasProperties) { - if (actual.hasChildren && expected.hasChildren) { - result - .append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end)) - .append(children.first.actual.stripFlags()) - .append(api.lineBuilder.expected.first(openTag.start + expectedName)) - .append(allProperties.stripFlags()) - .append(api.lineBuilder.expected.line(indent + openTag.end)) - .append(children.first.expected.stripFlags()) - .append(children.remaining.stripFlags()) - - if (namesAreEqual) { - result - .append(children.last.actual.stripFlags()) - .append(children.last.expected.stripFlags()) - .append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - } else { - result - .append(children.last.actual.stripFlags()) - .append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - .append(children.last.expected.stripFlags()) - .append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName))) - } - } else if (actual.hasChildren) { - result - .append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end)) - .append(allChildren.stripFlags()) - .append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - .append(api.lineBuilder.expected.first(openTag.start + expectedName)) - .append(allProperties.stripFlags()) - .append(api.lineBuilder.expected.last(indent + openTag.selfClose + openTag.end)) - } else if (expected.hasChildren) { - result - .append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end)) - .append(api.lineBuilder.expected.first(openTag.start + expectedName)) - .append(allProperties.stripFlags()) - .append(api.lineBuilder.expected.line(indent + openTag.end)) - .append(allChildren.stripFlags()) - .append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName))) - } else { - result - .append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end)) - .append(api.lineBuilder.expected.first(openTag.start + expectedName)) - .append(allProperties.stripFlags()) - .append(api.lineBuilder.expected.last(indent + openTag.selfCloseVoid + openTag.end)) - } - } else { - if (actual.hasChildren && expected.hasChildren) { - if (namesAreEqual) { - result - .append(api.lineBuilder.first(openTag.start + actualName + openTag.end)) - .append(allChildren.stripFlags()) - .append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - } else { - result - .append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end)) - .append(children.first.actual.stripFlags()) - .append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end)) - .append(children.first.expected.stripFlags()) - .append(children.remaining.stripFlags()) - .append(children.last.actual.stripFlags()) - .append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - .append(children.last.expected.stripFlags()) - .append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName))) - } - } else if (actual.hasChildren) { - result - .append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end)) - .append(allChildren.stripFlags()) - .append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - .append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end)) - } else if (expected.hasChildren) { - result - .append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end)) - .append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end)) - .append(allChildren.stripFlags()) - .append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName))) - } else { - if (namesAreEqual) { - result.append(api.lineBuilder.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end)) - } else { - result - .append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end)) - .append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end)) - } - } - } - - return result - }, - - shouldFormat (subject) { - return subject.isItem === true || subject.isProperty === true - }, - - increaseIndent: true - } -} -module.exports = diffShallow diff --git a/node_modules/@concordance/react/lib/elementFactory.js b/node_modules/@concordance/react/lib/elementFactory.js deleted file mode 100644 index 2697f87398..0000000000 --- a/node_modules/@concordance/react/lib/elementFactory.js +++ /dev/null @@ -1,353 +0,0 @@ -'use strict' - -const arrify = require('arrify') -const diffShallow = require('./diffShallow') -const escapeText = require('./escapeText') - -const FRAGMENT_NAME = Symbol.for('react.fragment') - -function factory (api, reactTags) { - const tag = Symbol('@concordance/react.ElementValue') - - function customPropertyFormatter (theme, indent, key, value) { - const separator = theme.react.attribute.separator + theme.react.attribute.value.openBracket - if (value.isSingle) { - return value - .withFirstPrefixed(key.formatAsKey(theme) + separator) - .withLastPostfixed(theme.react.attribute.value.closeBracket) - } - - return api.lineBuilder.first(key.formatAsKey(theme) + separator) - .concat(value.withFirstPrefixed(indent.increase()).stripFlags()) - .append(api.lineBuilder.last(indent + theme.react.attribute.value.closeBracket)) - } - - function themeProperty (theme) { - theme.property.increaseValueIndent = true - theme.property.customFormat = customPropertyFormatter - } - - function themeStringProperty (theme) { - theme.property.separator = theme.react.attribute.separator - theme.property.after = '' - Object.assign(theme.string.line, theme.react.attribute.value.string.line) - } - - function customItemFormatter (theme, indent, value) { - if (value.isSingle) { - return value - .withFirstPrefixed(theme.react.child.openBracket) - .withLastPostfixed(theme.react.child.closeBracket) - } - - return api.lineBuilder.first(theme.react.child.openBracket) - .concat(value.withFirstPrefixed(indent.increase()).stripFlags()) - .append(api.lineBuilder.last(indent + theme.react.child.closeBracket)) - } - - function themeChild (theme) { - theme.item.increaseValueIndent = true - theme.item.customFormat = customItemFormatter - } - - function themeReactChild (theme) { - theme.item.after = '' - } - - function themeStringChild (theme) { - theme.item.after = '' - Object.assign(theme.string, theme.react.child.string) - } - - function describe (props) { - const element = props.value - - const type = element.type - const hasTypeFn = typeof type === 'function' - const typeFn = hasTypeFn ? type : null - const name = hasTypeFn ? type.displayName || type.name : type - - const children = arrify(element.props.children) - - const properties = Object.assign({}, element.props) - delete properties.children - if (element.key !== null) { - properties.key = element.key - } - const hasProperties = Object.keys(properties).length > 0 - - return new DescribedElementValue(Object.assign({ - children, - hasProperties, - hasTypeFn, - name, - properties, - typeFn, - isList: children.length > 0 - }, props)) - } - - function deserialize (state, recursor) { - return new DeserializedElementValue(state, recursor) - } - - class ElementValue extends api.ObjectValue { - constructor (props) { - super(props) - this.isFragment = props.name === FRAGMENT_NAME - this.name = props.name - this.hasProperties = props.hasProperties - this.hasTypeFn = props.hasTypeFn - - this.hasChildren = this.isList - } - - compare (expected) { - return this.tag === expected.tag && this.name === expected.name - ? api.SHALLOW_EQUAL - : api.UNEQUAL - } - - formatName (theme) { - const formatted = api.wrapFromTheme(theme.react.tagName, this.isFragment ? 'React.Fragment' : this.name) - return this.hasTypeFn - ? formatted + theme.react.functionType - : formatted - } - - compareNames (expected) { - return this.name === expected.name && this.hasTypeFn === expected.hasTypeFn - } - - formatShallow (theme, indent) { - const childBuffer = api.lineBuilder.buffer() - const propertyBuffer = api.lineBuilder.buffer() - - return { - append (formatted, origin) { - if (origin.isItem === true) { - childBuffer.append(formatted) - } else { - propertyBuffer.append(formatted) - } - }, - - finalize: () => { - const name = this.formatName(theme) - const openTag = theme.react.openTag - - if (!this.hasChildren && !this.hasProperties) { - return api.lineBuilder.single(openTag.start + name + openTag.selfCloseVoid + openTag.end) - } - - const innerIndentation = indent.increase() - const children = childBuffer.withFirstPrefixed(innerIndentation).stripFlags() - const properties = propertyBuffer.withFirstPrefixed(innerIndentation).stripFlags() - - const result = api.lineBuilder.buffer() - if (this.hasProperties) { - result - .append(api.lineBuilder.first(openTag.start + name)) - .append(properties) - - if (this.hasChildren) { - result.append(api.lineBuilder.line(indent + openTag.end)) - } else { - result.append(api.lineBuilder.last(indent + openTag.selfClose + openTag.end)) - } - } else { - result.append(api.lineBuilder.first(openTag.start + name + openTag.end)) - } - - if (this.hasChildren) { - result - .append(children) - .append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, name))) - } - - return result - }, - - maxDepth: () => { - const name = this.formatName(theme) - const openTag = theme.react.openTag - - if (!this.hasChildren && !this.hasProperties) { - return api.lineBuilder.single(openTag.start + name + openTag.selfCloseVoid + openTag.end) - } - - let str = openTag.start + name - if (this.hasProperties) { - str += theme.maxDepth - if (this.hasChildren) { - str += openTag.end - } else { - str += ' ' + openTag.selfClose + openTag.end - } - } else { - str += openTag.end - } - - if (this.hasChildren) { - str += theme.maxDepth + api.wrapFromTheme(theme.react.closeTag, name) - } - - return api.lineBuilder.single(str) - }, - - shouldFormat (subject) { - return subject.isItem === true || subject.isProperty === true - }, - - increaseIndent: true - } - } - - prepareDiff (expected) { - return { - compareResult: this.tag === expected.tag - ? api.SHALLOW_EQUAL - : api.UNEQUAL - } - } - - diffShallow (expected, theme, indent) { - return diffShallow(api, this, expected, theme, indent) - } - - serialize () { - return [this.isFragment, this.isFragment ? null : this.name, this.hasProperties, this.hasTypeFn, super.serialize()] - } - } - Object.defineProperty(ElementValue.prototype, 'tag', {value: tag}) - - function modifyThemes (recursor) { - return api.mapRecursor(recursor, next => { - let modifier - if (next.isItem === true) { - if (next.tag === api.descriptorTags.primitiveItem && next.value.tag === api.descriptorTags.string) { - modifier = themeStringChild - } else if (next.tag === api.descriptorTags.complexItem && reactTags.has(next.value.tag)) { - modifier = themeReactChild - } else { - modifier = themeChild - } - } else if (next.isProperty === true) { - if ( - next.tag === api.descriptorTags.primitiveProperty && - next.value.tag === api.descriptorTags.string && - !next.value.includesLinebreaks - ) { - modifier = themeStringProperty - } else { - modifier = themeProperty - } - } - - return modifier - ? api.modifyTheme(next, modifier) - : next - }) - } - - function DescribedMixin (base) { - return class extends api.DescribedMixin(base) { - constructor (props) { - super(props) - this.children = props.children - this.properties = props.properties - this.typeFn = props.typeFn - } - - compare (expected) { - const result = super.compare(expected) - return result === api.SHALLOW_EQUAL && this.typeFn !== expected.typeFn - ? api.UNEQUAL - : result - } - - compareNames (expected) { - return super.compareNames(expected) && this.typeFn === expected.typeFn - } - - createPropertyRecursor () { - // Symbols are not valid property keys for React elements. This code - // also assumes that the keys can be formatted as JSX-like attribute - // names. Keys are not pre-escaped before being passed to Concordance's - // property descriptor. - const keys = Object.keys(this.properties).sort() - const size = keys.length - - let index = 0 - const next = () => { - if (index === size) return null - - const key = keys[index++] - // Note that string values are not specifically escaped such that the - // output is valid JSX. - return this.describeProperty(key, this.describeAny(this.properties[key])) - } - - return {size, next} - } - - createListRecursor () { - if (!this.isList) return super.createListRecursor() - - const size = this.children.length - - let index = 0 - const next = () => { - if (index === size) return null - - const current = index++ - const child = this.children[current] - const type = typeof child - let descriptor - if (type === 'string') { - descriptor = this.describeAny(escapeText(child)) - } else { - descriptor = this.describeAny(child) - } - - return this.describeItem(current, descriptor) - } - - return {size, next} - } - - createRecursor () { - return modifyThemes(super.createRecursor()) - } - } - } - - function DeserializedMixin (base) { - return class extends api.DeserializedMixin(base) { - constructor (state, recursor) { - super(state[4], recursor) - this.isFragment = state[0] - this.name = this.isFragment ? FRAGMENT_NAME : state[1] - this.hasProperties = state[2] - this.hasTypeFn = state[3] - } - - createRecursor () { - return modifyThemes(super.createRecursor()) - } - } - } - - const DescribedElementValue = DescribedMixin(ElementValue) - const DeserializedElementValue = DeserializedMixin(ElementValue) - - return { - DescribedMixin, - DeserializedMixin, - ElementValue, - describe, - deserialize, - tag - } -} -module.exports = factory diff --git a/node_modules/@concordance/react/lib/escapeText.js b/node_modules/@concordance/react/lib/escapeText.js deleted file mode 100644 index 52447b1b61..0000000000 --- a/node_modules/@concordance/react/lib/escapeText.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict' - -function escapeText (text) { - return text - .replace(//g, '>') - // TODO: Escape characters that Concordance would otherwise replace with \u - // sequences. -} -module.exports = escapeText diff --git a/node_modules/@concordance/react/lib/testJsonFactory.js b/node_modules/@concordance/react/lib/testJsonFactory.js deleted file mode 100644 index c3e97a620f..0000000000 --- a/node_modules/@concordance/react/lib/testJsonFactory.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict' - -const arrify = require('arrify') - -function factory (api, element) { - const tag = Symbol('@concordance/react.TestJsonValue') - - function describe (props) { - const obj = props.value - - const name = obj.type - const children = arrify(obj.children) - const properties = Object.assign({}, obj.props) - const hasProperties = Object.keys(properties).length > 0 - - return new DescribedTestJsonValue(Object.assign({ - children, - hasProperties, - hasTypeFn: false, - name, - properties, - typeFn: null, - isList: children.length > 0 - }, props)) - } - - function deserialize (state, recursor) { - return new DeserializedTestJsonValue(state, recursor) - } - - class TestJsonValue extends element.ElementValue { - compare (expected) { - // Allow expected value to be a React element. - return (this.tag === expected.tag || expected.tag === element.tag) && this.name === expected.name - ? api.SHALLOW_EQUAL - : api.UNEQUAL - } - - prepareDiff (expected) { - return { - // Allow expected value to be a React element. - compareResult: this.tag === expected.tag || expected.tag === element.tag - ? api.SHALLOW_EQUAL - : api.UNEQUAL - } - } - } - Object.defineProperty(TestJsonValue.prototype, 'tag', {value: tag}) - - const DescribedTestJsonValue = element.DescribedMixin(TestJsonValue) - const DeserializedTestJsonValue = element.DeserializedMixin(TestJsonValue) - - return { - describe, - deserialize, - tag - } -} -module.exports = factory diff --git a/node_modules/@concordance/react/node_modules/arrify/index.js b/node_modules/@concordance/react/node_modules/arrify/index.js deleted file mode 100644 index 2a2fdeeb1d..0000000000 --- a/node_modules/@concordance/react/node_modules/arrify/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -module.exports = function (val) { - if (val === null || val === undefined) { - return []; - } - - return Array.isArray(val) ? val : [val]; -}; diff --git a/node_modules/@concordance/react/node_modules/arrify/license b/node_modules/@concordance/react/node_modules/arrify/license deleted file mode 100644 index 654d0bfe94..0000000000 --- a/node_modules/@concordance/react/node_modules/arrify/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/@concordance/react/node_modules/arrify/readme.md b/node_modules/@concordance/react/node_modules/arrify/readme.md deleted file mode 100644 index 183d07576f..0000000000 --- a/node_modules/@concordance/react/node_modules/arrify/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# arrify [![Build Status](https://travis-ci.org/sindresorhus/arrify.svg?branch=master)](https://travis-ci.org/sindresorhus/arrify) - -> Convert a value to an array - - -## Install - -``` -$ npm install --save arrify -``` - - -## Usage - -```js -const arrify = require('arrify'); - -arrify('unicorn'); -//=> ['unicorn'] - -arrify(['unicorn']); -//=> ['unicorn'] - -arrify(null); -//=> [] - -arrify(undefined); -//=> [] -``` - -*Supplying `null` or `undefined` results in an empty array.* - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/@concordance/react/package.json b/node_modules/@concordance/react/package.json deleted file mode 100644 index f0ba9b96c8..0000000000 --- a/node_modules/@concordance/react/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "@concordance/react", - "version": "2.0.0", - "description": "Compare, format, diff and serialize React trees with Concordance", - "main": "index.js", - "files": [ - "lib", - "index.js" - ], - "engines": { - "node": ">=6.12.3 <7 || >=8.9.4 <9 || >=10.0.0" - }, - "scripts": { - "build:fixtures": "babel --presets=module:@babel/preset-react,module:ava/stage-4 --out-dir=test/fixtures/react --extensions=.jsx test/fixtures/react", - "lint": "as-i-preach", - "pretest": "npm run -s build:fixtures", - "test": "npm run -s lint && nyc ava" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/concordancejs/react.git" - }, - "author": "Mark Wubben (https://novemberborn.net/)", - "license": "ISC", - "bugs": { - "url": "https://github.com/concordancejs/react/issues" - }, - "homepage": "https://github.com/concordancejs/react#readme", - "keywords": [ - "concordance-plugin", - "concordance", - "react" - ], - "dependencies": { - "arrify": "^1.0.1" - }, - "devDependencies": { - "@babel/cli": "^7.1.0", - "@babel/core": "^7.1.0", - "@babel/preset-react": "^7.0.0", - "@novemberborn/as-i-preach": "^10.1.0", - "ava": "1.0.0-beta.8", - "codecov": "^3.1.0", - "concordance": "^4.0.0", - "nyc": "^13.0.1", - "react": "^16.5.2", - "react-test-renderer": "^16.5.2" - }, - "as-i-preach": { - "allowDevDependencies": [ - "test/**/*.js", - "test/**/*.jsx" - ], - "ignore": [ - "test/fixtures/react/*.js" - ] - }, - "ava": { - "babel": { - "testOptions": { - "presets": [ - "module:@babel/preset-react" - ] - } - } - }, - "nyc": { - "reporter": [ - "html", - "lcov", - "text" - ] - }, - "standard-engine": "@novemberborn/as-i-preach" -} \ No newline at end of file diff --git a/node_modules/@sindresorhus/is/dist/index.d.ts b/node_modules/@sindresorhus/is/dist/index.d.ts deleted file mode 100644 index e94d30b767..0000000000 --- a/node_modules/@sindresorhus/is/dist/index.d.ts +++ /dev/null @@ -1,132 +0,0 @@ -/// -/// -/// -/// -/// -declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; -declare type Primitive = null | undefined | string | number | boolean | Symbol; -export interface ArrayLike { - length: number; -} -export interface Class { - new (...args: any[]): T; -} -declare type DomElement = object & { - nodeType: 1; - nodeName: string; -}; -declare type NodeStream = object & { - pipe: Function; -}; -export declare const enum TypeName { - null = "null", - boolean = "boolean", - undefined = "undefined", - string = "string", - number = "number", - symbol = "symbol", - Function = "Function", - GeneratorFunction = "GeneratorFunction", - AsyncFunction = "AsyncFunction", - Observable = "Observable", - Array = "Array", - Buffer = "Buffer", - Object = "Object", - RegExp = "RegExp", - Date = "Date", - Error = "Error", - Map = "Map", - Set = "Set", - WeakMap = "WeakMap", - WeakSet = "WeakSet", - Int8Array = "Int8Array", - Uint8Array = "Uint8Array", - Uint8ClampedArray = "Uint8ClampedArray", - Int16Array = "Int16Array", - Uint16Array = "Uint16Array", - Int32Array = "Int32Array", - Uint32Array = "Uint32Array", - Float32Array = "Float32Array", - Float64Array = "Float64Array", - ArrayBuffer = "ArrayBuffer", - SharedArrayBuffer = "SharedArrayBuffer", - DataView = "DataView", - Promise = "Promise", - URL = "URL" -} -declare function is(value: unknown): TypeName; -declare namespace is { - const undefined: (value: unknown) => value is undefined; - const string: (value: unknown) => value is string; - const number: (value: unknown) => value is number; - const function_: (value: unknown) => value is Function; - const null_: (value: unknown) => value is null; - const class_: (value: unknown) => value is Class; - const boolean: (value: unknown) => value is boolean; - const symbol: (value: unknown) => value is Symbol; - const numericString: (value: unknown) => boolean; - const array: (arg: any) => arg is any[]; - const buffer: (input: unknown) => input is Buffer; - const nullOrUndefined: (value: unknown) => value is null | undefined; - const object: (value: unknown) => value is object; - const iterable: (value: unknown) => value is IterableIterator; - const asyncIterable: (value: unknown) => value is AsyncIterableIterator; - const generator: (value: unknown) => value is Generator; - const nativePromise: (value: unknown) => value is Promise; - const promise: (value: unknown) => value is Promise; - const generatorFunction: (value: unknown) => value is GeneratorFunction; - const asyncFunction: (value: unknown) => value is Function; - const boundFunction: (value: unknown) => value is Function; - const regExp: (value: unknown) => value is RegExp; - const date: (value: unknown) => value is Date; - const error: (value: unknown) => value is Error; - const map: (value: unknown) => value is Map; - const set: (value: unknown) => value is Set; - const weakMap: (value: unknown) => value is WeakMap; - const weakSet: (value: unknown) => value is WeakSet; - const int8Array: (value: unknown) => value is Int8Array; - const uint8Array: (value: unknown) => value is Uint8Array; - const uint8ClampedArray: (value: unknown) => value is Uint8ClampedArray; - const int16Array: (value: unknown) => value is Int16Array; - const uint16Array: (value: unknown) => value is Uint16Array; - const int32Array: (value: unknown) => value is Int32Array; - const uint32Array: (value: unknown) => value is Uint32Array; - const float32Array: (value: unknown) => value is Float32Array; - const float64Array: (value: unknown) => value is Float64Array; - const arrayBuffer: (value: unknown) => value is ArrayBuffer; - const sharedArrayBuffer: (value: unknown) => value is SharedArrayBuffer; - const dataView: (value: unknown) => value is DataView; - const directInstanceOf: (instance: unknown, klass: Class) => instance is T; - const urlInstance: (value: unknown) => value is URL; - const urlString: (value: unknown) => boolean; - const truthy: (value: unknown) => boolean; - const falsy: (value: unknown) => boolean; - const nan: (value: unknown) => boolean; - const primitive: (value: unknown) => value is Primitive; - const integer: (value: unknown) => value is number; - const safeInteger: (value: unknown) => value is number; - const plainObject: (value: unknown) => boolean; - const typedArray: (value: unknown) => value is TypedArray; - const arrayLike: (value: unknown) => value is ArrayLike; - const inRange: (value: number, range: number | number[]) => boolean; - const domElement: (value: unknown) => value is DomElement; - const observable: (value: unknown) => boolean; - const nodeStream: (value: unknown) => value is NodeStream; - const infinite: (value: unknown) => boolean; - const even: (value: number) => boolean; - const odd: (value: number) => boolean; - const emptyArray: (value: unknown) => boolean; - const nonEmptyArray: (value: unknown) => boolean; - const emptyString: (value: unknown) => boolean; - const nonEmptyString: (value: unknown) => boolean; - const emptyStringOrWhitespace: (value: unknown) => boolean; - const emptyObject: (value: unknown) => boolean; - const nonEmptyObject: (value: unknown) => boolean; - const emptySet: (value: unknown) => boolean; - const nonEmptySet: (value: unknown) => boolean; - const emptyMap: (value: unknown) => boolean; - const nonEmptyMap: (value: unknown) => boolean; - const any: (predicate: unknown, ...values: unknown[]) => boolean; - const all: (predicate: unknown, ...values: unknown[]) => boolean; -} -export default is; diff --git a/node_modules/@sindresorhus/is/dist/index.js b/node_modules/@sindresorhus/is/dist/index.js deleted file mode 100644 index 3cbafae18c..0000000000 --- a/node_modules/@sindresorhus/is/dist/index.js +++ /dev/null @@ -1,245 +0,0 @@ -"use strict"; -/// -/// -/// -/// -Object.defineProperty(exports, "__esModule", { value: true }); -// TODO: Use the `URL` global when targeting Node.js 10 -// tslint:disable-next-line -const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL; -const toString = Object.prototype.toString; -const isOfType = (type) => (value) => typeof value === type; -const isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input); -const getObjectType = (value) => { - const objectName = toString.call(value).slice(8, -1); - if (objectName) { - return objectName; - } - return null; -}; -const isObjectOfType = (type) => (value) => getObjectType(value) === type; -function is(value) { - switch (value) { - case null: - return "null" /* null */; - case true: - case false: - return "boolean" /* boolean */; - default: - } - switch (typeof value) { - case 'undefined': - return "undefined" /* undefined */; - case 'string': - return "string" /* string */; - case 'number': - return "number" /* number */; - case 'symbol': - return "symbol" /* symbol */; - default: - } - if (is.function_(value)) { - return "Function" /* Function */; - } - if (is.observable(value)) { - return "Observable" /* Observable */; - } - if (Array.isArray(value)) { - return "Array" /* Array */; - } - if (isBuffer(value)) { - return "Buffer" /* Buffer */; - } - const tagType = getObjectType(value); - if (tagType) { - return tagType; - } - if (value instanceof String || value instanceof Boolean || value instanceof Number) { - throw new TypeError('Please don\'t use object wrappers for primitive types'); - } - return "Object" /* Object */; -} -(function (is) { - // tslint:disable-next-line:strict-type-predicates - const isObject = (value) => typeof value === 'object'; - // tslint:disable:variable-name - is.undefined = isOfType('undefined'); - is.string = isOfType('string'); - is.number = isOfType('number'); - is.function_ = isOfType('function'); - // tslint:disable-next-line:strict-type-predicates - is.null_ = (value) => value === null; - is.class_ = (value) => is.function_(value) && value.toString().startsWith('class '); - is.boolean = (value) => value === true || value === false; - is.symbol = isOfType('symbol'); - // tslint:enable:variable-name - is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value)); - is.array = Array.isArray; - is.buffer = isBuffer; - is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); - is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value)); - is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]); - is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]); - is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw); - is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value); - const hasPromiseAPI = (value) => !is.null_(value) && - isObject(value) && - is.function_(value.then) && - is.function_(value.catch); - is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value); - is.generatorFunction = isObjectOfType("GeneratorFunction" /* GeneratorFunction */); - is.asyncFunction = isObjectOfType("AsyncFunction" /* AsyncFunction */); - is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype'); - is.regExp = isObjectOfType("RegExp" /* RegExp */); - is.date = isObjectOfType("Date" /* Date */); - is.error = isObjectOfType("Error" /* Error */); - is.map = (value) => isObjectOfType("Map" /* Map */)(value); - is.set = (value) => isObjectOfType("Set" /* Set */)(value); - is.weakMap = (value) => isObjectOfType("WeakMap" /* WeakMap */)(value); - is.weakSet = (value) => isObjectOfType("WeakSet" /* WeakSet */)(value); - is.int8Array = isObjectOfType("Int8Array" /* Int8Array */); - is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */); - is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */); - is.int16Array = isObjectOfType("Int16Array" /* Int16Array */); - is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */); - is.int32Array = isObjectOfType("Int32Array" /* Int32Array */); - is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */); - is.float32Array = isObjectOfType("Float32Array" /* Float32Array */); - is.float64Array = isObjectOfType("Float64Array" /* Float64Array */); - is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */); - is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */); - is.dataView = isObjectOfType("DataView" /* DataView */); - is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype; - is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value); - is.urlString = (value) => { - if (!is.string(value)) { - return false; - } - try { - new URLGlobal(value); // tslint:disable-line no-unused-expression - return true; - } - catch (_a) { - return false; - } - }; - is.truthy = (value) => Boolean(value); - is.falsy = (value) => !value; - is.nan = (value) => Number.isNaN(value); - const primitiveTypes = new Set([ - 'undefined', - 'string', - 'number', - 'boolean', - 'symbol' - ]); - is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value); - is.integer = (value) => Number.isInteger(value); - is.safeInteger = (value) => Number.isSafeInteger(value); - is.plainObject = (value) => { - // From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js - let prototype; - return getObjectType(value) === "Object" /* Object */ && - (prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator - prototype === Object.getPrototypeOf({})); - }; - const typedArrayTypes = new Set([ - "Int8Array" /* Int8Array */, - "Uint8Array" /* Uint8Array */, - "Uint8ClampedArray" /* Uint8ClampedArray */, - "Int16Array" /* Int16Array */, - "Uint16Array" /* Uint16Array */, - "Int32Array" /* Int32Array */, - "Uint32Array" /* Uint32Array */, - "Float32Array" /* Float32Array */, - "Float64Array" /* Float64Array */ - ]); - is.typedArray = (value) => { - const objectType = getObjectType(value); - if (objectType === null) { - return false; - } - return typedArrayTypes.has(objectType); - }; - const isValidLength = (value) => is.safeInteger(value) && value > -1; - is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length); - is.inRange = (value, range) => { - if (is.number(range)) { - return value >= Math.min(0, range) && value <= Math.max(range, 0); - } - if (is.array(range) && range.length === 2) { - return value >= Math.min(...range) && value <= Math.max(...range); - } - throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); - }; - const NODE_TYPE_ELEMENT = 1; - const DOM_PROPERTIES_TO_CHECK = [ - 'innerHTML', - 'ownerDocument', - 'style', - 'attributes', - 'nodeValue' - ]; - is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) && - !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value); - is.observable = (value) => { - if (!value) { - return false; - } - if (value[Symbol.observable] && value === value[Symbol.observable]()) { - return true; - } - if (value['@@observable'] && value === value['@@observable']()) { - return true; - } - return false; - }; - is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value); - is.infinite = (value) => value === Infinity || value === -Infinity; - const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem; - is.even = isAbsoluteMod2(0); - is.odd = isAbsoluteMod2(1); - const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false; - is.emptyArray = (value) => is.array(value) && value.length === 0; - is.nonEmptyArray = (value) => is.array(value) && value.length > 0; - is.emptyString = (value) => is.string(value) && value.length === 0; - is.nonEmptyString = (value) => is.string(value) && value.length > 0; - is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); - is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; - is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0; - is.emptySet = (value) => is.set(value) && value.size === 0; - is.nonEmptySet = (value) => is.set(value) && value.size > 0; - is.emptyMap = (value) => is.map(value) && value.size === 0; - is.nonEmptyMap = (value) => is.map(value) && value.size > 0; - const predicateOnArray = (method, predicate, values) => { - if (is.function_(predicate) === false) { - throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); - } - if (values.length === 0) { - throw new TypeError('Invalid number of values'); - } - return method.call(values, predicate); - }; - // tslint:disable variable-name - is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values); - is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); - // tslint:enable variable-name -})(is || (is = {})); -// Some few keywords are reserved, but we'll populate them for Node.js users -// See https://github.com/Microsoft/TypeScript/issues/2536 -Object.defineProperties(is, { - class: { - value: is.class_ - }, - function: { - value: is.function_ - }, - null: { - value: is.null_ - } -}); -exports.default = is; -// For CommonJS default export support -module.exports = is; -module.exports.default = is; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@sindresorhus/is/dist/index.js.map b/node_modules/@sindresorhus/is/dist/index.js.map deleted file mode 100644 index cd827fc291..0000000000 --- a/node_modules/@sindresorhus/is/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,0CAA0C;AAC1C,2CAA2C;AAC3C,0BAA0B;;AAE1B,uDAAuD;AACvD,2BAA2B;AAC3B,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AAqDxE,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;AAC3C,MAAM,QAAQ,GAAG,CAAI,IAAY,EAAE,EAAE,CAAC,CAAC,KAAc,EAAc,EAAE,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC;AAC5F,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAmB,E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AC,CAAC;SAChD;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,SAAgB,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEF,+BAA+B;IAClB,MAAG,GAAG,CAAC,SAAkB,EAAE,GAAG,MAAiB,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC9G,MAAG,GAAG,CAAC,SAAkB,EAAE,GAAG,MAAiB,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5H,8BAA8B;AAC/B,CAAC,EAvNS,EAAE,KAAF,EAAE,QAuNX;AAED,4EAA4E;AAC5E,0DAA0D;AAC1D,MAAM,CAAC,gBAAgB,CAAC,EAAE,EAAE;IAC3B,KAAK,EAAE;QACN,KAAK,EAAE,EAAE,CAAC,MAAM;KAChB;IACD,QAAQ,EAAE;QACT,KAAK,EAAE,EAAE,CAAC,SAAS;KACnB;IACD,IAAI,EAAE;QACL,KAAK,EAAE,EAAE,CAAC,KAAK;KACf;CACD,CAAC,CAAC;AAEH,kBAAe,EAAE,CAAC;AAElB,sCAAsC;AACtC,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;AACpB,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@sindresorhus/is/package.json b/node_modules/@sindresorhus/is/package.json deleted file mode 100644 index 66fc8bad1f..0000000000 --- a/node_modules/@sindresorhus/is/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@sindresorhus/is", - "version": "0.14.0", - "description": "Type check values: `is.string('🦄') //=> true`", - "license": "MIT", - "repository": "sindresorhus/is", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "main": "dist/index.js", - "engines": { - "node": ">=6" - }, - "scripts": { - "lint": "tslint --format stylish --project .", - "build": "del dist && tsc", - "test": "npm run lint && npm run build && ava dist/tests", - "prepublish": "npm run build && del dist/tests" - }, - "files": [ - "dist" - ], - "keywords": [ - "type", - "types", - "is", - "check", - "checking", - "validate", - "validation", - "utility", - "util", - "typeof", - "instanceof", - "object", - "assert", - "assertion", - "test", - "kind", - "primitive", - "verify", - "compare" - ], - "devDependencies": { - "@sindresorhus/tsconfig": "^0.1.0", - "@types/jsdom": "^11.12.0", - "@types/node": "^10.12.10", - "@types/tempy": "^0.2.0", - "@types/zen-observable": "^0.8.0", - "ava": "^0.25.0", - "del-cli": "^1.1.0", - "jsdom": "^11.6.2", - "rxjs": "^6.3.3", - "tempy": "^0.2.1", - "tslint": "^5.9.1", - "tslint-xo": "^0.10.0", - "typescript": "^3.2.1", - "zen-observable": "^0.8.8" - }, - "types": "dist/index.d.ts" -} \ No newline at end of file diff --git a/node_modules/@sindresorhus/is/readme.md b/node_modules/@sindresorhus/is/readme.md deleted file mode 100644 index 97c023b574..0000000000 --- a/node_modules/@sindresorhus/is/readme.md +++ /dev/null @@ -1,451 +0,0 @@ -# is [![Build Status](https://travis-ci.org/sindresorhus/is.svg?branch=master)](https://travis-ci.org/sindresorhus/is) - -> Type check values: `is.string('🦄') //=> true` - - - - -## Install - -``` -$ npm install @sindresorhus/is -``` - - -## Usage - -```js -const is = require('@sindresorhus/is'); - -is('🦄'); -//=> 'string' - -is(new Map()); -//=> 'Map' - -is.number(6); -//=> true -``` - -When using `is` together with TypeScript, [type guards](http://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types) are being used to infer the correct type inside if-else statements. - -```ts -import is from '@sindresorhus/is'; - -const padLeft = (value: string, padding: string | number) => { - if (is.number(padding)) { - // `padding` is typed as `number` - return Array(padding + 1).join(' ') + value; - } - - if (is.string(padding)) { - // `padding` is typed as `string` - return padding + value; - } - - throw new TypeError(`Expected 'padding' to be of type 'string' or 'number', got '${is(padding)}'.`); -} - -padLeft('🦄', 3); -//=> ' 🦄' - -padLeft('🦄', '🌈'); -//=> '🌈🦄' -``` - - -## API - -### is(value) - -Returns the type of `value`. - -Primitives are lowercase and object types are camelcase. - -Example: - -- `'undefined'` -- `'null'` -- `'string'` -- `'symbol'` -- `'Array'` -- `'Function'` -- `'Object'` - -Note: It will throw an error if you try to feed it object-wrapped primitives, as that's a bad practice. For example `new String('foo')`. - -### is.{method} - -All the below methods accept a value and returns a boolean for whether the value is of the desired type. - -#### Primitives - -##### .undefined(value) -##### .null(value) -##### .string(value) -##### .number(value) -##### .boolean(value) -##### .symbol(value) - -#### Built-in types - -##### .array(value) -##### .function(value) -##### .buffer(value) -##### .object(value) - -Keep in mind that [functions are objects too](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions). - -##### .numericString(value) - -Returns `true` for a string that represents a number. For example, `'42'` and `'-8'`. - -Note: `'NaN'` returns `false`, but `'Infinity'` and `'-Infinity'` return `true`. - -##### .regExp(value) -##### .date(value) -##### .error(value) -##### .nativePromise(value) -##### .promise(value) - -Returns `true` for any object with a `.then()` and `.catch()` method. Prefer this one over `.nativePromise()` as you usually want to allow userland promise implementations too. - -##### .generator(value) - -Returns `true` for any object that implements its own `.next()` and `.throw()` methods and has a function definition for `Symbol.iterator`. - -##### .generatorFunction(value) - -##### .asyncFunction(value) - -Returns `true` for any `async` function that can be called with the `await` operator. - -```js -is.asyncFunction(async () => {}); -// => true - -is.asyncFunction(() => {}); -// => false -``` - -##### .boundFunction(value) - -Returns `true` for any `bound` function. - -```js -is.boundFunction(() => {}); -// => true - -is.boundFunction(function () {}.bind(null)); -// => true - -is.boundFunction(function () {}); -// => false -``` - -##### .map(value) -##### .set(value) -##### .weakMap(value) -##### .weakSet(value) - -#### Typed arrays - -##### .int8Array(value) -##### .uint8Array(value) -##### .uint8ClampedArray(value) -##### .int16Array(value) -##### .uint16Array(value) -##### .int32Array(value) -##### .uint32Array(value) -##### .float32Array(value) -##### .float64Array(value) - -#### Structured data - -##### .arrayBuffer(value) -##### .sharedArrayBuffer(value) -##### .dataView(value) - -#### Emptiness - -##### .emptyString(value) - -Returns `true` if the value is a `string` and the `.length` is 0. - -##### .nonEmptyString(value) - -Returns `true` if the value is a `string` and the `.length` is more than 0. - -##### .emptyStringOrWhitespace(value) - -Returns `true` if `is.emptyString(value)` or if it's a `string` that is all whitespace. - -##### .emptyArray(value) - -Returns `true` if the value is an `Array` and the `.length` is 0. - -##### .nonEmptyArray(value) - -Returns `true` if the value is an `Array` and the `.length` is more than 0. - -##### .emptyObject(value) - -Returns `true` if the value is an `Object` and `Object.keys(value).length` is 0. - -Please note that `Object.keys` returns only own enumerable properties. Hence something like this can happen: - -```js -const object1 = {}; - -Object.defineProperty(object1, 'property1', { - value: 42, - writable: true, - enumerable: false, - configurable: true -}); - -is.emptyObject(object1); -// => true -``` - -##### .nonEmptyObject(value) - -Returns `true` if the value is an `Object` and `Object.keys(value).length` is more than 0. - -##### .emptySet(value) - -Returns `true` if the value is a `Set` and the `.size` is 0. - -##### .nonEmptySet(Value) - -Returns `true` if the value is a `Set` and the `.size` is more than 0. - -##### .emptyMap(value) - -Returns `true` if the value is a `Map` and the `.size` is 0. - -##### .nonEmptyMap(value) - -Returns `true` if the value is a `Map` and the `.size` is more than 0. - -#### Miscellaneous - -##### .directInstanceOf(value, class) - -Returns `true` if `value` is a direct instance of `class`. - -```js -is.directInstanceOf(new Error(), Error); -//=> true - -class UnicornError extends Error {} - -is.directInstanceOf(new UnicornError(), Error); -//=> false -``` - -##### .urlInstance(value) - -Returns `true` if `value` is an instance of the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL). - -```js -const url = new URL('https://example.com'); - -is.urlInstance(url); -//=> true -``` - -### .url(value) - -Returns `true` if `value` is a URL string. - -Note: this only does basic checking using the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL) constructor. - -```js -const url = 'https://example.com'; - -is.url(url); -//=> true - -is.url(new URL(url)); -//=> false -``` - -##### .truthy(value) - -Returns `true` for all values that evaluate to true in a boolean context: - -```js -is.truthy('🦄'); -//=> true - -is.truthy(undefined); -//=> false -``` - -##### .falsy(value) - -Returns `true` if `value` is one of: `false`, `0`, `''`, `null`, `undefined`, `NaN`. - -##### .nan(value) -##### .nullOrUndefined(value) -##### .primitive(value) - -JavaScript primitives are as follows: `null`, `undefined`, `string`, `number`, `boolean`, `symbol`. - -##### .integer(value) - -##### .safeInteger(value) - -Returns `true` if `value` is a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - -##### .plainObject(value) - -An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`. - -##### .iterable(value) -##### .asyncIterable(value) -##### .class(value) - -Returns `true` for instances created by a class. - -##### .typedArray(value) - -##### .arrayLike(value) - -A `value` is array-like if it is not a function and has a `value.length` that is a safe integer greater than or equal to 0. - -```js -is.arrayLike(document.forms); -//=> true - -function foo() { - is.arrayLike(arguments); - //=> true -} -foo(); -``` - -##### .inRange(value, range) - -Check if `value` (number) is in the given `range`. The range is an array of two values, lower bound and upper bound, in no specific order. - -```js -is.inRange(3, [0, 5]); -is.inRange(3, [5, 0]); -is.inRange(0, [-2, 2]); -``` - -##### .inRange(value, upperBound) - -Check if `value` (number) is in the range of `0` to `upperBound`. - -```js -is.inRange(3, 10); -``` - -##### .domElement(value) - -Returns `true` if `value` is a DOM Element. - -##### .nodeStream(value) - -Returns `true` if `value` is a Node.js [stream](https://nodejs.org/api/stream.html). - -```js -const fs = require('fs'); - -is.nodeStream(fs.createReadStream('unicorn.png')); -//=> true -``` - -##### .observable(value) - -Returns `true` if `value` is an `Observable`. - -```js -const {Observable} = require('rxjs'); - -is.observable(new Observable()); -//=> true -``` - -##### .infinite(value) - -Check if `value` is `Infinity` or `-Infinity`. - -##### .even(value) - -Returns `true` if `value` is an even integer. - -##### .odd(value) - -Returns `true` if `value` is an odd integer. - -##### .any(predicate, ...values) - -Returns `true` if **any** of the input `values` returns true in the `predicate`: - -```js -is.any(is.string, {}, true, '🦄'); -//=> true - -is.any(is.boolean, 'unicorns', [], new Map()); -//=> false -``` - -##### .all(predicate, ...values) - -Returns `true` if **all** of the input `values` returns true in the `predicate`: - -```js -is.all(is.object, {}, new Map(), new Set()); -//=> true - -is.all(is.string, '🦄', [], 'unicorns'); -//=> false -``` - - -## FAQ - -### Why yet another type checking module? - -There are hundreds of type checking modules on npm, unfortunately, I couldn't find any that fit my needs: - -- Includes both type methods and ability to get the type -- Types of primitives returned as lowercase and object types as camelcase -- Covers all built-ins -- Unsurprising behavior -- Well-maintained -- Comprehensive test suite - -For the ones I found, pick 3 of these. - -The most common mistakes I noticed in these modules was using `instanceof` for type checking, forgetting that functions are objects, and omitting `symbol` as a primitive. - - -## Related - -- [ow](https://github.com/sindresorhus/ow) - Function argument validation for humans -- [is-stream](https://github.com/sindresorhus/is-stream) - Check if something is a Node.js stream -- [is-observable](https://github.com/sindresorhus/is-observable) - Check if a value is an Observable -- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array -- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address -- [is-array-sorted](https://github.com/sindresorhus/is-array-sorted) - Check if an Array is sorted -- [is-error-constructor](https://github.com/sindresorhus/is-error-constructor) - Check if a value is an error constructor -- [is-empty-iterable](https://github.com/sindresorhus/is-empty-iterable) - Check if an Iterable is empty -- [is-blob](https://github.com/sindresorhus/is-blob) - Check if a value is a Blob - File-like object of immutable, raw data -- [has-emoji](https://github.com/sindresorhus/has-emoji) - Check whether a string has any emoji - - -## Created by - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Giora Guttsait](https://github.com/gioragutt) -- [Brandon Smith](https://github.com/brandon93s) - - -## License - -MIT diff --git a/node_modules/@szmarczak/http-timer/LICENSE b/node_modules/@szmarczak/http-timer/LICENSE deleted file mode 100755 index 15ad2e8d57..0000000000 --- a/node_modules/@szmarczak/http-timer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Szymon Marczak - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@szmarczak/http-timer/README.md b/node_modules/@szmarczak/http-timer/README.md deleted file mode 100755 index 13279ed8cf..0000000000 --- a/node_modules/@szmarczak/http-timer/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# http-timer -> Timings for HTTP requests - -[![Build Status](https://travis-ci.org/szmarczak/http-timer.svg?branch=master)](https://travis-ci.org/szmarczak/http-timer) -[![Coverage Status](https://coveralls.io/repos/github/szmarczak/http-timer/badge.svg?branch=master)](https://coveralls.io/github/szmarczak/http-timer?branch=master) -[![install size](https://packagephobia.now.sh/badge?p=@szmarczak/http-timer)](https://packagephobia.now.sh/result?p=@szmarczak/http-timer) - -Inspired by the [`request` package](https://github.com/request/request). - -## Usage -```js -'use strict'; -const https = require('https'); -const timer = require('@szmarczak/http-timer'); - -const request = https.get('https://httpbin.org/anything'); -const timings = timer(request); - -request.on('response', response => { - response.on('data', () => {}); // Consume the data somehow - response.on('end', () => { - console.log(timings); - }); -}); - -// { start: 1535708511443, -// socket: 1535708511444, -// lookup: 1535708511444, -// connect: 1535708511582, -// upload: 1535708511887, -// response: 1535708512037, -// end: 1535708512040, -// phases: -// { wait: 1, -// dns: 0, -// tcp: 138, -// request: 305, -// firstByte: 150, -// download: 3, -// total: 597 } } -``` - -## API - -### timer(request) - -Returns: `Object` - -- `start` - Time when the request started. -- `socket` - Time when a socket was assigned to the request. -- `lookup` - Time when the DNS lookup finished. -- `connect` - Time when the socket successfully connected. -- `upload` - Time when the request finished uploading. -- `response` - Time when the request fired the `response` event. -- `end` - Time when the response fired the `end` event. -- `error` - Time when the request fired the `error` event. -- `phases` - - `wait` - `timings.socket - timings.start` - - `dns` - `timings.lookup - timings.socket` - - `tcp` - `timings.connect - timings.lookup` - - `request` - `timings.upload - timings.connect` - - `firstByte` - `timings.response - timings.upload` - - `download` - `timings.end - timings.response` - - `total` - `timings.end - timings.start` or `timings.error - timings.start` - -**Note**: The time is a `number` representing the milliseconds elapsed since the UNIX epoch. - -## License - -MIT diff --git a/node_modules/@szmarczak/http-timer/package.json b/node_modules/@szmarczak/http-timer/package.json deleted file mode 100755 index cf366a763c..0000000000 --- a/node_modules/@szmarczak/http-timer/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "@szmarczak/http-timer", - "version": "1.1.2", - "description": "Timings for HTTP requests", - "main": "source", - "engines": { - "node": ">=6" - }, - "scripts": { - "test": "xo && nyc ava", - "coveralls": "nyc report --reporter=text-lcov | coveralls" - }, - "files": [ - "source" - ], - "keywords": [ - "http", - "https", - "timer", - "timings" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/szmarczak/http-timer.git" - }, - "author": "Szymon Marczak", - "license": "MIT", - "bugs": { - "url": "https://github.com/szmarczak/http-timer/issues" - }, - "homepage": "https://github.com/szmarczak/http-timer#readme", - "xo": { - "rules": { - "unicorn/filename-case": "camelCase" - } - }, - "devDependencies": { - "ava": "^0.25.0", - "coveralls": "^3.0.2", - "p-event": "^2.1.0", - "nyc": "^12.0.2", - "xo": "^0.22.0" - }, - "dependencies": { - "defer-to-connect": "^1.0.1" - } -} \ No newline at end of file diff --git a/node_modules/@szmarczak/http-timer/source/index.js b/node_modules/@szmarczak/http-timer/source/index.js deleted file mode 100755 index e294580402..0000000000 --- a/node_modules/@szmarczak/http-timer/source/index.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict'; -const deferToConnect = require('defer-to-connect'); - -module.exports = request => { - const timings = { - start: Date.now(), - socket: null, - lookup: null, - connect: null, - upload: null, - response: null, - end: null, - error: null, - phases: { - wait: null, - dns: null, - tcp: null, - request: null, - firstByte: null, - download: null, - total: null - } - }; - - const handleError = origin => { - const emit = origin.emit.bind(origin); - origin.emit = (event, ...args) => { - // Catches the `error` event - if (event === 'error') { - timings.error = Date.now(); - timings.phases.total = timings.error - timings.start; - - origin.emit = emit; - } - - // Saves the original behavior - return emit(event, ...args); - }; - }; - - let uploadFinished = false; - const onUpload = () => { - timings.upload = Date.now(); - timings.phases.request = timings.upload - timings.connect; - }; - - handleError(request); - - request.once('socket', socket => { - timings.socket = Date.now(); - timings.phases.wait = timings.socket - timings.start; - - const lookupListener = () => { - timings.lookup = Date.now(); - timings.phases.dns = timings.lookup - timings.socket; - }; - - socket.once('lookup', lookupListener); - - deferToConnect(socket, () => { - timings.connect = Date.now(); - - if (timings.lookup === null) { - socket.removeListener('lookup', lookupListener); - timings.lookup = timings.connect; - timings.phases.dns = timings.lookup - timings.socket; - } - - timings.phases.tcp = timings.connect - timings.lookup; - - if (uploadFinished && !timings.upload) { - onUpload(); - } - }); - }); - - request.once('finish', () => { - uploadFinished = true; - - if (timings.connect) { - onUpload(); - } - }); - - request.once('response', response => { - timings.response = Date.now(); - timings.phases.firstByte = timings.response - timings.upload; - - handleError(response); - - response.once('end', () => { - timings.end = Date.now(); - timings.phases.download = timings.end - timings.response; - timings.phases.total = timings.end - timings.start; - }); - }); - - return timings; -}; diff --git a/node_modules/@types/normalize-package-data/LICENSE b/node_modules/@types/normalize-package-data/LICENSE deleted file mode 100755 index 21071075c2..0000000000 --- a/node_modules/@types/normalize-package-data/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/normalize-package-data/README.md b/node_modules/@types/normalize-package-data/README.md deleted file mode 100755 index e24ae276de..0000000000 --- a/node_modules/@types/normalize-package-data/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/normalize-package-data` - -# Summary -This package contains type definitions for normalize-package-data (https://github.com/npm/normalize-package-data#readme). - -# Details -Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data - -Additional Details - * Last updated: Sun, 07 Jan 2018 07:34:38 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by Jeff Dickey . diff --git a/node_modules/@types/normalize-package-data/index.d.ts b/node_modules/@types/normalize-package-data/index.d.ts deleted file mode 100755 index fa8186b0b1..0000000000 --- a/node_modules/@types/normalize-package-data/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Type definitions for normalize-package-data 2.4 -// Project: https://github.com/npm/normalize-package-data#readme -// Definitions by: Jeff Dickey -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = normalize; - -declare function normalize(data: normalize.Input, warn?: normalize.WarnFn, strict?: boolean): void; -declare function normalize(data: normalize.Input, strict?: boolean): void; - -declare namespace normalize { - type WarnFn = (msg: string) => void; - interface Input {[k: string]: any; } - - interface Person { - name?: string; - email?: string; - url?: string; - } - - interface Package { - [k: string]: any; - name: string; - version: string; - files?: string[]; - bin?: {[k: string]: string }; - man?: string[]; - keywords?: string[]; - author?: Person; - maintainers?: Person[]; - contributors?: Person[]; - bundleDependencies?: {[name: string]: string; }; - dependencies?: {[name: string]: string; }; - devDependencies?: {[name: string]: string; }; - optionalDependencies?: {[name: string]: string; }; - description?: string; - engines?: {[type: string]: string }; - license?: string; - repository?: { type: string, url: string }; - bugs?: { url: string, email?: string } | { url?: string, email: string }; - homepage?: string; - scripts?: {[k: string]: string}; - readme: string; - _id: string; - } -} diff --git a/node_modules/@types/normalize-package-data/package.json b/node_modules/@types/normalize-package-data/package.json deleted file mode 100755 index 830641a9de..0000000000 --- a/node_modules/@types/normalize-package-data/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@types/normalize-package-data", - "version": "2.4.0", - "description": "TypeScript definitions for normalize-package-data", - "license": "MIT", - "contributors": [ - { - "name": "Jeff Dickey", - "url": "https://github.com/jdxcode", - "githubUsername": "jdxcode" - } - ], - "main": "", - "repository": { - "type": "git", - "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "5d2101e9e55c73e1d649a6c311e0d40bdfaa25bb06bb75ea6f3bb0d149c1303b", - "typeScriptVersion": "2.0" -} \ No newline at end of file diff --git a/node_modules/ansi-align/CHANGELOG.md b/node_modules/ansi-align/CHANGELOG.md deleted file mode 100644 index 36eeb52c94..0000000000 --- a/node_modules/ansi-align/CHANGELOG.md +++ /dev/null @@ -1,58 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -### [3.0.1](https://github.com/nexdrew/ansi-align/compare/v3.0.0...v3.0.1) (2021-09-27) - - -### Bug Fixes - -* **package:** update string-width to version 4.1.0 ([#52](https://github.com/nexdrew/ansi-align/issues/52)) ([ab5b733](https://github.com/nexdrew/ansi-align/commit/ab5b733b1c30eef87b75e15459f2216db28d7ed3)) - - -# [3.0.0](https://github.com/nexdrew/ansi-align/compare/v2.0.0...v3.0.0) (2018-12-17) - - -### Bug Fixes - -* **package:** update string-width to version 3.0.0 ([#50](https://github.com/nexdrew/ansi-align/issues/50)) ([67f0d8f](https://github.com/nexdrew/ansi-align/commit/67f0d8f)) - - -### BREAKING CHANGES - -* **package:** Node 4 no longer supported, please update to Node 6+ or use ansi-align@2.0.0 - - - - -# [2.0.0](https://github.com/nexdrew/ansi-align/compare/v1.1.0...v2.0.0) (2017-05-01) - - -### Features - -* ES2015ify, dropping support for Node <4 ([#30](https://github.com/nexdrew/ansi-align/issues/30)) ([7b43f48](https://github.com/nexdrew/ansi-align/commit/7b43f48)) - - -### BREAKING CHANGES - -* Node 0.10 or 0.12 no longer supported, please update to Node 4+ or use ansi-align@1.1.0 - - - - -# [1.1.0](https://github.com/nexdrew/ansi-align/compare/v1.0.0...v1.1.0) (2016-06-06) - - -### Features - -* support left-alignment as no-op ([#3](https://github.com/nexdrew/ansi-align/issues/3)) ([e581db6](https://github.com/nexdrew/ansi-align/commit/e581db6)) - - - - -# 1.0.0 (2016-04-30) - - -### Features - -* initial commit ([1914d90](https://github.com/nexdrew/ansi-align/commit/1914d90)) diff --git a/node_modules/ansi-align/LICENSE b/node_modules/ansi-align/LICENSE deleted file mode 100644 index ab601b657e..0000000000 --- a/node_modules/ansi-align/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2016, Contributors - -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. diff --git a/node_modules/ansi-align/README.md b/node_modules/ansi-align/README.md deleted file mode 100644 index 5e51682552..0000000000 --- a/node_modules/ansi-align/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# ansi-align - -> align-text with ANSI support for CLIs - -[![Build Status](https://travis-ci.org/nexdrew/ansi-align.svg?branch=master)](https://travis-ci.org/nexdrew/ansi-align) -[![Coverage Status](https://coveralls.io/repos/github/nexdrew/ansi-align/badge.svg?branch=master)](https://coveralls.io/github/nexdrew/ansi-align?branch=master) -[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) -[![Greenkeeper badge](https://badges.greenkeeper.io/nexdrew/ansi-align.svg)](https://greenkeeper.io/) - -Easily center- or right- align a block of text, carefully ignoring ANSI escape codes. - -E.g. turn this: - -ansi text block no alignment :( - -Into this: - -ansi text block center aligned! - -## Install - -```sh -npm install --save ansi-align -``` - -```js -var ansiAlign = require('ansi-align') -``` - -## API - -### `ansiAlign(text, [opts])` - -Align the given text per the line with the greatest [`string-width`](https://github.com/sindresorhus/string-width), returning a new string (or array). - -#### Arguments - -- `text`: required, string or array - - The text to align. If a string is given, it will be split using either the `opts.split` value or `'\n'` by default. If an array is given, a different array of modified strings will be returned. - -- `opts`: optional, object - - Options to change behavior, see below. - -#### Options - -- `opts.align`: string, default `'center'` - - The alignment mode. Use `'center'` for center-alignment, `'right'` for right-alignment, or `'left'` for left-alignment. Note that the given `text` is assumed to be left-aligned already, so specifying `align: 'left'` just returns the `text` as is (no-op). - -- `opts.split`: string or RegExp, default `'\n'` - - The separator to use when splitting the text. Only used if text is given as a string. - -- `opts.pad`: string, default `' '` - - The value used to left-pad (prepend to) lines of lesser width. Will be repeated as necessary to adjust alignment to the line with the greatest width. - -### `ansiAlign.center(text)` - -Alias for `ansiAlign(text, { align: 'center' })`. - -### `ansiAlign.right(text)` - -Alias for `ansiAlign(text, { align: 'right' })`. - -### `ansiAlign.left(text)` - -Alias for `ansiAlign(text, { align: 'left' })`, which is a no-op. - -## Similar Packages - -- [`center-align`](https://github.com/jonschlinkert/center-align): Very close to this package, except it doesn't support ANSI codes. -- [`left-pad`](https://github.com/camwest/left-pad): Great for left-padding but does not support center alignment or ANSI codes. -- Pretty much anything by the [chalk](https://github.com/chalk) team - -## License - -ISC © Contributors diff --git a/node_modules/ansi-align/index.js b/node_modules/ansi-align/index.js deleted file mode 100644 index 67fa826d06..0000000000 --- a/node_modules/ansi-align/index.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict' - -const stringWidth = require('string-width') - -function ansiAlign (text, opts) { - if (!text) return text - - opts = opts || {} - const align = opts.align || 'center' - - // short-circuit `align: 'left'` as no-op - if (align === 'left') return text - - const split = opts.split || '\n' - const pad = opts.pad || ' ' - const widthDiffFn = align !== 'right' ? halfDiff : fullDiff - - let returnString = false - if (!Array.isArray(text)) { - returnString = true - text = String(text).split(split) - } - - let width - let maxWidth = 0 - text = text.map(function (str) { - str = String(str) - width = stringWidth(str) - maxWidth = Math.max(width, maxWidth) - return { - str, - width - } - }).map(function (obj) { - return new Array(widthDiffFn(maxWidth, obj.width) + 1).join(pad) + obj.str - }) - - return returnString ? text.join(split) : text -} - -ansiAlign.left = function left (text) { - return ansiAlign(text, { align: 'left' }) -} - -ansiAlign.center = function center (text) { - return ansiAlign(text, { align: 'center' }) -} - -ansiAlign.right = function right (text) { - return ansiAlign(text, { align: 'right' }) -} - -module.exports = ansiAlign - -function halfDiff (maxWidth, curWidth) { - return Math.floor((maxWidth - curWidth) / 2) -} - -function fullDiff (maxWidth, curWidth) { - return maxWidth - curWidth -} diff --git a/node_modules/ansi-align/package.json b/node_modules/ansi-align/package.json deleted file mode 100644 index 30b7ce1475..0000000000 --- a/node_modules/ansi-align/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "ansi-align", - "version": "3.0.1", - "description": "align-text with ANSI support for CLIs", - "main": "index.js", - "scripts": { - "pretest": "standard", - "test": "nyc ava", - "coverage": "nyc report --reporter=text-lcov | coveralls", - "release": "standard-version" - }, - "files": [ - "index.js" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/nexdrew/ansi-align.git" - }, - "keywords": [ - "ansi", - "align", - "cli", - "center", - "pad" - ], - "author": "nexdrew", - "license": "ISC", - "bugs": { - "url": "https://github.com/nexdrew/ansi-align/issues" - }, - "homepage": "https://github.com/nexdrew/ansi-align#readme", - "dependencies": { - "string-width": "^4.1.0" - }, - "devDependencies": { - "ava": "^2.0.0", - "chalk": "^2.4.2", - "coveralls": "^3.0.3", - "nyc": "^14.0.0", - "standard": "^14.0.0", - "standard-version": "^7.0.0" - } -} \ No newline at end of file diff --git a/node_modules/ava/cli.js b/node_modules/ava/cli.js deleted file mode 100755 index 2114a9a14a..0000000000 --- a/node_modules/ava/cli.js +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env node -'use strict'; -const debug = require('debug')('ava'); -const importLocal = require('import-local'); - -// Prefer the local installation of AVA -if (importLocal(__filename)) { - debug('Using local install of AVA'); -} else { - require('./lib/cli').run(); -} diff --git a/node_modules/ava/entrypoints/cli.mjs b/node_modules/ava/entrypoints/cli.mjs new file mode 100755 index 0000000000..aaa436e542 --- /dev/null +++ b/node_modules/ava/entrypoints/cli.mjs @@ -0,0 +1,4 @@ +#!/usr/bin/env node +import run from '../lib/cli.js'; + +run(); diff --git a/node_modules/ava/entrypoints/eslint-plugin-helper.cjs b/node_modules/ava/entrypoints/eslint-plugin-helper.cjs new file mode 100644 index 0000000000..99e90638b6 --- /dev/null +++ b/node_modules/ava/entrypoints/eslint-plugin-helper.cjs @@ -0,0 +1,109 @@ +'use strict'; +const path = require('path'); +const url = require('url'); +const v8 = require('v8'); +const {Worker} = require('worker_threads'); + +const { + classify, + hasExtension, + isHelperish, + matches, + normalizeFileForMatching, + normalizePatterns, +} = require('../lib/glob-helpers.cjs'); + +const MAX_DATA_LENGTH_EXCLUSIVE = 100 * 1024; // Allocate 100 KiB to exchange globs. + +let data; +let sync; +let worker; + +const resolveGlobsSync = (projectDir, overrideExtensions, overrideFiles) => { + if (worker === undefined) { + const dataBuffer = new SharedArrayBuffer(MAX_DATA_LENGTH_EXCLUSIVE); + data = new Uint8Array(dataBuffer); + + const syncBuffer = new SharedArrayBuffer(4); + sync = new Int32Array(syncBuffer); + + const filename = path.join(__dirname, '../lib/eslint-plugin-helper-worker.js'); + worker = new Worker(url.pathToFileURL(filename), { + workerData: { + dataBuffer, + syncBuffer, + firstMessage: {projectDir, overrideExtensions, overrideFiles}, + }, + }); + worker.unref(); + } else { + worker.postMessage({projectDir, overrideExtensions, overrideFiles}); + } + + const synchronize = Atomics.wait(sync, 0, 0, 10_000); + if (synchronize === 'timed-out') { + throw new Error('Timed out resolving AVA configuration'); + } + + const byteLength = Atomics.exchange(sync, 0, 0); + if (byteLength === MAX_DATA_LENGTH_EXCLUSIVE) { + throw new Error('Globs are over 100 KiB and cannot be resolved'); + } + + const globsOrError = v8.deserialize(data.slice(0, byteLength)); + if (globsOrError instanceof Error) { + throw globsOrError; + } + + return globsOrError; +}; + +const helperCache = new Map(); + +function load(projectDir, overrides) { + const cacheKey = `${JSON.stringify(overrides)}\n${projectDir}`; + if (helperCache.has(cacheKey)) { + return helperCache.get(cacheKey); + } + + let helperPatterns = []; + if (overrides && overrides.helpers !== undefined) { + if (!Array.isArray(overrides.helpers) || overrides.helpers.length === 0) { + throw new Error('The ’helpers’ override must be an array containing glob patterns.'); + } + + helperPatterns = normalizePatterns(overrides.helpers); + } + + const globs = resolveGlobsSync(projectDir, overrides && overrides.extensions, overrides && overrides.files); + + const classifyForESLint = file => { + const {isTest} = classify(file, globs); + let isHelper = false; + if (!isTest && hasExtension(globs.extensions, file)) { + file = normalizeFileForMatching(projectDir, file); + isHelper = isHelperish(file) || (helperPatterns.length > 0 && matches(file, helperPatterns)); + } + + return {isHelper, isTest}; + }; + + const helper = Object.freeze({ + classifyFile: classifyForESLint, + classifyImport: importPath => { + if (hasExtension(globs.extensions, importPath)) { + // The importPath has one of the test file extensions: we can classify + // it directly. + return classifyForESLint(importPath); + } + + // Add the first extension. If multiple extensions are available, assume + // patterns are not biased to any particular extension. + return classifyForESLint(`${importPath}.${globs.extensions[0]}`); + }, + }); + helperCache.set(cacheKey, helper); + return helper; +} + +exports.load = load; diff --git a/node_modules/ava/entrypoints/main.cjs b/node_modules/ava/entrypoints/main.cjs new file mode 100644 index 0000000000..c0a5562b46 --- /dev/null +++ b/node_modules/ava/entrypoints/main.cjs @@ -0,0 +1,2 @@ +'use strict'; +module.exports = require('../lib/worker/main.cjs'); diff --git a/node_modules/ava/entrypoints/main.mjs b/node_modules/ava/entrypoints/main.mjs new file mode 100644 index 0000000000..36b076bb62 --- /dev/null +++ b/node_modules/ava/entrypoints/main.mjs @@ -0,0 +1 @@ +export {default} from '../lib/worker/main.cjs'; diff --git a/node_modules/ava/entrypoints/plugin.cjs b/node_modules/ava/entrypoints/plugin.cjs new file mode 100644 index 0000000000..9c594ad0a6 --- /dev/null +++ b/node_modules/ava/entrypoints/plugin.cjs @@ -0,0 +1,2 @@ +'use strict'; +module.exports = require('../lib/worker/plugin.cjs'); diff --git a/node_modules/ava/entrypoints/plugin.mjs b/node_modules/ava/entrypoints/plugin.mjs new file mode 100644 index 0000000000..f777eb4f71 --- /dev/null +++ b/node_modules/ava/entrypoints/plugin.mjs @@ -0,0 +1,4 @@ +import * as plugin from '../lib/worker/plugin.cjs'; + +const {registerSharedWorker} = plugin; +export {registerSharedWorker}; diff --git a/node_modules/ava/eslint-plugin-helper.js b/node_modules/ava/eslint-plugin-helper.js deleted file mode 100644 index b8e4a71ec3..0000000000 --- a/node_modules/ava/eslint-plugin-helper.js +++ /dev/null @@ -1,201 +0,0 @@ -'use strict'; -let isMainThread = true; -let supportsWorkers = false; -try { - ({isMainThread} = require('worker_threads')); - supportsWorkers = true; -} catch {} - -const {classify, hasExtension, isHelperish, matches, normalizeFileForMatching, normalizeGlobs, normalizePatterns} = require('./lib/globs'); - -let resolveGlobs; -let resolveGlobsSync; - -if (!supportsWorkers || !isMainThread) { - const normalizeExtensions = require('./lib/extensions'); - const {loadConfig, loadConfigSync} = require('./lib/load-config'); - const providerManager = require('./lib/provider-manager'); - - const configCache = new Map(); - - const collectProviders = ({conf, projectDir}) => { - const providers = []; - if (Reflect.has(conf, 'babel')) { - const {level, main} = providerManager.babel(projectDir); - providers.push({ - level, - main: main({config: conf.babel}), - type: 'babel' - }); - } - - if (Reflect.has(conf, 'typescript')) { - const {level, main} = providerManager.typescript(projectDir); - providers.push({ - level, - main: main({config: conf.typescript}), - type: 'typescript' - }); - } - - return providers; - }; - - const buildGlobs = ({conf, providers, projectDir, overrideExtensions, overrideFiles}) => { - const extensions = overrideExtensions ? - normalizeExtensions(overrideExtensions) : - normalizeExtensions(conf.extensions, providers); - - return { - cwd: projectDir, - ...normalizeGlobs({ - extensions, - files: overrideFiles ? overrideFiles : conf.files, - providers - }) - }; - }; - - resolveGlobsSync = (projectDir, overrideExtensions, overrideFiles) => { - if (!configCache.has(projectDir)) { - const conf = loadConfigSync({resolveFrom: projectDir}); - const providers = collectProviders({conf, projectDir}); - configCache.set(projectDir, {conf, providers}); - } - - const {conf, providers} = configCache.get(projectDir); - return buildGlobs({conf, providers, projectDir, overrideExtensions, overrideFiles}); - }; - - resolveGlobs = async (projectDir, overrideExtensions, overrideFiles) => { - if (!configCache.has(projectDir)) { - configCache.set(projectDir, loadConfig({resolveFrom: projectDir}).then(conf => { // eslint-disable-line promise/prefer-await-to-then - const providers = collectProviders({conf, projectDir}); - return {conf, providers}; - })); - } - - const {conf, providers} = await configCache.get(projectDir); - return buildGlobs({conf, providers, projectDir, overrideExtensions, overrideFiles}); - }; -} - -if (supportsWorkers) { - const v8 = require('v8'); - - const MAX_DATA_LENGTH_EXCLUSIVE = 100 * 1024; // Allocate 100 KiB to exchange globs. - - if (isMainThread) { - const {Worker} = require('worker_threads'); - let data; - let sync; - let worker; - - resolveGlobsSync = (projectDir, overrideExtensions, overrideFiles) => { - if (worker === undefined) { - const dataBuffer = new SharedArrayBuffer(MAX_DATA_LENGTH_EXCLUSIVE); - data = new Uint8Array(dataBuffer); - - const syncBuffer = new SharedArrayBuffer(4); - sync = new Int32Array(syncBuffer); - - worker = new Worker(__filename, { - workerData: { - dataBuffer, - syncBuffer, - firstMessage: {projectDir, overrideExtensions, overrideFiles} - } - }); - worker.unref(); - } else { - worker.postMessage({projectDir, overrideExtensions, overrideFiles}); - } - - Atomics.wait(sync, 0, 0); - - const byteLength = Atomics.exchange(sync, 0, 0); - if (byteLength === MAX_DATA_LENGTH_EXCLUSIVE) { - throw new Error('Globs are over 100 KiB and cannot be resolved'); - } - - const globsOrError = v8.deserialize(data.slice(0, byteLength)); - if (globsOrError instanceof Error) { - throw globsOrError; - } - - return globsOrError; - }; - } else { - const {parentPort, workerData} = require('worker_threads'); - const data = new Uint8Array(workerData.dataBuffer); - const sync = new Int32Array(workerData.syncBuffer); - - const handleMessage = async ({projectDir, overrideExtensions, overrideFiles}) => { - let encoded; - try { - const globs = await resolveGlobs(projectDir, overrideExtensions, overrideFiles); - encoded = v8.serialize(globs); - } catch (error) { - encoded = v8.serialize(error); - } - - const byteLength = encoded.length < MAX_DATA_LENGTH_EXCLUSIVE ? encoded.copy(data) : MAX_DATA_LENGTH_EXCLUSIVE; - Atomics.store(sync, 0, byteLength); - Atomics.notify(sync, 0); - }; - - parentPort.on('message', handleMessage); - handleMessage(workerData.firstMessage); - delete workerData.firstMessage; - } -} - -const helperCache = new Map(); - -function load(projectDir, overrides) { - const cacheKey = `${JSON.stringify(overrides)}\n${projectDir}`; - if (helperCache.has(cacheKey)) { - return helperCache.get(cacheKey); - } - - let helperPatterns = []; - if (overrides && overrides.helpers !== undefined) { - if (!Array.isArray(overrides.helpers) || overrides.helpers.length === 0) { - throw new Error('The ’helpers’ override must be an array containing glob patterns.'); - } - - helperPatterns = normalizePatterns(overrides.helpers); - } - - const globs = resolveGlobsSync(projectDir, overrides && overrides.extensions, overrides && overrides.files); - - const classifyForESLint = file => { - const {isTest} = classify(file, globs); - let isHelper = false; - if (!isTest && hasExtension(globs.extensions, file)) { - file = normalizeFileForMatching(projectDir, file); - isHelper = isHelperish(file) || (helperPatterns.length > 0 && matches(file, helperPatterns)); - } - - return {isHelper, isTest}; - }; - - const helper = Object.freeze({ - classifyFile: classifyForESLint, - classifyImport: importPath => { - if (hasExtension(globs.extensions, importPath)) { - // The importPath has one of the test file extensions: we can classify - // it directly. - return classifyForESLint(importPath); - } - - // Add the first extension. If multiple extensions are available, assume - // patterns are not biased to any particular extension. - return classifyForESLint(`${importPath}.${globs.extensions[0]}`); - } - }); - helperCache.set(cacheKey, helper); - return helper; -} - -exports.load = load; diff --git a/node_modules/ava/index.d.ts b/node_modules/ava/index.d.ts index a1a8fa5955..24b722040a 100644 --- a/node_modules/ava/index.d.ts +++ b/node_modules/ava/index.d.ts @@ -1,822 +1,12 @@ -export interface Subscribable { - subscribe(observer: { - error(err: any): void; - complete(): void; - }): void; -} +import type {TestFn} from './types/test-fn'; -export type Constructor = (new (...args: any[]) => any); - -/** Specify one or more expectations the thrown error must satisfy. */ -export type ThrowsExpectation = { - /** The thrown error must have a code that equals the given string or number. */ - code?: string | number; - - /** The thrown error must be an instance of this constructor. */ - instanceOf?: Constructor; - - /** The thrown error must be strictly equal to this value. */ - is?: Error; - - /** The thrown error must have a message that equals the given string, or matches the regular expression. */ - message?: string | RegExp; - - /** The thrown error must have a name that equals the given string. */ - name?: string; -}; - -export type CommitDiscardOptions = { - /** - * Whether the logs should be included in those of the parent test. - */ - retainLogs?: boolean; -}; - -/** Options that can be passed to the `t.snapshot()` assertion. */ -export type SnapshotOptions = { - /** If provided and not an empty string, used to select the snapshot to compare the `expected` value against. */ - id?: string; -}; - -export interface Assertions { - /** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). Comes with power-assert. */ - assert: AssertAssertion; - - /** Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */ - deepEqual: DeepEqualAssertion; - - /** Assert that `actual` is like `expected`. */ - like: LikeAssertion; - - /** Fail the test. */ - fail: FailAssertion; - - /** Assert that `actual` is strictly false. */ - false: FalseAssertion; - - /** Assert that `actual` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy). */ - falsy: FalsyAssertion; - - /** - * Assert that `actual` is [the same - * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`. - */ - is: IsAssertion; - - /** - * Assert that `actual` is not [the same - * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`. - */ - not: NotAssertion; - - /** Assert that `actual` is not [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */ - notDeepEqual: NotDeepEqualAssertion; - - /** Assert that `string` does not match the regular expression. */ - notRegex: NotRegexAssertion; - - /** Assert that the function does not throw. */ - notThrows: NotThrowsAssertion; - - /** Assert that the async function does not throw, or that the promise does not reject. Must be awaited. */ - notThrowsAsync: NotThrowsAsyncAssertion; - - /** Count a passing assertion. */ - pass: PassAssertion; - - /** Assert that `string` matches the regular expression. */ - regex: RegexAssertion; - - /** - * Assert that `expected` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to a - * previously recorded [snapshot](https://github.com/concordancejs/concordance#serialization-details), or if - * necessary record a new snapshot. - */ - snapshot: SnapshotAssertion; - - /** - * Assert that the function throws [an error](https://www.npmjs.com/package/is-error). If so, returns the error value. - */ - throws: ThrowsAssertion; - - /** - * Assert that the async function throws [an error](https://www.npmjs.com/package/is-error), or the promise rejects - * with one. If so, returns a promise for the error value, which must be awaited. - */ - throwsAsync: ThrowsAsyncAssertion; - - /** Assert that `actual` is strictly true. */ - true: TrueAssertion; - - /** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). */ - truthy: TruthyAssertion; -} - -export interface AssertAssertion { - /** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). Comes with power-assert. */ - (actual: any, message?: string): void; - - /** Skip this assertion. */ - skip(actual: any, message?: string): void; -} - -export interface DeepEqualAssertion { - /** Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */ - (actual: ValueType, expected: ValueType, message?: string): void; - - /** Skip this assertion. */ - skip(actual: any, expected: any, message?: string): void; -} - -export interface LikeAssertion { - /** Assert that `value` is like `selector`. */ - (value: any, selector: Record, message?: string): void; - - /** Skip this assertion. */ - skip(value: any, selector: any, message?: string): void; -} - -export interface FailAssertion { - /** Fail the test. */ - (message?: string): void; - - /** Skip this assertion. */ - skip(message?: string): void; -} - -export interface FalseAssertion { - /** Assert that `actual` is strictly false. */ - (actual: any, message?: string): void; - - /** Skip this assertion. */ - skip(actual: any, message?: string): void; -} - -export interface FalsyAssertion { - /** Assert that `actual` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy). */ - (actual: any, message?: string): void; - - /** Skip this assertion. */ - skip(actual: any, message?: string): void; -} - -export interface IsAssertion { - /** - * Assert that `actual` is [the same - * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`. - */ - (actual: ValueType, expected: ValueType, message?: string): void; - - /** Skip this assertion. */ - skip(actual: any, expected: any, message?: string): void; -} - -export interface NotAssertion { - /** - * Assert that `actual` is not [the same - * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`. - */ - (actual: ValueType, expected: ValueType, message?: string): void; - - /** Skip this assertion. */ - skip(actual: any, expected: any, message?: string): void; -} - -export interface NotDeepEqualAssertion { - /** Assert that `actual` is not [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */ - (actual: ValueType, expected: ValueType, message?: string): void; - - /** Skip this assertion. */ - skip(actual: any, expected: any, message?: string): void; -} - -export interface NotRegexAssertion { - /** Assert that `string` does not match the regular expression. */ - (string: string, regex: RegExp, message?: string): void; - - /** Skip this assertion. */ - skip(string: string, regex: RegExp, message?: string): void; -} - -export interface NotThrowsAssertion { - /** Assert that the function does not throw. */ - (fn: () => any, message?: string): void; - - /** Skip this assertion. */ - skip(fn: () => any, message?: string): void; -} - -export interface NotThrowsAsyncAssertion { - /** Assert that the async function does not throw. You must await the result. */ - (fn: () => PromiseLike, message?: string): Promise; - - /** Assert that the promise does not reject. You must await the result. */ - (promise: PromiseLike, message?: string): Promise; - - /** Skip this assertion. */ - skip(nonThrower: any, message?: string): void; -} - -export interface PassAssertion { - /** Count a passing assertion. */ - (message?: string): void; - - /** Skip this assertion. */ - skip(message?: string): void; -} - -export interface RegexAssertion { - /** Assert that `string` matches the regular expression. */ - (string: string, regex: RegExp, message?: string): void; - - /** Skip this assertion. */ - skip(string: string, regex: RegExp, message?: string): void; -} - -export interface SnapshotAssertion { - /** - * Assert that `expected` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to a - * previously recorded [snapshot](https://github.com/concordancejs/concordance#serialization-details), or if - * necessary record a new snapshot. - */ - (expected: any, message?: string): void; - - /** - * Assert that `expected` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to a - * previously recorded [snapshot](https://github.com/concordancejs/concordance#serialization-details) (selected - * through `options.id` if provided), or if necessary record a new snapshot. - */ - (expected: any, options: SnapshotOptions, message?: string): void; - - /** Skip this assertion. */ - skip(expected: any, message?: string): void; - - /** Skip this assertion. */ - skip(expected: any, options: SnapshotOptions, message?: string): void; -} - -export interface ThrowsAssertion { - /** - * Assert that the function throws [an error](https://www.npmjs.com/package/is-error). If so, returns the error value. - * The error must satisfy all expectations. - */ - (fn: () => any, expectations?: ThrowsExpectation | null, message?: string): ThrownError; - - /** Skip this assertion. */ - skip(fn: () => any, expectations?: any, message?: string): void; -} - -export interface ThrowsAsyncAssertion { - /** - * Assert that the async function throws [an error](https://www.npmjs.com/package/is-error). If so, returns the error - * value. You must await the result. - */ - (fn: () => PromiseLike, expectations?: null, message?: string): Promise; - - /** - * Assert that the async function throws [an error](https://www.npmjs.com/package/is-error). If so, returns the error - * value. You must await the result. The error must satisfy all expectations. - */ - (fn: () => PromiseLike, expectations: ThrowsExpectation, message?: string): Promise; - - /** - * Assert that the promise rejects with [an error](https://www.npmjs.com/package/is-error). If so, returns the - * rejection reason. You must await the result. - */ - (promise: PromiseLike, expectations?: null, message?: string): Promise; - - /** - * Assert that the promise rejects with [an error](https://www.npmjs.com/package/is-error). If so, returns the - * rejection reason. You must await the result. The error must satisfy all expectations. - */ - (promise: PromiseLike, expectations: ThrowsExpectation, message?: string): Promise; - - /** Skip this assertion. */ - skip(thrower: any, expectations?: any, message?: string): void; -} - -export interface TrueAssertion { - /** Assert that `actual` is strictly true. */ - (actual: any, message?: string): void; - - /** Skip this assertion. */ - skip(actual: any, message?: string): void; -} - -export interface TruthyAssertion { - /** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). */ - (actual: any, message?: string): void; - - /** Skip this assertion. */ - skip(actual: any, message?: string): void; -} - -/** The `t` value passed to test & hook implementations. */ -export interface ExecutionContext extends Assertions { - /** Test context, shared with hooks. */ - context: Context; - - /** Title of the test or hook. */ - readonly title: string; - - /** Whether the test has passed. Only accurate in afterEach hooks. */ - readonly passed: boolean; - - log: LogFn; - plan: PlanFn; - teardown: TeardownFn; - timeout: TimeoutFn; - try: TryFn; -} - -export interface LogFn { - /** Log one or more values. */ - (...values: any[]): void; - - /** Skip logging. */ - skip(...values: any[]): void; -} - -export interface PlanFn { - /** - * Plan how many assertion there are in the test. The test will fail if the actual assertion count doesn't match the - * number of planned assertions. See [assertion planning](https://github.com/avajs/ava#assertion-planning). - */ - (count: number): void; - - /** Don't plan assertions. */ - skip(count: number): void; -} - -export interface TimeoutFn { - /** - * Set a timeout for the test, in milliseconds. The test will fail if the timeout is exceeded. - * The timeout is reset each time an assertion is made. - */ - (ms: number, message?: string): void; -} - -export interface TeardownFn { - /** Declare a function to be run after the test has ended. */ - (fn: () => void): void; -} - -export interface TryFn { - /** - * Attempt to run some assertions. The result must be explicitly committed or discarded or else - * the test will fail. A macro may be provided. The title may help distinguish attempts from - * one another. - */ - (title: string, fn: EitherMacro, ...args: Args): Promise; - - /** - * Attempt to run some assertions. The result must be explicitly committed or discarded or else - * the test will fail. A macro may be provided. The title may help distinguish attempts from - * one another. - */ - (title: string, fn: [EitherMacro, ...Array>], ...args: Args): Promise; - - /** - * Attempt to run some assertions. The result must be explicitly committed or discarded or else - * the test will fail. A macro may be provided. - */ - (fn: EitherMacro, ...args: Args): Promise; - - /** - * Attempt to run some assertions. The result must be explicitly committed or discarded or else - * the test will fail. A macro may be provided. - */ - (fn: [EitherMacro, ...Array>], ...args: Args): Promise; -} - -export interface AssertionError extends Error {} - -export interface TryResult { - /** - * Title of the attempt, helping you tell attempts aparts. - */ - title: string; - - /** - * Indicates whether all assertions passed, or at least one failed. - */ - passed: boolean; - - /** - * Errors raised for each failed assertion. - */ - errors: AssertionError[]; - - /** - * Logs created during the attempt using `t.log()`. Contains formatted values. - */ - logs: string[]; - - /** - * Commit the attempt. Counts as one assertion for the plan count. If the - * attempt failed, calling this will also cause your test to fail. - */ - commit(options?: CommitDiscardOptions): void; - - /** - * Discard the attempt. - */ - discard(options?: CommitDiscardOptions): void; -} - -/** The `t` value passed to implementations for tests & hooks declared with the `.cb` modifier. */ -export interface CbExecutionContext extends ExecutionContext { - /** - * End the test. If `error` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) the test or hook - * will fail. - */ - end(error?: any): void; -} - -export type ImplementationResult = PromiseLike | Subscribable | void; -export type Implementation = (t: ExecutionContext) => ImplementationResult; -export type CbImplementation = (t: CbExecutionContext) => ImplementationResult; - -/** A reusable test or hook implementation. */ -export type UntitledMacro = (t: ExecutionContext, ...args: Args) => ImplementationResult; - -/** A reusable test or hook implementation. */ -export type Macro = UntitledMacro & { - /** - * Implement this function to generate a test (or hook) title whenever this macro is used. `providedTitle` contains - * the title provided when the test or hook was declared. Also receives the remaining test arguments. - */ - title?: (providedTitle: string | undefined, ...args: Args) => string; -}; - -export type EitherMacro = Macro | UntitledMacro; - -/** Alias for a single macro, or an array of macros. */ -export type OneOrMoreMacros = EitherMacro | [EitherMacro, ...Array>]; - -/** A reusable test or hook implementation, for tests & hooks declared with the `.cb` modifier. */ -export type UntitledCbMacro = (t: CbExecutionContext, ...args: Args) => ImplementationResult; - -/** A reusable test or hook implementation, for tests & hooks declared with the `.cb` modifier. */ -export type CbMacro = UntitledCbMacro & { - title?: (providedTitle: string | undefined, ...args: Args) => string; -}; - -export type EitherCbMacro = CbMacro | UntitledCbMacro; - -/** Alias for a single macro, or an array of macros, used for tests & hooks declared with the `.cb` modifier. */ -export type OneOrMoreCbMacros = EitherCbMacro | [EitherCbMacro, ...Array>]; - -export interface TestInterface { - /** Declare a concurrent test. */ - (title: string, implementation: Implementation): void; - - /** Declare a concurrent test that uses one or more macros. Additional arguments are passed to the macro. */ - (title: string, macros: OneOrMoreMacros, ...rest: T): void; - - /** Declare a concurrent test that uses one or more macros. The macro is responsible for generating a unique test title. */ - (macros: OneOrMoreMacros, ...rest: T): void; - - /** Declare a hook that is run once, after all tests have passed. */ - after: AfterInterface; - - /** Declare a hook that is run after each passing test. */ - afterEach: AfterInterface; - - /** Declare a hook that is run once, before all tests. */ - before: BeforeInterface; - - /** Declare a hook that is run before each test. */ - beforeEach: BeforeInterface; - - /** Declare a test that must call `t.end()` when it's done. */ - cb: CbInterface; - - /** Declare a test that is expected to fail. */ - failing: FailingInterface; - - /** Declare tests and hooks that are run serially. */ - serial: SerialInterface; - - only: OnlyInterface; - skip: SkipInterface; - todo: TodoDeclaration; - meta: MetaInterface; -} - -export interface AfterInterface { - /** Declare a hook that is run once, after all tests have passed. */ - (implementation: Implementation): void; - - /** Declare a hook that is run once, after all tests have passed. */ - (title: string, implementation: Implementation): void; - - /** Declare a hook that is run once, after all tests have passed. Additional arguments are passed to the macro. */ - (title: string, macros: OneOrMoreMacros, ...rest: T): void; - - /** Declare a hook that is run once, after all tests have passed. */ - (macros: OneOrMoreMacros, ...rest: T): void; - - /** Declare a hook that is run once, after all tests are done. */ - always: AlwaysInterface; - - /** Declare a hook that must call `t.end()` when it's done. */ - cb: HookCbInterface; - - skip: HookSkipInterface; -} - -export interface AlwaysInterface { - /** Declare a hook that is run once, after all tests are done. */ - (implementation: Implementation): void; - - /** Declare a hook that is run once, after all tests are done. */ - (title: string, implementation: Implementation): void; - - /** Declare a hook that is run once, after all tests are done. Additional arguments are passed to the macro. */ - (title: string, macros: OneOrMoreMacros, ...rest: T): void; - - /** Declare a hook that is run once, after all tests are done. */ - (macros: OneOrMoreMacros, ...rest: T): void; - - /** Declare a hook that must call `t.end()` when it's done. */ - cb: HookCbInterface; - - skip: HookSkipInterface; -} - -export interface BeforeInterface { - /** Declare a hook that is run once, before all tests. */ - (implementation: Implementation): void; - - /** Declare a hook that is run once, before all tests. */ - (title: string, implementation: Implementation): void; - - /** Declare a hook that is run once, before all tests. Additional arguments are passed to the macro. */ - (title: string, macros: OneOrMoreMacros, ...rest: T): void; - - /** Declare a hook that is run once, before all tests. */ - (macros: OneOrMoreMacros, ...rest: T): void; - - /** Declare a hook that must call `t.end()` when it's done. */ - cb: HookCbInterface; - - skip: HookSkipInterface; -} - -export interface CbInterface { - /** Declare a test that must call `t.end()` when it's done. */ - (title: string, implementation: CbImplementation): void; - - /** - * Declare a concurrent test that uses one or more macros. The macros must call `t.end()` when they're done. - * Additional arguments are passed to the macro. - */ - (title: string, macros: OneOrMoreCbMacros, ...rest: T): void; - - /** - * Declare a concurrent test that uses one or more macros. The macros must call `t.end()` when they're done. - * The macro is responsible for generating a unique test title. - */ - (macros: OneOrMoreCbMacros, ...rest: T): void; - - /** Declare a test that is expected to fail. */ - failing: CbFailingInterface; - - only: CbOnlyInterface; - skip: CbSkipInterface; -} - -export interface CbFailingInterface { - /** Declare a test that must call `t.end()` when it's done. The test is expected to fail. */ - (title: string, implementation: CbImplementation): void; - - /** - * Declare a test that uses one or more macros. The macros must call `t.end()` when they're done. - * Additional arguments are passed to the macro. The test is expected to fail. - */ - (title: string, macros: OneOrMoreCbMacros, ...rest: T): void; - - /** - * Declare a test that uses one or more macros. The macros must call `t.end()` when they're done. - * The test is expected to fail. - */ - (macros: OneOrMoreCbMacros, ...rest: T): void; - - only: CbOnlyInterface; - skip: CbSkipInterface; -} - -export interface CbOnlyInterface { - /** - * Declare a test that must call `t.end()` when it's done. Only this test and others declared with `.only()` are run. - */ - (title: string, implementation: CbImplementation): void; - - /** - * Declare a test that uses one or more macros. The macros must call `t.end()` when they're done. - * Additional arguments are passed to the macro. Only this test and others declared with `.only()` are run. - */ - (title: string, macros: OneOrMoreCbMacros, ...rest: T): void; - - /** - * Declare a test that uses one or more macros. The macros must call `t.end()` when they're done. - * Additional arguments are passed to the macro. Only this test and others declared with `.only()` are run. - */ - (macros: OneOrMoreCbMacros, ...rest: T): void; -} - -export interface CbSkipInterface { - /** Skip this test. */ - (title: string, implementation: CbImplementation): void; - - /** Skip this test. */ - (title: string, macros: OneOrMoreCbMacros, ...rest: T): void; - - /** Skip this test. */ - (macros: OneOrMoreCbMacros, ...rest: T): void; -} - -export interface FailingInterface { - /** Declare a concurrent test. The test is expected to fail. */ - (title: string, implementation: Implementation): void; - - /** - * Declare a concurrent test that uses one or more macros. Additional arguments are passed to the macro. - * The test is expected to fail. - */ - (title: string, macros: OneOrMoreMacros, ...rest: T): void; - - /** - * Declare a concurrent test that uses one or more macros. The macro is responsible for generating a unique test title. - * The test is expected to fail. - */ - (macros: OneOrMoreMacros, ...rest: T): void; - - only: OnlyInterface; - skip: SkipInterface; -} - -export interface HookCbInterface { - /** Declare a hook that must call `t.end()` when it's done. */ - (implementation: CbImplementation): void; - - /** Declare a hook that must call `t.end()` when it's done. */ - (title: string, implementation: CbImplementation): void; - - /** - * Declare a hook that uses one or more macros. The macros must call `t.end()` when they're done. - * Additional arguments are passed to the macro. - */ - (title: string, macros: OneOrMoreCbMacros, ...rest: T): void; - - /** - * Declare a hook that uses one or more macros. The macros must call `t.end()` when they're done. - */ - (macros: OneOrMoreCbMacros, ...rest: T): void; - - skip: HookCbSkipInterface; -} - -export interface HookCbSkipInterface { - /** Skip this hook. */ - (implementation: CbImplementation): void; - - /** Skip this hook. */ - (title: string, implementation: CbImplementation): void; - - /** Skip this hook. */ - (title: string, macros: OneOrMoreCbMacros, ...rest: T): void; - - /** Skip this hook. */ - (macros: OneOrMoreCbMacros, ...rest: T): void; -} - -export interface HookSkipInterface { - /** Skip this hook. */ - (implementation: Implementation): void; - - /** Skip this hook. */ - (title: string, implementation: Implementation): void; - - /** Skip this hook. */ - (title: string, macros: OneOrMoreMacros, ...rest: T): void; - - /** Skip this hook. */ - (macros: OneOrMoreMacros, ...rest: T): void; -} - -export interface OnlyInterface { - /** Declare a test. Only this test and others declared with `.only()` are run. */ - (title: string, implementation: Implementation): void; - - /** - * Declare a test that uses one or more macros. Additional arguments are passed to the macro. - * Only this test and others declared with `.only()` are run. - */ - (title: string, macros: OneOrMoreMacros, ...rest: T): void; - - /** - * Declare a test that uses one or more macros. The macro is responsible for generating a unique test title. - * Only this test and others declared with `.only()` are run. - */ - (macros: OneOrMoreMacros, ...rest: T): void; -} - -export interface SerialInterface { - /** Declare a serial test. */ - (title: string, implementation: Implementation): void; - - /** Declare a serial test that uses one or more macros. Additional arguments are passed to the macro. */ - (title: string, macros: OneOrMoreMacros, ...rest: T): void; - - /** - * Declare a serial test that uses one or more macros. The macro is responsible for generating a unique test title. - */ - (macros: OneOrMoreMacros, ...rest: T): void; - - /** Declare a serial hook that is run once, after all tests have passed. */ - after: AfterInterface; - - /** Declare a serial hook that is run after each passing test. */ - afterEach: AfterInterface; - - /** Declare a serial hook that is run once, before all tests. */ - before: BeforeInterface; - - /** Declare a serial hook that is run before each test. */ - beforeEach: BeforeInterface; - - /** Declare a serial test that must call `t.end()` when it's done. */ - cb: CbInterface; - - /** Declare a serial test that is expected to fail. */ - failing: FailingInterface; - - only: OnlyInterface; - skip: SkipInterface; - todo: TodoDeclaration; -} - -export interface SkipInterface { - /** Skip this test. */ - (title: string, implementation: Implementation): void; - - /** Skip this test. */ - (title: string, macros: OneOrMoreMacros, ...rest: T): void; - - /** Skip this test. */ - (macros: OneOrMoreMacros, ...rest: T): void; -} - -export interface TodoDeclaration { - /** Declare a test that should be implemented later. */ - (title: string): void; -} - -export interface MetaInterface { - /** Path to the test file being executed. */ - file: string; - - /** Directory where snapshots are stored. */ - snapshotDirectory: string; -} +export * from './types/assertions'; +export * from './types/try-fn'; +export * from './types/test-fn'; +export * from './types/subscribable'; /** Call to declare a test, or chain to declare hooks or test modifiers */ -declare const test: TestInterface; +declare const test: TestFn; /** Call to declare a test, or chain to declare hooks or test modifiers */ export default test; - -/** Call to declare a hook that is run once, after all tests have passed, or chain to declare modifiers. */ -export const after: AfterInterface; - -/** Call to declare a hook that is run after each passing test, or chain to declare modifiers. */ -export const afterEach: AfterInterface; - -/** Call to declare a hook that is run once, before all tests, or chain to declare modifiers. */ -export const before: BeforeInterface; - -/** Call to declare a hook that is run before each test, or chain to declare modifiers. */ -export const beforeEach: BeforeInterface; - -/** Call to declare a test that must invoke `t.end()` when it's done, or chain to declare modifiers. */ -export const cb: CbInterface; - -/** Call to declare a test that is expected to fail, or chain to declare modifiers. */ -export const failing: FailingInterface; - -/** Call to declare a test that is run exclusively, along with other tests declared with `.only()`. */ -export const only: OnlyInterface; - -/** Call to declare a serial test, or chain to declare serial hooks or test modifiers. */ -export const serial: SerialInterface; - -/** Skip this test. */ -export const skip: SkipInterface; - -/** Declare a test that should be implemented later. */ -export const todo: TodoDeclaration; - -/** Meta data associated with the current process. */ -export const meta: MetaInterface; diff --git a/node_modules/ava/index.js b/node_modules/ava/index.js deleted file mode 100644 index 24f28865b2..0000000000 --- a/node_modules/ava/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -// Ensure the same AVA install is loaded by the test file as by the test worker -if (process.env.AVA_PATH && process.env.AVA_PATH !== __dirname) { - module.exports = require(process.env.AVA_PATH); -} else { - module.exports = require('./lib/worker/main'); -} diff --git a/node_modules/ava/lib/api.js b/node_modules/ava/lib/api.js index 14d2a72004..bf0cb2498c 100644 --- a/node_modules/ava/lib/api.js +++ b/node_modules/ava/lib/api.js @@ -1,23 +1,25 @@ -'use strict'; -const fs = require('fs'); -const path = require('path'); -const os = require('os'); -const commonPathPrefix = require('common-path-prefix'); -const resolveCwd = require('resolve-cwd'); -const debounce = require('lodash/debounce'); -const arrify = require('arrify'); -const ms = require('ms'); -const chunkd = require('chunkd'); -const Emittery = require('emittery'); -const pMap = require('p-map'); -const tempDir = require('temp-dir'); -const globs = require('./globs'); -const isCi = require('./is-ci'); -const RunStatus = require('./run-status'); -const fork = require('./fork'); -const serializeError = require('./serialize-error'); -const {getApplicableLineNumbers} = require('./line-numbers'); -const sharedWorkers = require('./plugin-support/shared-workers'); +import fs from 'node:fs'; +import os from 'node:os'; +import path from 'node:path'; +import process from 'node:process'; + +import arrify from 'arrify'; +import chunkd from 'chunkd'; +import commonPathPrefix from 'common-path-prefix'; +import Emittery from 'emittery'; +import ms from 'ms'; +import pMap from 'p-map'; +import resolveCwd from 'resolve-cwd'; +import tempDir from 'temp-dir'; + +import fork from './fork.js'; +import * as globs from './globs.js'; +import isCi from './is-ci.js'; +import {getApplicableLineNumbers} from './line-numbers.js'; +import {observeWorkerProcess} from './plugin-support/shared-workers.js'; +import RunStatus from './run-status.js'; +import scheduler from './scheduler.js'; +import serializeError from './serialize-error.js'; function resolveModules(modules) { return arrify(modules).map(name => { @@ -40,7 +42,40 @@ function getFilePathPrefix(files) { return commonPathPrefix(files); } -class Api extends Emittery { +class TimeoutTrigger { + constructor(fn, waitMs = 0) { + this.fn = fn.bind(null); + this.ignoreUntil = 0; + this.waitMs = waitMs; + this.timer = undefined; + } + + debounce() { + if (this.timer === undefined) { + this.timer = setTimeout(() => this.trigger(), this.waitMs); + } else { + this.timer.refresh(); + } + } + + discard() { + // N.B. this.timer is not cleared so if debounce() is called after it will + // not run again. + clearTimeout(this.timer); + } + + ignoreFor(periodMs) { + this.ignoreUntil = Math.max(this.ignoreUntil, Date.now() + periodMs); + } + + trigger() { + if (Date.now() >= this.ignoreUntil) { + this.fn(); + } + } +} + +export default class Api extends Emittery { constructor(options) { super(); @@ -55,7 +90,7 @@ class Api extends Emittery { } } - async run({files: selectedFiles = [], filter = [], runtimeOptions = {}} = {}) { + async run({files: selectedFiles = [], filter = [], runtimeOptions = {}} = {}) { // eslint-disable-line complexity let setupOrGlobError; const apiOptions = this.options; @@ -70,11 +105,11 @@ class Api extends Emittery { let bailed = false; const pendingWorkers = new Set(); const timedOutWorkerFiles = new Set(); - let restartTimer; + let timeoutTrigger; if (apiOptions.timeout && !apiOptions.debug) { const timeout = ms(apiOptions.timeout); - restartTimer = debounce(() => { + timeoutTrigger = new TimeoutTrigger(() => { // If failFast is active, prevent new test files from running after // the current ones are exited. if (failFast) { @@ -89,7 +124,7 @@ class Api extends Emittery { } }, timeout); } else { - restartTimer = Object.assign(() => {}, {cancel() {}}); + timeoutTrigger = new TimeoutTrigger(() => {}); } this._interruptHandler = () => { @@ -102,7 +137,7 @@ class Api extends Emittery { bailed = true; // Make sure we don't run the timeout handler - restartTimer.cancel(); + timeoutTrigger.discard(); runStatus.emitStateChange({type: 'interrupt'}); @@ -111,6 +146,8 @@ class Api extends Emittery { } }; + const {providers = []} = this.options; + let testFiles; try { testFiles = await globs.findTests({cwd: this.options.projectDir, ...apiOptions.globs}); @@ -118,7 +155,8 @@ class Api extends Emittery { selectedFiles = filter.length === 0 ? testFiles : globs.applyTestFileFilter({ cwd: this.options.projectDir, filter: filter.map(({pattern}) => pattern), - testFiles + providers, + testFiles, }); } } catch (error) { @@ -126,6 +164,13 @@ class Api extends Emittery { setupOrGlobError = error; } + const selectionInsights = { + filter, + ignoredFilterPatternFiles: selectedFiles.ignoredFilterPatternFiles || [], + testFileCount: testFiles.length, + selectionCount: selectedFiles.length, + }; + try { if (this.options.parallelRuns) { const {currentIndex, totalRuns} = this.options.parallelRuns; @@ -137,11 +182,13 @@ class Api extends Emittery { const currentFileCount = selectedFiles.length; - runStatus = new RunStatus(fileCount, {currentFileCount, currentIndex, totalRuns}); + runStatus = new RunStatus(fileCount, {currentFileCount, currentIndex, totalRuns}, selectionInsights); } else { - runStatus = new RunStatus(selectedFiles.length, null); + runStatus = new RunStatus(selectedFiles.length, null, selectionInsights); } + selectedFiles = scheduler.failingTestsFirst(selectedFiles, this._getLocalCacheDir(), this.options.cacheEnabled); + const debugWithoutSpecificFile = Boolean(this.options.debug) && !this.options.debug.active && selectedFiles.length !== 1; await this.emit('run', { @@ -155,7 +202,7 @@ class Api extends Emittery { previousFailures: runtimeOptions.previousFailures || 0, runOnlyExclusive: runtimeOptions.runOnlyExclusive === true, runVector: runtimeOptions.runVector || 0, - status: runStatus + status: runStatus, }); if (setupOrGlobError) { @@ -169,9 +216,9 @@ class Api extends Emittery { runStatus.on('stateChange', record => { if (record.testFile && !timedOutWorkerFiles.has(record.testFile)) { - // Restart the timer whenever there is activity from workers that + // Debounce the timer whenever there is activity from workers that // haven't already timed out. - restartTimer(); + timeoutTrigger.debounce(); } if (failFast && (record.type === 'hook-failed' || record.type === 'test-failed' || record.type === 'worker-failed')) { @@ -185,14 +232,16 @@ class Api extends Emittery { } }); - const {providers = []} = this.options; - const providerStates = (await Promise.all(providers.map(async ({type, main}) => { + const providerStates = []; + await Promise.all(providers.map(async ({type, main}) => { const state = await main.compile({cacheDir: this._createCacheDir(), files: testFiles}); - return state === null ? null : {type, state}; - }))).filter(state => state !== null); + if (state !== null) { + providerStates.push({type, state}); + } + })); // Resolve the correct concurrency value. - let concurrency = Math.min(os.cpus().length, isCi ? 2 : Infinity); + let concurrency = Math.min(os.cpus().length, isCi ? 2 : Number.POSITIVE_INFINITY); if (apiOptions.concurrency > 0) { concurrency = apiOptions.concurrency; } @@ -212,13 +261,15 @@ class Api extends Emittery { } const lineNumbers = getApplicableLineNumbers(globs.normalizeFileForMatching(apiOptions.projectDir, file), filter); + // Removing `providers` field because they cannot be transfered to the worker threads. + const {providers, ...forkOptions} = apiOptions; const options = { - ...apiOptions, + ...forkOptions, providerStates, lineNumbers, recordNewSnapshots: !isCi, // If we're looking for matches, run every single test process in exclusive-only mode - runOnlyExclusive: apiOptions.match.length > 0 || runtimeOptions.runOnlyExclusive === true + runOnlyExclusive: apiOptions.match.length > 0 || runtimeOptions.runOnlyExclusive === true, }; if (runtimeOptions.updateSnapshots) { @@ -227,42 +278,52 @@ class Api extends Emittery { } const worker = fork(file, options, apiOptions.nodeArguments); + worker.onStateChange(data => { + if (data.type === 'test-timeout-configured' && !apiOptions.debug) { + timeoutTrigger.ignoreFor(data.period); + } + }); runStatus.observeWorker(worker, file, {selectingLines: lineNumbers.length > 0}); - deregisteredSharedWorkers.push(sharedWorkers.observeWorkerProcess(worker, runStatus)); + deregisteredSharedWorkers.push(observeWorkerProcess(worker, runStatus)); pendingWorkers.add(worker); worker.promise.then(() => { pendingWorkers.delete(worker); }); - restartTimer(); + timeoutTrigger.debounce(); await worker.promise; }, {concurrency, stopOnError: false}); // Allow shared workers to clean up before the run ends. await Promise.all(deregisteredSharedWorkers); + scheduler.storeFailedTestFiles(runStatus, this.options.cacheEnabled === false ? null : this._createCacheDir()); } catch (error) { if (error && error.name === 'AggregateError') { - for (const err of error) { - runStatus.emitStateChange({type: 'internal-error', err: serializeError('Internal error', false, err)}); + for (const error_ of error.errors) { + runStatus.emitStateChange({type: 'internal-error', err: serializeError('Internal error', false, error_)}); } } else { runStatus.emitStateChange({type: 'internal-error', err: serializeError('Internal error', false, error)}); } } - restartTimer.cancel(); + timeoutTrigger.discard(); return runStatus; } + _getLocalCacheDir() { + return path.join(this.options.projectDir, 'node_modules', '.cache', 'ava'); + } + _createCacheDir() { if (this._cacheDir) { return this._cacheDir; } - const cacheDir = this.options.cacheEnabled === false ? - fs.mkdtempSync(`${tempDir}${path.sep}`) : - path.join(this.options.projectDir, 'node_modules', '.cache', 'ava'); + const cacheDir = this.options.cacheEnabled === false + ? fs.mkdtempSync(`${tempDir}${path.sep}`) + : this._getLocalCacheDir(); // Ensure cacheDir exists fs.mkdirSync(cacheDir, {recursive: true}); @@ -272,5 +333,3 @@ class Api extends Emittery { return cacheDir; } } - -module.exports = Api; diff --git a/node_modules/ava/lib/assert.js b/node_modules/ava/lib/assert.js index 8201ea9fbb..70d24d1bff 100644 --- a/node_modules/ava/lib/assert.js +++ b/node_modules/ava/lib/assert.js @@ -1,23 +1,23 @@ -'use strict'; -const concordance = require('concordance'); -const isError = require('is-error'); -const isPromise = require('is-promise'); -const concordanceOptions = require('./concordance-options').default; -const {CIRCULAR_SELECTOR, isLikeSelector, selectComparable} = require('./like-selector'); -const snapshotManager = require('./snapshot-manager'); +import concordance from 'concordance'; +import isError from 'is-error'; +import isPromise from 'is-promise'; + +import concordanceOptions from './concordance-options.js'; +import {CIRCULAR_SELECTOR, isLikeSelector, selectComparable} from './like-selector.js'; +import {SnapshotError, VersionMismatchError} from './snapshot-manager.js'; function formatDescriptorDiff(actualDescriptor, expectedDescriptor, options) { options = {...options, ...concordanceOptions}; return { label: 'Difference:', - formatted: concordance.diffDescriptors(actualDescriptor, expectedDescriptor, options) + formatted: concordance.diffDescriptors(actualDescriptor, expectedDescriptor, options), }; } function formatDescriptorWithLabel(label, descriptor) { return { label, - formatted: concordance.formatDescriptor(descriptor, concordanceOptions) + formatted: concordance.formatDescriptor(descriptor, concordanceOptions), }; } @@ -25,17 +25,13 @@ function formatWithLabel(label, value) { return formatDescriptorWithLabel(label, concordance.describe(value, concordanceOptions)); } -function formatPowerAssertValue(value) { - return concordance.format(value, concordanceOptions); -} - const hasOwnProperty = (object, prop) => Object.prototype.hasOwnProperty.call(object, prop); const noop = () => {}; const notImplemented = () => { throw new Error('not implemented'); }; -class AssertionError extends Error { +export class AssertionError extends Error { constructor(options) { super(options.message || ''); this.name = 'AssertionError'; @@ -52,19 +48,11 @@ class AssertionError extends Error { // use the values for custom diff views this.raw = options.raw; - // Reserved for power-assert statements - this.statements = []; - - if (options.savedError) { - this.savedError = options.savedError; - } else { - this.savedError = getErrorWithLongStackTrace(); - } + this.savedError = options.savedError ? options.savedError : getErrorWithLongStackTrace(); } } -exports.AssertionError = AssertionError; -function checkAssertionMessage(assertion, message) { +export function checkAssertionMessage(assertion, message) { if (typeof message === 'undefined' || typeof message === 'string') { return true; } @@ -73,50 +61,48 @@ function checkAssertionMessage(assertion, message) { assertion, improperUsage: true, message: 'The assertion message must be a string', - values: [formatWithLabel('Called with:', message)] + values: [formatWithLabel('Called with:', message)], }); } -exports.checkAssertionMessage = checkAssertionMessage; - function getErrorWithLongStackTrace() { const limitBefore = Error.stackTraceLimit; - Error.stackTraceLimit = Infinity; - const err = new Error(); + Error.stackTraceLimit = Number.POSITIVE_INFINITY; + const error = new Error(); // eslint-disable-line unicorn/error-message Error.stackTraceLimit = limitBefore; - return err; + return error; } -function validateExpectations(assertion, expectations, numberArgs, experiments) { // eslint-disable-line complexity +function validateExpectations(assertion, expectations, numberArgs) { // eslint-disable-line complexity if (numberArgs === 1 || expectations === null || expectations === undefined) { - if (experiments.disableNullExpectations && expectations === null) { + if (expectations === null) { throw new AssertionError({ assertion, message: `The second argument to \`t.${assertion}()\` must be an expectation object or \`undefined\``, - values: [formatWithLabel('Called with:', expectations)] + values: [formatWithLabel('Called with:', expectations)], }); } expectations = {}; } else if ( - typeof expectations === 'function' || - typeof expectations === 'string' || - expectations instanceof RegExp || - typeof expectations !== 'object' || - Array.isArray(expectations) || - Object.keys(expectations).length === 0 + typeof expectations === 'function' + || typeof expectations === 'string' + || expectations instanceof RegExp + || typeof expectations !== 'object' + || Array.isArray(expectations) + || Object.keys(expectations).length === 0 ) { throw new AssertionError({ assertion, message: `The second argument to \`t.${assertion}()\` must be an expectation object, \`null\` or \`undefined\``, - values: [formatWithLabel('Called with:', expectations)] + values: [formatWithLabel('Called with:', expectations)], }); } else { if (hasOwnProperty(expectations, 'instanceOf') && typeof expectations.instanceOf !== 'function') { throw new AssertionError({ assertion, message: `The \`instanceOf\` property of the second argument to \`t.${assertion}()\` must be a function`, - values: [formatWithLabel('Called with:', expectations)] + values: [formatWithLabel('Called with:', expectations)], }); } @@ -124,7 +110,7 @@ function validateExpectations(assertion, expectations, numberArgs, experiments) throw new AssertionError({ assertion, message: `The \`message\` property of the second argument to \`t.${assertion}()\` must be a string or regular expression`, - values: [formatWithLabel('Called with:', expectations)] + values: [formatWithLabel('Called with:', expectations)], }); } @@ -132,7 +118,7 @@ function validateExpectations(assertion, expectations, numberArgs, experiments) throw new AssertionError({ assertion, message: `The \`name\` property of the second argument to \`t.${assertion}()\` must be a string`, - values: [formatWithLabel('Called with:', expectations)] + values: [formatWithLabel('Called with:', expectations)], }); } @@ -140,7 +126,7 @@ function validateExpectations(assertion, expectations, numberArgs, experiments) throw new AssertionError({ assertion, message: `The \`code\` property of the second argument to \`t.${assertion}()\` must be a string or number`, - values: [formatWithLabel('Called with:', expectations)] + values: [formatWithLabel('Called with:', expectations)], }); } @@ -156,7 +142,7 @@ function validateExpectations(assertion, expectations, numberArgs, experiments) throw new AssertionError({ assertion, message: `The second argument to \`t.${assertion}()\` contains unexpected properties`, - values: [formatWithLabel('Called with:', expectations)] + values: [formatWithLabel('Called with:', expectations)], }); } } @@ -173,7 +159,7 @@ function assertExpectations({assertion, actual, expectations, message, prefix, s assertion, message, savedError, - values: [formatWithLabel(`${prefix} exception that is not an error:`, actual)] + values: [formatWithLabel(`${prefix} exception that is not an error:`, actual)], }); } @@ -187,8 +173,8 @@ function assertExpectations({assertion, actual, expectations, message, prefix, s actualStack, values: [ formatWithLabel(`${prefix} unexpected exception:`, actual), - formatWithLabel('Expected to be strictly equal to:', expectations.is) - ] + formatWithLabel('Expected to be strictly equal to:', expectations.is), + ], }); } @@ -200,8 +186,8 @@ function assertExpectations({assertion, actual, expectations, message, prefix, s actualStack, values: [ formatWithLabel(`${prefix} unexpected exception:`, actual), - formatWithLabel('Expected instance of:', expectations.instanceOf) - ] + formatWithLabel('Expected instance of:', expectations.instanceOf), + ], }); } @@ -213,8 +199,8 @@ function assertExpectations({assertion, actual, expectations, message, prefix, s actualStack, values: [ formatWithLabel(`${prefix} unexpected exception:`, actual), - formatWithLabel('Expected name to equal:', expectations.name) - ] + formatWithLabel('Expected name to equal:', expectations.name), + ], }); } @@ -226,8 +212,8 @@ function assertExpectations({assertion, actual, expectations, message, prefix, s actualStack, values: [ formatWithLabel(`${prefix} unexpected exception:`, actual), - formatWithLabel('Expected message to equal:', expectations.message) - ] + formatWithLabel('Expected message to equal:', expectations.message), + ], }); } @@ -239,8 +225,8 @@ function assertExpectations({assertion, actual, expectations, message, prefix, s actualStack, values: [ formatWithLabel(`${prefix} unexpected exception:`, actual), - formatWithLabel('Expected message to match:', expectations.message) - ] + formatWithLabel('Expected message to match:', expectations.message), + ], }); } @@ -252,53 +238,31 @@ function assertExpectations({assertion, actual, expectations, message, prefix, s actualStack, values: [ formatWithLabel(`${prefix} unexpected exception:`, actual), - formatWithLabel('Expected code to equal:', expectations.code) - ] + formatWithLabel('Expected code to equal:', expectations.code), + ], }); } } -class Assertions { +export class Assertions { constructor({ pass = notImplemented, pending = notImplemented, fail = notImplemented, skip = notImplemented, compareWithSnapshot = notImplemented, - powerAssert, experiments = {}, - disableSnapshots = false + disableSnapshots = false, } = {}) { const withSkip = assertionFn => { assertionFn.skip = skip; return assertionFn; }; - // When adding new enhanced functions with new patterns, don't forget to - // enable the pattern in the power-assert compilation step in @ava/babel. - const withPowerAssert = (pattern, assertionFn) => powerAssert.empower(assertionFn, { - onError: event => { - if (event.powerAssertContext) { - event.error.statements = powerAssert.format(event.powerAssertContext, formatPowerAssertValue); - } - - fail(event.error); - }, - onSuccess: () => { - pass(); - }, - bindReceiver: false, - patterns: [pattern] - }); - - const checkMessage = (assertion, message, powerAssert = false) => { + const checkMessage = (assertion, message) => { const result = checkAssertionMessage(assertion, message); if (result === true) { - return this.true; - } - - if (powerAssert) { - throw result; + return true; } fail(result); @@ -307,52 +271,58 @@ class Assertions { this.pass = withSkip(() => { pass(); + return true; }); this.fail = withSkip(message => { if (!checkMessage('fail', message)) { - return; + return false; } fail(new AssertionError({ assertion: 'fail', - message: message || 'Test failed via `t.fail()`' + message: message || 'Test failed via `t.fail()`', })); + + return false; }); this.is = withSkip((actual, expected, message) => { if (!checkMessage('is', message)) { - return; + return false; } if (Object.is(actual, expected)) { pass(); - } else { - const result = concordance.compare(actual, expected, concordanceOptions); - const actualDescriptor = result.actual || concordance.describe(actual, concordanceOptions); - const expectedDescriptor = result.expected || concordance.describe(expected, concordanceOptions); + return true; + } - if (result.pass) { - fail(new AssertionError({ - assertion: 'is', - message, - raw: {actual, expected}, - values: [formatDescriptorWithLabel('Values are deeply equal to each other, but they are not the same:', actualDescriptor)] - })); - } else { - fail(new AssertionError({ - assertion: 'is', - message, - raw: {actual, expected}, - values: [formatDescriptorDiff(actualDescriptor, expectedDescriptor)] - })); - } + const result = concordance.compare(actual, expected, concordanceOptions); + const actualDescriptor = result.actual || concordance.describe(actual, concordanceOptions); + const expectedDescriptor = result.expected || concordance.describe(expected, concordanceOptions); + + if (result.pass) { + fail(new AssertionError({ + assertion: 'is', + message, + raw: {actual, expected}, + values: [formatDescriptorWithLabel('Values are deeply equal to each other, but they are not the same:', actualDescriptor)], + })); + } else { + fail(new AssertionError({ + assertion: 'is', + message, + raw: {actual, expected}, + values: [formatDescriptorDiff(actualDescriptor, expectedDescriptor)], + })); } + + return false; }); this.not = withSkip((actual, expected, message) => { if (!checkMessage('not', message)) { - return; + return false; } if (Object.is(actual, expected)) { @@ -360,36 +330,40 @@ class Assertions { assertion: 'not', message, raw: {actual, expected}, - values: [formatWithLabel('Value is the same as:', actual)] + values: [formatWithLabel('Value is the same as:', actual)], })); - } else { - pass(); + return false; } + + pass(); + return true; }); this.deepEqual = withSkip((actual, expected, message) => { if (!checkMessage('deepEqual', message)) { - return; + return false; } const result = concordance.compare(actual, expected, concordanceOptions); if (result.pass) { pass(); - } else { - const actualDescriptor = result.actual || concordance.describe(actual, concordanceOptions); - const expectedDescriptor = result.expected || concordance.describe(expected, concordanceOptions); - fail(new AssertionError({ - assertion: 'deepEqual', - message, - raw: {actual, expected}, - values: [formatDescriptorDiff(actualDescriptor, expectedDescriptor)] - })); + return true; } + + const actualDescriptor = result.actual || concordance.describe(actual, concordanceOptions); + const expectedDescriptor = result.expected || concordance.describe(expected, concordanceOptions); + fail(new AssertionError({ + assertion: 'deepEqual', + message, + raw: {actual, expected}, + values: [formatDescriptorDiff(actualDescriptor, expectedDescriptor)], + })); + return false; }); this.notDeepEqual = withSkip((actual, expected, message) => { if (!checkMessage('notDeepEqual', message)) { - return; + return false; } const result = concordance.compare(actual, expected, concordanceOptions); @@ -399,16 +373,18 @@ class Assertions { assertion: 'notDeepEqual', message, raw: {actual, expected}, - values: [formatDescriptorWithLabel('Value is deeply equal:', actualDescriptor)] + values: [formatDescriptorWithLabel('Value is deeply equal:', actualDescriptor)], })); - } else { - pass(); + return false; } + + pass(); + return true; }); this.like = withSkip((actual, selector, message) => { if (!checkMessage('like', message)) { - return; + return false; } if (!isLikeSelector(selector)) { @@ -416,9 +392,9 @@ class Assertions { assertion: 'like', improperUsage: true, message: '`t.like()` selector must be a non-empty object', - values: [formatWithLabel('Called with:', selector)] + values: [formatWithLabel('Called with:', selector)], })); - return; + return false; } let comparable; @@ -430,9 +406,9 @@ class Assertions { assertion: 'like', improperUsage: true, message: '`t.like()` selector must not contain circular references', - values: [formatWithLabel('Called with:', selector)] + values: [formatWithLabel('Called with:', selector)], })); - return; + return false; } throw error; @@ -441,15 +417,18 @@ class Assertions { const result = concordance.compare(comparable, selector, concordanceOptions); if (result.pass) { pass(); - } else { - const actualDescriptor = result.actual || concordance.describe(comparable, concordanceOptions); - const expectedDescriptor = result.expected || concordance.describe(selector, concordanceOptions); - fail(new AssertionError({ - assertion: 'like', - message, - values: [formatDescriptorDiff(actualDescriptor, expectedDescriptor)] - })); + return true; } + + const actualDescriptor = result.actual || concordance.describe(comparable, concordanceOptions); + const expectedDescriptor = result.expected || concordance.describe(selector, concordanceOptions); + fail(new AssertionError({ + assertion: 'like', + message, + values: [formatDescriptorDiff(actualDescriptor, expectedDescriptor)], + })); + + return false; }); this.throws = withSkip((...args) => { @@ -467,7 +446,7 @@ class Assertions { assertion: 'throws', improperUsage: true, message: '`t.throws()` must be called with a function', - values: [formatWithLabel('Called with:', fn)] + values: [formatWithLabel('Called with:', fn)], })); return; } @@ -489,7 +468,7 @@ class Assertions { fail(new AssertionError({ assertion: 'throws', message, - values: [formatWithLabel('Function returned a promise. Use `t.throwsAsync()` instead:', retval)] + values: [formatWithLabel('Function returned a promise. Use `t.throwsAsync()` instead:', retval)], })); return; } @@ -501,7 +480,7 @@ class Assertions { fail(new AssertionError({ assertion: 'throws', message, - values: [formatWithLabel('Function returned:', retval)] + values: [formatWithLabel('Function returned:', retval)], })); return; } @@ -512,7 +491,7 @@ class Assertions { actual, expectations, message, - prefix: 'Function threw' + prefix: 'Function threw', }); pass(); return actual; @@ -521,11 +500,11 @@ class Assertions { } }); - this.throwsAsync = withSkip((...args) => { + this.throwsAsync = withSkip(async (...args) => { let [thrower, expectations, message] = args; if (!checkMessage('throwsAsync', message)) { - return Promise.resolve(); + return; } if (typeof thrower !== 'function' && !isPromise(thrower)) { @@ -533,28 +512,28 @@ class Assertions { assertion: 'throwsAsync', improperUsage: true, message: '`t.throwsAsync()` must be called with a function or promise', - values: [formatWithLabel('Called with:', thrower)] + values: [formatWithLabel('Called with:', thrower)], })); - return Promise.resolve(); + return; } try { expectations = validateExpectations('throwsAsync', expectations, args.length, experiments); } catch (error) { fail(error); - return Promise.resolve(); + return; } - const handlePromise = (promise, wasReturned) => { + const handlePromise = async (promise, wasReturned) => { // Create an error object to record the stack before it gets lost in the promise chain. const savedError = getErrorWithLongStackTrace(); // Handle "promise like" objects by casting to a real Promise. - const intermediate = Promise.resolve(promise).then(value => { // eslint-disable-line promise/prefer-await-to-then + const intermediate = Promise.resolve(promise).then(value => { throw new AssertionError({ assertion: 'throwsAsync', message, savedError, - values: [formatWithLabel(`${wasReturned ? 'Returned promise' : 'Promise'} resolved with:`, value)] + values: [formatWithLabel(`${wasReturned ? 'Returned promise' : 'Promise'} resolved with:`, value)], }); }, error => { assertExpectations({ @@ -563,14 +542,17 @@ class Assertions { expectations, message, prefix: `${wasReturned ? 'Returned promise' : 'Promise'} rejected with`, - savedError + savedError, }); return error; }); pending(intermediate); - // Don't reject the returned promise, even if the assertion fails. - return intermediate.catch(noop); + try { + return await intermediate; + } catch { + // Don't reject the returned promise, even if the assertion fails. + } }; if (isPromise(thrower)) { @@ -590,9 +572,9 @@ class Assertions { assertion: 'throwsAsync', message, actualStack: actual.stack, - values: [formatWithLabel('Function threw synchronously. Use `t.throws()` instead:', actual)] + values: [formatWithLabel('Function threw synchronously. Use `t.throws()` instead:', actual)], })); - return Promise.resolve(); + return; } if (isPromise(retval)) { @@ -602,9 +584,8 @@ class Assertions { fail(new AssertionError({ assertion: 'throwsAsync', message, - values: [formatWithLabel('Function returned:', retval)] + values: [formatWithLabel('Function returned:', retval)], })); - return Promise.resolve(); }); this.notThrows = withSkip((fn, message) => { @@ -617,7 +598,7 @@ class Assertions { assertion: 'notThrows', improperUsage: true, message: '`t.notThrows()` must be called with a function', - values: [formatWithLabel('Called with:', fn)] + values: [formatWithLabel('Called with:', fn)], })); return; } @@ -629,7 +610,7 @@ class Assertions { assertion: 'notThrows', message, actualStack: error.stack, - values: [formatWithLabel('Function threw:', error)] + values: [formatWithLabel('Function threw:', error)], })); return; } @@ -647,26 +628,30 @@ class Assertions { assertion: 'notThrowsAsync', improperUsage: true, message: '`t.notThrowsAsync()` must be called with a function or promise', - values: [formatWithLabel('Called with:', nonThrower)] + values: [formatWithLabel('Called with:', nonThrower)], })); return Promise.resolve(); } - const handlePromise = (promise, wasReturned) => { + const handlePromise = async (promise, wasReturned) => { // Create an error object to record the stack before it gets lost in the promise chain. const savedError = getErrorWithLongStackTrace(); // Handle "promise like" objects by casting to a real Promise. - const intermediate = Promise.resolve(promise).then(noop, error => { // eslint-disable-line promise/prefer-await-to-then + const intermediate = Promise.resolve(promise).then(noop, error => { throw new AssertionError({ assertion: 'notThrowsAsync', message, savedError, - values: [formatWithLabel(`${wasReturned ? 'Returned promise' : 'Promise'} rejected with:`, error)] + values: [formatWithLabel(`${wasReturned ? 'Returned promise' : 'Promise'} rejected with:`, error)], }); }); pending(intermediate); - // Don't reject the returned promise, even if the assertion fails. - return intermediate.catch(noop); + + try { + return await intermediate; + } catch { + // Don't reject the returned promise, even if the assertion fails. + } }; if (isPromise(nonThrower)) { @@ -681,7 +666,7 @@ class Assertions { assertion: 'notThrowsAsync', message, actualStack: error.stack, - values: [formatWithLabel('Function threw:', error)] + values: [formatWithLabel('Function threw:', error)], })); return Promise.resolve(); } @@ -690,7 +675,7 @@ class Assertions { fail(new AssertionError({ assertion: 'notThrowsAsync', message, - values: [formatWithLabel('Function did not return a promise. Use `t.notThrows()` instead:', retval)] + values: [formatWithLabel('Function did not return a promise. Use `t.notThrows()` instead:', retval)], })); return Promise.resolve(); } @@ -698,47 +683,50 @@ class Assertions { return handlePromise(retval, true); }); - this.snapshot = withSkip((expected, ...rest) => { - if (disableSnapshots && experiments.disableSnapshotsInHooks) { + this.snapshot = withSkip((expected, message) => { + if (disableSnapshots) { fail(new AssertionError({ assertion: 'snapshot', message: '`t.snapshot()` can only be used in tests', - improperUsage: true + improperUsage: true, })); - return; + return false; } - let message; - let snapshotOptions; - if (rest.length > 1) { - [snapshotOptions, message] = rest; - } else { - const [optionsOrMessage] = rest; - if (typeof optionsOrMessage === 'object') { - snapshotOptions = optionsOrMessage; - } else { - message = optionsOrMessage; - } + if (message && message.id !== undefined) { + fail(new AssertionError({ + assertion: 'snapshot', + message: 'AVA 4 no longer supports snapshot IDs', + improperUsage: true, + values: [formatWithLabel('Called with id:', message.id)], + })); + return false; } if (!checkMessage('snapshot', message)) { - return; + return false; + } + + if (message === '') { + fail(new AssertionError({ + assertion: 'snapshot', + improperUsage: true, + message: 'The snapshot assertion message must be a non-empty string', + values: [formatWithLabel('Called with:', message)], + })); + return false; } let result; try { - result = compareWithSnapshot({ - expected, - id: snapshotOptions ? snapshotOptions.id : undefined, - message - }); + result = compareWithSnapshot({expected, message}); } catch (error) { - if (!(error instanceof snapshotManager.SnapshotError)) { + if (!(error instanceof SnapshotError)) { throw error; } const improperUsage = {name: error.name, snapPath: error.snapPath}; - if (error instanceof snapshotManager.VersionMismatchError) { + if (error instanceof VersionMismatchError) { improperUsage.snapVersion = error.snapVersion; improperUsage.expectedVersion = error.expectedVersion; } @@ -746,48 +734,55 @@ class Assertions { fail(new AssertionError({ assertion: 'snapshot', message: message || 'Could not compare snapshot', - improperUsage + improperUsage, })); - return; + return false; } if (result.pass) { pass(); - } else if (result.actual) { + return true; + } + + if (result.actual) { fail(new AssertionError({ assertion: 'snapshot', message: message || 'Did not match snapshot', - values: [formatDescriptorDiff(result.actual, result.expected, {invert: true})] + values: [formatDescriptorDiff(result.actual, result.expected, {invert: true})], })); } else { // This can only occur in CI environments. fail(new AssertionError({ assertion: 'snapshot', - message: message || 'No snapshot available — new snapshots are not created in CI environments' + message: message || 'No snapshot available — new snapshots are not created in CI environments', })); } + + return false; }); this.truthy = withSkip((actual, message) => { if (!checkMessage('truthy', message)) { - return; + return false; } if (actual) { pass(); - } else { - fail(new AssertionError({ - assertion: 'truthy', - message, - operator: '!!', - values: [formatWithLabel('Value is not truthy:', actual)] - })); + return true; } + + fail(new AssertionError({ + assertion: 'truthy', + message, + operator: '!!', + values: [formatWithLabel('Value is not truthy:', actual)], + })); + return false; }); this.falsy = withSkip((actual, message) => { if (!checkMessage('falsy', message)) { - return; + return false; } if (actual) { @@ -795,48 +790,54 @@ class Assertions { assertion: 'falsy', message, operator: '!', - values: [formatWithLabel('Value is not falsy:', actual)] + values: [formatWithLabel('Value is not falsy:', actual)], })); - } else { - pass(); + return false; } + + pass(); + return true; }); this.true = withSkip((actual, message) => { if (!checkMessage('true', message)) { - return; + return false; } if (actual === true) { pass(); - } else { - fail(new AssertionError({ - assertion: 'true', - message, - values: [formatWithLabel('Value is not `true`:', actual)] - })); + return true; } + + fail(new AssertionError({ + assertion: 'true', + message, + values: [formatWithLabel('Value is not `true`:', actual)], + })); + return false; }); this.false = withSkip((actual, message) => { if (!checkMessage('false', message)) { - return; + return false; } if (actual === false) { pass(); - } else { - fail(new AssertionError({ - assertion: 'false', - message, - values: [formatWithLabel('Value is not `false`:', actual)] - })); + return true; } + + fail(new AssertionError({ + assertion: 'false', + message, + values: [formatWithLabel('Value is not `false`:', actual)], + })); + return false; }); this.regex = withSkip((string, regex, message) => { if (!checkMessage('regex', message)) { - return; + return false; } if (typeof string !== 'string') { @@ -844,9 +845,9 @@ class Assertions { assertion: 'regex', improperUsage: true, message: '`t.regex()` must be called with a string', - values: [formatWithLabel('Called with:', string)] + values: [formatWithLabel('Called with:', string)], })); - return; + return false; } if (!(regex instanceof RegExp)) { @@ -854,9 +855,9 @@ class Assertions { assertion: 'regex', improperUsage: true, message: '`t.regex()` must be called with a regular expression', - values: [formatWithLabel('Called with:', regex)] + values: [formatWithLabel('Called with:', regex)], })); - return; + return false; } if (!regex.test(string)) { @@ -865,18 +866,19 @@ class Assertions { message, values: [ formatWithLabel('Value must match expression:', string), - formatWithLabel('Regular expression:', regex) - ] + formatWithLabel('Regular expression:', regex), + ], })); - return; + return false; } pass(); + return true; }); this.notRegex = withSkip((string, regex, message) => { if (!checkMessage('notRegex', message)) { - return; + return false; } if (typeof string !== 'string') { @@ -884,9 +886,9 @@ class Assertions { assertion: 'notRegex', improperUsage: true, message: '`t.notRegex()` must be called with a string', - values: [formatWithLabel('Called with:', string)] + values: [formatWithLabel('Called with:', string)], })); - return; + return false; } if (!(regex instanceof RegExp)) { @@ -894,9 +896,9 @@ class Assertions { assertion: 'notRegex', improperUsage: true, message: '`t.notRegex()` must be called with a regular expression', - values: [formatWithLabel('Called with:', regex)] + values: [formatWithLabel('Called with:', regex)], })); - return; + return false; } if (regex.test(string)) { @@ -905,50 +907,33 @@ class Assertions { message, values: [ formatWithLabel('Value must not match expression:', string), - formatWithLabel('Regular expression:', regex) - ] + formatWithLabel('Regular expression:', regex), + ], })); - return; + return false; } pass(); + return true; }); - if (powerAssert === undefined) { - this.assert = withSkip((actual, message) => { - if (!checkMessage('assert', message)) { - return; - } + this.assert = withSkip((actual, message) => { + if (!checkMessage('assert', message)) { + return false; + } - if (!actual) { - fail(new AssertionError({ - assertion: 'assert', - message, - operator: '!!', - values: [formatWithLabel('Value is not truthy:', actual)] - })); - return; - } + if (!actual) { + fail(new AssertionError({ + assertion: 'assert', + message, + operator: '!!', + values: [formatWithLabel('Value is not truthy:', actual)], + })); + return false; + } - pass(); - }); - } else { - this.assert = withSkip(withPowerAssert( - 'assert(value, [message])', - (actual, message) => { - checkMessage('assert', message, true); - - if (!actual) { - throw new AssertionError({ - assertion: 'assert', - message, - operator: '!!', - values: [formatWithLabel('Value is not truthy:', actual)] - }); - } - }) - ); - } + pass(); + return true; + }); } } -exports.Assertions = Assertions; diff --git a/node_modules/ava/lib/chalk.js b/node_modules/ava/lib/chalk.js index 36a2956ca7..eca6d4267c 100644 --- a/node_modules/ava/lib/chalk.js +++ b/node_modules/ava/lib/chalk.js @@ -1,20 +1,15 @@ -'use strict'; -const chalk = require('chalk'); +import {Chalk} from 'chalk'; // eslint-disable-line unicorn/import-style -let ctx = null; -exports.get = () => { - if (!ctx) { - throw new Error('Chalk has not yet been configured'); - } +let chalk = new Chalk(); // eslint-disable-line import/no-mutable-exports - return ctx; -}; +export {chalk}; -exports.set = options => { - if (ctx) { +let configured = false; +export function set(options) { + if (configured) { throw new Error('Chalk has already been configured'); } - ctx = new chalk.Instance(options); - return ctx; -}; + configured = true; + chalk = new Chalk(options); +} diff --git a/node_modules/ava/lib/cli.js b/node_modules/ava/lib/cli.js index e591a6643c..3f9974732f 100644 --- a/node_modules/ava/lib/cli.js +++ b/node_modules/ava/lib/cli.js @@ -1,89 +1,112 @@ -'use strict'; -const path = require('path'); -const del = require('del'); -const updateNotifier = require('update-notifier'); -const figures = require('figures'); -const arrify = require('arrify'); -const yargs = require('yargs'); -const readPkg = require('read-pkg'); -const isCi = require('./is-ci'); -const {loadConfig} = require('./load-config'); + +import fs from 'node:fs'; +import path from 'node:path'; +import process from 'node:process'; + +import arrify from 'arrify'; +import ciParallelVars from 'ci-parallel-vars'; +import del from 'del'; +import figures from 'figures'; +import yargs from 'yargs'; +import {hideBin} from 'yargs/helpers'; // eslint-disable-line node/file-extension-in-import + +import Api from './api.js'; +import {chalk} from './chalk.js'; +import validateEnvironmentVariables from './environment-variables.js'; +import normalizeExtensions from './extensions.js'; +import {normalizeGlobs, normalizePattern} from './globs.js'; +import {controlFlow} from './ipc-flow-control.cjs'; +import isCi from './is-ci.js'; +import {splitPatternAndLineNumbers} from './line-numbers.js'; +import {loadConfig} from './load-config.js'; +import normalizeModuleTypes from './module-types.js'; +import normalizeNodeArguments from './node-arguments.js'; +import providerManager from './provider-manager.js'; +import DefaultReporter from './reporters/default.js'; +import TapReporter from './reporters/tap.js'; +import Watcher from './watcher.js'; function exit(message) { - console.error(`\n ${require('./chalk').get().red(figures.cross)} ${message}`); + console.error(`\n ${chalk.red(figures.cross)} ${message}`); process.exit(1); // eslint-disable-line unicorn/no-process-exit } -const coerceLastValue = value => { - return Array.isArray(value) ? value.pop() : value; -}; +const coerceLastValue = value => Array.isArray(value) ? value.pop() : value; const FLAGS = { concurrency: { alias: 'c', coerce: coerceLastValue, description: 'Max number of test files running at the same time (default: CPU cores)', - type: 'number' + type: 'number', }, 'fail-fast': { coerce: coerceLastValue, description: 'Stop after first test failure', - type: 'boolean' + type: 'boolean', }, match: { alias: 'm', description: 'Only run tests with matching title (can be repeated)', - type: 'string' + type: 'string', + }, + 'no-worker-threads': { + coerce: coerceLastValue, + description: 'Don\'t use worker threads', + type: 'boolean', }, 'node-arguments': { coerce: coerceLastValue, description: 'Additional Node.js arguments for launching worker processes (specify as a single string)', - type: 'string' + type: 'string', }, serial: { alias: 's', coerce: coerceLastValue, description: 'Run tests serially', - type: 'boolean' + type: 'boolean', }, tap: { alias: 't', coerce: coerceLastValue, description: 'Generate TAP output', - type: 'boolean' + type: 'boolean', }, timeout: { alias: 'T', coerce: coerceLastValue, description: 'Set global timeout (milliseconds or human-readable, e.g. 10s, 2m)', - type: 'string' + type: 'string', }, 'update-snapshots': { alias: 'u', coerce: coerceLastValue, description: 'Update snapshots', - type: 'boolean' + type: 'boolean', }, verbose: { alias: 'v', coerce: coerceLastValue, - description: 'Enable verbose output', - type: 'boolean' + description: 'Enable verbose output (default)', + type: 'boolean', }, watch: { alias: 'w', coerce: coerceLastValue, description: 'Re-run tests when files change', - type: 'boolean' - } + type: 'boolean', + }, }; -exports.run = async () => { // eslint-disable-line complexity - let conf = {}; - let confError = null; +export default async function loadCli() { // eslint-disable-line complexity + let conf; + let confError; try { - const {argv: {config: configFile}} = yargs.help(false); + const {argv: {config: configFile}} = yargs(hideBin(process.argv)).help(false); conf = await loadConfig({configFile}); + if (conf.configFile && path.basename(conf.configFile) !== path.relative(conf.projectDir, conf.configFile)) { + console.log(chalk.magenta(` ${figures.warning} Using configuration from ${conf.configFile}`)); + } } catch (error) { confError = error; } @@ -91,18 +114,24 @@ exports.run = async () => { // eslint-disable-line complexity // Enter debug mode if the main process is being inspected. This assumes the // worker processes are automatically inspected, too. It is not necessary to // run AVA with the debug command, though it's allowed. - const activeInspector = require('inspector').url() !== undefined; // eslint-disable-line node/no-unsupported-features/node-builtins - let debug = activeInspector ? - { + let activeInspector = false; + try { + const {default: inspector} = await import('node:inspector'); // eslint-disable-line node/no-unsupported-features/es-syntax + + activeInspector = inspector.url() !== undefined; + } catch {} + + let debug = activeInspector + ? { active: true, break: false, files: [], host: undefined, - port: undefined + port: undefined, } : null; let resetCache = false; - const {argv} = yargs + const {argv} = yargs(hideBin(process.argv)) .parserConfiguration({ 'boolean-negation': true, 'camel-case-expansion': false, @@ -116,7 +145,7 @@ exports.run = async () => { // eslint-disable-line complexity 'set-placeholder-key': false, 'short-option-groups': true, 'strip-aliased': true, - 'unknown-options-as-args': false + 'unknown-options-as-args': false, }) .usage('$0 [...]') .usage('$0 debug [...]') @@ -124,16 +153,16 @@ exports.run = async () => { // eslint-disable-line complexity .options({ color: { description: 'Force color output', - type: 'boolean' + type: 'boolean', }, config: { - description: 'Specific JavaScript file for AVA to read its config from, instead of using package.json or ava.config.* files' - } + description: 'Specific JavaScript file for AVA to read its config from, instead of using package.json or ava.config.* files', + }, }) .command('* [...]', 'Run tests', yargs => yargs.options(FLAGS).positional('pattern', { array: true, - describe: 'Glob patterns to select what test files to run. Leave empty if you want AVA to run all test files instead. Add a colon and specify line numbers of specific tests to run', - type: 'string' + describe: 'Select which test files to run. Leave empty if you want AVA to run all test files as per your configuration. Accepts glob patterns, directories that (recursively) contain test files, and file paths. Add a colon and specify line numbers of specific tests to run', + type: 'string', }), argv => { if (activeInspector) { debug.files = argv.pattern || []; @@ -145,22 +174,22 @@ exports.run = async () => { // eslint-disable-line complexity yargs => yargs.options(FLAGS).options({ break: { description: 'Break before the test file is loaded', - type: 'boolean' + type: 'boolean', }, host: { default: '127.0.0.1', description: 'Address or hostname through which you can connect to the inspector', - type: 'string' + type: 'string', }, port: { default: 9229, description: 'Port on which you can connect to the inspector', - type: 'number' - } + type: 'number', + }, }).positional('pattern', { demand: true, describe: 'Glob patterns to select a single test file to debug. Add a colon and specify line numbers of specific tests to run', - type: 'string' + type: 'string', }), argv => { debug = { @@ -168,12 +197,12 @@ exports.run = async () => { // eslint-disable-line complexity break: argv.break === true, files: argv.pattern, host: argv.host, - port: argv.port + port: argv.port, }; }) .command( 'reset-cache', - 'Reset AVA’s compilation cache and exit', + 'Delete any temporary files and state kept by AVA, then exit', yargs => yargs, () => { resetCache = true; @@ -184,8 +213,14 @@ exports.run = async () => { // eslint-disable-line complexity .help(); const combined = {...conf}; + for (const flag of Object.keys(FLAGS)) { - if (Reflect.has(argv, flag)) { + if (flag === 'no-worker-threads' && Reflect.has(argv, 'worker-threads')) { + combined.workerThreads = argv['worker-threads']; + continue; + } + + if (argv[flag] !== undefined) { if (flag === 'fail-fast') { combined.failFast = argv[flag]; } else if (flag === 'update-snapshots') { @@ -196,13 +231,15 @@ exports.run = async () => { // eslint-disable-line complexity } } - const chalkOptions = {level: combined.color === false ? 0 : require('chalk').level}; - const chalk = require('./chalk').set(chalkOptions); - - if (combined.updateSnapshots && combined.match) { - exit('Snapshots cannot be updated when matching specific tests.'); + const chalkOptions = {level: 0}; + if (combined.color !== false) { + const {supportsColor: {level}} = await import('chalk'); // eslint-disable-line node/no-unsupported-features/es-syntax, unicorn/import-style + chalkOptions.level = level; } + const {set: setChalk} = await import('./chalk.js'); // eslint-disable-line node/no-unsupported-features/es-syntax + setChalk(chalkOptions); + if (confError) { if (confError.parent) { exit(`${confError.message}\n\n${chalk.gray((confError.parent && confError.parent.stack) || confError.parent)}`); @@ -211,23 +248,23 @@ exports.run = async () => { // eslint-disable-line complexity } } - updateNotifier({pkg: require('../package.json')}).notify(); - const {nonSemVerExperiments: experiments, projectDir} = conf; if (resetCache) { const cacheDir = path.join(projectDir, 'node_modules', '.cache', 'ava'); + try { - await del('*', { - cwd: cacheDir, - nodir: true - }); - console.error(`\n${chalk.green(figures.tick)} Removed AVA cache files in ${cacheDir}`); + const deletedFilePaths = await del('*', {cwd: cacheDir}); + + if (deletedFilePaths.length === 0) { + console.log(`\n${chalk.green(figures.tick)} No cache files to remove`); + } else { + console.log(`\n${chalk.green(figures.tick)} Removed AVA cache files in ${cacheDir}`); + } + process.exit(0); // eslint-disable-line unicorn/no-process-exit } catch (error) { exit(`Error removing AVA cache files in ${cacheDir}\n\n${chalk.gray((error && error.stack) || error)}`); } - - return; } if (argv.watch) { @@ -266,6 +303,10 @@ exports.run = async () => { // eslint-disable-line complexity console.log(chalk.magenta(` ${figures.warning} Experiments are enabled. These are unsupported and may change or be removed at any time.`)); } + if (Reflect.has(conf, 'babel')) { + exit('Built-in Babel support has been removed.'); + } + if (Reflect.has(conf, 'compileEnhancements')) { exit('Enhancement compilation must be configured in AVA’s Babel options.'); } @@ -278,22 +319,9 @@ exports.run = async () => { // eslint-disable-line complexity exit('’sources’ has been removed. Use ’ignoredByWatcher’ to provide glob patterns of files that the watcher should ignore.'); } - const ciParallelVars = require('ci-parallel-vars'); - const Api = require('./api'); - const DefaultReporter = require('./reporters/default'); - const TapReporter = require('./reporters/tap'); - const Watcher = require('./watcher'); - const normalizeExtensions = require('./extensions'); - const normalizeModuleTypes = require('./module-types'); - const {normalizeGlobs, normalizePattern} = require('./globs'); - const normalizeNodeArguments = require('./node-arguments'); - const validateEnvironmentVariables = require('./environment-variables'); - const {splitPatternAndLineNumbers} = require('./line-numbers'); - const providerManager = require('./provider-manager'); - let pkg; try { - pkg = readPkg.sync({cwd: projectDir}); + pkg = JSON.parse(fs.readFileSync(path.resolve(projectDir, 'package.json'))); } catch (error) { if (error.code !== 'ENOENT') { throw error; @@ -303,26 +331,13 @@ exports.run = async () => { // eslint-disable-line complexity const {type: defaultModuleType = 'commonjs'} = pkg || {}; const providers = []; - if (Reflect.has(conf, 'babel')) { - try { - const {level, main} = providerManager.babel(projectDir); - providers.push({ - level, - main: main({config: conf.babel}), - type: 'babel' - }); - } catch (error) { - exit(error.message); - } - } - if (Reflect.has(conf, 'typescript')) { try { - const {level, main} = providerManager.typescript(projectDir); + const {level, main} = await providerManager.typescript(projectDir); providers.push({ level, main: main({config: conf.typescript}), - type: 'typescript' + type: 'typescript', }); } catch (error) { exit(error.message); @@ -377,16 +392,14 @@ exports.run = async () => { // eslint-disable-line complexity .map(pattern => splitPatternAndLineNumbers(pattern)) .map(({pattern, ...rest}) => ({ pattern: normalizePattern(path.relative(projectDir, path.resolve(process.cwd(), pattern))), - ...rest + ...rest, })); - if (combined.updateSnapshots && filter.some(condition => condition.lineNumbers !== null)) { - exit('Snapshots cannot be updated when selecting specific tests by their line number.'); - } const api = new Api({ cacheEnabled: combined.cache !== false, chalkOptions, concurrency: combined.concurrency || 0, + workerThreads: combined.workerThreads !== false, debug, environmentVariables, experiments, @@ -406,38 +419,31 @@ exports.run = async () => { // eslint-disable-line complexity snapshotDir: combined.snapshotDir ? path.resolve(projectDir, combined.snapshotDir) : null, timeout: combined.timeout || '10s', updateSnapshots: combined.updateSnapshots, - workerArgv: argv['--'] + workerArgv: argv['--'], }); const reporter = combined.tap && !combined.watch && debug === null ? new TapReporter({ + extensions: globs.extensions, projectDir, reportStream: process.stdout, - stdStream: process.stderr + stdStream: process.stderr, }) : new DefaultReporter({ + extensions: globs.extensions, projectDir, reportStream: process.stdout, stdStream: process.stderr, watching: combined.watch, - verbose: debug !== null || combined.verbose || isCi || !process.stdout.isTTY }); api.on('run', plan => { reporter.startRun(plan); if (process.env.AVA_EMIT_RUN_STATUS_OVER_IPC === 'I\'ll find a payphone baby / Take some time to talk to you') { - const {controlFlow} = require('./ipc-flow-control'); const bufferedSend = controlFlow(process); - if (process.versions.node >= '12.16.0') { - plan.status.on('stateChange', evt => { - bufferedSend(evt); - }); - } else { - const v8 = require('v8'); - plan.status.on('stateChange', evt => { - bufferedSend([...v8.serialize(evt)]); - }); - } + plan.status.on('stateChange', evt => { + bufferedSend(evt); + }); } plan.status.on('stateChange', evt => { @@ -455,7 +461,7 @@ exports.run = async () => { // eslint-disable-line complexity globs, projectDir, providers, - reporter + reporter, }); watcher.observeStdin(process.stdin); } else { @@ -476,4 +482,4 @@ exports.run = async () => { // eslint-disable-line complexity process.exitCode = runStatus.suggestExitCode({matching: match.length > 0}); reporter.endRun(); } -}; +} diff --git a/node_modules/ava/lib/code-excerpt.js b/node_modules/ava/lib/code-excerpt.js index c8f81d201d..ca9ab05863 100644 --- a/node_modules/ava/lib/code-excerpt.js +++ b/node_modules/ava/lib/code-excerpt.js @@ -1,14 +1,14 @@ -'use strict'; -const fs = require('fs'); -const equalLength = require('equal-length'); -const codeExcerpt = require('code-excerpt'); -const truncate = require('cli-truncate'); -const chalk = require('./chalk').get(); +import fs from 'node:fs'; + +import truncate from 'cli-truncate'; +import codeExcerpt from 'code-excerpt'; + +import {chalk} from './chalk.js'; const formatLineNumber = (lineNumber, maxLineNumber) => ' '.repeat(Math.max(0, String(maxLineNumber).length - String(lineNumber).length)) + lineNumber; -module.exports = (source, options = {}) => { +export default function exceptCode(source, options = {}) { if (!source.isWithinProject || source.isDependency) { return null; } @@ -18,7 +18,7 @@ module.exports = (source, options = {}) => { let contents; try { - contents = fs.readFileSync(file, 'utf8'); + contents = fs.readFileSync(new URL(file), 'utf8'); } catch { return null; } @@ -30,25 +30,20 @@ module.exports = (source, options = {}) => { const lines = excerpt.map(item => ({ line: item.line, - value: truncate(item.value, maxWidth - String(line).length - 5) + value: truncate(item.value, maxWidth - String(line).length - 5), })); - const joinedLines = lines.map(line => line.value).join('\n'); - const extendedLines = equalLength(joinedLines).split('\n'); + const extendedWidth = Math.max(...lines.map(item => item.value.length)); return lines - .map((item, index) => ({ - line: item.line, - value: extendedLines[index] - })) .map(item => { const isErrorSource = item.line === line; const lineNumber = formatLineNumber(item.line, line) + ':'; const coloredLineNumber = isErrorSource ? lineNumber : chalk.grey(lineNumber); - const result = ` ${coloredLineNumber} ${item.value}`; + const result = ` ${coloredLineNumber} ${item.value.padEnd(extendedWidth)}`; return isErrorSource ? chalk.bgRed(result) : result; }) .join('\n'); -}; +} diff --git a/node_modules/ava/lib/concordance-options.js b/node_modules/ava/lib/concordance-options.js index 05eb30abf6..48a367054b 100644 --- a/node_modules/ava/lib/concordance-options.js +++ b/node_modules/ava/lib/concordance-options.js @@ -1,37 +1,32 @@ -'use strict'; -const util = require('util'); // eslint-disable-line unicorn/import-style -const ansiStyles = require('ansi-styles'); -const stripAnsi = require('strip-ansi'); -const cloneDeepWith = require('lodash/cloneDeepWith'); -const reactPlugin = require('@concordance/react'); -const chalk = require('./chalk').get(); +import {inspect} from 'node:util'; -// Wrap Concordance's React plugin. Change the name to avoid collisions if in -// the future users can register plugins themselves. -const avaReactPlugin = {...reactPlugin, name: 'ava-plugin-react'}; -const plugins = [avaReactPlugin]; +import ansiStyles from 'ansi-styles'; +import {Chalk} from 'chalk'; // eslint-disable-line unicorn/import-style +import stripAnsi from 'strip-ansi'; -const forceColor = new chalk.Instance({level: Math.max(chalk.level, 1)}); +import {chalk} from './chalk.js'; + +const forceColor = new Chalk({level: Math.max(chalk.level, 1)}); const colorTheme = { boolean: ansiStyles.yellow, circular: forceColor.grey('[Circular]'), date: { invalid: forceColor.red('invalid'), - value: ansiStyles.blue + value: ansiStyles.blue, }, diffGutters: { actual: forceColor.red('-') + ' ', expected: forceColor.green('+') + ' ', - padding: ' ' + padding: ' ', }, error: { ctor: {open: ansiStyles.grey.open + '(', close: ')' + ansiStyles.grey.close}, - name: ansiStyles.magenta + name: ansiStyles.magenta, }, function: { name: ansiStyles.blue, - stringTag: ansiStyles.magenta + stringTag: ansiStyles.magenta, }, global: ansiStyles.magenta, item: {after: forceColor.grey(',')}, @@ -45,44 +40,16 @@ const colorTheme = { closeBracket: forceColor.grey('}'), ctor: ansiStyles.magenta, stringTag: {open: ansiStyles.magenta.open + '@', close: ansiStyles.magenta.close}, - secondaryStringTag: {open: ansiStyles.grey.open + '@', close: ansiStyles.grey.close} + secondaryStringTag: {open: ansiStyles.grey.open + '@', close: ansiStyles.grey.close}, }, property: { after: forceColor.grey(','), keyBracket: {open: forceColor.grey('['), close: forceColor.grey(']')}, - valueFallback: forceColor.grey('…') - }, - react: { - functionType: forceColor.grey('\u235F'), - openTag: { - start: forceColor.grey('<'), - end: forceColor.grey('>'), - selfClose: forceColor.grey('/'), - selfCloseVoid: ' ' + forceColor.grey('/') - }, - closeTag: { - open: forceColor.grey('') - }, - tagName: ansiStyles.magenta, - attribute: { - separator: '=', - value: { - openBracket: forceColor.grey('{'), - closeBracket: forceColor.grey('}'), - string: { - line: {open: forceColor.blue('"'), close: forceColor.blue('"'), escapeQuote: '"'} - } - } - }, - child: { - openBracket: forceColor.grey('{'), - closeBracket: forceColor.grey('}') - } + valueFallback: forceColor.grey('…'), }, regexp: { source: {open: ansiStyles.blue.open + '/', close: '/' + ansiStyles.blue.close}, - flags: ansiStyles.yellow + flags: ansiStyles.yellow, }, stats: {separator: forceColor.grey('---')}, string: { @@ -94,45 +61,42 @@ const colorTheme = { diff: { insert: { open: ansiStyles.bgGreen.open + ansiStyles.black.open, - close: ansiStyles.black.close + ansiStyles.bgGreen.close + close: ansiStyles.black.close + ansiStyles.bgGreen.close, }, delete: { open: ansiStyles.bgRed.open + ansiStyles.black.open, - close: ansiStyles.black.close + ansiStyles.bgRed.close + close: ansiStyles.black.close + ansiStyles.bgRed.close, }, equal: ansiStyles.blue, insertLine: { open: ansiStyles.green.open, - close: ansiStyles.green.close + close: ansiStyles.green.close, }, deleteLine: { open: ansiStyles.red.open, - close: ansiStyles.red.close - } - } + close: ansiStyles.red.close, + }, + }, }, symbol: ansiStyles.yellow, typedArray: { - bytes: ansiStyles.yellow + bytes: ansiStyles.yellow, }, - undefined: ansiStyles.yellow + undefined: ansiStyles.yellow, }; -const plainTheme = cloneDeepWith(colorTheme, value => { - if (typeof value === 'string') { - return stripAnsi(value); - } -}); +const plainTheme = JSON.parse(JSON.stringify(colorTheme), value => typeof value === 'string' ? stripAnsi(value) : value); const theme = chalk.level > 0 ? colorTheme : plainTheme; -exports.default = { +const concordanceOptions = { // Use Node's object inspection depth, clamped to a minimum of 3 get maxDepth() { - return Math.max(3, util.inspect.defaultOptions.depth); + return Math.max(3, inspect.defaultOptions.depth); }, - plugins, - theme + theme, }; -exports.snapshotManager = {plugins, theme: plainTheme}; +export default concordanceOptions; + +export const snapshotManager = {theme: plainTheme}; diff --git a/node_modules/ava/lib/context-ref.js b/node_modules/ava/lib/context-ref.js index b0b703e994..e440ca7385 100644 --- a/node_modules/ava/lib/context-ref.js +++ b/node_modules/ava/lib/context-ref.js @@ -1,7 +1,4 @@ -'use strict'; -const clone = require('lodash/clone'); - -class ContextRef { +export default class ContextRef { constructor() { this.value = {}; } @@ -18,7 +15,6 @@ class ContextRef { return new LateBinding(this); } } -module.exports = ContextRef; class LateBinding extends ContextRef { constructor(ref) { @@ -29,7 +25,8 @@ class LateBinding extends ContextRef { get() { if (!this.bound) { - this.set(clone(this.ref.get())); + const value = this.ref.get(); + this.set(value !== null && typeof value === 'object' ? {...value} : value); } return super.get(); diff --git a/node_modules/ava/lib/create-chain.js b/node_modules/ava/lib/create-chain.js index ce52b1876f..525fa96d12 100644 --- a/node_modules/ava/lib/create-chain.js +++ b/node_modules/ava/lib/create-chain.js @@ -1,4 +1,3 @@ -'use strict'; const chainRegistry = new WeakMap(); function startChain(name, call, defaults) { @@ -48,20 +47,16 @@ function createHookChain(hook, isAfterHook) { // * `skip` must come at the end // * no `only` // * no repeating - extendChain(hook, 'cb', 'callback'); extendChain(hook, 'skip', 'skipped'); - extendChain(hook.cb, 'skip', 'skipped'); if (isAfterHook) { extendChain(hook, 'always'); - extendChain(hook.always, 'cb', 'callback'); extendChain(hook.always, 'skip', 'skipped'); - extendChain(hook.always.cb, 'skip', 'skipped'); } return hook; } -function createChain(fn, defaults, meta) { +export default function createChain(fn, defaults, meta) { // Test chaining rules: // * `serial` must come at the start // * `only` and `skip` must come at the end @@ -69,27 +64,15 @@ function createChain(fn, defaults, meta) { // * `only` and `skip` cannot be chained together // * no repeating const root = startChain('test', fn, {...defaults, type: 'test'}); - extendChain(root, 'cb', 'callback'); extendChain(root, 'failing'); extendChain(root, 'only', 'exclusive'); extendChain(root, 'serial'); extendChain(root, 'skip', 'skipped'); - extendChain(root.cb, 'failing'); - extendChain(root.cb, 'only', 'exclusive'); - extendChain(root.cb, 'skip', 'skipped'); - extendChain(root.cb.failing, 'only', 'exclusive'); - extendChain(root.cb.failing, 'skip', 'skipped'); extendChain(root.failing, 'only', 'exclusive'); extendChain(root.failing, 'skip', 'skipped'); - extendChain(root.serial, 'cb', 'callback'); extendChain(root.serial, 'failing'); extendChain(root.serial, 'only', 'exclusive'); extendChain(root.serial, 'skip', 'skipped'); - extendChain(root.serial.cb, 'failing'); - extendChain(root.serial.cb, 'only', 'exclusive'); - extendChain(root.serial.cb, 'skip', 'skipped'); - extendChain(root.serial.cb.failing, 'only', 'exclusive'); - extendChain(root.serial.cb.failing, 'skip', 'skipped'); extendChain(root.serial.failing, 'only', 'exclusive'); extendChain(root.serial.failing, 'skip', 'skipped'); @@ -108,9 +91,38 @@ function createChain(fn, defaults, meta) { root.todo = startChain('test.todo', fn, {...defaults, type: 'test', todo: true}); root.serial.todo = startChain('test.serial.todo', fn, {...defaults, serial: true, type: 'test', todo: true}); + root.macro = options => { + if (typeof options === 'function') { + return Object.freeze({exec: options}); + } + + return Object.freeze({exec: options.exec, title: options.title}); + }; + root.meta = meta; + // Our type definition uses ESM syntax; when using CJS with VSCode, the + // auto-completion assumes the root is accessed through `require('ava').default`. + // Placate VSCode by adding a mostly hidden default property on the root. + // This is available through both CJS and ESM imports. We use a proxy so that + // we don't end up with root.default.default.default chains. + Object.defineProperty(root, 'default', { + configurable: false, + enumerable: false, + writable: false, + value: new Proxy(root, { + apply(target, thisArg, argumentsList) { + target.apply(thisArg, argumentsList); + }, + get(target, prop) { + if (prop === 'default') { + throw new TypeError('Cannot access default.default'); + } + + return target[prop]; + }, + }), + }); + return root; } - -module.exports = createChain; diff --git a/node_modules/ava/lib/environment-variables.js b/node_modules/ava/lib/environment-variables.js index 2d226dfcec..de2ac106c9 100644 --- a/node_modules/ava/lib/environment-variables.js +++ b/node_modules/ava/lib/environment-variables.js @@ -1,5 +1,4 @@ -'use strict'; -function validateEnvironmentVariables(environmentVariables) { +export default function validateEnvironmentVariables(environmentVariables) { if (!environmentVariables) { return {}; } @@ -12,5 +11,3 @@ function validateEnvironmentVariables(environmentVariables) { return environmentVariables; } - -module.exports = validateEnvironmentVariables; diff --git a/node_modules/ava/lib/eslint-plugin-helper-worker.js b/node_modules/ava/lib/eslint-plugin-helper-worker.js new file mode 100644 index 0000000000..e53bca401c --- /dev/null +++ b/node_modules/ava/lib/eslint-plugin-helper-worker.js @@ -0,0 +1,73 @@ +import v8 from 'node:v8'; +import {parentPort, workerData} from 'node:worker_threads'; + +import normalizeExtensions from './extensions.js'; +import {normalizeGlobs} from './globs.js'; +import {loadConfig} from './load-config.js'; +import providerManager from './provider-manager.js'; + +const MAX_DATA_LENGTH_EXCLUSIVE = 100 * 1024; // Allocate 100 KiB to exchange globs. + +const configCache = new Map(); + +const collectProviders = async ({conf, projectDir}) => { + const providers = []; + if (Reflect.has(conf, 'typescript')) { + const {level, main} = await providerManager.typescript(projectDir); + providers.push({ + level, + main: main({config: conf.typescript}), + type: 'typescript', + }); + } + + return providers; +}; + +const buildGlobs = ({conf, providers, projectDir, overrideExtensions, overrideFiles}) => { + const extensions = overrideExtensions + ? normalizeExtensions(overrideExtensions) + : normalizeExtensions(conf.extensions, providers); + + return { + cwd: projectDir, + ...normalizeGlobs({ + extensions, + files: overrideFiles ? overrideFiles : conf.files, + providers, + }), + }; +}; + +const resolveGlobs = async (projectDir, overrideExtensions, overrideFiles) => { + if (!configCache.has(projectDir)) { + configCache.set(projectDir, loadConfig({resolveFrom: projectDir}).then(async conf => { + const providers = await collectProviders({conf, projectDir}); + return {conf, providers}; + })); + } + + const {conf, providers} = await configCache.get(projectDir); + return buildGlobs({conf, providers, projectDir, overrideExtensions, overrideFiles}); +}; + +const data = new Uint8Array(workerData.dataBuffer); +const sync = new Int32Array(workerData.syncBuffer); + +const handleMessage = async ({projectDir, overrideExtensions, overrideFiles}) => { + let encoded; + try { + const globs = await resolveGlobs(projectDir, overrideExtensions, overrideFiles); + encoded = v8.serialize(globs); + } catch (error) { + encoded = v8.serialize(error); + } + + const byteLength = encoded.length < MAX_DATA_LENGTH_EXCLUSIVE ? encoded.copy(data) : MAX_DATA_LENGTH_EXCLUSIVE; + Atomics.store(sync, 0, byteLength); + Atomics.notify(sync, 0); +}; + +parentPort.on('message', handleMessage); +handleMessage(workerData.firstMessage); +delete workerData.firstMessage; diff --git a/node_modules/ava/lib/extensions.js b/node_modules/ava/lib/extensions.js index 8ee05c3f77..cd96963072 100644 --- a/node_modules/ava/lib/extensions.js +++ b/node_modules/ava/lib/extensions.js @@ -1,4 +1,4 @@ -module.exports = (configuredExtensions, providers = []) => { +export default function resolveExtensions(configuredExtensions, providers = []) { // Combine all extensions possible for testing. Remove duplicate extensions. const duplicates = new Set(); const seen = new Set(); @@ -43,4 +43,4 @@ module.exports = (configuredExtensions, providers = []) => { } return [...seen]; -}; +} diff --git a/node_modules/ava/lib/fork.js b/node_modules/ava/lib/fork.js index 75f3015b91..3f77039bd1 100644 --- a/node_modules/ava/lib/fork.js +++ b/node_modules/ava/lib/fork.js @@ -1,68 +1,71 @@ -'use strict'; -const childProcess = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const Emittery = require('emittery'); -const {controlFlow} = require('./ipc-flow-control'); - -if (fs.realpathSync(__filename) !== __filename) { - console.warn('WARNING: `npm link ava` and the `--preserve-symlink` flag are incompatible. We have detected that AVA is linked via `npm link`, and that you are using either an early version of Node 6, or the `--preserve-symlink` flag. This breaks AVA. You should upgrade to Node 6.2.0+, avoid the `--preserve-symlink` flag, or avoid using `npm link ava`.'); -} - -// In case the test file imports a different AVA install, -// the presence of this variable allows it to require this one instead -const AVA_PATH = path.resolve(__dirname, '..'); -const WORKER_PATH = require.resolve('./worker/subprocess'); +import childProcess from 'node:child_process'; +import process from 'node:process'; +import {fileURLToPath} from 'node:url'; +import {Worker} from 'node:worker_threads'; -class SharedWorkerChannel extends Emittery { - constructor({channelId, filename, initialData}, sendToFork) { - super(); +import Emittery from 'emittery'; +import {pEvent} from 'p-event'; - this.id = channelId; - this.filename = filename; - this.initialData = initialData; - this.sendToFork = sendToFork; - } +import {controlFlow} from './ipc-flow-control.cjs'; +import serializeError from './serialize-error.js'; - signalReady() { - this.sendToFork({ - type: 'shared-worker-ready', - channelId: this.id - }); - } - - signalError() { - this.sendToFork({ - type: 'shared-worker-error', - channelId: this.id - }); - } +let workerPath = new URL('worker/base.js', import.meta.url); +export function _testOnlyReplaceWorkerPath(replacement) { + workerPath = replacement; +} - emitMessage({messageId, replyTo, serializedData}) { - this.emit('message', { - messageId, - replyTo, - serializedData +const additionalExecArgv = ['--enable-source-maps']; + +const createWorker = (options, execArgv) => { + let worker; + let postMessage; + let close; + if (options.workerThreads) { + worker = new Worker(workerPath, { + argv: options.workerArgv, + env: {NODE_ENV: 'test', ...process.env, ...options.environmentVariables}, + execArgv: [...execArgv, ...additionalExecArgv], + workerData: { + options, + }, + trackUnmanagedFds: true, + stdin: true, + stdout: true, + stderr: true, }); - } - - forwardMessageToFork({messageId, replyTo, serializedData}) { - this.sendToFork({ - type: 'shared-worker-message', - channelId: this.id, - messageId, - replyTo, - serializedData + postMessage = worker.postMessage.bind(worker); + + // Ensure we've seen this event before we terminate the worker thread, as a + // workaround for https://github.com/nodejs/node/issues/38418. + const starting = pEvent(worker, 'message', ({ava}) => ava && ava.type === 'starting'); + + close = async () => { + try { + await starting; + await worker.terminate(); + } finally { + // No-op + } + }; + } else { + worker = childProcess.fork(fileURLToPath(workerPath), options.workerArgv, { + cwd: options.projectDir, + silent: true, + env: {NODE_ENV: 'test', ...process.env, ...options.environmentVariables}, + execArgv: [...execArgv, ...additionalExecArgv], }); + postMessage = controlFlow(worker); + close = async () => worker.kill(); } -} - -let forkCounter = 0; -module.exports = (file, options, execArgv = process.execArgv) => { - const forkId = `fork/${++forkCounter}`; - const sharedWorkerChannels = new Map(); + return { + worker, + postMessage, + close, + }; +}; +export default function loadFork(file, options, execArgv = process.execArgv) { let finished = false; const emitter = new Emittery(); @@ -75,31 +78,22 @@ module.exports = (file, options, execArgv = process.execArgv) => { options = { baseDir: process.cwd(), file, - forkId, - ...options + ...options, }; - const subprocess = childProcess.fork(WORKER_PATH, options.workerArgv, { - cwd: options.projectDir, - silent: true, - env: {NODE_ENV: 'test', ...process.env, ...options.environmentVariables, AVA_PATH}, - execArgv - }); - - subprocess.stdout.on('data', chunk => { + const {worker, postMessage, close} = createWorker(options, execArgv); + worker.stdout.on('data', chunk => { emitStateChange({type: 'worker-stdout', chunk}); }); - subprocess.stderr.on('data', chunk => { + worker.stderr.on('data', chunk => { emitStateChange({type: 'worker-stderr', chunk}); }); - const bufferedSend = controlFlow(subprocess); - let forcedExit = false; const send = evt => { if (!finished && !forcedExit) { - bufferedSend({ava: evt}); + postMessage({ava: evt}); } }; @@ -109,7 +103,7 @@ module.exports = (file, options, execArgv = process.execArgv) => { resolve(); }; - subprocess.on('message', message => { + worker.on('message', message => { if (!message.ava) { return; } @@ -119,15 +113,18 @@ module.exports = (file, options, execArgv = process.execArgv) => { send({type: 'options', options}); break; case 'shared-worker-connect': { - const channel = new SharedWorkerChannel(message.ava, send); - sharedWorkerChannels.set(channel.id, channel); - emitter.emit('connectSharedWorker', channel); + const {channelId, filename, initialData, port} = message.ava; + emitter.emit('connectSharedWorker', { + filename, + initialData, + port, + signalError() { + send({type: 'shared-worker-error', channelId}); + }, + }); break; } - case 'shared-worker-message': - sharedWorkerChannels.get(message.ava.channelId).emitMessage(message.ava); - break; case 'ping': send({type: 'pong'}); break; @@ -136,12 +133,12 @@ module.exports = (file, options, execArgv = process.execArgv) => { } }); - subprocess.on('error', err => { - emitStateChange({type: 'worker-failed', err}); + worker.on('error', error => { + emitStateChange({type: 'worker-failed', err: serializeError('Worker error', false, error, file)}); finish(); }); - subprocess.on('exit', (code, signal) => { + worker.on('exit', (code, signal) => { if (forcedExit) { emitStateChange({type: 'worker-finished', forcedExit}); } else if (code > 0) { @@ -158,12 +155,12 @@ module.exports = (file, options, execArgv = process.execArgv) => { return { file, - forkId, + threadId: worker.threadId, promise, exit() { forcedExit = true; - subprocess.kill(); + close(); }, notifyOfPeerFailure() { @@ -176,6 +173,6 @@ module.exports = (file, options, execArgv = process.execArgv) => { onStateChange(listener) { return emitter.on('stateChange', listener); - } + }, }; -}; +} diff --git a/node_modules/ava/lib/glob-helpers.cjs b/node_modules/ava/lib/glob-helpers.cjs new file mode 100644 index 0000000000..6e42c550f0 --- /dev/null +++ b/node_modules/ava/lib/glob-helpers.cjs @@ -0,0 +1,140 @@ +'use strict'; +const path = require('path'); +const process = require('process'); + +const ignoreByDefault = require('ignore-by-default'); +const picomatch = require('picomatch'); +const slash = require('slash'); + +const defaultIgnorePatterns = [...ignoreByDefault.directories(), '**/node_modules']; +exports.defaultIgnorePatterns = defaultIgnorePatterns; + +const defaultPicomatchIgnorePatterns = [ + ...defaultIgnorePatterns, + // Unlike globby(), picomatch needs a complete pattern when ignoring directories. + ...defaultIgnorePatterns.map(pattern => `${pattern}/**/*`), +]; + +const defaultMatchNoIgnore = picomatch(defaultPicomatchIgnorePatterns); + +const matchingCache = new WeakMap(); +const processMatchingPatterns = input => { + let result = matchingCache.get(input); + if (!result) { + const ignore = [...defaultPicomatchIgnorePatterns]; + const patterns = input.filter(pattern => { + if (pattern.startsWith('!')) { + // Unlike globby(), picomatch needs a complete pattern when ignoring directories. + ignore.push(pattern.slice(1), `${pattern.slice(1)}/**/*`); + return false; + } + + return true; + }); + + result = { + match: picomatch(patterns, {ignore}), + matchNoIgnore: picomatch(patterns), + individualMatchers: patterns.map(pattern => ({pattern, match: picomatch(pattern, {ignore})})), + }; + matchingCache.set(input, result); + } + + return result; +}; + +exports.processMatchingPatterns = processMatchingPatterns; + +const matchesIgnorePatterns = (file, patterns) => { + const {matchNoIgnore} = processMatchingPatterns(patterns); + return matchNoIgnore(file) || defaultMatchNoIgnore(file); +}; + +function classify(file, {cwd, extensions, filePatterns, ignoredByWatcherPatterns}) { + file = normalizeFileForMatching(cwd, file); + return { + isIgnoredByWatcher: matchesIgnorePatterns(file, ignoredByWatcherPatterns), + isTest: hasExtension(extensions, file) && !isHelperish(file) && filePatterns.length > 0 && matches(file, filePatterns), + }; +} + +exports.classify = classify; + +const hasExtension = (extensions, file) => extensions.includes(path.extname(file).slice(1)); + +exports.hasExtension = hasExtension; + +function isHelperish(file) { // Assume file has been normalized already. + // File names starting with an underscore are deemed "helpers". + if (path.basename(file).startsWith('_')) { + return true; + } + + // This function assumes the file has been normalized. If it couldn't be, + // don't check if it's got a parent directory that starts with an underscore. + // Deem it not a "helper". + if (path.isAbsolute(file)) { + return false; + } + + // If the file has a parent directory that starts with only a single + // underscore, it's deemed a "helper". + return path.dirname(file).split('/').some(dir => /^_(?:$|[^_])/.test(dir)); +} + +exports.isHelperish = isHelperish; + +function matches(file, patterns) { + const {match} = processMatchingPatterns(patterns); + return match(file); +} + +exports.matches = matches; + +function normalizeFileForMatching(cwd, file) { + if (process.platform === 'win32') { + cwd = slash(cwd); + file = slash(file); + } + + // Note that if `file` is outside `cwd` we can't normalize it. If this turns + // out to be a real-world scenario we may have to make changes in calling code + // to make sure the file isn't even selected for matching. + if (!file.startsWith(cwd)) { + return file; + } + + // Assume `cwd` does *not* end in a slash. + return file.slice(cwd.length + 1); +} + +exports.normalizeFileForMatching = normalizeFileForMatching; + +function normalizePattern(pattern) { + // Always use `/` in patterns, harmonizing matching across platforms + if (process.platform === 'win32') { + pattern = slash(pattern); + } + + if (pattern.endsWith('/')) { + pattern = pattern.slice(0, -1); + } + + if (pattern.startsWith('./')) { + return pattern.slice(2); + } + + if (pattern.startsWith('!./')) { + return `!${pattern.slice(3)}`; + } + + return pattern; +} + +exports.normalizePattern = normalizePattern; + +function normalizePatterns(patterns) { + return patterns.map(pattern => normalizePattern(pattern)); +} + +exports.normalizePatterns = normalizePatterns; diff --git a/node_modules/ava/lib/globs.js b/node_modules/ava/lib/globs.js index 2e03d312fc..4a751db6cc 100644 --- a/node_modules/ava/lib/globs.js +++ b/node_modules/ava/lib/globs.js @@ -1,54 +1,36 @@ -'use strict'; -const path = require('path'); -const globby = require('globby'); -const ignoreByDefault = require('ignore-by-default'); -const picomatch = require('picomatch'); -const slash = require('slash'); -const providerManager = require('./provider-manager'); - -const defaultIgnorePatterns = [...ignoreByDefault.directories(), '**/node_modules']; -const defaultPicomatchIgnorePatterns = [ - ...defaultIgnorePatterns, - // Unlike globby(), picomatch needs a complete pattern when ignoring directories. - ...defaultIgnorePatterns.map(pattern => `${pattern}/**/*`) -]; - -const defaultMatchNoIgnore = picomatch(defaultPicomatchIgnorePatterns); +import fs from 'node:fs'; +import path from 'node:path'; + +import {globby, globbySync} from 'globby'; + +import { + defaultIgnorePatterns, + hasExtension, + normalizeFileForMatching, + normalizePatterns, + processMatchingPatterns, +} from './glob-helpers.cjs'; + +export { + classify, + isHelperish, + matches, + normalizePattern, + defaultIgnorePatterns, + hasExtension, + normalizeFileForMatching, + normalizePatterns, +} from './glob-helpers.cjs'; const defaultIgnoredByWatcherPatterns = [ '**/*.snap.md', // No need to rerun tests when the Markdown files change. 'ava.config.js', // Config is not reloaded so avoid rerunning tests when it changes. - 'ava.config.cjs' // Config is not reloaded so avoid rerunning tests when it changes. + 'ava.config.cjs', // Config is not reloaded so avoid rerunning tests when it changes. ]; const buildExtensionPattern = extensions => extensions.length === 1 ? extensions[0] : `{${extensions.join(',')}}`; -function normalizePattern(pattern) { - // Always use `/` in patterns, harmonizing matching across platforms - if (process.platform === 'win32') { - pattern = slash(pattern); - } - - if (pattern.startsWith('./')) { - return pattern.slice(2); - } - - if (pattern.startsWith('!./')) { - return `!${pattern.slice(3)}`; - } - - return pattern; -} - -exports.normalizePattern = normalizePattern; - -function normalizePatterns(patterns) { - return patterns.map(pattern => normalizePattern(pattern)); -} - -exports.normalizePatterns = normalizePatterns; - -function normalizeGlobs({extensions, files: filePatterns, ignoredByWatcher: ignoredByWatcherPatterns, providers}) { +export function normalizeGlobs({extensions, files: filePatterns, ignoredByWatcher: ignoredByWatcherPatterns, providers}) { if (filePatterns !== undefined && (!Array.isArray(filePatterns) || filePatterns.length === 0)) { throw new Error('The ’files’ configuration must be an array containing glob patterns.'); } @@ -68,7 +50,7 @@ function normalizeGlobs({extensions, files: filePatterns, ignoredByWatcher: igno `**/test/**/*.${extensionPattern}`, `**/tests/**/*.${extensionPattern}`, '!**/__tests__/**/__{helper,fixture}?(s)__/**/*', - '!**/test?(s)/**/{helper,fixture}?(s)/**/*' + '!**/test?(s)/**/{helper,fixture}?(s)/**/*', ]; if (filePatterns) { @@ -84,40 +66,36 @@ function normalizeGlobs({extensions, files: filePatterns, ignoredByWatcher: igno ignoredByWatcherPatterns = ignoredByWatcherPatterns ? [...defaultIgnoredByWatcherPatterns, ...normalizePatterns(ignoredByWatcherPatterns)] : [...defaultIgnoredByWatcherPatterns]; - for (const {level, main} of providers) { - if (level >= providerManager.levels.pathRewrites) { - ({filePatterns, ignoredByWatcherPatterns} = main.updateGlobs({filePatterns, ignoredByWatcherPatterns})); - } + for (const {main} of providers) { + ({filePatterns, ignoredByWatcherPatterns} = main.updateGlobs({filePatterns, ignoredByWatcherPatterns})); } return {extensions, filePatterns, ignoredByWatcherPatterns}; } -exports.normalizeGlobs = normalizeGlobs; - -const hasExtension = (extensions, file) => extensions.includes(path.extname(file).slice(1)); - -exports.hasExtension = hasExtension; +const globOptions = { + // Globs should work relative to the cwd value only (this should be the + // project directory that AVA is run in). + absolute: false, + braceExpansion: true, + caseSensitiveMatch: false, + dot: false, + expandDirectories: false, + extglob: true, + followSymbolicLinks: true, + gitignore: false, + globstar: true, + ignore: defaultIgnorePatterns, + baseNameMatch: false, + stats: false, + unique: true, +}; const globFiles = async (cwd, patterns) => { const files = await globby(patterns, { - // Globs should work relative to the cwd value only (this should be the - // project directory that AVA is run in). - absolute: false, - braceExpansion: true, - caseSensitiveMatch: false, + ...globOptions, cwd, - dot: false, - expandDirectories: false, - extglob: true, - followSymbolicLinks: true, - gitignore: false, - globstar: true, - ignore: defaultIgnorePatterns, - baseNameMatch: false, onlyFiles: true, - stats: false, - unique: true }); // Return absolute file paths. This has the side-effect of normalizing paths @@ -125,119 +103,114 @@ const globFiles = async (cwd, patterns) => { return files.map(file => path.join(cwd, file)); }; -async function findFiles({cwd, extensions, filePatterns}) { - return (await globFiles(cwd, filePatterns)).filter(file => hasExtension(extensions, file)); -} +const globDirectoriesSync = (cwd, patterns) => { + const files = globbySync(patterns, { + ...globOptions, + cwd, + onlyDirectories: true, + }); -exports.findFiles = findFiles; + // Return absolute file paths. This has the side-effect of normalizing paths + // on Windows. + return files.map(file => path.join(cwd, file)); +}; -async function findTests({cwd, extensions, filePatterns}) { - return (await findFiles({cwd, extensions, filePatterns})).filter(file => !path.basename(file).startsWith('_')); +export async function findFiles({cwd, extensions, filePatterns}) { + const files = await globFiles(cwd, filePatterns); + return files.filter(file => hasExtension(extensions, file)); } -exports.findTests = findTests; +export async function findTests({cwd, extensions, filePatterns}) { + const files = await findFiles({cwd, extensions, filePatterns}); + return files.filter(file => !path.basename(file).startsWith('_')); +} -function getChokidarIgnorePatterns({ignoredByWatcherPatterns}) { +export function getChokidarIgnorePatterns({ignoredByWatcherPatterns}) { return [ ...defaultIgnorePatterns.map(pattern => `${pattern}/**/*`), - ...ignoredByWatcherPatterns.filter(pattern => !pattern.startsWith('!')) + ...ignoredByWatcherPatterns.filter(pattern => !pattern.startsWith('!')), ]; } -exports.getChokidarIgnorePatterns = getChokidarIgnorePatterns; - -const matchingCache = new WeakMap(); -const processMatchingPatterns = input => { - let result = matchingCache.get(input); - if (!result) { - const ignore = [...defaultPicomatchIgnorePatterns]; - const patterns = input.filter(pattern => { - if (pattern.startsWith('!')) { - // Unlike globby(), picomatch needs a complete pattern when ignoring directories. - ignore.push(pattern.slice(1), `${pattern.slice(1)}/**/*`); - return false; +export function applyTestFileFilter({ // eslint-disable-line complexity + cwd, + expandDirectories = true, + filter, + providers = [], + testFiles, + treatFilterPatternsAsFiles = true, +}) { + const {individualMatchers} = processMatchingPatterns(filter); + const normalizedFiles = testFiles.map(file => ({file, matcheable: normalizeFileForMatching(cwd, file)})); + + const selected = new Set(); + const unmatchedPatterns = new Set(individualMatchers.map(({pattern}) => pattern)); + + for (const {pattern, match} of individualMatchers) { + for (const {file, matcheable} of normalizedFiles) { + if (match(matcheable)) { + unmatchedPatterns.delete(pattern); + selected.add(file); } - - return true; - }); - - result = { - match: picomatch(patterns, {ignore}), - matchNoIgnore: picomatch(patterns) - }; - matchingCache.set(input, result); - } - - return result; -}; - -function matches(file, patterns) { - const {match} = processMatchingPatterns(patterns); - return match(file); -} - -exports.matches = matches; - -const matchesIgnorePatterns = (file, patterns) => { - const {matchNoIgnore} = processMatchingPatterns(patterns); - return matchNoIgnore(file) || defaultMatchNoIgnore(file); -}; - -function normalizeFileForMatching(cwd, file) { - if (process.platform === 'win32') { - cwd = slash(cwd); - file = slash(file); + } } - if (!cwd) { // TODO: Ensure tests provide an actual value. - return file; - } + if (expandDirectories && unmatchedPatterns.size > 0) { + const expansion = []; + for (const pattern of unmatchedPatterns) { + const directories = globDirectoriesSync(cwd, pattern); + if (directories.length > 0) { + unmatchedPatterns.delete(pattern); + expansion.push(directories); + } + } - // TODO: If `file` is outside `cwd` we can't normalize it. Need to figure - // out if that's a real-world scenario, but we may have to ensure the file - // isn't even selected. - if (!file.startsWith(cwd)) { - return file; + const directories = expansion.flat(); + if (directories.length > 0) { + for (const file of testFiles) { + if (selected.has(file)) { + continue; + } + + for (const dir of directories) { + if (file.startsWith(dir + path.sep)) { // eslint-disable-line max-depth + selected.add(file); + } + } + } + } } - // Assume `cwd` does *not* end in a slash. - return file.slice(cwd.length + 1); -} - -exports.normalizeFileForMatching = normalizeFileForMatching; + const ignoredFilterPatternFiles = []; + if (treatFilterPatternsAsFiles && unmatchedPatterns.size > 0) { + const providerExtensions = new Set(providers.flatMap(({main}) => main.extensions)); + for (const pattern of unmatchedPatterns) { + const file = path.join(cwd, pattern); + try { + const stats = fs.statSync(file); + if (!stats.isFile()) { + continue; + } + } catch (error) { + if (error.code === 'ENOENT') { + continue; + } + + throw error; + } -function isHelperish(file) { // Assume file has been normalized already. - // File names starting with an underscore are deemed "helpers". - if (path.basename(file).startsWith('_')) { - return true; - } + if ( + path.basename(file).startsWith('_') + || providerExtensions.has(path.extname(file).slice(1)) + || file.split(path.sep).includes('node_modules') + ) { + ignoredFilterPatternFiles.push(pattern); + continue; + } - // This function assumes the file has been normalized. If it couldn't be, - // don't check if it's got a parent directory that starts with an underscore. - // Deem it not a "helper". - if (path.isAbsolute(file)) { - return false; + selected.add(file); + } } - // If the file has a parent directory that starts with only a single - // underscore, it's deemed a "helper". - return path.dirname(file).split('/').some(dir => /^_(?:$|[^_])/.test(dir)); + return Object.assign([...selected], {ignoredFilterPatternFiles}); } - -exports.isHelperish = isHelperish; - -function classify(file, {cwd, extensions, filePatterns, ignoredByWatcherPatterns}) { - file = normalizeFileForMatching(cwd, file); - return { - isIgnoredByWatcher: matchesIgnorePatterns(file, ignoredByWatcherPatterns), - isTest: hasExtension(extensions, file) && !isHelperish(file) && filePatterns.length > 0 && matches(file, filePatterns) - }; -} - -exports.classify = classify; - -function applyTestFileFilter({cwd, filter, testFiles}) { - return testFiles.filter(file => matches(normalizeFileForMatching(cwd, file), filter)); -} - -exports.applyTestFileFilter = applyTestFileFilter; diff --git a/node_modules/ava/lib/ipc-flow-control.js b/node_modules/ava/lib/ipc-flow-control.cjs similarity index 98% rename from node_modules/ava/lib/ipc-flow-control.js rename to node_modules/ava/lib/ipc-flow-control.cjs index 52583c6901..7a7d5d0e9a 100644 --- a/node_modules/ava/lib/ipc-flow-control.js +++ b/node_modules/ava/lib/ipc-flow-control.cjs @@ -1,3 +1,4 @@ +'use strict'; function controlFlow(channel) { let errored = false; let deliverImmediately = true; diff --git a/node_modules/ava/lib/is-ci.js b/node_modules/ava/lib/is-ci.js index 227e7e1832..c0ec1aecb5 100644 --- a/node_modules/ava/lib/is-ci.js +++ b/node_modules/ava/lib/is-ci.js @@ -1,5 +1,7 @@ -const info = require('ci-info'); +import process from 'node:process'; + +import info from 'ci-info'; const {AVA_FORCE_CI} = process.env; -module.exports = AVA_FORCE_CI === 'not-ci' ? false : AVA_FORCE_CI === 'ci' || info.isCI; +export default AVA_FORCE_CI === 'not-ci' ? false : AVA_FORCE_CI === 'ci' || info.isCI; diff --git a/node_modules/ava/lib/like-selector.js b/node_modules/ava/lib/like-selector.js index fc720a59ad..09675a9fef 100644 --- a/node_modules/ava/lib/like-selector.js +++ b/node_modules/ava/lib/like-selector.js @@ -1,17 +1,13 @@ -'use strict'; -function isLikeSelector(selector) { - return selector !== null && - typeof selector === 'object' && - Reflect.getPrototypeOf(selector) === Object.prototype && - Reflect.ownKeys(selector).length > 0; +export function isLikeSelector(selector) { + return selector !== null + && typeof selector === 'object' + && Reflect.getPrototypeOf(selector) === Object.prototype + && Reflect.ownKeys(selector).length > 0; } -exports.isLikeSelector = isLikeSelector; +export const CIRCULAR_SELECTOR = new Error('Encountered a circular selector'); -const CIRCULAR_SELECTOR = new Error('Encountered a circular selector'); -exports.CIRCULAR_SELECTOR = CIRCULAR_SELECTOR; - -function selectComparable(lhs, selector, circular = new Set()) { +export function selectComparable(lhs, selector, circular = new Set()) { if (circular.has(selector)) { throw CIRCULAR_SELECTOR; } @@ -33,5 +29,3 @@ function selectComparable(lhs, selector, circular = new Set()) { return comparable; } - -exports.selectComparable = selectComparable; diff --git a/node_modules/ava/lib/line-numbers.js b/node_modules/ava/lib/line-numbers.js index 3e0857a27e..24a6e1f367 100644 --- a/node_modules/ava/lib/line-numbers.js +++ b/node_modules/ava/lib/line-numbers.js @@ -1,7 +1,4 @@ -'use strict'; - -const picomatch = require('picomatch'); -const flatten = require('lodash/flatten'); +import picomatch from 'picomatch'; const NUMBER_REGEX = /^\d+$/; const RANGE_REGEX = /^(?\d+)-(?\d+)$/; @@ -17,10 +14,10 @@ const sortNumbersAscending = array => { const parseNumber = string => Number.parseInt(string, 10); const removeAllWhitespace = string => string.replace(/\s/g, ''); -const range = (start, end) => new Array(end - start + 1).fill(start).map((element, index) => element + index); +const range = (start, end) => Array.from({length: end - start + 1}).fill(start).map((element, index) => element + index); -const parseLineNumbers = suffix => sortNumbersAscending(distinctArray(flatten( - suffix.split(',').map(part => { +const parseLineNumbers = suffix => sortNumbersAscending(distinctArray( + suffix.split(',').flatMap(part => { if (NUMBER_REGEX.test(part)) { return parseNumber(part); } @@ -34,10 +31,10 @@ const parseLineNumbers = suffix => sortNumbersAscending(distinctArray(flatten( } return range(start, end); - }) -))); + }), +)); -function splitPatternAndLineNumbers(pattern) { +export function splitPatternAndLineNumbers(pattern) { const parts = pattern.split(DELIMITER); if (parts.length === 1) { return {pattern, lineNumbers: null}; @@ -51,14 +48,10 @@ function splitPatternAndLineNumbers(pattern) { return {pattern: parts.join(DELIMITER), lineNumbers: parseLineNumbers(suffix)}; } -exports.splitPatternAndLineNumbers = splitPatternAndLineNumbers; - -function getApplicableLineNumbers(normalizedFilePath, filter) { - return sortNumbersAscending(distinctArray(flatten( +export function getApplicableLineNumbers(normalizedFilePath, filter) { + return sortNumbersAscending(distinctArray( filter .filter(({pattern, lineNumbers}) => lineNumbers && picomatch.isMatch(normalizedFilePath, pattern)) - .map(({lineNumbers}) => lineNumbers) - ))); + .flatMap(({lineNumbers}) => lineNumbers), + )); } - -exports.getApplicableLineNumbers = getApplicableLineNumbers; diff --git a/node_modules/ava/lib/load-config.js b/node_modules/ava/lib/load-config.js index 198a74207d..e02809ed3b 100644 --- a/node_modules/ava/lib/load-config.js +++ b/node_modules/ava/lib/load-config.js @@ -1,40 +1,17 @@ -'use strict'; -const fs = require('fs'); -const path = require('path'); -const url = require('url'); -const vm = require('vm'); -const {isPlainObject} = require('is-plain-object'); -const pkgConf = require('pkg-conf'); +import fs from 'node:fs'; +import path from 'node:path'; +import process from 'node:process'; +import url from 'node:url'; + +import {isPlainObject} from 'is-plain-object'; +import {packageConfig, packageJsonPath} from 'pkg-conf'; const NO_SUCH_FILE = Symbol('no ava.config.js file'); const MISSING_DEFAULT_EXPORT = Symbol('missing default export'); -const EXPERIMENTS = new Set([ - 'configurableModuleFormat', - 'disableNullExpectations', - 'disableSnapshotsInHooks', - 'nextGenConfig', - 'reverseTeardowns', - 'sharedWorkers' -]); - -// *Very* rudimentary support for loading ava.config.js files containing an `export default` statement. -const evaluateJsConfig = (contents, configFile) => { - const script = new vm.Script(`'use strict';(()=>{let __export__;\n${contents.toString('utf8').replace(/export default/g, '__export__ =')};return __export__;})()`, { - filename: configFile, - lineOffset: -1 - }); - return script.runInThisContext(); -}; +const EXPERIMENTS = new Set(); const importConfig = async ({configFile, fileForErrorMessage}) => { - let module; - try { - module = await import(url.pathToFileURL(configFile)); // eslint-disable-line node/no-unsupported-features/es-syntax - } catch (error) { - throw Object.assign(new Error(`Error loading ${fileForErrorMessage}: ${error.message}`), {parent: error}); - } - - const {default: config = MISSING_DEFAULT_EXPORT} = module; + const {default: config = MISSING_DEFAULT_EXPORT} = await import(url.pathToFileURL(configFile)); // eslint-disable-line node/no-unsupported-features/es-syntax if (config === MISSING_DEFAULT_EXPORT) { throw new Error(`${fileForErrorMessage} must have a default export`); } @@ -42,79 +19,22 @@ const importConfig = async ({configFile, fileForErrorMessage}) => { return config; }; -const loadJsConfig = ({projectDir, configFile = path.join(projectDir, 'ava.config.js')}, useImport = false) => { - if (!configFile.endsWith('.js')) { +const loadConfigFile = async ({projectDir, configFile}) => { + if (!fs.existsSync(configFile)) { return null; } const fileForErrorMessage = path.relative(projectDir, configFile); - - let config; try { - const contents = fs.readFileSync(configFile); - config = useImport && contents.includes('nonSemVerExperiments') && contents.includes('nextGenConfig') ? - importConfig({configFile, fileForErrorMessage}) : - evaluateJsConfig(contents, configFile) || MISSING_DEFAULT_EXPORT; + return {config: await importConfig({configFile, fileForErrorMessage}), configFile, fileForErrorMessage}; } catch (error) { - if (error.code === 'ENOENT') { - return null; - } - throw Object.assign(new Error(`Error loading ${fileForErrorMessage}: ${error.message}`), {parent: error}); } - - if (config === MISSING_DEFAULT_EXPORT) { - throw new Error(`${fileForErrorMessage} must have a default export, using ES module syntax`); - } - - return {config, fileForErrorMessage}; -}; - -const loadCjsConfig = ({projectDir, configFile = path.join(projectDir, 'ava.config.cjs')}) => { - if (!configFile.endsWith('.cjs')) { - return null; - } - - const fileForErrorMessage = path.relative(projectDir, configFile); - try { - return {config: require(configFile), fileForErrorMessage}; - } catch (error) { - if (error.code === 'MODULE_NOT_FOUND') { - return null; - } - - throw Object.assign(new Error(`Error loading ${fileForErrorMessage}`), {parent: error}); - } }; -const loadMjsConfig = ({projectDir, configFile = path.join(projectDir, 'ava.config.mjs')}, experimentally = false) => { - if (!configFile.endsWith('.mjs')) { - return null; - } - - const fileForErrorMessage = path.relative(projectDir, configFile); - try { - const contents = fs.readFileSync(configFile); - if (experimentally && contents.includes('nonSemVerExperiments') && contents.includes('nextGenConfig')) { - return {config: importConfig({configFile, fileForErrorMessage}), fileForErrorMessage}; - } - } catch (error) { - if (error.code === 'ENOENT') { - return null; - } - - throw Object.assign(new Error(`Error loading ${fileForErrorMessage}`), {parent: error}); - } - - throw new Error(`AVA cannot yet load ${fileForErrorMessage} files`); -}; - -function resolveConfigFile(projectDir, configFile) { +function resolveConfigFile(configFile) { if (configFile) { configFile = path.resolve(configFile); // Relative to CWD - if (path.basename(configFile) !== path.relative(projectDir, configFile)) { - throw new Error('Config files must be located next to the package.json file'); - } if (!configFile.endsWith('.js') && !configFile.endsWith('.cjs') && !configFile.endsWith('.mjs')) { throw new Error('Config files must have .js, .cjs or .mjs extensions'); @@ -124,93 +44,64 @@ function resolveConfigFile(projectDir, configFile) { return configFile; } -function loadConfigSync({configFile, resolveFrom = process.cwd(), defaults = {}} = {}) { - let packageConf = pkgConf.sync('ava', {cwd: resolveFrom}); - const filepath = pkgConf.filepath(packageConf); - const projectDir = filepath === null ? resolveFrom : path.dirname(filepath); +const gitScmFile = process.env.AVA_FAKE_SCM_ROOT || '.git'; - configFile = resolveConfigFile(projectDir, configFile); - const allowConflictWithPackageJson = Boolean(configFile); - - let [{config: fileConf, fileForErrorMessage} = {config: NO_SUCH_FILE, fileForErrorMessage: undefined}, ...conflicting] = [ - loadJsConfig({projectDir, configFile}), - loadCjsConfig({projectDir, configFile}), - loadMjsConfig({projectDir, configFile}) - ].filter(result => result !== null); +async function findRepoRoot(fromDir) { + const {root} = path.parse(fromDir); + let dir = fromDir; + while (root !== dir) { + try { + const stat = await fs.promises.stat(path.join(dir, gitScmFile)); // eslint-disable-line no-await-in-loop + if (stat.isFile() || stat.isDirectory()) { + return dir; + } + } catch {} - if (conflicting.length > 0) { - throw new Error(`Conflicting configuration in ${fileForErrorMessage} and ${conflicting.map(({fileForErrorMessage}) => fileForErrorMessage).join(' & ')}`); + dir = path.dirname(dir); } - if (fileConf !== NO_SUCH_FILE) { - if (allowConflictWithPackageJson) { - packageConf = {}; - } else if (Object.keys(packageConf).length > 0) { - throw new Error(`Conflicting configuration in ${fileForErrorMessage} and package.json`); - } + return root; +} - if (fileConf && typeof fileConf.then === 'function') { // eslint-disable-line promise/prefer-await-to-then - throw new TypeError(`${fileForErrorMessage} must not export a promise`); - } +export async function loadConfig({configFile, resolveFrom = process.cwd(), defaults = {}} = {}) { + let packageConf = await packageConfig('ava', {cwd: resolveFrom}); + const filepath = packageJsonPath(packageConf); + const projectDir = filepath === undefined ? resolveFrom : path.dirname(filepath); - if (!isPlainObject(fileConf) && typeof fileConf !== 'function') { - throw new TypeError(`${fileForErrorMessage} must export a plain object or factory function`); - } + const repoRoot = await findRepoRoot(projectDir); - if (typeof fileConf === 'function') { - fileConf = fileConf({projectDir}); - if (fileConf && typeof fileConf.then === 'function') { // eslint-disable-line promise/prefer-await-to-then - throw new TypeError(`Factory method exported by ${fileForErrorMessage} must not return a promise`); - } - - if (!isPlainObject(fileConf)) { - throw new TypeError(`Factory method exported by ${fileForErrorMessage} must return a plain object`); - } - } + // Conflicts are only allowed when an explicit config file is provided. + const allowConflictWithPackageJson = Boolean(configFile); + configFile = resolveConfigFile(configFile); - if ('ava' in fileConf) { - throw new Error(`Encountered ’ava’ property in ${fileForErrorMessage}; avoid wrapping the configuration`); + let fileConf = NO_SUCH_FILE; + let fileForErrorMessage; + let conflicting = []; + if (configFile) { + const loaded = await loadConfigFile({projectDir, configFile}); + if (loaded !== null) { + ({config: fileConf, fileForErrorMessage} = loaded); } - } + } else { + let searchDir = projectDir; + const stopAt = path.dirname(repoRoot); + do { + const results = await Promise.all([ // eslint-disable-line no-await-in-loop + loadConfigFile({projectDir, configFile: path.join(searchDir, 'ava.config.js')}), + loadConfigFile({projectDir, configFile: path.join(searchDir, 'ava.config.cjs')}), + loadConfigFile({projectDir, configFile: path.join(searchDir, 'ava.config.mjs')}), + ]); - const config = {...defaults, nonSemVerExperiments: {}, ...fileConf, ...packageConf, projectDir}; + [{config: fileConf, fileForErrorMessage, configFile} = {config: NO_SUCH_FILE, fileForErrorMessage: undefined}, ...conflicting] = results.filter(result => result !== null); - const {nonSemVerExperiments: experiments} = config; - if (!isPlainObject(experiments)) { - throw new Error(`nonSemVerExperiments from ${fileForErrorMessage} must be an object`); + searchDir = path.dirname(searchDir); + } while (fileConf === NO_SUCH_FILE && searchDir !== stopAt); } - for (const key of Object.keys(experiments)) { - if (!EXPERIMENTS.has(key)) { - throw new Error(`nonSemVerExperiments.${key} from ${fileForErrorMessage} is not a supported experiment`); - } - } - - return config; -} - -exports.loadConfigSync = loadConfigSync; - -async function loadConfig({configFile, resolveFrom = process.cwd(), defaults = {}} = {}) { - let packageConf = await pkgConf('ava', {cwd: resolveFrom}); - const filepath = pkgConf.filepath(packageConf); - const projectDir = filepath === null ? resolveFrom : path.dirname(filepath); - - configFile = resolveConfigFile(projectDir, configFile); - const allowConflictWithPackageJson = Boolean(configFile); - - // TODO: Refactor resolution logic to implement https://github.com/avajs/ava/issues/2285. - let [{config: fileConf, fileForErrorMessage} = {config: NO_SUCH_FILE, fileForErrorMessage: undefined}, ...conflicting] = [ - loadJsConfig({projectDir, configFile}, true), - loadCjsConfig({projectDir, configFile}), - loadMjsConfig({projectDir, configFile}, true) - ].filter(result => result !== null); - if (conflicting.length > 0) { throw new Error(`Conflicting configuration in ${fileForErrorMessage} and ${conflicting.map(({fileForErrorMessage}) => fileForErrorMessage).join(' & ')}`); } - let sawPromise = false; if (fileConf !== NO_SUCH_FILE) { if (allowConflictWithPackageJson) { packageConf = {}; @@ -218,21 +109,12 @@ async function loadConfig({configFile, resolveFrom = process.cwd(), defaults = { throw new Error(`Conflicting configuration in ${fileForErrorMessage} and package.json`); } - if (fileConf && typeof fileConf.then === 'function') { // eslint-disable-line promise/prefer-await-to-then - sawPromise = true; - fileConf = await fileConf; - } - if (!isPlainObject(fileConf) && typeof fileConf !== 'function') { throw new TypeError(`${fileForErrorMessage} must export a plain object or factory function`); } if (typeof fileConf === 'function') { - fileConf = fileConf({projectDir}); - if (fileConf && typeof fileConf.then === 'function') { // eslint-disable-line promise/prefer-await-to-then - sawPromise = true; - fileConf = await fileConf; - } + fileConf = await fileConf({projectDir}); if (!isPlainObject(fileConf)) { throw new TypeError(`Factory method exported by ${fileForErrorMessage} must return a plain object`); @@ -244,7 +126,7 @@ async function loadConfig({configFile, resolveFrom = process.cwd(), defaults = { } } - const config = {...defaults, nonSemVerExperiments: {}, ...fileConf, ...packageConf, projectDir}; + const config = {...defaults, nonSemVerExperiments: {}, ...fileConf, ...packageConf, projectDir, configFile}; const {nonSemVerExperiments: experiments} = config; if (!isPlainObject(experiments)) { @@ -257,11 +139,5 @@ async function loadConfig({configFile, resolveFrom = process.cwd(), defaults = { } } - if (sawPromise && experiments.nextGenConfig !== true) { - throw new Error(`${fileForErrorMessage} exported a promise or an asynchronous factory function. You must enable the ’asyncConfigurationLoading’ experiment for this to work.`); - } - return config; } - -exports.loadConfig = loadConfig; diff --git a/node_modules/ava/lib/module-types.js b/node_modules/ava/lib/module-types.js index 087d5d1e20..3b482a9a0a 100644 --- a/node_modules/ava/lib/module-types.js +++ b/node_modules/ava/lib/module-types.js @@ -54,12 +54,12 @@ const deriveFromArray = (extensions, defaultModuleType) => { return moduleTypes; }; -module.exports = (configuredExtensions, defaultModuleType, experiments) => { +export default function moduleTypes(configuredExtensions, defaultModuleType) { if (configuredExtensions === undefined) { return { cjs: 'commonjs', mjs: 'module', - js: defaultModuleType + js: defaultModuleType, }; } @@ -67,9 +67,5 @@ module.exports = (configuredExtensions, defaultModuleType, experiments) => { return deriveFromArray(configuredExtensions, defaultModuleType); } - if (!experiments.configurableModuleFormat) { - throw new Error('You must enable the `configurableModuleFormat` experiment in order to specify module types'); - } - return deriveFromObject(configuredExtensions, defaultModuleType); -}; +} diff --git a/node_modules/ava/lib/node-arguments.js b/node_modules/ava/lib/node-arguments.js index 0acc4d97ec..ea444cc195 100644 --- a/node_modules/ava/lib/node-arguments.js +++ b/node_modules/ava/lib/node-arguments.js @@ -1,7 +1,8 @@ -'use strict'; -const arrgv = require('arrgv'); +import process from 'node:process'; -function normalizeNodeArguments(fromConf = [], fromArgv = '') { +import arrgv from 'arrgv'; + +export default function normalizeNodeArguments(fromConf = [], fromArgv = '') { let parsedArgv = []; if (fromArgv !== '') { try { @@ -13,5 +14,3 @@ function normalizeNodeArguments(fromConf = [], fromArgv = '') { return [...process.execArgv, ...fromConf, ...parsedArgv]; } - -module.exports = normalizeNodeArguments; diff --git a/node_modules/ava/lib/now-and-timers.js b/node_modules/ava/lib/now-and-timers.cjs similarity index 100% rename from node_modules/ava/lib/now-and-timers.js rename to node_modules/ava/lib/now-and-timers.cjs diff --git a/node_modules/ava/lib/parse-test-args.js b/node_modules/ava/lib/parse-test-args.js index 5ea5f0aa47..a8bba17fa0 100644 --- a/node_modules/ava/lib/parse-test-args.js +++ b/node_modules/ava/lib/parse-test-args.js @@ -1,15 +1,26 @@ -'use strict'; -function parseTestArgs(args) { - const rawTitle = typeof args[0] === 'string' ? args.shift() : undefined; - const receivedImplementationArray = Array.isArray(args[0]); - const implementations = receivedImplementationArray ? args.shift() : args.splice(0, 1); +const buildTitle = (raw, implementation, args) => { + let value = implementation && implementation.title ? implementation.title(raw, ...args) : raw; + const isValid = typeof value === 'string'; + if (isValid) { + value = value.trim().replace(/\s+/g, ' '); + } - const buildTitle = implementation => { - const title = implementation.title ? implementation.title(rawTitle, ...args) : rawTitle; - return {title, isSet: typeof title !== 'undefined', isValid: typeof title === 'string', isEmpty: !title}; + return { + raw, + value, + isSet: value !== undefined, + isValid, + isEmpty: !isValid || value === '', }; +}; - return {args, buildTitle, implementations, rawTitle, receivedImplementationArray}; -} +export default function parseTestArgs(args) { + const rawTitle = typeof args[0] === 'string' ? args.shift() : undefined; + const implementation = args.shift(); -module.exports = parseTestArgs; + return { + args, + implementation: implementation && implementation.exec ? implementation.exec : implementation, + title: buildTitle(rawTitle, implementation, args), + }; +} diff --git a/node_modules/ava/lib/pkg.cjs b/node_modules/ava/lib/pkg.cjs new file mode 100644 index 0000000000..8adecbd96b --- /dev/null +++ b/node_modules/ava/lib/pkg.cjs @@ -0,0 +1,2 @@ +'use strict'; +module.exports = require('../package.json'); diff --git a/node_modules/ava/lib/plugin-support/shared-worker-loader.js b/node_modules/ava/lib/plugin-support/shared-worker-loader.js index 1453f0e39e..2813fe69c8 100644 --- a/node_modules/ava/lib/plugin-support/shared-worker-loader.js +++ b/node_modules/ava/lib/plugin-support/shared-worker-loader.js @@ -1,20 +1,30 @@ -const {EventEmitter, on} = require('events'); -const v8 = require('v8'); -const {workerData, parentPort} = require('worker_threads'); -const pkg = require('../../package.json'); +import {EventEmitter, on} from 'node:events'; +import process from 'node:process'; +import {workerData, parentPort, threadId} from 'node:worker_threads'; -// Used to forward messages received over the `parentPort`. Every subscription -// adds a listener, so do not enforce any maximums. +import pkg from '../pkg.cjs'; + +// Used to forward messages received over the `parentPort` and any direct ports +// to test workers. Every subscription adds a listener, so do not enforce any +// maximums. const events = new EventEmitter().setMaxListeners(0); +const emitMessage = message => { + // Wait for a turn of the event loop, to allow new subscriptions to be + // set up in response to the previous message. + setImmediate(() => events.emit('message', message)); +}; // Map of active test workers, used in receiveMessages() to get a reference to // the TestWorker instance, and relevant release functions. const activeTestWorkers = new Map(); +const internalMessagePort = Symbol('Internal MessagePort'); + class TestWorker { - constructor(id, file) { + constructor(id, file, port) { this.id = id; this.file = file; + this[internalMessagePort] = port; } teardown(fn) { @@ -47,10 +57,10 @@ class TestWorker { } class ReceivedMessage { - constructor(testWorker, id, serializedData) { + constructor(testWorker, id, data) { this.testWorker = testWorker; this.id = id; - this.data = v8.deserialize(new Uint8Array(serializedData)); + this.data = data; } reply(data) { @@ -98,7 +108,7 @@ async function * receiveMessages(fromTestWorker, replyTo) { let received = messageCache.get(message); if (received === undefined) { - received = new ReceivedMessage(active.instance, message.messageId, message.serializedData); + received = new ReceivedMessage(active.instance, message.messageId, message.data); messageCache.set(message, received); } @@ -107,59 +117,47 @@ async function * receiveMessages(fromTestWorker, replyTo) { } let messageCounter = 0; -const messageIdPrefix = `${workerData.id}/message`; +const messageIdPrefix = `${threadId}/message`; const nextMessageId = () => `${messageIdPrefix}/${++messageCounter}`; function publishMessage(testWorker, data, replyTo) { const id = nextMessageId(); - parentPort.postMessage({ + testWorker[internalMessagePort].postMessage({ type: 'message', messageId: id, - testWorkerId: testWorker.id, - serializedData: [...v8.serialize(data)], - replyTo + data, + replyTo, }); return { id, async * replies() { yield * receiveMessages(testWorker, id); - } + }, }; } function broadcastMessage(data) { const id = nextMessageId(); - parentPort.postMessage({ - type: 'broadcast', - messageId: id, - serializedData: [...v8.serialize(data)] - }); + for (const trackedWorker of activeTestWorkers.values()) { + trackedWorker.instance[internalMessagePort].postMessage({ + type: 'message', + messageId: id, + data, + }); + } return { id, async * replies() { yield * receiveMessages(undefined, id); - } + }, }; } async function loadFactory() { - try { - const mod = require(workerData.filename); - if (typeof mod === 'function') { - return mod; - } - - return mod.default; - } catch (error) { - if (error && (error.code === 'ERR_REQUIRE_ESM' || (error.code === 'MODULE_NOT_FOUND' && workerData.filename.startsWith('file://')))) { - const {default: factory} = await import(workerData.filename); // eslint-disable-line node/no-unsupported-features/es-syntax - return factory; - } - - throw error; - } + const {default: factory} = await import(workerData.filename); // eslint-disable-line node/no-unsupported-features/es-syntax + return factory; } let signalAvailable = () => { @@ -175,7 +173,7 @@ loadFactory(workerData.filename).then(factory => { factory({ negotiateProtocol(supported) { - if (!supported.includes('experimental')) { + if (!supported.includes('ava-4')) { fatal = new Error(`This version of AVA (${pkg.version}) is not compatible with shared worker plugin at ${workerData.filename}`); throw fatal; } @@ -184,12 +182,13 @@ loadFactory(workerData.filename).then(factory => { parentPort.on('message', async message => { if (message.type === 'register-test-worker') { - const {id, file} = message; - const instance = new TestWorker(id, file); + const {id, file, port} = message; + const instance = new TestWorker(id, file, port); activeTestWorkers.set(id, {instance, teardownFns: new Set()}); produceTestWorker(instance); + port.on('message', message => emitMessage({testWorkerId: id, ...message})); } if (message.type === 'deregister-test-worker') { @@ -205,18 +204,16 @@ loadFactory(workerData.filename).then(factory => { parentPort.postMessage({ type: 'deregistered-test-worker', - id + id, }); - } - // Wait for a turn of the event loop, to allow new subscriptions to be - // set up in response to the previous message. - setImmediate(() => events.emit('message', message)); + emitMessage(message); + } }); return { initialData: workerData.initialData, - protocol: 'experimental', + protocol: 'ava-4', ready() { signalAvailable(); @@ -235,9 +232,9 @@ loadFactory(workerData.filename).then(factory => { for await (const [worker] of on(events, 'testWorker')) { yield worker; } - } + }, }; - } + }, }); }).catch(error => { if (fatal === undefined) { diff --git a/node_modules/ava/lib/plugin-support/shared-workers.js b/node_modules/ava/lib/plugin-support/shared-workers.js index 5e7ba41e6c..94030ced5b 100644 --- a/node_modules/ava/lib/plugin-support/shared-workers.js +++ b/node_modules/ava/lib/plugin-support/shared-workers.js @@ -1,14 +1,11 @@ -const events = require('events'); -const serializeError = require('../serialize-error'); +import events from 'node:events'; +import {pathToFileURL} from 'node:url'; +import {Worker} from 'node:worker_threads'; -let Worker; -try { - ({Worker} = require('worker_threads')); -} catch {} +import serializeError from '../serialize-error.js'; -const LOADER = require.resolve('./shared-worker-loader'); +const LOADER = new URL('shared-worker-loader.js', import.meta.url); -let sharedWorkerCounter = 0; const launchedWorkers = new Map(); const waitForAvailable = async worker => { @@ -19,30 +16,28 @@ const waitForAvailable = async worker => { } }; -function launchWorker({filename, initialData}) { +function launchWorker(filename, initialData) { if (launchedWorkers.has(filename)) { return launchedWorkers.get(filename); } - const id = `shared-worker/${++sharedWorkerCounter}`; const worker = new Worker(LOADER, { // Ensure the worker crashes for unhandled rejections, rather than allowing undefined behavior. execArgv: ['--unhandled-rejections=strict'], workerData: { filename, - id, - initialData - } + initialData, + }, }); worker.setMaxListeners(0); const launched = { statePromises: { available: waitForAvailable(worker), - error: events.once(worker, 'error').then(([error]) => error) // eslint-disable-line promise/prefer-await-to-then + error: events.once(worker, 'error').then(([error]) => error), }, exited: false, - worker + worker, }; launchedWorkers.set(filename, launched); @@ -53,7 +48,7 @@ function launchWorker({filename, initialData}) { return launched; } -async function observeWorkerProcess(fork, runStatus) { +export async function observeWorkerProcess(fork, runStatus) { let registrationCount = 0; let signalDeregistered; const deregistered = new Promise(resolve => { @@ -66,26 +61,11 @@ async function observeWorkerProcess(fork, runStatus) { } }); - fork.onConnectSharedWorker(async channel => { - const launched = launchWorker(channel); - - const handleChannelMessage = ({messageId, replyTo, serializedData}) => { - launched.worker.postMessage({ - type: 'message', - testWorkerId: fork.forkId, - messageId, - replyTo, - serializedData - }); - }; + fork.onConnectSharedWorker(async ({filename, initialData, port, signalError}) => { + const launched = launchWorker(filename, initialData); const handleWorkerMessage = async message => { - if (message.type === 'broadcast' || (message.type === 'message' && message.testWorkerId === fork.forkId)) { - const {messageId, replyTo, serializedData} = message; - channel.forwardMessageToFork({messageId, replyTo, serializedData}); - } - - if (message.type === 'deregistered-test-worker' && message.id === fork.forkId) { + if (message.type === 'deregistered-test-worker' && message.id === fork.threadId) { launched.worker.off('message', handleWorkerMessage); registrationCount--; @@ -95,35 +75,35 @@ async function observeWorkerProcess(fork, runStatus) { } }; - launched.statePromises.error.then(error => { // eslint-disable-line promise/prefer-await-to-then + launched.statePromises.error.then(error => { signalDeregistered(); launched.worker.off('message', handleWorkerMessage); runStatus.emitStateChange({type: 'shared-worker-error', err: serializeError('Shared worker error', true, error)}); - channel.signalError(); + signalError(); }); try { await launched.statePromises.available; registrationCount++; + + port.postMessage({type: 'ready'}); + launched.worker.postMessage({ type: 'register-test-worker', - id: fork.forkId, - file: fork.file - }); + id: fork.threadId, + file: pathToFileURL(fork.file).toString(), + port, + }, [port]); fork.promise.finally(() => { launched.worker.postMessage({ type: 'deregister-test-worker', - id: fork.forkId + id: fork.threadId, }); - - channel.off('message', handleChannelMessage); }); launched.worker.on('message', handleWorkerMessage); - channel.on('message', handleChannelMessage); - channel.signalReady(); } catch { return; } finally { @@ -136,5 +116,3 @@ async function observeWorkerProcess(fork, runStatus) { return deregistered; } - -exports.observeWorkerProcess = observeWorkerProcess; diff --git a/node_modules/ava/lib/provider-manager.js b/node_modules/ava/lib/provider-manager.js index 5c95c07ff2..c3b7c85d8e 100644 --- a/node_modules/ava/lib/provider-manager.js +++ b/node_modules/ava/lib/provider-manager.js @@ -1,21 +1,21 @@ -const pkg = require('../package.json'); -const globs = require('./globs'); +import * as globs from './globs.js'; +import pkg from './pkg.cjs'; const levels = { - ava3: 1, - pathRewrites: 2 + // As the protocol changes, comparing levels by integer allows AVA to be + // compatible with different versions. Currently there is only one supported + // version, so this is effectively unused. The infrastructure is retained for + // future use. + levelIntegersAreCurrentlyUnused: 0, }; -exports.levels = levels; - const levelsByProtocol = { - 'ava-3': levels.ava3, - 'ava-3.2': levels.pathRewrites + 'ava-3.2': levels.levelIntegersAreCurrentlyUnused, }; -function load(providerModule, projectDir) { +async function load(providerModule, projectDir) { const ava = {version: pkg.version}; - const makeProvider = require(providerModule); + const {default: makeProvider} = await import(providerModule); // eslint-disable-line node/no-unsupported-features/es-syntax let fatal; let level; @@ -37,9 +37,9 @@ function load(providerModule, projectDir) { }, identifier, normalizeGlobPatterns: globs.normalizePatterns, - projectDir + projectDir, }; - } + }, }); if (fatal) { @@ -49,5 +49,11 @@ function load(providerModule, projectDir) { return {...provider, level}; } -exports.babel = projectDir => load('@ava/babel', projectDir); -exports.typescript = projectDir => load('@ava/typescript', projectDir); +const providerManager = { + levels, + async typescript(projectDir) { + return load('@ava/typescript', projectDir); + }, +}; + +export default providerManager; diff --git a/node_modules/ava/lib/reporters/beautify-stack.js b/node_modules/ava/lib/reporters/beautify-stack.js index 1d8a660dcb..cb65eedb54 100644 --- a/node_modules/ava/lib/reporters/beautify-stack.js +++ b/node_modules/ava/lib/reporters/beautify-stack.js @@ -1,16 +1,10 @@ -'use strict'; -const StackUtils = require('stack-utils'); +import StackUtils from 'stack-utils'; const stackUtils = new StackUtils({ ignoredPackages: [ - '@ava/babel', - '@ava/require-precompiled', '@ava/typescript', - 'append-transform', 'ava', - 'empower-core', - 'esm', - 'nyc' + 'nyc', ], internals: [ // AVA internals, which ignoredPackages don't ignore when we run our own unit tests. @@ -20,8 +14,8 @@ const stackUtils = new StackUtils({ /\(internal\/process\/task_queues\.js:\d+:\d+\)$/, /\(internal\/modules\/cjs\/.+?\.js:\d+:\d+\)$/, /async Promise\.all \(index/, - /new Promise \(\)/ - ] + /new Promise \(\)/, + ], }); /* @@ -60,7 +54,7 @@ const stackUtils = new StackUtils({ * Module.runMain (module.js:604:10) * ``` */ -module.exports = stack => { +export default function beautifyStack(stack) { if (!stack) { return []; } @@ -70,4 +64,4 @@ module.exports = stack => { .split('\n') .map(line => line.trim()) .filter(line => line !== ''); -}; +} diff --git a/node_modules/ava/lib/reporters/colors.js b/node_modules/ava/lib/reporters/colors.js index 31d0ec912c..644e897dff 100644 --- a/node_modules/ava/lib/reporters/colors.js +++ b/node_modules/ava/lib/reporters/colors.js @@ -1,17 +1,42 @@ -'use strict'; -const chalk = require('../chalk').get(); +import {chalk} from '../chalk.js'; -module.exports = { - log: chalk.gray, - title: chalk.bold, - error: chalk.red, - skip: chalk.yellow, - todo: chalk.blue, - pass: chalk.green, - duration: chalk.gray.dim, - errorSource: chalk.gray, - errorStack: chalk.gray, - errorStackInternal: chalk.gray.dim, - stack: chalk.red, - information: chalk.magenta +const colors = { + get log() { + return chalk.gray; + }, + get title() { + return chalk.bold; + }, + get error() { + return chalk.red; + }, + get skip() { + return chalk.yellow; + }, + get todo() { + return chalk.blue; + }, + get pass() { + return chalk.green; + }, + get duration() { + return chalk.gray.dim; + }, + get errorSource() { + return chalk.gray; + }, + get errorStack() { + return chalk.gray; + }, + get errorStackInternal() { + return chalk.gray.dim; + }, + get stack() { + return chalk.red; + }, + get information() { + return chalk.magenta; + }, }; + +export default colors; diff --git a/node_modules/ava/lib/reporters/default.js b/node_modules/ava/lib/reporters/default.js index 01e14c8655..bc74d5c02b 100644 --- a/node_modules/ava/lib/reporters/default.js +++ b/node_modules/ava/lib/reporters/default.js @@ -1,25 +1,24 @@ -'use strict'; -const os = require('os'); -const path = require('path'); -const stream = require('stream'); - -const cliCursor = require('cli-cursor'); -const figures = require('figures'); -const indentString = require('indent-string'); -const ora = require('ora'); -const plur = require('plur'); -const prettyMs = require('pretty-ms'); -const trimOffNewlines = require('trim-off-newlines'); - -const chalk = require('../chalk').get(); -const codeExcerpt = require('../code-excerpt'); -const beautifyStack = require('./beautify-stack'); -const colors = require('./colors'); -const formatSerializedError = require('./format-serialized-error'); -const improperUsageMessages = require('./improper-usage-messages'); -const prefixTitle = require('./prefix-title'); - -const nodeInternals = require('stack-utils').nodeInternals(); +import os from 'node:os'; +import path from 'node:path'; +import stream from 'node:stream'; +import {fileURLToPath} from 'node:url'; + +import figures from 'figures'; +import indentString from 'indent-string'; +import plur from 'plur'; +import prettyMs from 'pretty-ms'; +import StackUtils from 'stack-utils'; + +import {chalk} from '../chalk.js'; +import codeExcerpt from '../code-excerpt.js'; + +import beautifyStack from './beautify-stack.js'; +import colors from './colors.js'; +import formatSerializedError from './format-serialized-error.js'; +import improperUsageMessage from './improper-usage-messages.js'; +import prefixTitle from './prefix-title.js'; + +const nodeInternals = StackUtils.nodeInternals(); class LineWriter extends stream.Writable { constructor(dest) { @@ -52,129 +51,48 @@ class LineWriter extends stream.Writable { } } -class LineWriterWithSpinner extends LineWriter { - constructor(dest, spinner) { - super(dest); - - this.lastSpinnerText = ''; - this.spinner = spinner; - } - - _write(chunk, _, callback) { - this.spinner.clear(); - this._writeWithSpinner(chunk.toString('utf8')); - - callback(); - } - - _writev(pieces, callback) { - // Discard the current spinner output. Any lines that were meant to be - // preserved should be rewritten. - this.spinner.clear(); - - const last = pieces.pop(); - for (const piece of pieces) { - this.dest.write(piece.chunk); - } - - this._writeWithSpinner(last.chunk.toString('utf8')); - callback(); - } - - _writeWithSpinner(string) { - if (!this.spinner.isSpinning) { - this.dest.write(string); - return; - } - - this.lastSpinnerText = string; - // Ignore whitespace at the end of the chunk. We're continiously rewriting - // the last line through the spinner. Also be careful to remove the indent - // as the spinner adds its own. - this.spinner.text = string.trimEnd().slice(2); - this.spinner.render(); - } -} - function manageCorking(stream) { - let corked = false; - const cork = () => { - corked = true; - stream.cork(); - }; - - const uncork = () => { - corked = false; - stream.uncork(); - }; - return { - decorateFlushingWriter(fn) { - return function (...args) { - if (corked) { - stream.uncork(); - } - - try { - return fn.apply(this, args); - } finally { - if (corked) { - stream.cork(); - } - } - }; - }, - decorateWriter(fn) { return function (...args) { - cork(); + stream.cork(); try { return fn.apply(this, args); } finally { - uncork(); + stream.uncork(); } }; - } + }, }; } -class Reporter { +export default class Reporter { constructor({ - verbose, + extensions, reportStream, stdStream, projectDir, watching, - spinner, - durationThreshold + durationThreshold, }) { - this.verbose = verbose; + this.extensions = extensions; this.reportStream = reportStream; this.stdStream = stdStream; this.watching = watching; - this.relativeFile = file => path.relative(projectDir, file); + this.relativeFile = file => { + if (file.startsWith('file://')) { + file = fileURLToPath(file); + } - const {decorateWriter, decorateFlushingWriter} = manageCorking(this.reportStream); + return path.relative(projectDir, file); + }; + + const {decorateWriter} = manageCorking(this.reportStream); this.consumeStateChange = decorateWriter(this.consumeStateChange); this.endRun = decorateWriter(this.endRun); - if (this.verbose) { - this.durationThreshold = durationThreshold || 100; - this.spinner = null; - this.clearSpinner = () => {}; - this.lineWriter = new LineWriter(this.reportStream); - } else { - this.spinner = ora({ - isEnabled: true, - color: spinner ? spinner.color : 'gray', - discardStdin: !watching, - hideCursor: false, - spinner: spinner || (process.platform === 'win32' ? 'line' : 'dots'), - stream: reportStream - }); - this.clearSpinner = decorateFlushingWriter(this.spinner.clear.bind(this.spinner)); - this.lineWriter = new LineWriterWithSpinner(this.reportStream, this.spinner); - } + this.durationThreshold = durationThreshold || 100; + this.lineWriter = new LineWriter(this.reportStream); this.reset(); } @@ -198,7 +116,6 @@ class Reporter { this.sharedWorkerErrors = []; this.uncaughtExceptions = []; this.unhandledRejections = []; - this.unsavedSnapshots = []; this.previousFailures = 0; @@ -221,9 +138,10 @@ class Reporter { this.matching = plan.matching; this.previousFailures = plan.previousFailures; this.emptyParallelRun = plan.status.emptyParallelRun; + this.selectionInsights = plan.status.selectionInsights; if (this.watching || plan.files.length > 1) { - this.prefixTitle = (testFile, title) => prefixTitle(plan.filePathPrefix, testFile, title); + this.prefixTitle = (testFile, title) => prefixTitle(this.extensions, plan.filePathPrefix, testFile, title); } this.removePreviousListener = plan.status.on('stateChange', evt => { @@ -234,13 +152,7 @@ class Reporter { this.lineWriter.write(chalk.gray.dim('\u2500'.repeat(this.lineWriter.columns)) + os.EOL); } - if (this.spinner === null) { - this.lineWriter.writeLine(); - } else { - cliCursor.hide(this.reportStream); - this.lineWriter.writeLine(); - this.spinner.start(); - } + this.lineWriter.writeLine(); } consumeStateChange(event) { // eslint-disable-line complexity @@ -296,12 +208,10 @@ class Reporter { this.write(colors.error(`${figures.cross} Internal error`)); } - if (this.verbose) { - this.lineWriter.writeLine(colors.stack(event.err.summary)); - this.lineWriter.writeLine(colors.errorStack(event.err.stack)); - this.lineWriter.writeLine(); - this.lineWriter.writeLine(); - } + this.lineWriter.writeLine(colors.stack(event.err.summary)); + this.lineWriter.writeLine(colors.errorStack(event.err.stack)); + this.lineWriter.writeLine(); + this.lineWriter.writeLine(); break; } @@ -321,7 +231,7 @@ class Reporter { } case 'hook-finished': { - if (this.verbose && event.logs.length > 0) { + if (true && event.logs.length > 0) { this.lineWriter.writeLine(` ${this.prefixTitle(event.testFile, event.title)}`); this.writeLogs(event); } @@ -330,12 +240,10 @@ class Reporter { } case 'selected-test': { - if (this.verbose) { - if (event.skip) { - this.lineWriter.writeLine(colors.skip(`- ${this.prefixTitle(event.testFile, event.title)}`)); - } else if (event.todo) { - this.lineWriter.writeLine(colors.todo(`- ${this.prefixTitle(event.testFile, event.title)}`)); - } + if (event.skip) { + this.lineWriter.writeLine(colors.skip(`- ${this.prefixTitle(event.testFile, event.title)}`)); + } else if (event.todo) { + this.lineWriter.writeLine(colors.todo(`- ${this.prefixTitle(event.testFile, event.title)}`)); } break; @@ -344,29 +252,21 @@ class Reporter { case 'shared-worker-error': { this.sharedWorkerErrors.push(event); - if (this.verbose) { - this.lineWriter.ensureEmptyLine(); - this.lineWriter.writeLine(colors.error(`${figures.cross} Error in shared worker`)); - this.lineWriter.writeLine(); - this.writeErr(event); - } + this.lineWriter.ensureEmptyLine(); + this.lineWriter.writeLine(colors.error(`${figures.cross} Error in shared worker`)); + this.lineWriter.writeLine(); + this.writeErr(event); break; } - case 'snapshot-error': - this.unsavedSnapshots.push(event); - break; - case 'uncaught-exception': { this.uncaughtExceptions.push(event); - if (this.verbose) { - this.lineWriter.ensureEmptyLine(); - this.lineWriter.writeLine(colors.title(`Uncaught exception in ${this.relativeFile(event.testFile)}`)); - this.lineWriter.writeLine(); - this.writeErr(event); - } + this.lineWriter.ensureEmptyLine(); + this.lineWriter.writeLine(colors.title(`Uncaught exception in ${this.relativeFile(event.testFile)}`)); + this.lineWriter.writeLine(); + this.writeErr(event); break; } @@ -374,12 +274,10 @@ class Reporter { case 'unhandled-rejection': { this.unhandledRejections.push(event); - if (this.verbose) { - this.lineWriter.ensureEmptyLine(); - this.lineWriter.writeLine(colors.title(`Unhandled rejection in ${this.relativeFile(event.testFile)}`)); - this.lineWriter.writeLine(); - this.writeErr(event); - } + this.lineWriter.ensureEmptyLine(); + this.lineWriter.writeLine(colors.title(`Unhandled rejection in ${this.relativeFile(event.testFile)}`)); + this.lineWriter.writeLine(); + this.writeErr(event); break; } @@ -389,8 +287,12 @@ class Reporter { this.filesWithoutDeclaredTests.add(event.testFile); } - if (this.verbose && !this.filesWithMissingAvaImports.has(event.testFile)) { - if (event.nonZeroExitCode) { + if (!this.filesWithMissingAvaImports.has(event.testFile)) { + if (event.err) { + this.lineWriter.writeLine(colors.error(`${figures.cross} ${this.relativeFile(event.testFile)} exited due to an error:`)); + this.lineWriter.writeLine(); + this.writeErr(event); + } else if (event.nonZeroExitCode) { this.lineWriter.writeLine(colors.error(`${figures.cross} ${this.relativeFile(event.testFile)} exited with a non-zero exit code: ${event.nonZeroExitCode}`)); } else { this.lineWriter.writeLine(colors.error(`${figures.cross} ${this.relativeFile(event.testFile)} exited due to ${event.signal}`)); @@ -410,7 +312,7 @@ class Reporter { this.filesWithoutMatchedLineNumbers.add(event.testFile); this.lineWriter.writeLine(colors.error(`${figures.cross} Line numbers for ${this.relativeFile(event.testFile)} did not match any tests`)); - } else if (this.verbose && !this.failFastEnabled && fileStats.remainingTests > 0) { + } else if (true && !this.failFastEnabled && fileStats.remainingTests > 0) { this.lineWriter.writeLine(colors.error(`${figures.cross} ${fileStats.remainingTests} ${plur('test', fileStats.remainingTests)} remaining in ${this.relativeFile(event.testFile)}`)); } } @@ -419,9 +321,6 @@ class Reporter { } case 'worker-stderr': { - // Forcibly clear the spinner, writing the chunk corrupts the TTY. - this.clearSpinner(); - this.stdStream.write(event.chunk); // If the chunk does not end with a linebreak, *forcibly* write one to // ensure it remains visible in the TTY. @@ -433,17 +332,10 @@ class Reporter { this.reportStream.write(os.EOL); } - if (this.spinner !== null) { - this.lineWriter.write(this.lineWriter.lastSpinnerText); - } - break; } case 'worker-stdout': { - // Forcibly clear the spinner, writing the chunk corrupts the TTY. - this.clearSpinner(); - this.stdStream.write(event.chunk); // If the chunk does not end with a linebreak, *forcibly* write one to // ensure it remains visible in the TTY. @@ -454,10 +346,6 @@ class Reporter { if (event.chunk[event.chunk.length - 1] !== 0x0A) { this.reportStream.write(os.EOL); } - - if (this.spinner !== null) { - this.lineWriter.write(this.lineWriter.lastSpinnerText); - } } } } @@ -478,11 +366,7 @@ class Reporter { } write(string) { - if (this.verbose) { - this.lineWriter.writeLine(string); - } else { - this.writeWithCounts(string); - } + this.lineWriter.writeLine(string); } writeWithCounts(string) { @@ -529,7 +413,7 @@ class Reporter { writeErr(event) { if (event.err.name === 'TSError' && event.err.object && event.err.object.diagnosticText) { - this.lineWriter.writeLine(colors.errorStack(trimOffNewlines(event.err.object.diagnosticText))); + this.lineWriter.writeLine(colors.errorStack(event.err.object.diagnosticText)); this.lineWriter.writeLine(); return; } @@ -556,13 +440,13 @@ class Reporter { this.lineWriter.writeLine(); } - const message = improperUsageMessages.forError(event.err); + const message = improperUsageMessage(event.err); if (message) { this.lineWriter.writeLine(message); this.lineWriter.writeLine(); } } else if (event.err.nonErrorObject) { - this.lineWriter.writeLine(trimOffNewlines(event.err.formatted)); + this.lineWriter.writeLine(event.err.formatted); this.lineWriter.writeLine(); } else { this.lineWriter.writeLine(event.err.summary); @@ -618,27 +502,15 @@ class Reporter { writeTestSummary(event) { if (event.type === 'hook-failed' || event.type === 'test-failed') { - if (this.verbose) { - this.write(`${colors.error(figures.cross)} ${this.prefixTitle(event.testFile, event.title)} ${colors.error(event.err.message)}`); - } else { - this.write(this.prefixTitle(event.testFile, event.title)); - } + this.write(`${colors.error(figures.cross)} ${this.prefixTitle(event.testFile, event.title)} ${colors.error(event.err.message)}`); } else if (event.knownFailing) { - if (this.verbose) { - this.write(`${colors.error(figures.tick)} ${colors.error(this.prefixTitle(event.testFile, event.title))}`); - } else { - this.write(colors.error(this.prefixTitle(event.testFile, event.title))); - } - } else if (this.verbose) { + this.write(`${colors.error(figures.tick)} ${colors.error(this.prefixTitle(event.testFile, event.title))}`); + } else { const duration = event.duration > this.durationThreshold ? colors.duration(' (' + prettyMs(event.duration) + ')') : ''; this.write(`${colors.pass(figures.tick)} ${this.prefixTitle(event.testFile, event.title)}${duration}`); - } else { - this.write(this.prefixTitle(event.testFile, event.title)); } - if (this.verbose) { - this.writeLogs(event); - } + this.writeLogs(event); } writeFailure(event) { @@ -652,77 +524,51 @@ class Reporter { endRun() {// eslint-disable-line complexity let firstLinePostfix = this.watching ? ` ${chalk.gray.dim(`[${new Date().toLocaleTimeString('en-US', {hour12: false})}]`)}` : ''; - let wroteSomething = false; - if (!this.verbose) { - this.spinner.stop(); - cliCursor.show(this.reportStream); - } else if (this.emptyParallelRun) { + if (this.emptyParallelRun) { this.lineWriter.writeLine('No files tested in this parallel run'); this.lineWriter.writeLine(); return; } - if (!this.stats) { - this.lineWriter.writeLine(colors.error(`${figures.cross} Couldn’t find any files to test` + firstLinePostfix)); + if (this.selectionInsights.ignoredFilterPatternFiles.length > 0) { + this.write(colors.information(`${figures.warning} Paths for additional test files were disregarded:`)); this.lineWriter.writeLine(); - return; - } + for (const pattern of this.selectionInsights.ignoredFilterPatternFiles) { + this.lineWriter.writeLine(chalk.magenta(`* ${pattern}`)); + } - if (this.matching && this.stats.selectedTests === 0) { - this.lineWriter.writeLine(colors.error(`${figures.cross} Couldn’t find any matching tests` + firstLinePostfix)); this.lineWriter.writeLine(); - return; - } - - if (this.verbose) { - this.lineWriter.writeLine(colors.log(figures.line)); + this.write(colors.information('Files starting with underscores are never treated as test files.')); + this.write(colors.information('Files handled by @ava/typescript can only be selected if your configuration already selects them.')); this.lineWriter.writeLine(); - } else { - if (this.filesWithMissingAvaImports.size > 0) { - for (const testFile of this.filesWithMissingAvaImports) { - this.lineWriter.writeLine(colors.error(`${figures.cross} No tests found in ${this.relativeFile(testFile)}, make sure to import "ava" at the top of your test file`) + firstLinePostfix); - firstLinePostfix = ''; - wroteSomething = true; - } - } - - if (this.filesWithoutDeclaredTests.size > 0) { - for (const testFile of this.filesWithoutDeclaredTests) { - if (!this.filesWithMissingAvaImports.has(testFile)) { - this.lineWriter.writeLine(colors.error(`${figures.cross} No tests found in ${this.relativeFile(testFile)}`) + firstLinePostfix); - firstLinePostfix = ''; - wroteSomething = true; - } - } - } + } - if (this.lineNumberErrors.length > 0) { - for (const event of this.lineNumberErrors) { - this.lineWriter.writeLine(colors.information(`${figures.warning} Could not parse ${this.relativeFile(event.testFile)} for line number selection` + firstLinePostfix)); - firstLinePostfix = ''; - wroteSomething = true; + if (this.selectionInsights.selectionCount === 0) { + if (this.selectionInsights.testFileCount === 0) { + this.lineWriter.writeLine(colors.error(`${figures.cross} Couldn’t find any files to test` + firstLinePostfix)); + } else { + const {testFileCount: count} = this.selectionInsights; + this.lineWriter.writeLine(colors.error(`${figures.cross} Based on your configuration, ${count} test ${plur('file was', 'files were', count)} found, but did not match the CLI arguments:` + firstLinePostfix)); + this.lineWriter.writeLine(); + for (const {pattern} of this.selectionInsights.filter) { + this.lineWriter.writeLine(colors.error(`* ${pattern}`)); } } - if (this.filesWithoutMatchedLineNumbers.size > 0) { - for (const testFile of this.filesWithoutMatchedLineNumbers) { - if (!this.filesWithMissingAvaImports.has(testFile) && !this.filesWithoutDeclaredTests.has(testFile)) { - this.lineWriter.writeLine(colors.error(`${figures.cross} Line numbers for ${this.relativeFile(testFile)} did not match any tests`) + firstLinePostfix); - firstLinePostfix = ''; - wroteSomething = true; - } - } - } + this.lineWriter.writeLine(); + return; + } - if (wroteSomething) { - this.lineWriter.writeLine(); - this.lineWriter.writeLine(colors.log(figures.line)); - this.lineWriter.writeLine(); - wroteSomething = false; - } + if (this.matching && this.stats.selectedTests === 0) { + this.lineWriter.writeLine(colors.error(`${figures.cross} Couldn’t find any matching tests` + firstLinePostfix)); + this.lineWriter.writeLine(); + return; } + this.lineWriter.writeLine(colors.log(figures.line)); + this.lineWriter.writeLine(); + if (this.failures.length > 0) { const writeTrailingLines = this.internalErrors.length > 0 || this.sharedWorkerErrors.length > 0 || this.uncaughtExceptions.length > 0 || this.unhandledRejections.length > 0; @@ -732,106 +578,13 @@ class Reporter { if (event !== lastFailure) { this.lineWriter.writeLine(); this.lineWriter.writeLine(); - } else if (!this.verbose && writeTrailingLines) { + } else if (!true && writeTrailingLines) { this.lineWriter.writeLine(); this.lineWriter.writeLine(); } - - wroteSomething = true; - } - - if (this.verbose) { - this.lineWriter.writeLine(colors.log(figures.line)); - this.lineWriter.writeLine(); - } - } - - if (!this.verbose) { - if (this.internalErrors.length > 0) { - const writeTrailingLines = this.sharedWorkerErrors.length > 0 || this.uncaughtExceptions.length > 0 || this.unhandledRejections.length > 0; - - const last = this.internalErrors[this.internalErrors.length - 1]; - for (const event of this.internalErrors) { - if (event.testFile) { - this.lineWriter.writeLine(colors.error(`${figures.cross} Internal error when running ${this.relativeFile(event.testFile)}`)); - } else { - this.lineWriter.writeLine(colors.error(`${figures.cross} Internal error`)); - } - - this.lineWriter.writeLine(colors.stack(event.err.summary)); - this.lineWriter.writeLine(colors.errorStack(event.err.stack)); - if (event !== last || writeTrailingLines) { - this.lineWriter.writeLine(); - this.lineWriter.writeLine(); - this.lineWriter.writeLine(); - } - - wroteSomething = true; - } - } - - if (this.sharedWorkerErrors.length > 0) { - const writeTrailingLines = this.uncaughtExceptions.length > 0 || this.unhandledRejections.length > 0; - - const last = this.sharedWorkerErrors[this.sharedWorkerErrors.length - 1]; - for (const evt of this.sharedWorkerErrors) { - this.lineWriter.writeLine(colors.error(`${figures.cross} Error in shared worker`)); - this.lineWriter.writeLine(); - this.writeErr(evt.err); - if (evt !== last || writeTrailingLines) { - this.lineWriter.writeLine(); - this.lineWriter.writeLine(); - } - - wroteSomething = true; - } - } - - if (this.uncaughtExceptions.length > 0) { - const writeTrailingLines = this.unhandledRejections.length > 0; - - const last = this.uncaughtExceptions[this.uncaughtExceptions.length - 1]; - for (const event of this.uncaughtExceptions) { - this.lineWriter.writeLine(colors.title(`Uncaught exception in ${this.relativeFile(event.testFile)}`)); - this.lineWriter.writeLine(); - this.writeErr(event); - if (event !== last || writeTrailingLines) { - this.lineWriter.writeLine(); - this.lineWriter.writeLine(); - } - - wroteSomething = true; - } - } - - if (this.unhandledRejections.length > 0) { - const last = this.unhandledRejections[this.unhandledRejections.length - 1]; - for (const event of this.unhandledRejections) { - this.lineWriter.writeLine(colors.title(`Unhandled rejection in ${this.relativeFile(event.testFile)}`)); - this.lineWriter.writeLine(); - this.writeErr(event); - if (event !== last) { - this.lineWriter.writeLine(); - this.lineWriter.writeLine(); - } - - wroteSomething = true; - } - } - - if (wroteSomething) { - this.lineWriter.writeLine(colors.log(figures.line)); - this.lineWriter.writeLine(); - } - } - - if (this.unsavedSnapshots.length > 0) { - this.lineWriter.writeLine(colors.title('Could not update snapshots for the following test files:')); - this.lineWriter.writeLine(); - for (const event of this.unsavedSnapshots) { - this.lineWriter.writeLine(`${figures.warning} ${this.relativeFile(event.testFile)}`); } + this.lineWriter.writeLine(colors.log(figures.line)); this.lineWriter.writeLine(); } @@ -853,16 +606,14 @@ class Reporter { } this.lineWriter.writeLine(colors.information(`\`--fail-fast\` is on. ${remaining}.`)); - if (this.verbose) { - this.lineWriter.writeLine(); - } + this.lineWriter.writeLine(); } - if (this.verbose && this.stats.parallelRuns) { + if (this.stats.parallelRuns) { const { currentFileCount, currentIndex, - totalRuns + totalRuns, } = this.stats.parallelRuns; this.lineWriter.writeLine(colors.information(`Ran ${currentFileCount} test ${plur('file', currentFileCount)} out of ${this.stats.files} for job ${currentIndex + 1} of ${totalRuns}`)); this.lineWriter.writeLine(); @@ -879,11 +630,11 @@ class Reporter { } if ( - this.stats.failedHooks === 0 && - this.stats.failedTests === 0 && - this.stats.passedTests > 0 + this.stats.failedHooks === 0 + && this.stats.failedTests === 0 + && this.stats.passedTests > 0 ) { - this.lineWriter.writeLine(colors.pass(`${this.stats.passedTests} ${plur('test', this.stats.passedTests)} passed`) + firstLinePostfix + this.lineWriter.writeLine(colors.pass(`${this.stats.passedTests} ${plur('test', this.stats.passedTests)} passed`) + firstLinePostfix, ); firstLinePostfix = ''; } @@ -917,4 +668,3 @@ class Reporter { } } } -module.exports = Reporter; diff --git a/node_modules/ava/lib/reporters/format-serialized-error.js b/node_modules/ava/lib/reporters/format-serialized-error.js index d9cfe26590..617f658577 100644 --- a/node_modules/ava/lib/reporters/format-serialized-error.js +++ b/node_modules/ava/lib/reporters/format-serialized-error.js @@ -1,27 +1,16 @@ -'use strict'; -const trimOffNewlines = require('trim-off-newlines'); -const chalk = require('../chalk').get(); +export default function formatSerializedError(error) { + const printMessage = error.values.length === 0 + ? Boolean(error.message) + : !error.values[0].label.startsWith(error.message); -function formatSerializedError(error) { - const printMessage = error.values.length === 0 ? - Boolean(error.message) : - !error.values[0].label.startsWith(error.message); - - if (error.statements.length === 0 && error.values.length === 0) { + if (error.values.length === 0) { return {formatted: null, printMessage}; } let formatted = ''; for (const value of error.values) { - formatted += `${value.label}\n\n${trimOffNewlines(value.formatted)}\n\n`; - } - - for (const statement of error.statements) { - formatted += `${statement[0]}\n${chalk.grey('=>')} ${trimOffNewlines(statement[1])}\n\n`; + formatted += `${value.label}\n\n${value.formatted}\n\n`; } - formatted = trimOffNewlines(formatted); - return {formatted, printMessage}; + return {formatted: formatted.trim(), printMessage}; } - -module.exports = formatSerializedError; diff --git a/node_modules/ava/lib/reporters/improper-usage-messages.js b/node_modules/ava/lib/reporters/improper-usage-messages.js index 6cc3276c38..7c66e3ca90 100644 --- a/node_modules/ava/lib/reporters/improper-usage-messages.js +++ b/node_modules/ava/lib/reporters/improper-usage-messages.js @@ -1,8 +1,7 @@ -'use strict'; -const chalk = require('../chalk').get(); -const pkg = require('../../package.json'); +import {chalk} from '../chalk.js'; +import pkg from '../pkg.cjs'; -exports.forError = error => { +export default function buildMessage(error) { if (!error.improperUsage) { return null; } @@ -21,7 +20,7 @@ Visit the following URL for more details: if (assertion === 'snapshot') { const {name, snapPath} = error.improperUsage; - if (name === 'ChecksumError') { + if (name === 'ChecksumError' || name === 'InvalidSnapshotError') { return `The snapshot file is corrupted. File path: ${chalk.yellow(snapPath)} @@ -39,9 +38,9 @@ Please run AVA again with the ${chalk.cyan('--update-snapshots')} flag to upgrad if (name === 'VersionMismatchError') { const {snapVersion, expectedVersion} = error.improperUsage; - const upgradeMessage = snapVersion < expectedVersion ? - `Please run AVA again with the ${chalk.cyan('--update-snapshots')} flag to upgrade.` : - 'You should upgrade AVA.'; + const upgradeMessage = snapVersion < expectedVersion + ? `Please run AVA again with the ${chalk.cyan('--update-snapshots')} flag to upgrade.` + : 'You should upgrade AVA.'; return `The snapshot file is v${snapVersion}, but only v${expectedVersion} is supported. @@ -52,4 +51,4 @@ ${upgradeMessage}`; } return null; -}; +} diff --git a/node_modules/ava/lib/reporters/prefix-title.js b/node_modules/ava/lib/reporters/prefix-title.js index 83636ef027..633531c103 100644 --- a/node_modules/ava/lib/reporters/prefix-title.js +++ b/node_modules/ava/lib/reporters/prefix-title.js @@ -1,21 +1,23 @@ -'use strict'; -const path = require('path'); -const figures = require('figures'); -const chalk = require('../chalk').get(); +import path from 'node:path'; -const SEPERATOR = ' ' + chalk.gray.dim(figures.pointerSmall) + ' '; +import figures from 'figures'; -module.exports = (base, file, title) => { - const prefix = file +import {chalk} from '../chalk.js'; + +const SEPARATOR = ' ' + chalk.gray.dim(figures.pointerSmall) + ' '; + +export default function prefixTitle(extensions, base, file, title) { + const parts = file // Only replace base if it is found at the start of the path .replace(base, (match, offset) => offset === 0 ? '' : match) - .replace(/\.spec/, '') - .replace(/\.test/, '') - .replace(/test-/g, '') - .replace(/\.js$/, '') .split(path.sep) - .filter(p => p !== '__tests__') - .join(SEPERATOR); + .filter(p => p !== '__tests__'); + + const filename = parts.pop() + .replace(/\.spec\./, '.') + .replace(/\.test\./, '.') + .replace(/test-/, '') + .replace(new RegExp(`.(${extensions.join('|')})$`), ''); - return prefix + SEPERATOR + title; -}; + return [...parts, filename, title].join(SEPARATOR); +} diff --git a/node_modules/ava/lib/reporters/tap.js b/node_modules/ava/lib/reporters/tap.js index d3d4a46031..60d2944d78 100644 --- a/node_modules/ava/lib/reporters/tap.js +++ b/node_modules/ava/lib/reporters/tap.js @@ -1,14 +1,13 @@ -'use strict'; -const os = require('os'); -const path = require('path'); +import os from 'node:os'; +import path from 'node:path'; -const plur = require('plur'); -const stripAnsi = require('strip-ansi'); -const supertap = require('supertap'); -const indentString = require('indent-string'); +import indentString from 'indent-string'; +import plur from 'plur'; +import stripAnsi from 'strip-ansi'; +import supertap from 'supertap'; -const beautifyStack = require('./beautify-stack'); -const prefixTitle = require('./prefix-title'); +import beautifyStack from './beautify-stack.js'; +import prefixTitle from './prefix-title.js'; function dumpError(error) { const object = {...error.object}; @@ -30,10 +29,7 @@ function dumpError(error) { } if (error.values.length > 0) { - object.values = error.values.reduce((acc, value) => { // eslint-disable-line unicorn/no-reduce - acc[value.label] = stripAnsi(value.formatted); - return acc; - }, {}); + object.values = Object.fromEntries(error.values.map(({label, formatted}) => [label, stripAnsi(formatted)])); } } @@ -49,10 +45,11 @@ function dumpError(error) { return object; } -class TapReporter { +export default class TapReporter { constructor(options) { this.i = 0; + this.extensions = options.extensions; this.stdStream = options.stdStream; this.reportStream = options.reportStream; @@ -65,7 +62,7 @@ class TapReporter { startRun(plan) { if (plan.files.length > 1) { - this.prefixTitle = (testFile, title) => prefixTitle(plan.filePathPrefix, testFile, title); + this.prefixTitle = (testFile, title) => prefixTitle(this.extensions, plan.filePathPrefix, testFile, title); } plan.status.on('stateChange', evt => this.consumeStateChange(evt)); @@ -80,7 +77,7 @@ class TapReporter { failed: this.stats.failedTests + this.stats.remainingTests, passed: this.stats.passedTests + this.stats.passedKnownFailingTests, skipped: this.stats.skippedTests, - todo: this.stats.todoTests + todo: this.stats.todoTests, }) + os.EOL); if (this.stats.parallelRuns) { @@ -93,7 +90,7 @@ class TapReporter { failed: 0, passed: 0, skipped: 0, - todo: 0 + todo: 0, }) + os.EOL); } } @@ -105,7 +102,7 @@ class TapReporter { index: ++this.i, passed: flags.passed, skip: flags.skip, - todo: flags.todo + todo: flags.todo, }) + os.EOL); } @@ -117,7 +114,7 @@ class TapReporter { index: ++this.i, passed: false, skip: false, - todo: false + todo: false, }) + os.EOL); } @@ -132,11 +129,11 @@ class TapReporter { } writeTimeout(evt) { - const err = new Error(`Exited because no new tests completed within the last ${evt.period}ms of inactivity`); + const error = new Error(`Exited because no new tests completed within the last ${evt.period}ms of inactivity`); for (const [testFile, tests] of evt.pendingTests) { for (const title of tests) { - this.writeTest({testFile, title, err}, {passed: false, todo: false, skip: false}); + this.writeTest({testFile, title, err: error}, {passed: false, todo: false, skip: false}); } } } @@ -168,9 +165,6 @@ class TapReporter { this.writeTest(evt, {passed: false, todo: true, skip: false}); } - break; - case 'snapshot-error': - this.writeComment(evt, {title: 'Could not update snapshots'}); break; case 'stats': this.stats = evt.stats; @@ -219,4 +213,3 @@ class TapReporter { } } } -module.exports = TapReporter; diff --git a/node_modules/ava/lib/run-status.js b/node_modules/ava/lib/run-status.js index 35bbdcbb37..a18f4e1af3 100644 --- a/node_modules/ava/lib/run-status.js +++ b/node_modules/ava/lib/run-status.js @@ -1,17 +1,21 @@ -'use strict'; -const Emittery = require('emittery'); -const cloneDeep = require('lodash/cloneDeep'); +import v8 from 'node:v8'; -class RunStatus extends Emittery { - constructor(files, parallelRuns) { +import Emittery from 'emittery'; + +const copyStats = stats => v8.deserialize(v8.serialize(stats)); + +export default class RunStatus extends Emittery { + constructor(files, parallelRuns, selectionInsights) { super(); this.pendingTests = new Map(); - this.emptyParallelRun = parallelRuns && - parallelRuns.currentFileCount === 0 && - parallelRuns.totalRuns > 1 && - files > 0; + this.emptyParallelRun = parallelRuns + && parallelRuns.currentFileCount === 0 + && parallelRuns.totalRuns > 1 + && files > 0; + + this.selectionInsights = selectionInsights; this.stats = { byFile: new Map(), @@ -32,7 +36,7 @@ class RunStatus extends Emittery { timeouts: 0, todoTests: 0, uncaughtExceptions: 0, - unhandledRejections: 0 + unhandledRejections: 0, }; } @@ -51,7 +55,7 @@ class RunStatus extends Emittery { todoTests: 0, uncaughtExceptions: 0, unhandledRejections: 0, - ...stats + ...stats, }); this.pendingTests.set(testFile, new Set()); @@ -147,7 +151,7 @@ class RunStatus extends Emittery { } if (changedStats) { - this.emit('stateChange', {type: 'stats', stats: cloneDeep(stats)}); + this.emit('stateChange', {type: 'stats', stats: copyStats(stats)}); } this.emit('stateChange', event); @@ -163,15 +167,15 @@ class RunStatus extends Emittery { } if ( - this.stats.declaredTests === 0 || - this.stats.internalErrors > 0 || - this.stats.failedHooks > 0 || - this.stats.failedTests > 0 || - this.stats.failedWorkers > 0 || - this.stats.sharedWorkerErrors > 0 || - this.stats.timeouts > 0 || - this.stats.uncaughtExceptions > 0 || - this.stats.unhandledRejections > 0 + this.stats.declaredTests === 0 + || this.stats.internalErrors > 0 + || this.stats.failedHooks > 0 + || this.stats.failedTests > 0 + || this.stats.failedWorkers > 0 + || this.stats.sharedWorkerErrors > 0 + || this.stats.timeouts > 0 + || this.stats.uncaughtExceptions > 0 + || this.stats.unhandledRejections > 0 ) { return 1; } @@ -194,6 +198,8 @@ class RunStatus extends Emittery { this.pendingTests.get(event.testFile).delete(event.title); } } -} -module.exports = RunStatus; + getFailedTestFiles() { + return [...this.stats.byFile].filter(statByFile => statByFile[1].failedTests).map(statByFile => statByFile[0]); + } +} diff --git a/node_modules/ava/lib/runner.js b/node_modules/ava/lib/runner.js index 1f55774393..11539446ef 100644 --- a/node_modules/ava/lib/runner.js +++ b/node_modules/ava/lib/runner.js @@ -1,14 +1,19 @@ -'use strict'; -const Emittery = require('emittery'); -const matcher = require('matcher'); -const ContextRef = require('./context-ref'); -const createChain = require('./create-chain'); -const parseTestArgs = require('./parse-test-args'); -const snapshotManager = require('./snapshot-manager'); -const serializeError = require('./serialize-error'); -const Runnable = require('./test'); - -class Runner extends Emittery { +import process from 'node:process'; +import {pathToFileURL} from 'node:url'; + +import Emittery from 'emittery'; +import {matcher} from 'matcher'; + +import ContextRef from './context-ref.js'; +import createChain from './create-chain.js'; +import parseTestArgs from './parse-test-args.js'; +import serializeError from './serialize-error.js'; +import {load as loadSnapshots, determineSnapshotDir} from './snapshot-manager.js'; +import Runnable from './test.js'; +import {waitForReady} from './worker/state.cjs'; + +const makeFileURL = file => file.startsWith('file://') ? file : pathToFileURL(file).toString(); +export default class Runner extends Emittery { constructor(options = {}) { super(); @@ -18,21 +23,18 @@ class Runner extends Emittery { this.file = options.file; this.checkSelectedByLineNumbers = options.checkSelectedByLineNumbers; this.match = options.match || []; - this.powerAssert = undefined; // Assigned later. this.projectDir = options.projectDir; this.recordNewSnapshots = options.recordNewSnapshots === true; this.runOnlyExclusive = options.runOnlyExclusive === true; this.serial = options.serial === true; - this.skippingTests = false; this.snapshotDir = options.snapshotDir; this.updateSnapshots = options.updateSnapshots; this.activeRunnables = new Set(); this.boundCompareTestSnapshot = this.compareTestSnapshot.bind(this); - this.skippedSnapshots = false; this.boundSkipSnapshot = this.skipSnapshot.bind(this); this.interrupted = false; - this.snapshots = null; + this.nextTaskIndex = 0; this.tasks = { after: [], @@ -43,9 +45,9 @@ class Runner extends Emittery { beforeEach: [], concurrent: [], serial: [], - todo: [] + todo: [], }; - this.waitForReady = []; + this.waitForReady = waitForReady; const uniqueTestTitles = new Set(); this.registerUniqueTitle = title => { @@ -57,14 +59,21 @@ class Runner extends Emittery { return true; }; + this.notifyTimeoutUpdate = timeoutMs => { + this.emit('stateChange', { + type: 'test-timeout-configured', + period: timeoutMs, + }); + }; + let hasStarted = false; let scheduledStart = false; const meta = Object.freeze({ - file: options.file, + file: makeFileURL(options.file), get snapshotDirectory() { const {file, snapshotDir: fixedLocation, projectDir} = options; - return snapshotManager.determineSnapshotDir({file, fixedLocation, projectDir}); - } + return makeFileURL(determineSnapshotDir({file, fixedLocation, projectDir})); + }, }); this.chain = createChain((metadata, testArgs) => { // eslint-disable-line complexity if (hasStarted) { @@ -81,97 +90,95 @@ class Runner extends Emittery { metadata.taskIndex = this.nextTaskIndex++; - const {args, buildTitle, implementations, rawTitle} = parseTestArgs(testArgs); + const {args, implementation, title} = parseTestArgs(testArgs); if (this.checkSelectedByLineNumbers) { metadata.selected = this.checkSelectedByLineNumbers(); } if (metadata.todo) { - if (implementations.length > 0) { + if (implementation) { throw new TypeError('`todo` tests are not allowed to have an implementation. Use `test.skip()` for tests with an implementation.'); } - if (!rawTitle) { // Either undefined or a string. + if (!title.raw) { // Either undefined or a string. throw new TypeError('`todo` tests require a title'); } - if (!this.registerUniqueTitle(rawTitle)) { - throw new Error(`Duplicate test title: ${rawTitle}`); + if (!this.registerUniqueTitle(title.value)) { + throw new Error(`Duplicate test title: ${title.value}`); } - if (this.match.length > 0) { - // --match selects TODO tests. - if (matcher([rawTitle], this.match).length === 1) { - metadata.exclusive = true; - this.runOnlyExclusive = true; - } + // --match selects TODO tests. + if (this.match.length > 0 && matcher(title.value, this.match).length === 1) { + metadata.exclusive = true; + this.runOnlyExclusive = true; } - this.tasks.todo.push({title: rawTitle, metadata}); + this.tasks.todo.push({title: title.value, metadata}); this.emit('stateChange', { type: 'declared-test', - title: rawTitle, + title: title.value, knownFailing: false, - todo: true + todo: true, }); } else { - if (implementations.length === 0) { + if (!implementation) { throw new TypeError('Expected an implementation. Use `test.todo()` for tests without an implementation.'); } - for (const implementation of implementations) { - let {title, isSet, isValid, isEmpty} = buildTitle(implementation); + if (Array.isArray(implementation)) { + throw new TypeError('AVA 4 no longer supports multiple implementations.'); + } + + if (title.isSet && !title.isValid) { + throw new TypeError('Test & hook titles must be strings'); + } - if (isSet && !isValid) { - throw new TypeError('Test & hook titles must be strings'); + let fallbackTitle = title.value; + if (title.isEmpty) { + if (metadata.type === 'test') { + throw new TypeError('Tests must have a title'); + } else if (metadata.always) { + fallbackTitle = `${metadata.type}.always hook`; + } else { + fallbackTitle = `${metadata.type} hook`; } + } - if (isEmpty) { - if (metadata.type === 'test') { - throw new TypeError('Tests must have a title'); - } else if (metadata.always) { - title = `${metadata.type}.always hook`; - } else { - title = `${metadata.type} hook`; - } + if (metadata.type === 'test' && !this.registerUniqueTitle(title.value)) { + throw new Error(`Duplicate test title: ${title.value}`); + } + + const task = { + title: title.value || fallbackTitle, + implementation, + args, + metadata: {...metadata}, + }; + + if (metadata.type === 'test') { + if (this.match.length > 0) { + // --match overrides .only() + task.metadata.exclusive = matcher(title.value, this.match).length === 1; } - if (metadata.type === 'test' && !this.registerUniqueTitle(title)) { - throw new Error(`Duplicate test title: ${title}`); + if (task.metadata.exclusive) { + this.runOnlyExclusive = true; } - const task = { - title, - implementation, - args, - metadata: {...metadata} - }; + this.tasks[metadata.serial ? 'serial' : 'concurrent'].push(task); - if (metadata.type === 'test') { - if (this.match.length > 0) { - // --match overrides .only() - task.metadata.exclusive = matcher([title], this.match).length === 1; - } - - if (task.metadata.skipped) { - this.skippingTests = true; - } - - if (task.metadata.exclusive) { - this.runOnlyExclusive = true; - } - - this.tasks[metadata.serial ? 'serial' : 'concurrent'].push(task); - this.emit('stateChange', { - type: 'declared-test', - title, - knownFailing: metadata.failing, - todo: false - }); - } else if (!metadata.skipped) { - this.tasks[metadata.type + (metadata.always ? 'Always' : '')].push(task); - } + this.snapshots.touch(title.value, metadata.taskIndex); + + this.emit('stateChange', { + type: 'declared-test', + title: title.value, + knownFailing: metadata.failing, + todo: false, + }); + } else if (!metadata.skipped) { + this.tasks[metadata.type + (metadata.always ? 'Always' : '')].push(task); } } }, { @@ -182,54 +189,43 @@ class Runner extends Emittery { failing: false, callback: false, inline: false, // Set for attempt metadata created by `t.try()` - always: false + always: false, }, meta); } - compareTestSnapshot(options) { - if (!this.snapshots) { - this.snapshots = snapshotManager.load({ - file: this.file, - fixedLocation: this.snapshotDir, - projectDir: this.projectDir, - recordNewSnapshots: this.recordNewSnapshots, - updating: this.updateSnapshots && !this.runOnlyExclusive && !this.skippingTests - }); - this.emit('dependency', this.snapshots.snapPath); + get snapshots() { + if (this._snapshots) { + return this._snapshots; } - return this.snapshots.compare(options); - } + // Lazy load not when the runner is instantiated but when snapshots are + // needed. This should be after the test file has been loaded and source + // maps are available. + const snapshots = loadSnapshots({ + file: this.file, + fixedLocation: this.snapshotDir, + projectDir: this.projectDir, + recordNewSnapshots: this.recordNewSnapshots, + updating: this.updateSnapshots, + }); + if (snapshots.snapPath !== undefined) { + this.emit('dependency', snapshots.snapPath); + } - skipSnapshot() { - this.skippedSnapshots = true; + this._snapshots = snapshots; + return snapshots; } - saveSnapshotState() { - if ( - this.updateSnapshots && - ( - this.runOnlyExclusive || - this.skippingTests || - this.skippedSnapshots - ) - ) { - return {cannotSave: true}; - } - - if (this.snapshots) { - return {touchedFiles: this.snapshots.save()}; - } + compareTestSnapshot(options) { + return this.snapshots.compare(options); + } - if (this.updateSnapshots) { - return {touchedFiles: snapshotManager.cleanSnapshots({ - file: this.file, - fixedLocation: this.snapshotDir, - projectDir: this.projectDir - })}; - } + skipSnapshot(options) { + return this.snapshots.skipSnapshot(options); + } - return {}; + async saveSnapshotState() { + return {touchedFiles: await this.snapshots.save()}; } onRun(runnable) { @@ -240,16 +236,6 @@ class Runner extends Emittery { this.activeRunnables.delete(runnable); } - attributeLeakedError(err) { - for (const runnable of this.activeRunnables) { - if (runnable.attributeLeakedError(err)) { - return true; - } - } - - return false; - } - beforeExitHandler() { for (const runnable of this.activeRunnables) { runnable.finishDueToInactivity(); @@ -269,25 +255,25 @@ class Runner extends Emittery { }; let waitForSerial = Promise.resolve(); - await runnables.reduce((previous, runnable) => { // eslint-disable-line unicorn/no-reduce + await runnables.reduce((previous, runnable) => { // eslint-disable-line unicorn/no-array-reduce if (runnable.metadata.serial || this.serial) { - waitForSerial = previous.then(() => { + waitForSerial = previous.then(() => // Serial runnables run as long as there was no previous failure, unless // the runnable should always be run. - return (allPassed || runnable.metadata.always) && runAndStoreResult(runnable); - }); + (allPassed || runnable.metadata.always) && runAndStoreResult(runnable), + ); return waitForSerial; } return Promise.all([ previous, - waitForSerial.then(() => { + waitForSerial.then(() => // Concurrent runnables are kicked off after the previous serial // runnables have completed, as long as there was no previous failure // (or if the runnable should always be run). One concurrent runnable's // failure does not prevent the next runnable from running. - return (allPassed || runnable.metadata.always) && runAndStoreResult(runnable); - }) + (allPassed || runnable.metadata.always) && runAndStoreResult(runnable), + ), ]); }, waitForSerial); @@ -303,22 +289,22 @@ class Runner extends Emittery { return result; } - async runHooks(tasks, contextRef, {titleSuffix, testPassed, associatedTaskIndex} = {}) { + async runHooks(tasks, contextRef, {titleSuffix, testPassed} = {}) { const hooks = tasks.map(task => new Runnable({ contextRef, experiments: this.experiments, failWithoutAssertions: false, - fn: task.args.length === 0 ? - task.implementation : - t => task.implementation.apply(null, [t].concat(task.args)), + fn: task.args.length === 0 + ? task.implementation + : t => Reflect.apply(task.implementation, null, [t, ...task.args]), compareTestSnapshot: this.boundCompareTestSnapshot, skipSnapshot: this.boundSkipSnapshot, updateSnapshots: this.updateSnapshots, - metadata: {...task.metadata, associatedTaskIndex}, - powerAssert: this.powerAssert, + metadata: task.metadata, title: `${task.title}${titleSuffix || ''}`, isHook: true, - testPassed + testPassed, + notifyTimeoutUpdate: this.notifyTimeoutUpdate, })); const outcome = await this.runMultiple(hooks, this.serial); for (const result of outcome.storedResults) { @@ -327,7 +313,7 @@ class Runner extends Emittery { type: 'hook-finished', title: result.title, duration: result.duration, - logs: result.logs + logs: result.logs, }); } else { this.emit('stateChange', { @@ -335,7 +321,7 @@ class Runner extends Emittery { title: result.title, err: serializeError('Hook failure', true, result.error), duration: result.duration, - logs: result.logs + logs: result.logs, }); } } @@ -350,8 +336,7 @@ class Runner extends Emittery { contextRef, { titleSuffix: hookSuffix, - associatedTaskIndex: task.metadata.taskIndex - } + }, ); let testOk = false; @@ -361,16 +346,16 @@ class Runner extends Emittery { contextRef, experiments: this.experiments, failWithoutAssertions: this.failWithoutAssertions, - fn: task.args.length === 0 ? - task.implementation : - t => task.implementation.apply(null, [t].concat(task.args)), + fn: task.args.length === 0 + ? task.implementation + : t => Reflect.apply(task.implementation, null, [t, ...task.args]), compareTestSnapshot: this.boundCompareTestSnapshot, skipSnapshot: this.boundSkipSnapshot, updateSnapshots: this.updateSnapshots, metadata: task.metadata, - powerAssert: this.powerAssert, title: task.title, - registerUniqueTitle: this.registerUniqueTitle + registerUniqueTitle: this.registerUniqueTitle, + notifyTimeoutUpdate: this.notifyTimeoutUpdate, }); const result = await this.runSingle(test); @@ -382,7 +367,7 @@ class Runner extends Emittery { title: result.title, duration: result.duration, knownFailing: result.metadata.failing, - logs: result.logs + logs: result.logs, }); hooksOk = await this.runHooks( @@ -391,7 +376,6 @@ class Runner extends Emittery { { titleSuffix: hookSuffix, testPassed: testOk, - associatedTaskIndex: task.metadata.taskIndex }); } else { this.emit('stateChange', { @@ -400,7 +384,7 @@ class Runner extends Emittery { err: serializeError('Test failure', true, result.error, this.file), duration: result.duration, knownFailing: result.metadata.failing, - logs: result.logs + logs: result.logs, }); // Don't run `afterEach` hooks if the test failed. } @@ -412,20 +396,21 @@ class Runner extends Emittery { { titleSuffix: hookSuffix, testPassed: testOk, - associatedTaskIndex: task.metadata.taskIndex }); return alwaysOk && hooksOk && testOk; } - async start() { + async start() { // eslint-disable-line complexity const concurrentTests = []; const serialTests = []; for (const task of this.tasks.serial) { if (this.runOnlyExclusive && !task.metadata.exclusive) { + this.snapshots.skipBlock(task.title, task.metadata.taskIndex); continue; } if (this.checkSelectedByLineNumbers && !task.metadata.selected) { + this.snapshots.skipBlock(task.title, task.metadata.taskIndex); continue; } @@ -434,20 +419,24 @@ class Runner extends Emittery { title: task.title, knownFailing: task.metadata.failing, skip: task.metadata.skipped, - todo: false + todo: false, }); - if (!task.metadata.skipped) { + if (task.metadata.skipped) { + this.snapshots.skipBlock(task.title, task.metadata.taskIndex); + } else { serialTests.push(task); } } for (const task of this.tasks.concurrent) { if (this.runOnlyExclusive && !task.metadata.exclusive) { + this.snapshots.skipBlock(task.title, task.metadata.taskIndex); continue; } if (this.checkSelectedByLineNumbers && !task.metadata.selected) { + this.snapshots.skipBlock(task.title, task.metadata.taskIndex); continue; } @@ -456,15 +445,15 @@ class Runner extends Emittery { title: task.title, knownFailing: task.metadata.failing, skip: task.metadata.skipped, - todo: false + todo: false, }); - if (!task.metadata.skipped) { - if (this.serial) { - serialTests.push(task); - } else { - concurrentTests.push(task); - } + if (task.metadata.skipped) { + this.snapshots.skipBlock(task.title, task.metadata.taskIndex); + } else if (this.serial) { + serialTests.push(task); + } else { + concurrentTests.push(task); } } @@ -482,7 +471,7 @@ class Runner extends Emittery { title: task.title, knownFailing: false, skip: false, - todo: true + todo: true, }); } @@ -498,13 +487,13 @@ class Runner extends Emittery { // Note that the hooks and tests always begin running asynchronously. const beforePromise = this.runHooks(this.tasks.before, contextRef); - const serialPromise = beforePromise.then(beforeHooksOk => { // eslint-disable-line promise/prefer-await-to-then + const serialPromise = beforePromise.then(beforeHooksOk => { // Don't run tests if a `before` hook failed. if (!beforeHooksOk) { return false; } - return serialTests.reduce(async (previous, task) => { // eslint-disable-line unicorn/no-reduce + return serialTests.reduce(async (previous, task) => { // eslint-disable-line unicorn/no-array-reduce const previousOk = await previous; // Don't start tests after an interrupt. if (this.interrupted) { @@ -520,7 +509,7 @@ class Runner extends Emittery { return this.runTest(task, contextRef.copy()); }, true); }); - const concurrentPromise = Promise.all([beforePromise, serialPromise]).then(async ([beforeHooksOk, serialOk]) => { // eslint-disable-line promise/prefer-await-to-then + const concurrentPromise = Promise.all([beforePromise, serialPromise]).then(async ([beforeHooksOk, serialOk]) => { // Don't run tests if a `before` hook failed, or if `failFast` is enabled // and a previous serial test failed. if (!beforeHooksOk || (!serialOk && this.failFast)) { @@ -534,9 +523,7 @@ class Runner extends Emittery { // If a concurrent test fails, even if `failFast` is enabled it won't // stop other concurrent tests from running. - const allOkays = await Promise.all(concurrentTests.map(task => { - return this.runTest(task, contextRef.copy()); - })); + const allOkays = await Promise.all(concurrentTests.map(task => this.runTest(task, contextRef.copy()))); return allOkays.every(ok => ok); }); @@ -563,5 +550,3 @@ class Runner extends Emittery { this.interrupted = true; } } - -module.exports = Runner; diff --git a/node_modules/ava/lib/scheduler.js b/node_modules/ava/lib/scheduler.js new file mode 100644 index 0000000000..b64c69225b --- /dev/null +++ b/node_modules/ava/lib/scheduler.js @@ -0,0 +1,53 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +import writeFileAtomic from 'write-file-atomic'; + +import isCi from './is-ci.js'; + +const FILENAME = 'failing-tests.json'; + +const scheduler = { + storeFailedTestFiles(runStatus, cacheDir) { + if (isCi || !cacheDir) { + return; + } + + try { + writeFileAtomic.sync(path.join(cacheDir, FILENAME), JSON.stringify(runStatus.getFailedTestFiles())); + } catch {} + }, + + // Order test-files, so that files with failing tests come first + failingTestsFirst(selectedFiles, cacheDir, cacheEnabled) { + if (isCi || cacheEnabled === false) { + return selectedFiles; + } + + const filePath = path.join(cacheDir, FILENAME); + let failedTestFiles; + try { + failedTestFiles = JSON.parse(fs.readFileSync(filePath)); + } catch { + return selectedFiles; + } + + return [...selectedFiles].sort((f, s) => { + if (failedTestFiles.includes(f) && failedTestFiles.includes(s)) { + return 0; + } + + if (failedTestFiles.includes(f)) { + return -1; + } + + if (failedTestFiles.includes(s)) { + return 1; + } + + return 0; + }); + }, +}; + +export default scheduler; diff --git a/node_modules/ava/lib/serialize-error.js b/node_modules/ava/lib/serialize-error.js index 3a6e240786..13b5ab178e 100644 --- a/node_modules/ava/lib/serialize-error.js +++ b/node_modules/ava/lib/serialize-error.js @@ -1,42 +1,45 @@ -'use strict'; -const path = require('path'); -const cleanYamlObject = require('clean-yaml-object'); -const concordance = require('concordance'); -const isError = require('is-error'); -const slash = require('slash'); -const StackUtils = require('stack-utils'); -const assert = require('./assert'); -const concordanceOptions = require('./concordance-options').default; +import path from 'node:path'; +import process from 'node:process'; +import {fileURLToPath, pathToFileURL} from 'node:url'; + +import cleanYamlObject from 'clean-yaml-object'; +import concordance from 'concordance'; +import isError from 'is-error'; +import StackUtils from 'stack-utils'; + +import {AssertionError} from './assert.js'; +import concordanceOptions from './concordance-options.js'; function isAvaAssertionError(source) { - return source instanceof assert.AssertionError; + return source instanceof AssertionError; } function filter(propertyName, isRoot) { return !isRoot || (propertyName !== 'message' && propertyName !== 'name' && propertyName !== 'stack'); } +function normalizeFile(file, ...base) { + return file.startsWith('file://') ? file : pathToFileURL(path.resolve(...base, file)).toString(); +} + const stackUtils = new StackUtils(); function extractSource(stack, testFile) { if (!stack || !testFile) { return null; } - // Normalize the test file so it matches `callSite.file`. - const relFile = path.relative(process.cwd(), testFile); - const normalizedFile = process.platform === 'win32' ? slash(relFile) : relFile; + testFile = normalizeFile(testFile); + for (const line of stack.split('\n')) { - try { - const callSite = stackUtils.parseLine(line); - if (callSite.file === normalizedFile) { - return { - isDependency: false, - isWithinProject: true, - file: path.resolve(process.cwd(), callSite.file), - line: callSite.line - }; - } - } catch {} + const callSite = stackUtils.parseLine(line); + if (callSite && normalizeFile(callSite.file) === testFile) { + return { + isDependency: false, + isWithinProject: true, + file: testFile, + line: callSite.line, + }; + } } return null; @@ -52,8 +55,8 @@ function buildSource(source) { // directory set to the project directory. const projectDir = process.cwd(); - const file = path.resolve(projectDir, source.file.trim()); - const rel = path.relative(projectDir, file); + const file = normalizeFile(source.file.trim(), projectDir); + const rel = path.relative(projectDir, fileURLToPath(file)); const [segment] = rel.split(path.sep); const isWithinProject = segment !== '..' && (process.platform !== 'win32' || !segment.includes(':')); @@ -63,60 +66,59 @@ function buildSource(source) { isDependency, isWithinProject, file, - line: source.line + line: source.line, }; } -function trySerializeError(err, shouldBeautifyStack, testFile) { - const stack = err.savedError ? err.savedError.stack : err.stack; +function trySerializeError(error, shouldBeautifyStack, testFile) { + const stack = error.savedError ? error.savedError.stack : error.stack; const retval = { - avaAssertionError: isAvaAssertionError(err), + avaAssertionError: isAvaAssertionError(error), nonErrorObject: false, source: extractSource(stack, testFile), stack, - shouldBeautifyStack + shouldBeautifyStack, }; - if (err.actualStack) { - retval.stack = err.actualStack; + if (error.actualStack) { + retval.stack = error.actualStack; } if (retval.avaAssertionError) { - retval.improperUsage = err.improperUsage; - retval.message = err.message; - retval.name = err.name; - retval.statements = err.statements; - retval.values = err.values; - - if (err.fixedSource) { - const source = buildSource(err.fixedSource); + retval.improperUsage = error.improperUsage; + retval.message = error.message; + retval.name = error.name; + retval.values = error.values; + + if (error.fixedSource) { + const source = buildSource(error.fixedSource); if (source) { retval.source = source; } } - if (err.assertion) { - retval.assertion = err.assertion; + if (error.assertion) { + retval.assertion = error.assertion; } - if (err.operator) { - retval.operator = err.operator; + if (error.operator) { + retval.operator = error.operator; } } else { - retval.object = cleanYamlObject(err, filter); // Cleanly copy non-standard properties - if (typeof err.message === 'string') { - retval.message = err.message; + retval.object = cleanYamlObject(error, filter); // Cleanly copy non-standard properties + if (typeof error.message === 'string') { + retval.message = error.message; } - if (typeof err.name === 'string') { - retval.name = err.name; + if (typeof error.name === 'string') { + retval.name = error.name; } } - if (typeof err.stack === 'string') { - const lines = err.stack.split('\n'); - if (err.name === 'SyntaxError' && !lines[0].startsWith('SyntaxError')) { + if (typeof error.stack === 'string') { + const lines = error.stack.split('\n'); + if (error.name === 'SyntaxError' && !lines[0].startsWith('SyntaxError')) { retval.summary = ''; for (const line of lines) { retval.summary += line + '\n'; @@ -127,11 +129,8 @@ function trySerializeError(err, shouldBeautifyStack, testFile) { retval.summary = retval.summary.trim(); } else { - // Skip the source line header inserted by `esm`: - // - const start = lines.findIndex(line => !/:\d+$/.test(line)); retval.summary = ''; - for (let index = start; index < lines.length; index++) { + for (let index = 0; index < lines.length; index++) { if (lines[index].startsWith(' at')) { break; } @@ -146,17 +145,17 @@ function trySerializeError(err, shouldBeautifyStack, testFile) { return retval; } -function serializeError(origin, shouldBeautifyStack, err, testFile) { - if (!isError(err)) { +export default function serializeError(origin, shouldBeautifyStack, error, testFile) { + if (!isError(error)) { return { avaAssertionError: false, nonErrorObject: true, - formatted: concordance.formatDescriptor(concordance.describe(err, concordanceOptions), concordanceOptions) + formatted: concordance.formatDescriptor(concordance.describe(error, concordanceOptions), concordanceOptions), }; } try { - return trySerializeError(err, shouldBeautifyStack, testFile); + return trySerializeError(error, shouldBeautifyStack, testFile); } catch { const replacement = new Error(`${origin}: Could not serialize error`); return { @@ -165,9 +164,7 @@ function serializeError(origin, shouldBeautifyStack, err, testFile) { name: replacement.name, message: replacement.message, stack: replacement.stack, - summary: replacement.message + summary: replacement.message, }; } } - -module.exports = serializeError; diff --git a/node_modules/ava/lib/snapshot-manager.js b/node_modules/ava/lib/snapshot-manager.js index 5e19b16099..3e3b4b89d2 100644 --- a/node_modules/ava/lib/snapshot-manager.js +++ b/node_modules/ava/lib/snapshot-manager.js @@ -1,24 +1,24 @@ -'use strict'; - -const crypto = require('crypto'); -const fs = require('fs'); -const path = require('path'); -const zlib = require('zlib'); - -const concordance = require('concordance'); -const indentString = require('indent-string'); -const md5Hex = require('md5-hex'); -const convertSourceMap = require('convert-source-map'); -const slash = require('slash'); -const writeFileAtomic = require('write-file-atomic'); -const mem = require('mem'); - -const concordanceOptions = require('./concordance-options').snapshotManager; +import {Buffer} from 'node:buffer'; +import crypto from 'node:crypto'; +import fs from 'node:fs'; +import {findSourceMap} from 'node:module'; +import path from 'node:path'; +import {fileURLToPath} from 'node:url'; +import zlib from 'node:zlib'; + +import cbor from 'cbor'; +import concordance from 'concordance'; +import indentString from 'indent-string'; +import mem from 'mem'; +import slash from 'slash'; +import writeFileAtomic from 'write-file-atomic'; + +import {snapshotManager as concordanceOptions} from './concordance-options.js'; // Increment if encoding layout or Concordance serialization versions change. Previous AVA versions will not be able to // decode buffers generated by a newer version, so changing this value will require a major version bump of AVA itself. // The version is encoded as an unsigned 16 bit integer. -const VERSION = 2; +const VERSION = 3; const VERSION_HEADER = Buffer.alloc(2); VERSION_HEADER.writeUInt16LE(VERSION); @@ -28,26 +28,24 @@ const READABLE_PREFIX = Buffer.from(`AVA Snapshot v${VERSION}\n`, 'ascii'); const REPORT_SEPARATOR = Buffer.from('\n\n', 'ascii'); const REPORT_TRAILING_NEWLINE = Buffer.from('\n', 'ascii'); -const MD5_HASH_LENGTH = 16; +const SHA_256_HASH_LENGTH = 32; -class SnapshotError extends Error { +export class SnapshotError extends Error { constructor(message, snapPath) { super(message); this.name = 'SnapshotError'; this.snapPath = snapPath; } } -exports.SnapshotError = SnapshotError; -class ChecksumError extends SnapshotError { +export class ChecksumError extends SnapshotError { constructor(snapPath) { super('Checksum mismatch', snapPath); this.name = 'ChecksumError'; } } -exports.ChecksumError = ChecksumError; -class VersionMismatchError extends SnapshotError { +export class VersionMismatchError extends SnapshotError { constructor(snapPath, version) { super('Unexpected snapshot version', snapPath); this.name = 'VersionMismatchError'; @@ -55,20 +53,25 @@ class VersionMismatchError extends SnapshotError { this.expectedVersion = VERSION; } } -exports.VersionMismatchError = VersionMismatchError; + +export class InvalidSnapshotError extends SnapshotError { + constructor(snapPath) { + super('Invalid snapshot file', snapPath); + this.name = 'InvalidSnapshotError'; + } +} const LEGACY_SNAPSHOT_HEADER = Buffer.from('// Jest Snapshot v1'); function isLegacySnapshot(buffer) { return LEGACY_SNAPSHOT_HEADER.equals(buffer.slice(0, LEGACY_SNAPSHOT_HEADER.byteLength)); } -class LegacyError extends SnapshotError { +export class LegacyError extends SnapshotError { constructor(snapPath) { super('Legacy snapshot file', snapPath); this.name = 'LegacyError'; } } -exports.LegacyError = LegacyError; function tryRead(file) { try { @@ -82,168 +85,117 @@ function tryRead(file) { } } -function withoutLineEndings(buffer) { - let checkPosition = buffer.byteLength - 1; - while (buffer[checkPosition] === 0x0A || buffer[checkPosition] === 0x0D) { - checkPosition--; - } +function formatEntry(snapshot, index) { + const { + data, + label = `Snapshot ${index + 1}`, // Human-readable labels start counting at 1. + } = snapshot; - return buffer.slice(0, checkPosition + 1); -} + const description = data + ? concordance.formatDescriptor(concordance.deserialize(data), concordanceOptions) + : ''; -function formatEntry(label, descriptor) { - if (label) { - label = `> ${label}\n\n`; - } + const blockquote = label.split(/\n/).map(line => '> ' + line).join('\n'); - const codeBlock = indentString(concordance.formatDescriptor(descriptor, concordanceOptions), 4); - return Buffer.from(label + codeBlock, 'utf8'); + return `${blockquote}\n\n${indentString(description, 4)}`; } -function combineEntries(entries) { - const buffers = []; - let byteLength = 0; +function combineEntries({blocks}) { + const combined = new BufferBuilder(); - const sortedKeys = [...entries.keys()].sort((keyA, keyB) => { - const [a, b] = [entries.get(keyA), entries.get(keyB)]; - const taskDifference = a.taskIndex - b.taskIndex; + for (const {title, snapshots} of blocks) { + const last = snapshots[snapshots.length - 1]; + combined.write(`\n\n## ${title}\n\n`); - if (taskDifference !== 0) { - return taskDifference; - } - - const [assocA, assocB] = [a.associatedTaskIndex, b.associatedTaskIndex]; - if (assocA !== undefined && assocB !== undefined) { - const assocDifference = assocA - assocB; + for (const [index, snapshot] of snapshots.entries()) { + combined.write(formatEntry(snapshot, index)); - if (assocDifference !== 0) { - return assocDifference; - } - } - - return a.snapIndex - b.snapIndex; - }); - - for (const key of sortedKeys) { - const keyBuffer = Buffer.from(`\n\n## ${key}\n\n`, 'utf8'); - buffers.push(keyBuffer); - byteLength += keyBuffer.byteLength; - - const formattedEntries = entries.get(key).buffers; - const last = formattedEntries[formattedEntries.length - 1]; - for (const entry of formattedEntries) { - buffers.push(entry); - byteLength += entry.byteLength; - - if (entry !== last) { - buffers.push(REPORT_SEPARATOR); - byteLength += REPORT_SEPARATOR.byteLength; + if (snapshot !== last) { + combined.write(REPORT_SEPARATOR); } } } - return {buffers, byteLength}; + return combined; } -function generateReport(relFile, snapFile, entries) { - const combined = combineEntries(entries); - const {buffers} = combined; - let {byteLength} = combined; - - const header = Buffer.from(`# Snapshot report for \`${slash(relFile)}\` +function generateReport(relFile, snapFile, snapshots) { + return new BufferBuilder() + .write(`# Snapshot report for \`${slash(relFile)}\` The actual snapshot is saved in \`${snapFile}\`. -Generated by [AVA](https://avajs.dev).`, 'utf8'); - buffers.unshift(header); - byteLength += header.byteLength; - - buffers.push(REPORT_TRAILING_NEWLINE); - byteLength += REPORT_TRAILING_NEWLINE.byteLength; - return Buffer.concat(buffers, byteLength); +Generated by [AVA](https://avajs.dev).`) + .append(combineEntries(snapshots)) + .write(REPORT_TRAILING_NEWLINE) + .toBuffer(); } -function appendReportEntries(existingReport, entries) { - const combined = combineEntries(entries); - const {buffers} = combined; - let {byteLength} = combined; - - const prepend = withoutLineEndings(existingReport); - buffers.unshift(prepend); - byteLength += prepend.byteLength; +class BufferBuilder { + constructor() { + this.buffers = []; + this.byteOffset = 0; + } - buffers.push(REPORT_TRAILING_NEWLINE); - byteLength += REPORT_TRAILING_NEWLINE.byteLength; - return Buffer.concat(buffers, byteLength); -} + append(builder) { + this.buffers.push(...builder.buffers); + this.byteOffset += builder.byteOffset; + return this; + } -function encodeSnapshots(buffersByHash) { - const buffers = []; - let byteOffset = 0; - - // Entry start and end pointers are relative to the header length. This means - // it's possible to append new entries to an existing snapshot file, without - // having to rewrite pointers for existing entries. - const headerLength = Buffer.alloc(4); - buffers.push(headerLength); - byteOffset += 4; - - // Allows 65535 hashes (tests or identified snapshots) per file. - const numberHashes = Buffer.alloc(2); - numberHashes.writeUInt16LE(buffersByHash.size); - buffers.push(numberHashes); - byteOffset += 2; - - const entries = []; - // Maps can't have duplicate keys, so all items in [...buffersByHash.keys()] - // are unique, so sortedHashes should be deterministic. - const sortedHashes = [...buffersByHash.keys()].sort(); - const sortedBuffersByHash = [...sortedHashes.map(hash => [hash, buffersByHash.get(hash)])]; - for (const [hash, snapshotBuffers] of sortedBuffersByHash) { - buffers.push(Buffer.from(hash, 'hex')); - byteOffset += MD5_HASH_LENGTH; - - // Allows 65535 snapshots per hash. - const numberSnapshots = Buffer.alloc(2); - numberSnapshots.writeUInt16LE(snapshotBuffers.length, 0); - buffers.push(numberSnapshots); - byteOffset += 2; - - for (const value of snapshotBuffers) { - // Each pointer is 32 bits, restricting the total, uncompressed buffer to - // 4 GiB. - const start = Buffer.alloc(4); - const end = Buffer.alloc(4); - entries.push({start, end, value}); - - buffers.push(start, end); - byteOffset += 8; + write(data) { + if (typeof data === 'string') { + this.write(Buffer.from(data, 'utf8')); + } else { + this.buffers.push(data); + this.byteOffset += data.byteLength; } - } - headerLength.writeUInt32LE(byteOffset, 0); + return this; + } - let bodyOffset = 0; - for (const entry of entries) { - const start = bodyOffset; - const end = bodyOffset + entry.value.byteLength; - entry.start.writeUInt32LE(start, 0); - entry.end.writeUInt32LE(end, 0); - buffers.push(entry.value); - bodyOffset = end; + toBuffer() { + return Buffer.concat(this.buffers, this.byteOffset); } +} + +function sortBlocks(blocksByTitle, blockIndices) { + return [...blocksByTitle].sort( + ([aTitle], [bTitle]) => { + const a = blockIndices.get(aTitle); + const b = blockIndices.get(bTitle); + + if (a === undefined) { + if (b === undefined) { + return 0; + } - byteOffset += bodyOffset; + return 1; + } + + if (b === undefined) { + return -1; + } - const compressed = zlib.gzipSync(Buffer.concat(buffers, byteOffset)); + return a - b; + }, + ); +} + +async function encodeSnapshots(snapshotData) { + const encoded = await cbor.encodeAsync(snapshotData, { + omitUndefinedProperties: true, + canonical: true, + }); + const compressed = zlib.gzipSync(encoded); compressed[9] = 0x03; // Override the GZip header containing the OS to always be Linux - const md5sum = crypto.createHash('md5').update(compressed).digest(); + const sha256sum = crypto.createHash('sha256').update(compressed).digest(); return Buffer.concat([ READABLE_PREFIX, VERSION_HEADER, - md5sum, - compressed - ], READABLE_PREFIX.byteLength + VERSION_HEADER.byteLength + MD5_HASH_LENGTH + compressed.byteLength); + sha256sum, + compressed, + ], READABLE_PREFIX.byteLength + VERSION_HEADER.byteLength + SHA_256_HASH_LENGTH + compressed.byteLength); } function decodeSnapshots(buffer, snapPath) { @@ -253,182 +205,207 @@ function decodeSnapshots(buffer, snapPath) { // The version starts after the readable prefix, which is ended by a newline // byte (0x0A). - const versionOffset = buffer.indexOf(0x0A) + 1; + const newline = buffer.indexOf(0x0A); + if (newline === -1) { + throw new InvalidSnapshotError(snapPath); + } + + const versionOffset = newline + 1; const version = buffer.readUInt16LE(versionOffset); if (version !== VERSION) { throw new VersionMismatchError(snapPath, version); } - const md5sumOffset = versionOffset + 2; - const compressedOffset = md5sumOffset + MD5_HASH_LENGTH; + const sha256sumOffset = versionOffset + 2; + const compressedOffset = sha256sumOffset + SHA_256_HASH_LENGTH; const compressed = buffer.slice(compressedOffset); - const md5sum = crypto.createHash('md5').update(compressed).digest(); - const expectedSum = buffer.slice(md5sumOffset, compressedOffset); - if (!md5sum.equals(expectedSum)) { + const sha256sum = crypto.createHash('sha256').update(compressed).digest(); + const expectedSum = buffer.slice(sha256sumOffset, compressedOffset); + if (!sha256sum.equals(expectedSum)) { throw new ChecksumError(snapPath); } const decompressed = zlib.gunzipSync(compressed); - let byteOffset = 0; - - const headerLength = decompressed.readUInt32LE(byteOffset); - byteOffset += 4; - - const snapshotsByHash = new Map(); - const numberHashes = decompressed.readUInt16LE(byteOffset); - byteOffset += 2; - - for (let count = 0; count < numberHashes; count++) { - const hash = decompressed.toString('hex', byteOffset, byteOffset + MD5_HASH_LENGTH); - byteOffset += MD5_HASH_LENGTH; - - const numberSnapshots = decompressed.readUInt16LE(byteOffset); - byteOffset += 2; - - const snapshotsBuffers = new Array(numberSnapshots); - for (let index = 0; index < numberSnapshots; index++) { - const start = decompressed.readUInt32LE(byteOffset) + headerLength; - byteOffset += 4; - const end = decompressed.readUInt32LE(byteOffset) + headerLength; - byteOffset += 4; - snapshotsBuffers[index] = decompressed.slice(start, end); - } - - // Allow for new entries to be appended to an existing header, which could - // lead to the same hash being present multiple times. - if (snapshotsByHash.has(hash)) { - snapshotsByHash.set(hash, snapshotsByHash.get(hash).concat(snapshotsBuffers)); - } else { - snapshotsByHash.set(hash, snapshotsBuffers); - } - } - - return snapshotsByHash; + return cbor.decode(decompressed); } class Manager { constructor(options) { - this.appendOnly = options.appendOnly; this.dir = options.dir; this.recordNewSnapshots = options.recordNewSnapshots; + this.updating = options.updating; this.relFile = options.relFile; this.reportFile = options.reportFile; + this.reportPath = options.reportPath; this.snapFile = options.snapFile; this.snapPath = options.snapPath; - this.snapshotsByHash = options.snapshotsByHash; + this.oldBlocksByTitle = options.oldBlocksByTitle; + this.newBlocksByTitle = options.newBlocksByTitle; + this.blockIndices = new Map(); + this.error = options.error; this.hasChanges = false; - this.reportEntries = new Map(); + } + + touch(title, taskIndex) { + this.blockIndices.set(title, taskIndex); } compare(options) { - const hash = md5Hex(options.belongsTo); - const entries = this.snapshotsByHash.get(hash) || []; - const snapshotBuffer = entries[options.index]; + if (this.error) { + throw this.error; + } - if (!snapshotBuffer) { + const block = this.newBlocksByTitle.get(options.belongsTo); + + const snapshot = block && block.snapshots[options.index]; + const data = snapshot && snapshot.data; + + if (!data) { if (!this.recordNewSnapshots) { return {pass: false}; } if (options.deferRecording) { - const record = this.deferRecord(hash, options); + const record = this.deferRecord(options); return {pass: true, record}; } - this.record(hash, options); + this.record(options); return {pass: true}; } - const actual = concordance.deserialize(snapshotBuffer, concordanceOptions); + const actual = concordance.deserialize(data, concordanceOptions); const expected = concordance.describe(options.expected, concordanceOptions); const pass = concordance.compareDescriptors(actual, expected); return {actual, expected, pass}; } - deferRecord(hash, options) { - const descriptor = concordance.describe(options.expected, concordanceOptions); - const snapshot = concordance.serialize(descriptor); - const entry = formatEntry(options.label, descriptor); - const {taskIndex, snapIndex, associatedTaskIndex} = options; + recordSerialized({data, label, belongsTo, index}) { + let block = this.newBlocksByTitle.get(belongsTo); + if (!block) { + block = {snapshots: []}; + } - return () => { // Must be called in order! - this.hasChanges = true; + const {snapshots} = block; - let snapshots = this.snapshotsByHash.get(hash); - if (!snapshots) { - snapshots = []; - this.snapshotsByHash.set(hash, snapshots); + if (index > snapshots.length) { + throw new RangeError(`Cannot record snapshot ${index} for ${JSON.stringify(belongsTo)}, exceeds expected index of ${snapshots.length}`); + } else if (index < snapshots.length) { + if (snapshots[index].data) { + throw new RangeError(`Cannot record snapshot ${index} for ${JSON.stringify(belongsTo)}, already exists`); } - if (options.index > snapshots.length) { - throw new RangeError(`Cannot record snapshot ${options.index} for ${JSON.stringify(options.belongsTo)}, exceeds expected index of ${snapshots.length}`); - } + snapshots[index] = {data, label}; + } else { + snapshots.push({data, label}); + } - if (options.index < snapshots.length) { - throw new RangeError(`Cannot record snapshot ${options.index} for ${JSON.stringify(options.belongsTo)}, already exists`); - } + this.newBlocksByTitle.set(belongsTo, block); + } - snapshots.push(snapshot); + deferRecord(options) { + const {expected, belongsTo, label, index} = options; + const descriptor = concordance.describe(expected, concordanceOptions); + const data = concordance.serialize(descriptor); - if (this.reportEntries.has(options.belongsTo)) { - this.reportEntries.get(options.belongsTo).buffers.push(entry); - } else { - this.reportEntries.set(options.belongsTo, {buffers: [entry], taskIndex, snapIndex, associatedTaskIndex}); - } + return () => { // Must be called in order! + this.hasChanges = true; + this.recordSerialized({data, label, belongsTo, index}); }; } - record(hash, options) { - const record = this.deferRecord(hash, options); + record(options) { + const record = this.deferRecord(options); record(); } - save() { + skipBlock(title) { + const block = this.oldBlocksByTitle.get(title); + + if (block) { + this.newBlocksByTitle.set(title, block); + } + } + + skipSnapshot({belongsTo, index, deferRecording}) { + const oldBlock = this.oldBlocksByTitle.get(belongsTo); + let snapshot = oldBlock && oldBlock.snapshots[index]; + + if (!snapshot) { + snapshot = {}; + } + + // Retain the label from the old snapshot, so as not to assume that the + // snapshot.skip() arguments are well-formed. + + // Defer recording if called in a try(). + if (deferRecording) { + return () => { // Must be called in order! + this.recordSerialized({belongsTo, index, ...snapshot}); + }; + } + + this.recordSerialized({belongsTo, index, ...snapshot}); + } + + async save() { + const {dir, relFile, snapFile, snapPath, reportPath} = this; + + if (this.updating && this.newBlocksByTitle.size === 0) { + return { + changedFiles: [cleanFile(snapPath), cleanFile(reportPath)].flat(), + temporaryFiles: [], + }; + } + if (!this.hasChanges) { return null; } - const {snapPath} = this; - const buffer = encodeSnapshots(this.snapshotsByHash); + const snapshots = { + blocks: sortBlocks(this.newBlocksByTitle, this.blockIndices).map( + ([title, block]) => ({title, ...block}), + ), + }; - const reportPath = path.join(this.dir, this.reportFile); - const existingReport = this.appendOnly ? tryRead(reportPath) : null; - const reportBuffer = existingReport ? - appendReportEntries(existingReport, this.reportEntries) : - generateReport(this.relFile, this.snapFile, this.reportEntries); + const buffer = await encodeSnapshots(snapshots); + const reportBuffer = generateReport(relFile, snapFile, snapshots); - fs.mkdirSync(this.dir, {recursive: true}); + await fs.promises.mkdir(dir, {recursive: true}); - const paths = [snapPath, reportPath]; - const tmpfileCreated = tmpfile => paths.push(tmpfile); - writeFileAtomic.sync(snapPath, buffer, {tmpfileCreated}); - writeFileAtomic.sync(reportPath, reportBuffer, {tmpfileCreated}); - return paths; + const temporaryFiles = []; + const tmpfileCreated = file => temporaryFiles.push(file); + await Promise.all([ + writeFileAtomic(snapPath, buffer, {tmpfileCreated}), + writeFileAtomic(reportPath, reportBuffer, {tmpfileCreated}), + ]); + return { + changedFiles: [snapPath, reportPath], + temporaryFiles, + }; } } const resolveSourceFile = mem(file => { - const testDir = path.dirname(file); - const buffer = tryRead(file); - if (!buffer) { - return file; // Assume the file is stubbed in our test suite. + const sourceMap = findSourceMap(file); + if (sourceMap === undefined) { + return file; } - const source = buffer.toString(); - const converter = convertSourceMap.fromSource(source) || convertSourceMap.fromMapFileSource(source, testDir); - if (converter) { - const map = converter.toObject(); - const firstSource = `${map.sourceRoot || ''}${map.sources[0]}`; - return path.resolve(testDir, firstSource); + const {payload} = sourceMap; + if (payload.sources.length === 0) { // Hypothetical? + return file; } - return file; + return payload.sources[0].startsWith('file://') + ? fileURLToPath(payload.sources[0]) + : payload.sources[0]; }); -const determineSnapshotDir = mem(({file, fixedLocation, projectDir}) => { +export const determineSnapshotDir = mem(({file, fixedLocation, projectDir}) => { const testDir = path.dirname(resolveSourceFile(file)); if (fixedLocation) { const relativeTestLocation = path.relative(projectDir, testDir); @@ -447,8 +424,6 @@ const determineSnapshotDir = mem(({file, fixedLocation, projectDir}) => { return testDir; }, {cacheKey: ([{file}]) => file}); -exports.determineSnapshotDir = determineSnapshotDir; - function determineSnapshotPaths({file, fixedLocation, projectDir}) { const dir = determineSnapshotDir({file, fixedLocation, projectDir}); const relFile = path.relative(projectDir, resolveSourceFile(file)); @@ -460,7 +435,9 @@ function determineSnapshotPaths({file, fixedLocation, projectDir}) { dir, relFile, snapFile, - reportFile + reportFile, + snapPath: path.join(dir, snapFile), + reportPath: path.join(dir, reportFile), }; } @@ -477,45 +454,52 @@ function cleanFile(file) { } } -// Remove snapshot and report if they exist. Returns an array containing the -// paths of the touched files. -function cleanSnapshots({file, fixedLocation, projectDir}) { - const {dir, snapFile, reportFile} = determineSnapshotPaths({file, fixedLocation, projectDir}); +export function load({file, fixedLocation, projectDir, recordNewSnapshots, updating}) { + // Keep runner unit tests that use `new Runner()` happy + if (file === undefined || projectDir === undefined) { + return new Manager({ + recordNewSnapshots, + updating, + oldBlocksByTitle: new Map(), + newBlocksByTitle: new Map(), + }); + } - return [ - ...cleanFile(path.join(dir, snapFile)), - ...cleanFile(path.join(dir, reportFile)) - ]; -} + const paths = determineSnapshotPaths({file, fixedLocation, projectDir}); + const buffer = tryRead(paths.snapPath); -exports.cleanSnapshots = cleanSnapshots; + if (!buffer) { + return new Manager({ + recordNewSnapshots, + updating, + ...paths, + oldBlocksByTitle: new Map(), + newBlocksByTitle: new Map(), + }); + } -function load({file, fixedLocation, projectDir, recordNewSnapshots, updating}) { - const {dir, relFile, snapFile, reportFile} = determineSnapshotPaths({file, fixedLocation, projectDir}); - const snapPath = path.join(dir, snapFile); + let blocksByTitle; + let snapshotError; - let appendOnly = !updating; - let snapshotsByHash; + try { + const data = decodeSnapshots(buffer, paths.snapPath); + blocksByTitle = new Map(data.blocks.map(({title, ...block}) => [title, block])); + } catch (error) { + blocksByTitle = new Map(); - if (!updating) { - const buffer = tryRead(snapPath); - if (buffer) { - snapshotsByHash = decodeSnapshots(buffer, snapPath); - } else { - appendOnly = false; + if (!updating) { // Discard all decoding errors when updating snapshots + snapshotError = error instanceof SnapshotError + ? error + : new InvalidSnapshotError(paths.snapPath); } } return new Manager({ - appendOnly, - dir, recordNewSnapshots, - relFile, - reportFile, - snapFile, - snapPath, - snapshotsByHash: snapshotsByHash || new Map() + updating, + ...paths, + oldBlocksByTitle: blocksByTitle, + newBlocksByTitle: updating ? new Map() : blocksByTitle, + error: snapshotError, }); } - -exports.load = load; diff --git a/node_modules/ava/lib/test.js b/node_modules/ava/lib/test.js index 866590d17c..7c10ca1af6 100644 --- a/node_modules/ava/lib/test.js +++ b/node_modules/ava/lib/test.js @@ -1,11 +1,11 @@ -'use strict'; -const concordance = require('concordance'); -const isPromise = require('is-promise'); -const plur = require('plur'); -const assert = require('./assert'); -const nowAndTimers = require('./now-and-timers'); -const parseTestArgs = require('./parse-test-args'); -const concordanceOptions = require('./concordance-options').default; +import concordance from 'concordance'; +import isPromise from 'is-promise'; +import plur from 'plur'; + +import {AssertionError, Assertions, checkAssertionMessage} from './assert.js'; +import concordanceOptions from './concordance-options.js'; +import nowAndTimers from './now-and-timers.cjs'; +import parseTestArgs from './parse-test-args.js'; function formatErrorValue(label, error) { const formatted = concordance.format(error, concordanceOptions); @@ -15,13 +15,13 @@ function formatErrorValue(label, error) { const captureSavedError = () => { const limitBefore = Error.stackTraceLimit; Error.stackTraceLimit = 1; - const err = new Error(); + const error = new Error(); // eslint-disable-line unicorn/error-message Error.stackTraceLimit = limitBefore; - return err; + return error; }; const testMap = new WeakMap(); -class ExecutionContext extends assert.Assertions { +class ExecutionContext extends Assertions { constructor(test) { super({ pass: () => { @@ -30,18 +30,15 @@ class ExecutionContext extends assert.Assertions { pending: promise => { test.addPendingAssertion(promise); }, - fail: err => { - test.addFailedAssertion(err); + fail: error => { + test.addFailedAssertion(error); }, skip: () => { test.countPassedAssertion(); }, - compareWithSnapshot: options => { - return test.compareWithSnapshot(options); - }, - powerAssert: test.powerAssert, + compareWithSnapshot: options => test.compareWithSnapshot(options), experiments: test.experiments, - disableSnapshots: test.isHook === true + disableSnapshots: test.isHook === true, }); testMap.set(this, test); @@ -50,11 +47,9 @@ class ExecutionContext extends assert.Assertions { }; this.log = (...inputArgs) => { - const args = inputArgs.map(value => { - return typeof value === 'string' ? - value : - concordance.format(value, concordanceOptions); - }); + const args = inputArgs.map(value => typeof value === 'string' + ? value + : concordance.format(value, concordanceOptions)); if (args.length > 0) { test.addLog(args.join(' ')); } @@ -81,97 +76,87 @@ class ExecutionContext extends assert.Assertions { throw error; } - const {args, buildTitle, implementations, receivedImplementationArray} = parseTestArgs(attemptArgs); + const {args, implementation, title} = parseTestArgs(attemptArgs); - if (implementations.length === 0) { + if (!implementation) { throw new TypeError('Expected an implementation.'); } - const attemptPromises = implementations.map((implementation, index) => { - let {title, isSet, isValid, isEmpty} = buildTitle(implementation); + if (Array.isArray(implementation)) { + throw new TypeError('AVA 4 no longer supports t.try() with multiple implementations.'); + } - if (!isSet || isEmpty) { - title = `${test.title} ─ attempt ${test.attemptCount + 1 + index}`; - } else if (isValid) { - title = `${test.title} ─ ${title}`; - } else { - throw new TypeError('`t.try()` titles must be strings'); // Throw synchronously! - } + let attemptTitle; + if (!title.isSet || title.isEmpty) { + attemptTitle = `${test.title} ─ attempt ${test.attemptCount + 1}`; + } else if (title.isValid) { + attemptTitle = `${test.title} ─ ${title.value}`; + } else { + throw new TypeError('`t.try()` titles must be strings'); + } - if (!test.registerUniqueTitle(title)) { - throw new Error(`Duplicate test title: ${title}`); - } + if (!test.registerUniqueTitle(attemptTitle)) { + throw new Error(`Duplicate test title: ${attemptTitle}`); + } + + let committed = false; + let discarded = false; - return {implementation, title}; - }).map(async ({implementation, title}) => { - let committed = false; - let discarded = false; - - const {assertCount, deferredSnapshotRecordings, errors, logs, passed, snapshotCount, startingSnapshotCount} = await test.runAttempt(title, t => implementation(t, ...args)); - - return { - errors, - logs: [...logs], // Don't allow modification of logs. - passed, - title, - commit: ({retainLogs = true} = {}) => { - if (committed) { - return; - } - - if (discarded) { - test.saveFirstError(new Error('Can’t commit a result that was previously discarded')); - return; - } - - committed = true; - test.finishAttempt({ - assertCount, - commit: true, - deferredSnapshotRecordings, - errors, - logs, - passed, - retainLogs, - snapshotCount, - startingSnapshotCount - }); - }, - discard: ({retainLogs = false} = {}) => { - if (committed) { - test.saveFirstError(new Error('Can’t discard a result that was previously committed')); - return; - } - - if (discarded) { - return; - } - - discarded = true; - test.finishAttempt({ - assertCount: 0, - commit: false, - deferredSnapshotRecordings, - errors, - logs, - passed, - retainLogs, - snapshotCount, - startingSnapshotCount - }); + const {assertCount, deferredSnapshotRecordings, errors, logs, passed, snapshotCount, startingSnapshotCount} = await test.runAttempt(attemptTitle, t => implementation(t, ...args)); + + return { + errors, + logs: [...logs], // Don't allow modification of logs. + passed, + title: attemptTitle, + commit: ({retainLogs = true} = {}) => { + if (committed) { + return; } - }; - }); - const results = await Promise.all(attemptPromises); - return receivedImplementationArray ? results : results[0]; - }; - } + if (discarded) { + test.saveFirstError(new Error('Can’t commit a result that was previously discarded')); + return; + } + + committed = true; + test.finishAttempt({ + assertCount, + commit: true, + deferredSnapshotRecordings, + errors, + logs, + passed, + retainLogs, + snapshotCount, + startingSnapshotCount, + }); + }, + discard: ({retainLogs = false} = {}) => { + if (committed) { + test.saveFirstError(new Error('Can’t discard a result that was previously committed')); + return; + } - get end() { - const end = testMap.get(this).bindEndCallback(); - const endFn = error => end(error, captureSavedError()); - return endFn; + if (discarded) { + return; + } + + discarded = true; + test.finishAttempt({ + assertCount: 0, + commit: false, + deferredSnapshotRecordings, + errors, + logs, + passed, + retainLogs, + snapshotCount, + startingSnapshotCount, + }); + }, + }; + }; } get title() { @@ -190,17 +175,9 @@ class ExecutionContext extends assert.Assertions { const test = testMap.get(this); return test.isHook ? test.testPassed : !test.assertError; } - - _throwsArgStart(assertion, file, line) { - testMap.get(this).trackThrows({assertion, file, line}); - } - - _throwsArgEnd() { - testMap.get(this).trackThrows(null); - } } -class Test { +export default class Test { constructor(options) { this.contextRef = options.contextRef; this.experiments = options.experiments || {}; @@ -208,12 +185,12 @@ class Test { this.fn = options.fn; this.isHook = options.isHook === true; this.metadata = options.metadata; - this.powerAssert = options.powerAssert; this.title = options.title; this.testPassed = options.testPassed; this.registerUniqueTitle = options.registerUniqueTitle; this.logs = []; this.teardowns = []; + this.notifyTimeoutUpdate = options.notifyTimeoutUpdate; const {snapshotBelongsTo = this.title, nextSnapshotIndex = 0} = options; this.snapshotBelongsTo = snapshotBelongsTo; @@ -222,24 +199,20 @@ class Test { const deferRecording = this.metadata.inline; this.deferredSnapshotRecordings = []; - this.compareWithSnapshot = ({expected, id, message}) => { + this.compareWithSnapshot = ({expected, message}) => { this.snapshotCount++; - // TODO: In a breaking change, reject non-undefined, falsy IDs and messages. - const belongsTo = id || snapshotBelongsTo; - const index = id ? 0 : this.nextSnapshotIndex++; - const label = id ? '' : message || `Snapshot ${index + 1}`; // Human-readable labels start counting at 1. + const belongsTo = snapshotBelongsTo; + const index = this.nextSnapshotIndex++; + const label = message; - const {taskIndex, associatedTaskIndex} = this.metadata; const {record, ...result} = options.compareTestSnapshot({ belongsTo, deferRecording, expected, index, label, - taskIndex, - snapIndex: this.snapshotCount, - associatedTaskIndex + taskIndex: this.metadata.taskIndex, }); if (record) { this.deferredSnapshotRecordings.push(record); @@ -250,16 +223,20 @@ class Test { this.skipSnapshot = () => { if (typeof options.skipSnapshot === 'function') { - options.skipSnapshot(); + const record = options.skipSnapshot({ + belongsTo: snapshotBelongsTo, + index: this.nextSnapshotIndex, + deferRecording, + taskIndex: this.metadata.taskIndex, + }); + if (record) { + this.deferredSnapshotRecordings.push(record); + } } - if (options.updateSnapshots) { - this.addFailedAssertion(new Error('Snapshot assertions cannot be skipped when updating snapshots')); - } else { - this.nextSnapshotIndex++; - this.snapshotCount++; - this.countPassedAssertion(); - } + this.nextSnapshotIndex++; + this.snapshotCount++; + this.countPassedAssertion(); }; this.runAttempt = async (title, fn) => { @@ -274,11 +251,11 @@ class Test { const attempt = new Test({ ...options, fn, - metadata: {...options.metadata, callback: false, failing: false, inline: true}, + metadata: {...options.metadata, failing: false, inline: true}, contextRef: contextRef.copy(), snapshotBelongsTo, nextSnapshotIndex, - title + title, }); const {deferredSnapshotRecordings, error, logs, passed, assertCount, snapshotCount} = await attempt.run(); @@ -291,53 +268,17 @@ class Test { this.attemptCount = 0; this.calledEnd = false; this.duration = null; - this.endCallbackFinisher = null; - this.finishDueToAttributedError = null; this.finishDueToInactivity = null; this.finishDueToTimeout = null; this.finishing = false; this.pendingAssertionCount = 0; this.pendingAttemptCount = 0; - this.pendingThrowsAssertion = null; this.planCount = null; this.startedAt = 0; this.timeoutMs = 0; this.timeoutTimer = null; } - bindEndCallback() { - if (this.metadata.callback) { - return (error, savedError) => { - this.endCallback(error, savedError); - }; - } - - const error_ = this.metadata.inline ? new Error('`t.end()` is not supported inside `t.try()`') : new Error('`t.end()` is not supported in this context. To use `t.end()` as a callback, you must use "callback mode" via `test.cb(testName, fn)`'); - throw error_; - } - - endCallback(error, savedError) { - if (this.calledEnd) { - this.saveFirstError(new Error('`t.end()` called more than once')); - return; - } - - this.calledEnd = true; - - if (error) { - this.saveFirstError(new assert.AssertionError({ - actual: error, - message: 'Callback called with an error', - savedError, - values: [formatErrorValue('Callback called with an error:', error)] - })); - } - - if (this.endCallbackFinisher) { - this.endCallbackFinisher(); - } - } - createExecutionContext() { return new ExecutionContext(this); } @@ -374,7 +315,7 @@ class Test { promise .catch(error => this.saveFirstError(error)) - .then(() => { // eslint-disable-line promise/prefer-await-to-then + .then(() => { this.pendingAssertionCount--; this.refreshTimeout(); }); @@ -451,7 +392,7 @@ class Test { } timeout(ms, message) { - const result = assert.checkAssertionMessage('timeout', message); + const result = checkAssertionMessage('timeout', message); if (result !== true) { this.saveFirstError(result); // Allow the timeout to be set even when the message is invalid. @@ -471,6 +412,8 @@ class Test { this.finishDueToTimeout(); } }, ms); + + this.notifyTimeoutUpdate(this.timeoutMs); } refreshTimeout() { @@ -509,11 +452,7 @@ class Test { } async runTeardowns() { - const teardowns = [...this.teardowns]; - - if (this.experiments.reverseTeardowns) { - teardowns.reverse(); - } + const teardowns = [...this.teardowns].reverse(); for (const teardown of teardowns) { try { @@ -526,11 +465,11 @@ class Test { verifyPlan() { if (!this.assertError && this.planCount !== null && this.planCount !== this.assertCount) { - this.saveFirstError(new assert.AssertionError({ + this.saveFirstError(new AssertionError({ assertion: 'plan', message: `Planned for ${this.planCount} ${plur('assertion', this.planCount)}, but got ${this.assertCount}.`, operator: '===', - savedError: this.planError + savedError: this.planError, })); } } @@ -561,70 +500,16 @@ class Test { } } - trackThrows(pending) { - this.pendingThrowsAssertion = pending; - } - - detectImproperThrows(error) { - if (!this.pendingThrowsAssertion) { - return false; - } - - const pending = this.pendingThrowsAssertion; - this.pendingThrowsAssertion = null; - - const values = []; - if (error) { - values.push(formatErrorValue(`The following error was thrown, possibly before \`t.${pending.assertion}()\` could be called:`, error)); - } - - this.saveFirstError(new assert.AssertionError({ - assertion: pending.assertion, - fixedSource: {file: pending.file, line: pending.line}, - improperUsage: true, - message: `Improper usage of \`t.${pending.assertion}()\` detected`, - savedError: error instanceof Error && error, - values - })); - return true; - } - - waitForPendingThrowsAssertion() { - return new Promise(resolve => { - this.finishDueToAttributedError = () => { - resolve(this.finish()); - }; - - this.finishDueToInactivity = () => { - this.detectImproperThrows(); - resolve(this.finish()); - }; - - // Wait up to a second to see if an error can be attributed to the - // pending assertion. - nowAndTimers.setTimeout(() => this.finishDueToInactivity(), 1000).unref(); - }); - } - - attributeLeakedError(error) { - if (!this.detectImproperThrows(error)) { - return false; - } - - this.finishDueToAttributedError(); - return true; - } - callFn() { try { return { ok: true, - retval: this.fn.call(null, this.createExecutionContext()) + retval: this.fn.call(null, this.createExecutionContext()), }; } catch (error) { return { ok: false, - error + error, }; } } @@ -634,13 +519,11 @@ class Test { const result = this.callFn(); if (!result.ok) { - if (!this.detectImproperThrows(result.error)) { - this.saveFirstError(new assert.AssertionError({ - message: 'Error thrown in test', - savedError: result.error instanceof Error && result.error, - values: [formatErrorValue('Error thrown in test:', result.error)] - })); - } + this.saveFirstError(new AssertionError({ + message: 'Error thrown in test', + savedError: result.error instanceof Error && result.error, + values: [formatErrorValue('Error thrown in test:', result.error)], + })); return this.finish(); } @@ -653,7 +536,7 @@ class Test { promise = new Promise((resolve, reject) => { result.retval.subscribe({ error: reject, - complete: () => resolve() + complete: () => resolve(), }); }); } else if (returnedPromise) { @@ -661,37 +544,6 @@ class Test { promise = Promise.resolve(result.retval); } - if (this.metadata.callback) { - if (returnedObservable || returnedPromise) { - const asyncType = returnedObservable ? 'observables' : 'promises'; - this.saveFirstError(new Error(`Do not return ${asyncType} from tests declared via \`test.cb(…)\`. Use \`test.cb(…)\` for legacy callback APIs. When using promises, observables or async functions, use \`test(…)\`.`)); - return this.finish(); - } - - if (this.calledEnd) { - return this.finish(); - } - - return new Promise(resolve => { - this.endCallbackFinisher = () => { - resolve(this.finish()); - }; - - this.finishDueToAttributedError = () => { - resolve(this.finish()); - }; - - this.finishDueToTimeout = () => { - resolve(this.finish()); - }; - - this.finishDueToInactivity = () => { - this.saveFirstError(new Error('`t.end()` was never called')); - resolve(this.finish()); - }; - }); - } - if (promise) { return new Promise(resolve => { this.finishDueToAttributedError = () => { @@ -703,24 +555,22 @@ class Test { }; this.finishDueToInactivity = () => { - const error = returnedObservable ? - new Error('Observable returned by test never completed') : - new Error('Promise returned by test never resolved'); + const error = returnedObservable + ? new Error('Observable returned by test never completed') + : new Error('Promise returned by test never resolved'); this.saveFirstError(error); resolve(this.finish()); }; promise .catch(error => { - if (!this.detectImproperThrows(error)) { - this.saveFirstError(new assert.AssertionError({ - message: 'Rejected promise returned by test', - savedError: error instanceof Error && error, - values: [formatErrorValue('Rejected promise returned by test. Reason:', error)] - })); - } + this.saveFirstError(new AssertionError({ + message: 'Rejected promise returned by test', + savedError: error instanceof Error && error, + values: [formatErrorValue('Rejected promise returned by test. Reason:', error)], + })); }) - .then(() => resolve(this.finish())); // eslint-disable-line promise/prefer-await-to-then + .then(() => resolve(this.finish())); }); } @@ -730,10 +580,6 @@ class Test { async finish() { this.finishing = true; - if (!this.assertError && this.pendingThrowsAssertion) { - return this.waitForPendingThrowsAssertion(); - } - this.clearTimeout(); this.verifyPlan(); this.verifyAssertions(); @@ -759,9 +605,7 @@ class Test { passed, snapshotCount: this.snapshotCount, assertCount: this.assertCount, - title: this.title + title: this.title, }; } } - -module.exports = Test; diff --git a/node_modules/ava/lib/watcher.js b/node_modules/ava/lib/watcher.js index 6c6511f1df..58d59e2452 100644 --- a/node_modules/ava/lib/watcher.js +++ b/node_modules/ava/lib/watcher.js @@ -1,18 +1,26 @@ -'use strict'; -const nodePath = require('path'); -const debug = require('debug')('ava:watcher'); -const chokidar = require('chokidar'); -const diff = require('lodash/difference'); -const flatten = require('lodash/flatten'); -const chalk = require('./chalk').get(); -const {applyTestFileFilter, classify, getChokidarIgnorePatterns} = require('./globs'); -const {levels: providerLevels} = require('./provider-manager'); - -function rethrowAsync(err) { +import nodePath from 'node:path'; + +import chokidar_ from 'chokidar'; +import createDebug from 'debug'; + +import {chalk} from './chalk.js'; +import {applyTestFileFilter, classify, getChokidarIgnorePatterns} from './globs.js'; + +let chokidar = chokidar_; +export function _testOnlyReplaceChokidar(replacement) { + chokidar = replacement; +} + +let debug = createDebug('ava:watcher'); +export function _testOnlyReplaceDebug(replacement) { + debug = replacement('ava:watcher'); +} + +function rethrowAsync(error) { // Don't swallow exceptions. Note that any // expected error should already have been logged setImmediate(() => { - throw err; + throw error; }); } @@ -77,7 +85,7 @@ class TestDependency { } } -class Watcher { +export default class Watcher { constructor({api, filter = [], globs, projectDir, providers, reporter}) { this.debouncer = new Debouncer(this); @@ -88,7 +96,7 @@ class Watcher { const patternFilters = filter.map(({pattern}) => pattern); - this.providers = providers.filter(({level}) => level >= providerLevels.pathRewrites); + this.providers = providers; this.run = (specificFiles = [], updateSnapshots = false) => { const clearLogOnNextRun = this.clearLogOnNextRun && this.runVector > 0; if (this.runVector > 0) { @@ -104,12 +112,18 @@ class Watcher { if (runOnlyExclusive) { // The test files that previously contained exclusive tests are always // run, together with the remaining specific files. - const remainingFiles = diff(specificFiles, exclusiveFiles); - specificFiles = this.filesWithExclusiveTests.concat(remainingFiles); + const remainingFiles = specificFiles.filter(file => !exclusiveFiles.includes(file)); + specificFiles = [...this.filesWithExclusiveTests, ...remainingFiles]; } if (filter.length > 0) { - specificFiles = applyTestFileFilter({cwd: projectDir, filter: patternFilters, testFiles: specificFiles}); + specificFiles = applyTestFileFilter({ + cwd: projectDir, + expandDirectories: false, + filter: patternFilters, + testFiles: specificFiles, + treatFilterPatternsAsFiles: false, + }); } this.pruneFailures(specificFiles); @@ -125,21 +139,21 @@ class Watcher { previousFailures: this.sumPreviousFailures(this.runVector), runOnlyExclusive, runVector: this.runVector, - updateSnapshots: updateSnapshots === true - } + updateSnapshots: updateSnapshots === true, + }, }) - .then(runStatus => { // eslint-disable-line promise/prefer-await-to-then + .then(runStatus => { reporter.endRun(); reporter.lineWriter.writeLine(END_MESSAGE); if (this.clearLogOnNextRun && ( - runStatus.stats.failedHooks > 0 || - runStatus.stats.failedTests > 0 || - runStatus.stats.failedWorkers > 0 || - runStatus.stats.internalErrors > 0 || - runStatus.stats.timeouts > 0 || - runStatus.stats.uncaughtExceptions > 0 || - runStatus.stats.unhandledRejections > 0 + runStatus.stats.failedHooks > 0 + || runStatus.stats.failedTests > 0 + || runStatus.stats.failedWorkers > 0 + || runStatus.stats.internalErrors > 0 + || runStatus.stats.timeouts > 0 + || runStatus.stats.uncaughtExceptions > 0 + || runStatus.stats.unhandledRejections > 0 )) { this.clearLogOnNextRun = false; } @@ -150,6 +164,7 @@ class Watcher { this.testDependencies = []; this.trackTestDependencies(api); + this.temporaryFiles = new Set(); this.touchedFiles = new Set(); this.trackTouchedFiles(api); @@ -168,7 +183,7 @@ class Watcher { chokidar.watch(['**/*'], { cwd: this.globs.cwd, ignored: getChokidarIgnorePatterns(this.globs), - ignoreInitial: true + ignoreInitial: true, }).on('all', (event, path) => { if (event === 'add' || event === 'change' || event === 'unlink') { debug('Detected %s of %s', event, path); @@ -231,9 +246,13 @@ class Watcher { return; } - for (const file of evt.files) { + for (const file of evt.files.changedFiles) { this.touchedFiles.add(file); } + + for (const file of evt.files.temporaryFiles) { + this.temporaryFiles.add(file); + } }); }); } @@ -307,7 +326,7 @@ class Watcher { this.filesWithFailures.push({ file, vector, - count: 1 + count: 1, }); } } @@ -379,6 +398,14 @@ class Watcher { return false; } + // Unlike touched files, temporary files are never cleared. We may see + // adds and unlinks detected separately, so we track the temporary files + // as long as AVA is running. + if (this.temporaryFiles.has(path)) { + debug('Ignoring known temporary file %s', path); + return false; + } + return true; }); @@ -394,21 +421,23 @@ class Watcher { } const dirtyHelpersAndSources = []; - const dirtyTests = []; + const addedOrChangedTests = []; + const unlinkedTests = []; for (const filePath of dirtyPaths) { const {isIgnoredByWatcher, isTest} = classify(filePath, this.globs); if (!isIgnoredByWatcher) { if (isTest) { - dirtyTests.push(filePath); + if (dirtyStates[filePath] === 'unlink') { + unlinkedTests.push(filePath); + } else { + addedOrChangedTests.push(filePath); + } } else { dirtyHelpersAndSources.push(filePath); } } } - const addedOrChangedTests = dirtyTests.filter(path => dirtyStates[path] !== 'unlink'); - const unlinkedTests = diff(dirtyTests, addedOrChangedTests); - this.cleanUnlinkedTests(unlinkedTests); // No need to rerun tests if the only change is that tests were deleted @@ -423,12 +452,10 @@ class Watcher { } // Try to find tests that depend on the changed source files - const testsByHelpersOrSource = dirtyHelpersAndSources.map(path => { - return this.testDependencies.filter(dep => dep.contains(path)).map(dep => { - debug('%s is a dependency of %s', path, dep.file); - return dep.file; - }); - }, this).filter(tests => tests.length > 0); + const testsByHelpersOrSource = dirtyHelpersAndSources.map(path => this.testDependencies.filter(dep => dep.contains(path)).map(dep => { + debug('%s is a dependency of %s', path, dep.file); + return dep.file; + })).filter(tests => tests.length > 0); // Rerun all tests if source files were changed that could not be traced to // specific tests @@ -440,8 +467,6 @@ class Watcher { } // Run all affected tests - this.run([...new Set(addedOrChangedTests.concat(flatten(testsByHelpersOrSource)))]); + this.run([...new Set([addedOrChangedTests, testsByHelpersOrSource].flat(2))]); } } - -module.exports = Watcher; diff --git a/node_modules/ava/lib/worker/base.js b/node_modules/ava/lib/worker/base.js new file mode 100644 index 0000000000..e62e30eb49 --- /dev/null +++ b/node_modules/ava/lib/worker/base.js @@ -0,0 +1,208 @@ +import {createRequire} from 'node:module'; +import process from 'node:process'; +import {pathToFileURL} from 'node:url'; +import {workerData} from 'node:worker_threads'; + +import setUpCurrentlyUnhandled from 'currently-unhandled'; + +import {set as setChalk} from '../chalk.js'; +import nowAndTimers from '../now-and-timers.cjs'; +import providerManager from '../provider-manager.js'; +import Runner from '../runner.js'; +import serializeError from '../serialize-error.js'; + +import channel from './channel.cjs'; +import dependencyTracking from './dependency-tracker.js'; +import lineNumberSelection from './line-numbers.js'; +import {set as setOptions} from './options.cjs'; +import {flags, refs, sharedWorkerTeardowns} from './state.cjs'; +import {isRunningInThread, isRunningInChildProcess} from './utils.cjs'; + +const currentlyUnhandled = setUpCurrentlyUnhandled(); + +const run = async options => { + setOptions(options); + setChalk(options.chalkOptions); + + if (options.chalkOptions.level > 0) { + const {stdout, stderr} = process; + global.console = Object.assign(global.console, new console.Console({stdout, stderr, colorMode: true})); + } + + async function exit(code) { + if (!process.exitCode) { + process.exitCode = code; + } + + dependencyTracking.flush(); + await channel.flush(); + process.exit(); // eslint-disable-line unicorn/no-process-exit + } + + let checkSelectedByLineNumbers; + try { + checkSelectedByLineNumbers = lineNumberSelection({ + file: options.file, + lineNumbers: options.lineNumbers, + }); + } catch (error) { + channel.send({type: 'line-number-selection-error', err: serializeError('Line number selection error', false, error, options.file)}); + checkSelectedByLineNumbers = () => false; + } + + const runner = new Runner({ + checkSelectedByLineNumbers, + experiments: options.experiments, + failFast: options.failFast, + failWithoutAssertions: options.failWithoutAssertions, + file: options.file, + match: options.match, + projectDir: options.projectDir, + recordNewSnapshots: options.recordNewSnapshots, + runOnlyExclusive: options.runOnlyExclusive, + serial: options.serial, + snapshotDir: options.snapshotDir, + updateSnapshots: options.updateSnapshots, + }); + + refs.runnerChain = runner.chain; + + channel.peerFailed.then(() => { + runner.interrupt(); + }); + + runner.on('dependency', dependencyTracking.track); + runner.on('stateChange', state => channel.send(state)); + + runner.on('error', error => { + channel.send({type: 'internal-error', err: serializeError('Internal runner error', false, error, runner.file)}); + exit(1); + }); + + runner.on('finish', async () => { + try { + const {touchedFiles} = await runner.saveSnapshotState(); + if (touchedFiles) { + channel.send({type: 'touched-files', files: touchedFiles}); + } + } catch (error) { + channel.send({type: 'internal-error', err: serializeError('Internal runner error', false, error, runner.file)}); + exit(1); + return; + } + + try { + await Promise.all(sharedWorkerTeardowns.map(fn => fn())); + } catch (error) { + channel.send({type: 'uncaught-exception', err: serializeError('Shared worker teardown error', false, error, runner.file)}); + exit(1); + return; + } + + nowAndTimers.setImmediate(() => { + for (const rejection of currentlyUnhandled()) { + channel.send({type: 'unhandled-rejection', err: serializeError('Unhandled rejection', true, rejection.reason, runner.file)}); + } + + exit(0); + }); + }); + + process.on('uncaughtException', error => { + channel.send({type: 'uncaught-exception', err: serializeError('Uncaught exception', true, error, runner.file)}); + exit(1); + }); + + // Store value to prevent required modules from modifying it. + const testPath = options.file; + + const extensionsToLoadAsModules = Object.entries(options.moduleTypes) + .filter(([, type]) => type === 'module') + .map(([extension]) => extension); + + // Install before processing options.require, so if helpers are added to the + // require configuration the *compiled* helper will be loaded. + const {projectDir, providerStates = []} = options; + const providers = []; + await Promise.all(providerStates.map(async ({type, state}) => { + if (type === 'typescript') { + const provider = await providerManager.typescript(projectDir); + providers.push(provider.worker({extensionsToLoadAsModules, state})); + } + })); + + const require = createRequire(import.meta.url); + const load = async ref => { + for (const provider of providers) { + if (provider.canLoad(ref)) { + return provider.load(ref, {requireFn: require}); + } + } + + for (const extension of extensionsToLoadAsModules) { + if (ref.endsWith(`.${extension}`)) { + return import(pathToFileURL(ref)); // eslint-disable-line node/no-unsupported-features/es-syntax + } + } + + // We still support require() since it's more easily monkey-patched. + return require(ref); + }; + + try { + for await (const ref of (options.require || [])) { + await load(ref); + } + + // Install dependency tracker after the require configuration has been evaluated + // to make sure we also track dependencies with custom require hooks + dependencyTracking.install(require.extensions, testPath); + + if (options.debug && options.debug.port !== undefined && options.debug.host !== undefined) { + // If an inspector was active when the main process started, and is + // already active for the worker process, do not open a new one. + const {default: inspector} = await import('node:inspector'); // eslint-disable-line node/no-unsupported-features/es-syntax + if (!options.debug.active || inspector.url() === undefined) { + inspector.open(options.debug.port, options.debug.host, true); + } + + if (options.debug.break) { + debugger; // eslint-disable-line no-debugger + } + } + + await load(testPath); + + if (flags.loadedMain) { + // Unreference the channel if the test file required AVA. This stops it + // from keeping the event loop busy, which means the `beforeExit` event can be + // used to detect when tests stall. + channel.unref(); + } else { + channel.send({type: 'missing-ava-import'}); + exit(1); + } + } catch (error) { + channel.send({type: 'uncaught-exception', err: serializeError('Uncaught exception', true, error, runner.file)}); + exit(1); + } +}; + +const onError = error => { + // There shouldn't be any errors, but if there are we may not have managed + // to bootstrap enough code to serialize them. Re-throw and let the process + // crash. + setImmediate(() => { + throw error; + }); +}; + +if (isRunningInThread) { + channel.send({type: 'starting'}); // AVA won't terminate the worker thread until it's seen this message. + const {options} = workerData; + delete workerData.options; // Don't allow user code access. + run(options).catch(onError); +} else if (isRunningInChildProcess) { + channel.send({type: 'ready-for-options'}); + channel.options.then(run).catch(onError); +} diff --git a/node_modules/ava/lib/worker/channel.cjs b/node_modules/ava/lib/worker/channel.cjs new file mode 100644 index 0000000000..7eed7960a0 --- /dev/null +++ b/node_modules/ava/lib/worker/channel.cjs @@ -0,0 +1,290 @@ +'use strict'; +const events = require('events'); +const process = require('process'); +const {MessageChannel, threadId} = require('worker_threads'); + +const timers = require('../now-and-timers.cjs'); + +const {isRunningInChildProcess, isRunningInThread} = require('./utils.cjs'); + +let pEvent = async (emitter, event, options) => { + // We need to import p-event, but import() is asynchronous. Buffer any events + // emitted in the meantime. Don't handle errors. + const buffer = []; + const addToBuffer = (...args) => buffer.push(args); + emitter.on(event, addToBuffer); + + try { + ({pEvent} = await import('p-event')); // eslint-disable-line node/no-unsupported-features/es-syntax + } finally { + emitter.off(event, addToBuffer); + } + + if (buffer.length === 0) { + return pEvent(emitter, event, options); + } + + // Now replay buffered events. + const replayEmitter = new events.EventEmitter(); + const promise = pEvent(replayEmitter, event, options); + for (const args of buffer) { + replayEmitter.emit(event, ...args); + } + + const replay = (...args) => replayEmitter.emit(event, ...args); + emitter.on(event, replay); + + try { + return await promise; + } finally { + emitter.off(event, replay); + } +}; + +const selectAvaMessage = type => message => message.ava && message.ava.type === type; + +class RefCounter { + constructor() { + this.count = 0; + } + + refAndTest() { + return ++this.count === 1; + } + + testAndUnref() { + return this.count > 0 && --this.count === 0; + } +} + +class MessagePortHandle { + constructor(port) { + this.counter = new RefCounter(); + this.unreferenceable = false; + this.channel = port; + // Referencing the port does not immediately prevent the thread from + // exiting. Use a timer to keep a reference for at least a second. + this.workaroundTimer = timers.setTimeout(() => {}, 1000).unref(); + } + + forceUnref() { + if (this.unreferenceable) { + return; + } + + this.unreferenceable = true; + this.workaroundTimer.unref(); + this.channel.unref(); + } + + ref() { + if (!this.unreferenceable && this.counter.refAndTest()) { + this.workaroundTimer.refresh().ref(); + this.channel.ref(); + } + } + + unref() { + if (!this.unreferenceable && this.counter.testAndUnref()) { + this.workaroundTimer.unref(); + this.channel.unref(); + } + } + + send(evt, transferList) { + this.channel.postMessage({ava: evt}, transferList); + } +} + +class IpcHandle { + constructor(bufferedSend) { + this.counter = new RefCounter(); + this.channel = process; + this.sendRaw = bufferedSend; + } + + ref() { + if (this.counter.refAndTest()) { + process.channel.ref(); + } + } + + unref() { + if (this.counter.testAndUnref()) { + process.channel.unref(); + } + } + + send(evt) { + this.sendRaw({ava: evt}); + } +} + +let handle; +if (isRunningInChildProcess) { + const {controlFlow} = require('../ipc-flow-control.cjs'); + handle = new IpcHandle(controlFlow(process)); +} else if (isRunningInThread) { + const {parentPort} = require('worker_threads'); + handle = new MessagePortHandle(parentPort); +} + +// The attaching of message listeners will cause the port to be referenced by +// Node.js. In order to keep track, explicitly reference before attaching. +handle.ref(); + +exports.options = pEvent(handle.channel, 'message', selectAvaMessage('options')).then(message => message.ava.options); +exports.peerFailed = pEvent(handle.channel, 'message', selectAvaMessage('peer-failed')); +exports.send = handle.send.bind(handle); +exports.unref = handle.unref.bind(handle); + +let pendingPings = Promise.resolve(); +async function flush() { + handle.ref(); + const promise = pendingPings.then(async () => { + handle.send({type: 'ping'}); + await pEvent(handle.channel, 'message', selectAvaMessage('pong')); + if (promise === pendingPings) { + handle.unref(); + } + }); + pendingPings = promise; + await promise; +} + +exports.flush = flush; + +let channelCounter = 0; +let messageCounter = 0; + +const channelEmitters = new Map(); +function createChannelEmitter(channelId) { + if (channelEmitters.size === 0) { + handle.channel.on('message', message => { + if (!message.ava) { + return; + } + + const {channelId, type, ...payload} = message.ava; + if (type === 'shared-worker-error') { + const emitter = channelEmitters.get(channelId); + if (emitter !== undefined) { + emitter.emit(type, payload); + } + } + }); + } + + const emitter = new events.EventEmitter(); + channelEmitters.set(channelId, emitter); + return [emitter, () => channelEmitters.delete(channelId)]; +} + +function registerSharedWorker(filename, initialData) { + const channelId = `${threadId}/channel/${++channelCounter}`; + + const {port1: ourPort, port2: theirPort} = new MessageChannel(); + const sharedWorkerHandle = new MessagePortHandle(ourPort); + + const [channelEmitter, unsubscribe] = createChannelEmitter(channelId); + + handle.send({ + type: 'shared-worker-connect', + channelId, + filename, + initialData, + port: theirPort, + }, [theirPort]); + + let currentlyAvailable = false; + let error = null; + + // The attaching of message listeners will cause the port to be referenced by + // Node.js. In order to keep track, explicitly reference before attaching. + sharedWorkerHandle.ref(); + const ready = pEvent(ourPort, 'message', ({type}) => type === 'ready').then(() => { + currentlyAvailable = error === null; + }).finally(() => { + // Once ready, it's up to user code to subscribe to messages, which (see + // below) causes us to reference the port. + sharedWorkerHandle.unref(); + }); + + const messageEmitters = new Set(); + + // Errors are received over the test worker channel, not the message port + // dedicated to the shared worker. + pEvent(channelEmitter, 'shared-worker-error').then(() => { + unsubscribe(); + sharedWorkerHandle.forceUnref(); + error = new Error('The shared worker is no longer available'); + currentlyAvailable = false; + for (const emitter of messageEmitters) { + emitter.emit('error', error); + } + }); + + ourPort.on('message', message => { + if (message.type === 'message') { + // Wait for a turn of the event loop, to allow new subscriptions to be set + // up in response to the previous message. + setImmediate(() => { + for (const emitter of messageEmitters) { + emitter.emit('message', message); + } + }); + } + }); + + return { + forceUnref: () => sharedWorkerHandle.forceUnref(), + ready, + channel: { + available: ready, + + get currentlyAvailable() { + return currentlyAvailable; + }, + + async * receive() { + if (error !== null) { + throw error; + } + + const emitter = new events.EventEmitter(); + messageEmitters.add(emitter); + try { + sharedWorkerHandle.ref(); + for await (const [message] of events.on(emitter, 'message')) { + yield message; + } + } finally { + sharedWorkerHandle.unref(); + messageEmitters.delete(emitter); + } + }, + + post(data, replyTo) { + if (error !== null) { + throw error; + } + + if (!currentlyAvailable) { + throw new Error('Shared worker is not yet available'); + } + + const messageId = `${channelId}/message/${++messageCounter}`; + ourPort.postMessage({ + type: 'message', + messageId, + replyTo, + data, + }); + + return messageId; + }, + }, + }; +} + +exports.registerSharedWorker = registerSharedWorker; diff --git a/node_modules/ava/lib/worker/dependency-tracker.js b/node_modules/ava/lib/worker/dependency-tracker.js index c8c4ea6ea6..f56ea10adf 100644 --- a/node_modules/ava/lib/worker/dependency-tracker.js +++ b/node_modules/ava/lib/worker/dependency-tracker.js @@ -1,20 +1,19 @@ -/* eslint-disable node/no-deprecated-api */ -'use strict'; -const ipc = require('./ipc'); +import process from 'node:process'; + +import channel from './channel.cjs'; const seenDependencies = new Set(); let newDependencies = []; + function flush() { if (newDependencies.length === 0) { return; } - ipc.send({type: 'dependencies', dependencies: newDependencies}); + channel.send({type: 'dependencies', dependencies: newDependencies}); newDependencies = []; } -exports.flush = flush; - function track(filename) { if (seenDependencies.has(filename)) { return; @@ -28,20 +27,22 @@ function track(filename) { newDependencies.push(filename); } -exports.track = track; - -function install(testPath) { - for (const ext of Object.keys(require.extensions)) { - const wrappedHandler = require.extensions[ext]; - - require.extensions[ext] = (module, filename) => { - if (filename !== testPath) { - track(filename); - } - - wrappedHandler(module, filename); - }; - } -} - -exports.install = install; +const tracker = { + flush, + track, + install(extensions, testPath) { + for (const ext of Object.keys(extensions)) { + const wrappedHandler = extensions[ext]; + + extensions[ext] = (module, filename) => { + if (filename !== testPath) { + track(filename); + } + + wrappedHandler(module, filename); + }; + } + }, +}; + +export default tracker; diff --git a/node_modules/ava/lib/worker/ensure-forked.js b/node_modules/ava/lib/worker/guard-environment.cjs similarity index 68% rename from node_modules/ava/lib/worker/ensure-forked.js rename to node_modules/ava/lib/worker/guard-environment.cjs index bad3bcbc80..d7909f30af 100644 --- a/node_modules/ava/lib/worker/ensure-forked.js +++ b/node_modules/ava/lib/worker/guard-environment.cjs @@ -1,15 +1,16 @@ 'use strict'; const path = require('path'); -const chalk = require('chalk'); // Use default Chalk instance. +const process = require('process'); + +const {isRunningInThread, isRunningInChildProcess} = require('./utils.cjs'); // Check if the test is being run without AVA cli -const isForked = typeof process.send === 'function'; -if (!isForked) { +if (!isRunningInChildProcess && !isRunningInThread) { if (process.argv[1]) { const fp = path.relative('.', process.argv[1]); console.log(); - console.error(`Test files must be run with the AVA CLI:\n\n ${chalk.grey.dim('$')} ${chalk.cyan('ava ' + fp)}\n`); + console.error(`Test files must be run with the AVA CLI:\n\n $ ava ${fp}\n`); process.exit(1); // eslint-disable-line unicorn/no-process-exit } else { diff --git a/node_modules/ava/lib/worker/ipc.js b/node_modules/ava/lib/worker/ipc.js deleted file mode 100644 index 55f2a22b07..0000000000 --- a/node_modules/ava/lib/worker/ipc.js +++ /dev/null @@ -1,201 +0,0 @@ -'use strict'; -const events = require('events'); -const pEvent = require('p-event'); -const {controlFlow} = require('../ipc-flow-control'); -const {get: getOptions} = require('./options'); - -const selectAvaMessage = type => message => message.ava && message.ava.type === type; - -exports.options = pEvent(process, 'message', selectAvaMessage('options')).then(message => message.ava.options); -exports.peerFailed = pEvent(process, 'message', selectAvaMessage('peer-failed')); - -const bufferedSend = controlFlow(process); -function send(evt) { - bufferedSend({ava: evt}); -} - -exports.send = send; - -let refs = 1; -function ref() { - if (++refs === 1) { - process.channel.ref(); - } -} - -function unref() { - if (refs > 0 && --refs === 0) { - process.channel.unref(); - } -} - -exports.unref = unref; - -let pendingPings = Promise.resolve(); -async function flush() { - ref(); - const promise = pendingPings.then(async () => { // eslint-disable-line promise/prefer-await-to-then - send({type: 'ping'}); - await pEvent(process, 'message', selectAvaMessage('pong')); - if (promise === pendingPings) { - unref(); - } - }); - pendingPings = promise; - await promise; -} - -exports.flush = flush; - -let channelCounter = 0; -let messageCounter = 0; - -const channelEmitters = new Map(); -function createChannelEmitter(channelId) { - if (channelEmitters.size === 0) { - process.on('message', message => { - if (!message.ava) { - return; - } - - const {channelId, type, ...payload} = message.ava; - if ( - type === 'shared-worker-error' || - type === 'shared-worker-message' || - type === 'shared-worker-ready' - ) { - const emitter = channelEmitters.get(channelId); - if (emitter !== undefined) { - emitter.emit(type, payload); - } - } - }); - } - - const emitter = new events.EventEmitter(); - channelEmitters.set(channelId, emitter); - return [emitter, () => channelEmitters.delete(channelId)]; -} - -function registerSharedWorker(filename, initialData) { - const channelId = `${getOptions().forkId}/channel/${++channelCounter}`; - const [channelEmitter, unsubscribe] = createChannelEmitter(channelId); - - let forcedUnref = false; - let refs = 0; - const forceUnref = () => { - if (forcedUnref) { - return; - } - - forcedUnref = true; - if (refs > 0) { - unref(); - } - }; - - const refChannel = () => { - if (!forcedUnref && ++refs === 1) { - ref(); - } - }; - - const unrefChannel = () => { - if (!forcedUnref && refs > 0 && --refs === 0) { - unref(); - } - }; - - send({ - type: 'shared-worker-connect', - channelId, - filename, - initialData - }); - - let currentlyAvailable = false; - let error = null; - - refChannel(); - const ready = pEvent(channelEmitter, 'shared-worker-ready').then(() => { // eslint-disable-line promise/prefer-await-to-then - currentlyAvailable = error === null; - }).finally(unrefChannel); - - const messageEmitters = new Set(); - const handleMessage = message => { - // Wait for a turn of the event loop, to allow new subscriptions to be set - // up in response to the previous message. - setImmediate(() => { - for (const emitter of messageEmitters) { - emitter.emit('message', message); - } - }); - }; - - channelEmitter.on('shared-worker-message', handleMessage); - - pEvent(channelEmitter, 'shared-worker-error').then(() => { // eslint-disable-line promise/prefer-await-to-then - unsubscribe(); - forceUnref(); - - error = new Error('The shared worker is no longer available'); - currentlyAvailable = false; - for (const emitter of messageEmitters) { - emitter.emit('error', error); - } - }); - - return { - forceUnref, - ready, - channel: { - available: ready, - - get currentlyAvailable() { - return currentlyAvailable; - }, - - async * receive() { - if (error !== null) { - throw error; - } - - const emitter = new events.EventEmitter(); - messageEmitters.add(emitter); - try { - refChannel(); - for await (const [message] of events.on(emitter, 'message')) { - yield message; - } - } finally { - unrefChannel(); - messageEmitters.delete(emitter); - } - }, - - post(serializedData, replyTo) { - if (error !== null) { - throw error; - } - - if (!currentlyAvailable) { - throw new Error('Shared worker is not yet available'); - } - - const messageId = `${channelId}/message/${++messageCounter}`; - send({ - type: 'shared-worker-message', - channelId, - messageId, - replyTo, - serializedData - }); - - return messageId; - } - } - }; -} - -exports.registerSharedWorker = registerSharedWorker; - diff --git a/node_modules/ava/lib/worker/line-numbers.js b/node_modules/ava/lib/worker/line-numbers.js index 2415118570..c7865f85fa 100644 --- a/node_modules/ava/lib/worker/line-numbers.js +++ b/node_modules/ava/lib/worker/line-numbers.js @@ -1,18 +1,27 @@ +import * as fs from 'node:fs'; +import {createRequire, findSourceMap} from 'node:module'; +import {pathToFileURL} from 'node:url'; + +import callsites from 'callsites'; + +const require = createRequire(import.meta.url); + function parse(file) { - const fs = require('fs'); + // Avoid loading these until we actually need to select tests by line number. const acorn = require('acorn'); const walk = require('acorn-walk'); const ast = acorn.parse(fs.readFileSync(file, 'utf8'), { ecmaVersion: 11, - locations: true + locations: true, + sourceType: 'module', }); const locations = []; walk.simple(ast, { CallExpression(node) { locations.push(node.loc); - } + }, }); // Walking is depth-first, but we want to sort these breadth-first. @@ -49,36 +58,65 @@ function findTest(locations, declaration) { return spans.pop(); } -const range = (start, end) => new Array(end - start + 1).fill(start).map((element, index) => element + index); +const range = (start, end) => Array.from({length: end - start + 1}).fill(start).map((element, index) => element + index); -module.exports = ({file, lineNumbers = []}) => { +const translate = (sourceMap, pos) => { + if (sourceMap === undefined) { + return pos; + } + + const entry = sourceMap.findEntry(pos.line - 1, pos.column); // Source maps are 0-based + return { + line: entry.originalLine + 1, // Readjust for Acorn. + column: entry.originalColumn, + }; +}; + +export default function lineNumberSelection({file, lineNumbers = []}) { if (lineNumbers.length === 0) { return undefined; } - // Avoid loading these until we actually need to select tests by line number. - const callsites = require('callsites'); - const sourceMapSupport = require('source-map-support'); - - const locations = parse(file); const selected = new Set(lineNumbers); + let locations = parse(file); + let lookedForSourceMap = false; + let sourceMap; + return () => { + if (!lookedForSourceMap) { + lookedForSourceMap = true; + + // The returned function is called *after* the file has been loaded. + // Source maps are not available before then. + sourceMap = findSourceMap(file); + + if (sourceMap !== undefined) { + locations = locations.map(({start, end}) => ({ + start: translate(sourceMap, start), + end: translate(sourceMap, end), + })); + } + } + // Assume this is called from a test declaration, which is located in the file. // If not… don't select the test! - const callSite = callsites().find(callSite => callSite.getFileName() === file); + const callSite = callsites().find(callSite => { + const current = callSite.getFileName(); + if (file.startsWith('file://')) { + return current.startsWith('file://') ? file === current : file === pathToFileURL(current).toString(); + } + + return current.startsWith('file://') ? pathToFileURL(file).toString() === current : file === current; + }); if (!callSite) { return false; } - // FIXME: This assumes the callSite hasn't already been adjusted. It's likely - // that if `source-map-support/register` has been loaded, this would result - // in the wrong location. - const sourceCallSite = sourceMapSupport.wrapCallSite(callSite); - const start = { - line: sourceCallSite.getLineNumber(), - column: sourceCallSite.getColumnNumber() - 1 // Use 0-indexed columns. - }; + const start = translate(sourceMap, { + line: callSite.getLineNumber(), // 1-based + column: callSite.getColumnNumber() - 1, // Comes out as 1-based, Acorn wants 0-based + }); const test = findTest(locations, start); if (!test) { @@ -87,4 +125,4 @@ module.exports = ({file, lineNumbers = []}) => { return range(test.start.line, test.end.line).some(line => selected.has(line)); }; -}; +} diff --git a/node_modules/ava/lib/worker/main.cjs b/node_modules/ava/lib/worker/main.cjs new file mode 100644 index 0000000000..b6afc0d00a --- /dev/null +++ b/node_modules/ava/lib/worker/main.cjs @@ -0,0 +1,12 @@ +'use strict'; +require('./guard-environment.cjs'); // eslint-disable-line import/no-unassigned-import + +const assert = require('assert'); + +const {flags, refs} = require('./state.cjs'); + +assert(refs.runnerChain); + +flags.loadedMain = true; + +module.exports = refs.runnerChain; diff --git a/node_modules/ava/lib/worker/main.js b/node_modules/ava/lib/worker/main.js deleted file mode 100644 index 80f0497c78..0000000000 --- a/node_modules/ava/lib/worker/main.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; -const runner = require('./subprocess').getRunner(); - -const makeCjsExport = () => { - function test(...args) { - return runner.chain(...args); - } - - return Object.assign(test, runner.chain); -}; - -// Support CommonJS modules by exporting a test function that can be fully -// chained. Also support ES module loaders by exporting __esModule and a -// default. Support `import * as ava from 'ava'` use cases by exporting a -// `test` member. Do all this whilst preventing `test.test.test() or -// `test.default.test()` chains, though in CommonJS `test.test()` is -// unavoidable. -module.exports = Object.assign(makeCjsExport(), { - __esModule: true, - default: runner.chain -}); diff --git a/node_modules/ava/lib/worker/options.js b/node_modules/ava/lib/worker/options.cjs similarity index 100% rename from node_modules/ava/lib/worker/options.js rename to node_modules/ava/lib/worker/options.cjs diff --git a/node_modules/ava/lib/worker/plugin.js b/node_modules/ava/lib/worker/plugin.cjs similarity index 69% rename from node_modules/ava/lib/worker/plugin.js rename to node_modules/ava/lib/worker/plugin.cjs index 2e8e94b883..346d19527f 100644 --- a/node_modules/ava/lib/worker/plugin.js +++ b/node_modules/ava/lib/worker/plugin.cjs @@ -1,18 +1,29 @@ -const v8 = require('v8'); const pkg = require('../../package.json'); -const subprocess = require('./subprocess'); -const options = require('./options'); + +const {registerSharedWorker: register} = require('./channel.cjs'); +const options = require('./options.cjs'); +const {sharedWorkerTeardowns, waitForReady} = require('./state.cjs'); + +require('./guard-environment.cjs'); // eslint-disable-line import/no-unassigned-import const workers = new Map(); const workerTeardownFns = new WeakMap(); function createSharedWorker(filename, initialData, teardown) { - const channel = subprocess.registerSharedWorker(filename, initialData, teardown); + const {channel, forceUnref, ready} = register(filename, initialData, teardown); + waitForReady.push(ready); + sharedWorkerTeardowns.push(async () => { + try { + await teardown(); + } finally { + forceUnref(); + } + }); class ReceivedMessage { - constructor(id, serializedData) { + constructor(id, data) { this.id = id; - this.data = v8.deserialize(new Uint8Array(serializedData)); + this.data = data; } reply(data) { @@ -35,7 +46,7 @@ function createSharedWorker(filename, initialData, teardown) { let message = messageCache.get(evt); if (message === undefined) { - message = new ReceivedMessage(evt.messageId, evt.serializedData); + message = new ReceivedMessage(evt.messageId, evt.data); messageCache.set(evt, message); } @@ -44,19 +55,19 @@ function createSharedWorker(filename, initialData, teardown) { } function publishMessage(data, replyTo) { - const id = channel.post([...v8.serialize(data)], replyTo); + const id = channel.post(data, replyTo); return { id, async * replies() { yield * receiveMessages(id); - } + }, }; } return { available: channel.available, - protocol: 'experimental', + protocol: 'ava-4', get currentlyAvailable() { return channel.currentlyAvailable; @@ -68,30 +79,28 @@ function createSharedWorker(filename, initialData, teardown) { async * subscribe() { yield * receiveMessages(); - } + }, }; } -const supportsSharedWorkers = process.versions.node >= '12.17.0'; - function registerSharedWorker({ filename, initialData, supportedProtocols, - teardown + teardown, }) { - if (!options.get().experiments.sharedWorkers) { - throw new Error('Shared workers are experimental. Opt in to them in your AVA configuration'); - } + const options_ = options.get(); - if (!supportsSharedWorkers) { - throw new Error('Shared workers require Node.js 12.17 or newer'); + if (!options_.workerThreads) { + throw new Error('Shared workers can be used only when worker threads are enabled'); } - if (!supportedProtocols.includes('experimental')) { - throw new Error(`This version of AVA (${pkg.version}) does not support any of the desired shared worker protocols: ${supportedProtocols.join()}`); + if (!supportedProtocols.includes('ava-4')) { + throw new Error(`This version of AVA (${pkg.version}) does not support any of the desired shared worker protocols: ${supportedProtocols.join(',')}`); } + filename = String(filename); // Allow URL instances. + let worker = workers.get(filename); if (worker === undefined) { worker = createSharedWorker(filename, initialData, async () => { diff --git a/node_modules/ava/lib/worker/state.cjs b/node_modules/ava/lib/worker/state.cjs new file mode 100644 index 0000000000..9e7deaeaf5 --- /dev/null +++ b/node_modules/ava/lib/worker/state.cjs @@ -0,0 +1,5 @@ +'use strict'; +exports.flags = {loadedMain: false}; +exports.refs = {runnerChain: null}; +exports.sharedWorkerTeardowns = []; +exports.waitForReady = []; diff --git a/node_modules/ava/lib/worker/subprocess.js b/node_modules/ava/lib/worker/subprocess.js deleted file mode 100644 index abd9aabab7..0000000000 --- a/node_modules/ava/lib/worker/subprocess.js +++ /dev/null @@ -1,266 +0,0 @@ -'use strict'; -const {pathToFileURL} = require('url'); -const currentlyUnhandled = require('currently-unhandled')(); - -require('./ensure-forked'); // eslint-disable-line import/no-unassigned-import - -const ipc = require('./ipc'); - -const supportsESM = async () => { - try { - await import('data:text/javascript,'); // eslint-disable-line node/no-unsupported-features/es-syntax - return true; - } catch {} - - return false; -}; - -ipc.send({type: 'ready-for-options'}); -ipc.options.then(async options => { - require('./options').set(options); - require('../chalk').set(options.chalkOptions); - - if (options.chalkOptions.level > 0) { - const {stdout, stderr} = process; - global.console = Object.assign(global.console, new console.Console({stdout, stderr, colorMode: true})); - } - - const nowAndTimers = require('../now-and-timers'); - const providerManager = require('../provider-manager'); - const Runner = require('../runner'); - const serializeError = require('../serialize-error'); - const dependencyTracking = require('./dependency-tracker'); - const lineNumberSelection = require('./line-numbers'); - - const sharedWorkerTeardowns = []; - - async function exit(code) { - if (!process.exitCode) { - process.exitCode = code; - } - - dependencyTracking.flush(); - await ipc.flush(); - process.exit(); // eslint-disable-line unicorn/no-process-exit - } - - // TODO: Initialize providers here, then pass to lineNumberSelection() so they - // can be used to parse the test file. - let checkSelectedByLineNumbers; - try { - checkSelectedByLineNumbers = lineNumberSelection({ - file: options.file, - lineNumbers: options.lineNumbers - }); - } catch (error) { - ipc.send({type: 'line-number-selection-error', err: serializeError('Line number selection error', false, error, options.file)}); - checkSelectedByLineNumbers = () => false; - } - - const runner = new Runner({ - checkSelectedByLineNumbers, - experiments: options.experiments, - failFast: options.failFast, - failWithoutAssertions: options.failWithoutAssertions, - file: options.file, - match: options.match, - projectDir: options.projectDir, - recordNewSnapshots: options.recordNewSnapshots, - runOnlyExclusive: options.runOnlyExclusive, - serial: options.serial, - snapshotDir: options.snapshotDir, - updateSnapshots: options.updateSnapshots - }); - - ipc.peerFailed.then(() => { // eslint-disable-line promise/prefer-await-to-then - runner.interrupt(); - }); - - const attributedRejections = new Set(); - process.on('unhandledRejection', (reason, promise) => { - if (runner.attributeLeakedError(reason)) { - attributedRejections.add(promise); - } - }); - - runner.on('dependency', dependencyTracking.track); - runner.on('stateChange', state => ipc.send(state)); - - runner.on('error', error => { - ipc.send({type: 'internal-error', err: serializeError('Internal runner error', false, error, runner.file)}); - exit(1); - }); - - runner.on('finish', async () => { - try { - const {cannotSave, touchedFiles} = runner.saveSnapshotState(); - if (cannotSave) { - ipc.send({type: 'snapshot-error'}); - } else if (touchedFiles) { - ipc.send({type: 'touched-files', files: touchedFiles}); - } - } catch (error) { - ipc.send({type: 'internal-error', err: serializeError('Internal runner error', false, error, runner.file)}); - exit(1); - return; - } - - try { - await Promise.all(sharedWorkerTeardowns.map(fn => fn())); - } catch (error) { - ipc.send({type: 'uncaught-exception', err: serializeError('Shared worker teardown error', false, error, runner.file)}); - exit(1); - return; - } - - nowAndTimers.setImmediate(() => { - currentlyUnhandled() - .filter(rejection => !attributedRejections.has(rejection.promise)) - .forEach(rejection => { - ipc.send({type: 'unhandled-rejection', err: serializeError('Unhandled rejection', true, rejection.reason, runner.file)}); - }); - - exit(0); - }); - }); - - process.on('uncaughtException', error => { - if (runner.attributeLeakedError(error)) { - return; - } - - ipc.send({type: 'uncaught-exception', err: serializeError('Uncaught exception', true, error, runner.file)}); - exit(1); - }); - - let accessedRunner = false; - exports.getRunner = () => { - accessedRunner = true; - return runner; - }; - - exports.registerSharedWorker = (filename, initialData, teardown) => { - const {channel, forceUnref, ready} = ipc.registerSharedWorker(filename, initialData); - runner.waitForReady.push(ready); - sharedWorkerTeardowns.push(async () => { - try { - await teardown(); - } finally { - forceUnref(); - } - }); - return channel; - }; - - // Store value to prevent required modules from modifying it. - const testPath = options.file; - - // Install basic source map support. - const sourceMapSupport = require('source-map-support'); - sourceMapSupport.install({ - environment: 'node', - handleUncaughtExceptions: false - }); - - const extensionsToLoadAsModules = Object.entries(options.moduleTypes) - .filter(([, type]) => type === 'module') - .map(([extension]) => extension); - - // Install before processing options.require, so if helpers are added to the - // require configuration the *compiled* helper will be loaded. - const {projectDir, providerStates = []} = options; - const providers = providerStates.map(({type, state}) => { - if (type === 'babel') { - const provider = providerManager.babel(projectDir).worker({extensionsToLoadAsModules, state}); - runner.powerAssert = provider.powerAssert; - return provider; - } - - if (type === 'typescript') { - return providerManager.typescript(projectDir).worker({extensionsToLoadAsModules, state}); - } - - return null; - }).filter(provider => provider !== null); - - let requireFn = require; - let isESMSupported; - const load = async ref => { - for (const extension of extensionsToLoadAsModules) { - if (ref.endsWith(`.${extension}`)) { - if (typeof isESMSupported !== 'boolean') { - // Lazily determine support since this prints an experimental warning. - // eslint-disable-next-line no-await-in-loop - isESMSupported = await supportsESM(); - } - - if (isESMSupported) { - return import(pathToFileURL(ref)); // eslint-disable-line node/no-unsupported-features/es-syntax - } - - ipc.send({type: 'internal-error', err: serializeError('Internal runner error', false, new Error('ECMAScript Modules are not supported in this Node.js version.'))}); - exit(1); - return; - } - } - - for (const provider of providers) { - if (provider.canLoad(ref)) { - return provider.load(ref, {requireFn}); - } - } - - return requireFn(ref); - }; - - try { - for await (const ref of (options.require || [])) { - const mod = await load(ref); - - try { - if (Reflect.has(mod, Symbol.for('esm:package'))) { - requireFn = mod(module); - } - } catch {} - } - - // Install dependency tracker after the require configuration has been evaluated - // to make sure we also track dependencies with custom require hooks - dependencyTracking.install(testPath); - - if (options.debug && options.debug.port !== undefined && options.debug.host !== undefined) { - // If an inspector was active when the main process started, and is - // already active for the worker process, do not open a new one. - const inspector = require('inspector'); // eslint-disable-line node/no-unsupported-features/node-builtins - if (!options.debug.active || inspector.url() === undefined) { - inspector.open(options.debug.port, options.debug.host, true); - } - - if (options.debug.break) { - debugger; // eslint-disable-line no-debugger - } - } - - await load(testPath); - - if (accessedRunner) { - // Unreference the IPC channel if the test file required AVA. This stops it - // from keeping the event loop busy, which means the `beforeExit` event can be - // used to detect when tests stall. - ipc.unref(); - } else { - ipc.send({type: 'missing-ava-import'}); - exit(1); - } - } catch (error) { - ipc.send({type: 'uncaught-exception', err: serializeError('Uncaught exception', true, error, runner.file)}); - exit(1); - } -}).catch(error => { - // There shouldn't be any errors, but if there are we may not have managed - // to bootstrap enough code to serialize them. Re-throw and let the process - // crash. - setImmediate(() => { - throw error; - }); -}); diff --git a/node_modules/ava/lib/worker/utils.cjs b/node_modules/ava/lib/worker/utils.cjs new file mode 100644 index 0000000000..b92153b816 --- /dev/null +++ b/node_modules/ava/lib/worker/utils.cjs @@ -0,0 +1,6 @@ +'use strict'; +const process = require('process'); +const {isMainThread} = require('worker_threads'); + +exports.isRunningInThread = isMainThread === false; +exports.isRunningInChildProcess = typeof process.send === 'function'; diff --git a/node_modules/ava/node_modules/acorn/CHANGELOG.md b/node_modules/ava/node_modules/acorn/CHANGELOG.md index 117c898c8a..d19b5f1bad 100644 --- a/node_modules/ava/node_modules/acorn/CHANGELOG.md +++ b/node_modules/ava/node_modules/acorn/CHANGELOG.md @@ -1,3 +1,27 @@ +## 8.7.0 (2021-12-27) + +### New features + +Support quoted export names. + +Upgrade to Unicode 14. + +Add support for Unicode 13 properties in regular expressions. + +### Bug fixes + +Use a loop to find line breaks, because the existing regexp search would overrun the end of the searched range and waste a lot of time in minified code. + +## 8.6.0 (2021-11-18) + +### Bug fixes + +Fix a bug where an object literal with multiple `__proto__` properties would incorrectly be accepted if a later property value held an assigment. + +### New features + +Support class private fields with the `in` operator. + ## 8.5.0 (2021-09-06) ### Bug fixes @@ -36,7 +60,7 @@ A new option, `allowSuperOutsideMethod`, can be used to suppress the error when Default `allowAwaitOutsideFunction` to true for ECMAScript 2022 an higher. -Add support for the `p` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag. +Add support for the `d` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag. ## 8.2.4 (2021-05-04) diff --git a/node_modules/ava/node_modules/acorn/dist/acorn.js b/node_modules/ava/node_modules/acorn/dist/acorn.js index 96e3b82d83..2d279e9fa8 100644 --- a/node_modules/ava/node_modules/acorn/dist/acorn.js +++ b/node_modules/ava/node_modules/acorn/dist/acorn.js @@ -1,8 +1,8 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = global || self, factory(global.acorn = {})); -}(this, (function (exports) { 'use strict'; + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.acorn = {})); +})(this, (function (exports) { 'use strict'; // Reserved word lists for various dialects of the language @@ -18,7 +18,7 @@ var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; - var keywords = { + var keywords$1 = { 5: ecma5AndLessKeywords, "5module": ecma5AndLessKeywords + " export import", 6: ecma5AndLessKeywords + " const class extends export import super" @@ -33,8 +33,8 @@ // are only applied when a character is found to actually have a // code point above 128. // Generated by `bin/generate-identifier-regex.js`. - var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; - var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; + var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); @@ -48,10 +48,10 @@ // generated by bin/generate-identifier-regex.js // eslint-disable-next-line comma-spacing - var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938]; + var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2637,96,16,1070,4050,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,46,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,482,44,11,6,17,0,322,29,19,43,1269,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4152,8,221,3,5761,15,7472,3104,541,1507,4938]; // eslint-disable-next-line comma-spacing - var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239]; + var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,357,0,62,13,1495,6,110,6,6,9,4759,9,787719,239]; // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is @@ -137,17 +137,17 @@ // Map keyword names to token types. - var keywords$1 = {}; + var keywords = {}; // Succinct definitions of keyword token types function kw(name, options) { if ( options === void 0 ) options = {}; options.keyword = name; - return keywords$1[name] = new TokenType(name, options) + return keywords[name] = new TokenType(name, options) } - var types = { + var types$1 = { num: new TokenType("num", startsExpr), regexp: new TokenType("regexp", startsExpr), string: new TokenType("string", startsExpr), @@ -256,6 +256,17 @@ return code === 10 || code === 13 || code === 0x2028 || code === 0x2029 } + function nextLineBreak(code, from, end) { + if ( end === void 0 ) end = code.length; + + for (var i = from; i < end; i++) { + var next = code.charCodeAt(i); + if (isNewLine(next)) + { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 } + } + return -1 + } + var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; @@ -264,11 +275,9 @@ var hasOwnProperty = ref.hasOwnProperty; var toString = ref.toString; - // Checks if an object has a property. - - function has(obj, propName) { - return hasOwnProperty.call(obj, propName) - } + var hasOwn = Object.hasOwn || (function (obj, propName) { return ( + hasOwnProperty.call(obj, propName) + ); }); var isArray = Array.isArray || (function (obj) { return ( toString.call(obj) === "[object Array]" @@ -278,6 +287,8 @@ return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") } + var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; + // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. @@ -304,14 +315,10 @@ function getLineInfo(input, offset) { for (var line = 1, cur = 0;;) { - lineBreakG.lastIndex = cur; - var match = lineBreakG.exec(input); - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else { - return new Position(line, offset - cur) - } + var nextBreak = nextLineBreak(input, cur, offset); + if (nextBreak < 0) { return new Position(line, offset - cur) } + ++line; + cur = nextBreak; } } @@ -417,7 +424,7 @@ var options = {}; for (var opt in defaultOptions) - { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } + { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; } if (options.ecmaVersion === "latest") { options.ecmaVersion = 1e8; @@ -489,7 +496,7 @@ var Parser = function Parser(options, input, startPos) { this.options = options = getOptions(options); this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); var reserved = ""; if (options.allowReserved !== true) { reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; @@ -520,7 +527,7 @@ // Properties of the current token: // Its type - this.type = types.eof; + this.type = types$1.eof; // For tokens that include more information than their type, the value this.value = null; // Its start and end offset @@ -580,8 +587,11 @@ }; prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; + prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit }; + prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit }; + prototypeAccessors.canAwait.get = function () { for (var i = this.scopeStack.length - 1; i >= 0; i--) { var scope = this.scopeStack[i]; @@ -590,20 +600,25 @@ } return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction }; + prototypeAccessors.allowSuper.get = function () { var ref = this.currentThisScope(); var flags = ref.flags; var inClassFieldInit = ref.inClassFieldInit; return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod }; + prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; + prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; + prototypeAccessors.allowNewDotTarget.get = function () { var ref = this.currentThisScope(); var flags = ref.flags; var inClassFieldInit = ref.inClassFieldInit; return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit }; + prototypeAccessors.inClassStaticBlock.get = function () { return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0 }; @@ -633,12 +648,12 @@ Object.defineProperties( Parser.prototype, prototypeAccessors ); - var pp = Parser.prototype; + var pp$9 = Parser.prototype; // ## Parser utilities var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; - pp.strictDirective = function(start) { + pp$9.strictDirective = function(start) { for (;;) { // Try to find string literal. skipWhiteSpace.lastIndex = start; @@ -666,7 +681,7 @@ // Predicate that tests whether the next token is of the given // type, and if yes, consumes it as a side effect. - pp.eat = function(type) { + pp$9.eat = function(type) { if (this.type === type) { this.next(); return true @@ -677,13 +692,13 @@ // Tests whether parsed token is a contextual keyword. - pp.isContextual = function(name) { - return this.type === types.name && this.value === name && !this.containsEsc + pp$9.isContextual = function(name) { + return this.type === types$1.name && this.value === name && !this.containsEsc }; // Consumes contextual keyword if possible. - pp.eatContextual = function(name) { + pp$9.eatContextual = function(name) { if (!this.isContextual(name)) { return false } this.next(); return true @@ -691,19 +706,19 @@ // Asserts that following token is given contextual keyword. - pp.expectContextual = function(name) { + pp$9.expectContextual = function(name) { if (!this.eatContextual(name)) { this.unexpected(); } }; // Test whether a semicolon can be inserted at the current position. - pp.canInsertSemicolon = function() { - return this.type === types.eof || - this.type === types.braceR || + pp$9.canInsertSemicolon = function() { + return this.type === types$1.eof || + this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; - pp.insertSemicolon = function() { + pp$9.insertSemicolon = function() { if (this.canInsertSemicolon()) { if (this.options.onInsertedSemicolon) { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } @@ -714,11 +729,11 @@ // Consume a semicolon, or, failing that, see if we are allowed to // pretend that there is a semicolon at this position. - pp.semicolon = function() { - if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } + pp$9.semicolon = function() { + if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); } }; - pp.afterTrailingComma = function(tokType, notNext) { + pp$9.afterTrailingComma = function(tokType, notNext) { if (this.type === tokType) { if (this.options.onTrailingComma) { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } @@ -731,13 +746,13 @@ // Expect a token of a given type. If found, consume it, otherwise, // raise an unexpected token error. - pp.expect = function(type) { + pp$9.expect = function(type) { this.eat(type) || this.unexpected(); }; // Raise an unexpected token error. - pp.unexpected = function(pos) { + pp$9.unexpected = function(pos) { this.raise(pos != null ? pos : this.start, "Unexpected token"); }; @@ -750,7 +765,7 @@ -1; } - pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { + pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { if (!refDestructuringErrors) { return } if (refDestructuringErrors.trailingComma > -1) { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } @@ -758,7 +773,7 @@ if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } }; - pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { if (!refDestructuringErrors) { return false } var shorthandAssign = refDestructuringErrors.shorthandAssign; var doubleProto = refDestructuringErrors.doubleProto; @@ -769,20 +784,20 @@ { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } }; - pp.checkYieldAwaitInDefaultParams = function() { + pp$9.checkYieldAwaitInDefaultParams = function() { if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } if (this.awaitPos) { this.raise(this.awaitPos, "Await expression cannot be a default value"); } }; - pp.isSimpleAssignTarget = function(expr) { + pp$9.isSimpleAssignTarget = function(expr) { if (expr.type === "ParenthesizedExpression") { return this.isSimpleAssignTarget(expr.expression) } return expr.type === "Identifier" || expr.type === "MemberExpression" }; - var pp$1 = Parser.prototype; + var pp$8 = Parser.prototype; // ### Statement parsing @@ -791,10 +806,10 @@ // `program` argument. If present, the statements will be appended // to its body instead of creating a new node. - pp$1.parseTopLevel = function(node) { + pp$8.parseTopLevel = function(node) { var exports = Object.create(null); if (!node.body) { node.body = []; } - while (this.type !== types.eof) { + while (this.type !== types$1.eof) { var stmt = this.parseStatement(null, true, exports); node.body.push(stmt); } @@ -813,7 +828,7 @@ var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; - pp$1.isLet = function(context) { + pp$8.isLet = function(context) { if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); @@ -839,7 +854,7 @@ // check 'async [no LineTerminator here] function' // - 'async /*foo*/ function' is OK. // - 'async /*\n*/ function' is invalid. - pp$1.isAsyncFunction = function() { + pp$8.isAsyncFunction = function() { if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { return false } @@ -859,11 +874,11 @@ // `if (foo) /blah/.exec(foo)`, where looking at the previous token // does not help. - pp$1.parseStatement = function(context, topLevel, exports) { + pp$8.parseStatement = function(context, topLevel, exports) { var starttype = this.type, node = this.startNode(), kind; if (this.isLet(context)) { - starttype = types._var; + starttype = types$1._var; kind = "let"; } @@ -872,35 +887,35 @@ // complexity. switch (starttype) { - case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) - case types._debugger: return this.parseDebuggerStatement(node) - case types._do: return this.parseDoStatement(node) - case types._for: return this.parseForStatement(node) - case types._function: + case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types$1._debugger: return this.parseDebuggerStatement(node) + case types$1._do: return this.parseDoStatement(node) + case types$1._for: return this.parseForStatement(node) + case types$1._function: // Function as sole body of either an if statement or a labeled statement // works, but not when it is part of a labeled statement that is the sole // body of an if statement. if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } return this.parseFunctionStatement(node, false, !context) - case types._class: + case types$1._class: if (context) { this.unexpected(); } return this.parseClass(node, true) - case types._if: return this.parseIfStatement(node) - case types._return: return this.parseReturnStatement(node) - case types._switch: return this.parseSwitchStatement(node) - case types._throw: return this.parseThrowStatement(node) - case types._try: return this.parseTryStatement(node) - case types._const: case types._var: + case types$1._if: return this.parseIfStatement(node) + case types$1._return: return this.parseReturnStatement(node) + case types$1._switch: return this.parseSwitchStatement(node) + case types$1._throw: return this.parseThrowStatement(node) + case types$1._try: return this.parseTryStatement(node) + case types$1._const: case types$1._var: kind = kind || this.value; if (context && kind !== "var") { this.unexpected(); } return this.parseVarStatement(node, kind) - case types._while: return this.parseWhileStatement(node) - case types._with: return this.parseWithStatement(node) - case types.braceL: return this.parseBlock(true, node) - case types.semi: return this.parseEmptyStatement(node) - case types._export: - case types._import: - if (this.options.ecmaVersion > 10 && starttype === types._import) { + case types$1._while: return this.parseWhileStatement(node) + case types$1._with: return this.parseWithStatement(node) + case types$1.braceL: return this.parseBlock(true, node) + case types$1.semi: return this.parseEmptyStatement(node) + case types$1._export: + case types$1._import: + if (this.options.ecmaVersion > 10 && starttype === types$1._import) { skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); @@ -914,7 +929,7 @@ if (!this.inModule) { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } } - return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) + return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports) // If the statement does not start with a statement keyword or a // brace, it's an ExpressionStatement or LabeledStatement. We @@ -929,17 +944,17 @@ } var maybeName = this.value, expr = this.parseExpression(); - if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) { return this.parseLabeledStatement(node, maybeName, expr, context) } else { return this.parseExpressionStatement(node, expr) } } }; - pp$1.parseBreakContinueStatement = function(node, keyword) { + pp$8.parseBreakContinueStatement = function(node, keyword) { var isBreak = keyword === "break"; this.next(); - if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } - else if (this.type !== types.name) { this.unexpected(); } + if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types$1.name) { this.unexpected(); } else { node.label = this.parseIdent(); this.semicolon(); @@ -959,21 +974,21 @@ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") }; - pp$1.parseDebuggerStatement = function(node) { + pp$8.parseDebuggerStatement = function(node) { this.next(); this.semicolon(); return this.finishNode(node, "DebuggerStatement") }; - pp$1.parseDoStatement = function(node) { + pp$8.parseDoStatement = function(node) { this.next(); this.labels.push(loopLabel); node.body = this.parseStatement("do"); this.labels.pop(); - this.expect(types._while); + this.expect(types$1._while); node.test = this.parseParenExpression(); if (this.options.ecmaVersion >= 6) - { this.eat(types.semi); } + { this.eat(types$1.semi); } else { this.semicolon(); } return this.finishNode(node, "DoWhileStatement") @@ -987,25 +1002,25 @@ // part (semicolon immediately after the opening parenthesis), it // is a regular `for` loop. - pp$1.parseForStatement = function(node) { + pp$8.parseForStatement = function(node) { this.next(); var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1; this.labels.push(loopLabel); this.enterScope(0); - this.expect(types.parenL); - if (this.type === types.semi) { + this.expect(types$1.parenL); + if (this.type === types$1.semi) { if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, null) } var isLet = this.isLet(); - if (this.type === types._var || this.type === types._const || isLet) { + if (this.type === types$1._var || this.type === types$1._const || isLet) { var init$1 = this.startNode(), kind = isLet ? "let" : this.value; this.next(); this.parseVar(init$1, true, kind); this.finishNode(init$1, "VariableDeclaration"); - if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { + if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { if (this.options.ecmaVersion >= 9) { - if (this.type === types._in) { + if (this.type === types$1._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } @@ -1017,9 +1032,9 @@ var startsWithLet = this.isContextual("let"), isForOf = false; var refDestructuringErrors = new DestructuringErrors; var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); - if (this.type === types._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { if (this.options.ecmaVersion >= 9) { - if (this.type === types._in) { + if (this.type === types$1._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } @@ -1034,21 +1049,21 @@ return this.parseFor(node, init) }; - pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { + pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { this.next(); return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) }; - pp$1.parseIfStatement = function(node) { + pp$8.parseIfStatement = function(node) { this.next(); node.test = this.parseParenExpression(); // allow function declarations in branches, but only in non-strict mode node.consequent = this.parseStatement("if"); - node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; + node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; return this.finishNode(node, "IfStatement") }; - pp$1.parseReturnStatement = function(node) { + pp$8.parseReturnStatement = function(node) { if (!this.inFunction && !this.options.allowReturnOutsideFunction) { this.raise(this.start, "'return' outside of function"); } this.next(); @@ -1057,16 +1072,16 @@ // optional arguments, we eagerly look for a semicolon or the // possibility to insert one. - if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; } else { node.argument = this.parseExpression(); this.semicolon(); } return this.finishNode(node, "ReturnStatement") }; - pp$1.parseSwitchStatement = function(node) { + pp$8.parseSwitchStatement = function(node) { this.next(); node.discriminant = this.parseParenExpression(); node.cases = []; - this.expect(types.braceL); + this.expect(types$1.braceL); this.labels.push(switchLabel); this.enterScope(0); @@ -1075,9 +1090,9 @@ // adding statements to. var cur; - for (var sawDefault = false; this.type !== types.braceR;) { - if (this.type === types._case || this.type === types._default) { - var isCase = this.type === types._case; + for (var sawDefault = false; this.type !== types$1.braceR;) { + if (this.type === types$1._case || this.type === types$1._default) { + var isCase = this.type === types$1._case; if (cur) { this.finishNode(cur, "SwitchCase"); } node.cases.push(cur = this.startNode()); cur.consequent = []; @@ -1089,7 +1104,7 @@ sawDefault = true; cur.test = null; } - this.expect(types.colon); + this.expect(types$1.colon); } else { if (!cur) { this.unexpected(); } cur.consequent.push(this.parseStatement(null)); @@ -1102,7 +1117,7 @@ return this.finishNode(node, "SwitchStatement") }; - pp$1.parseThrowStatement = function(node) { + pp$8.parseThrowStatement = function(node) { this.next(); if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { this.raise(this.lastTokEnd, "Illegal newline after throw"); } @@ -1113,21 +1128,21 @@ // Reused empty array added for node fields that are always empty. - var empty = []; + var empty$1 = []; - pp$1.parseTryStatement = function(node) { + pp$8.parseTryStatement = function(node) { this.next(); node.block = this.parseBlock(); node.handler = null; - if (this.type === types._catch) { + if (this.type === types$1._catch) { var clause = this.startNode(); this.next(); - if (this.eat(types.parenL)) { + if (this.eat(types$1.parenL)) { clause.param = this.parseBindingAtom(); var simple = clause.param.type === "Identifier"; this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); - this.expect(types.parenR); + this.expect(types$1.parenR); } else { if (this.options.ecmaVersion < 10) { this.unexpected(); } clause.param = null; @@ -1137,20 +1152,20 @@ this.exitScope(); node.handler = this.finishNode(clause, "CatchClause"); } - node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; + node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { this.raise(node.start, "Missing catch or finally clause"); } return this.finishNode(node, "TryStatement") }; - pp$1.parseVarStatement = function(node, kind) { + pp$8.parseVarStatement = function(node, kind) { this.next(); this.parseVar(node, false, kind); this.semicolon(); return this.finishNode(node, "VariableDeclaration") }; - pp$1.parseWhileStatement = function(node) { + pp$8.parseWhileStatement = function(node) { this.next(); node.test = this.parseParenExpression(); this.labels.push(loopLabel); @@ -1159,7 +1174,7 @@ return this.finishNode(node, "WhileStatement") }; - pp$1.parseWithStatement = function(node) { + pp$8.parseWithStatement = function(node) { if (this.strict) { this.raise(this.start, "'with' in strict mode"); } this.next(); node.object = this.parseParenExpression(); @@ -1167,12 +1182,12 @@ return this.finishNode(node, "WithStatement") }; - pp$1.parseEmptyStatement = function(node) { + pp$8.parseEmptyStatement = function(node) { this.next(); return this.finishNode(node, "EmptyStatement") }; - pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { + pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) { var label = list[i$1]; @@ -1180,7 +1195,7 @@ if (label.name === maybeName) { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); } } - var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; for (var i = this.labels.length - 1; i >= 0; i--) { var label$1 = this.labels[i]; if (label$1.statementStart === node.start) { @@ -1196,7 +1211,7 @@ return this.finishNode(node, "LabeledStatement") }; - pp$1.parseExpressionStatement = function(node, expr) { + pp$8.parseExpressionStatement = function(node, expr) { node.expression = expr; this.semicolon(); return this.finishNode(node, "ExpressionStatement") @@ -1206,14 +1221,14 @@ // strict"` declarations when `allowStrict` is true (used for // function bodies). - pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) { + pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; if ( node === void 0 ) node = this.startNode(); node.body = []; - this.expect(types.braceL); + this.expect(types$1.braceL); if (createNewLexicalScope) { this.enterScope(0); } - while (this.type !== types.braceR) { + while (this.type !== types$1.braceR) { var stmt = this.parseStatement(null); node.body.push(stmt); } @@ -1227,13 +1242,13 @@ // `parseStatement` will already have parsed the init statement or // expression. - pp$1.parseFor = function(node, init) { + pp$8.parseFor = function(node, init) { node.init = init; - this.expect(types.semi); - node.test = this.type === types.semi ? null : this.parseExpression(); - this.expect(types.semi); - node.update = this.type === types.parenR ? null : this.parseExpression(); - this.expect(types.parenR); + this.expect(types$1.semi); + node.test = this.type === types$1.semi ? null : this.parseExpression(); + this.expect(types$1.semi); + node.update = this.type === types$1.parenR ? null : this.parseExpression(); + this.expect(types$1.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); @@ -1243,8 +1258,8 @@ // Parse a `for`/`in` and `for`/`of` loop, which are almost // same from parser's perspective. - pp$1.parseForIn = function(node, init) { - var isForIn = this.type === types._in; + pp$8.parseForIn = function(node, init) { + var isForIn = this.type === types$1._in; this.next(); if ( @@ -1265,7 +1280,7 @@ } node.left = init; node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); - this.expect(types.parenR); + this.expect(types$1.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); @@ -1274,28 +1289,28 @@ // Parse a list of variable declarations. - pp$1.parseVar = function(node, isFor, kind) { + pp$8.parseVar = function(node, isFor, kind) { node.declarations = []; node.kind = kind; for (;;) { var decl = this.startNode(); this.parseVarId(decl, kind); - if (this.eat(types.eq)) { + if (this.eat(types$1.eq)) { decl.init = this.parseMaybeAssign(isFor); - } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { + } else if (kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { this.unexpected(); - } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) { + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); } else { decl.init = null; } node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(types.comma)) { break } + if (!this.eat(types$1.comma)) { break } } return node }; - pp$1.parseVarId = function(decl, kind) { + pp$8.parseVarId = function(decl, kind) { decl.id = this.parseBindingAtom(); this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); }; @@ -1306,18 +1321,18 @@ // `statement & FUNC_STATEMENT`). // Remove `allowExpressionBody` for 7.0.0, as it is only called with false - pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { + pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { this.initFunction(node); if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { - if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) + if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT)) { this.unexpected(); } - node.generator = this.eat(types.star); + node.generator = this.eat(types$1.star); } if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } if (statement & FUNC_STATEMENT) { - node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent(); if (node.id && !(statement & FUNC_HANGING_STATEMENT)) // If it is a regular function declaration in sloppy mode, then it is // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding @@ -1333,7 +1348,7 @@ this.enterScope(functionFlags(node.async, node.generator)); if (!(statement & FUNC_STATEMENT)) - { node.id = this.type === types.name ? this.parseIdent() : null; } + { node.id = this.type === types$1.name ? this.parseIdent() : null; } this.parseFunctionParams(node); this.parseFunctionBody(node, allowExpressionBody, false, forInit); @@ -1344,16 +1359,16 @@ return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") }; - pp$1.parseFunctionParams = function(node) { - this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + pp$8.parseFunctionParams = function(node) { + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); }; // Parse a class declaration or literal (depending on the // `isStatement` parameter). - pp$1.parseClass = function(node, isStatement) { + pp$8.parseClass = function(node, isStatement) { this.next(); // ecma-262 14.6 Class Definitions @@ -1367,8 +1382,8 @@ var classBody = this.startNode(); var hadConstructor = false; classBody.body = []; - this.expect(types.braceL); - while (this.type !== types.braceR) { + this.expect(types$1.braceL); + while (this.type !== types$1.braceR) { var element = this.parseClassElement(node.superClass !== null); if (element) { classBody.body.push(element); @@ -1387,8 +1402,8 @@ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") }; - pp$1.parseClassElement = function(constructorAllowsSuper) { - if (this.eat(types.semi)) { return null } + pp$8.parseClassElement = function(constructorAllowsSuper) { + if (this.eat(types$1.semi)) { return null } var ecmaVersion = this.options.ecmaVersion; var node = this.startNode(); @@ -1400,11 +1415,11 @@ if (this.eatContextual("static")) { // Parse static init block - if (ecmaVersion >= 13 && this.eat(types.braceL)) { + if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { this.parseClassStaticBlock(node); return node } - if (this.isClassElementNameStart() || this.type === types.star) { + if (this.isClassElementNameStart() || this.type === types$1.star) { isStatic = true; } else { keyName = "static"; @@ -1412,13 +1427,13 @@ } node.static = isStatic; if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { - if ((this.isClassElementNameStart() || this.type === types.star) && !this.canInsertSemicolon()) { + if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { isAsync = true; } else { keyName = "async"; } } - if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types.star)) { + if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { isGenerator = true; } if (!keyName && !isAsync && !isGenerator) { @@ -1445,7 +1460,7 @@ } // Parse element value - if (ecmaVersion < 13 || this.type === types.parenL || kind !== "method" || isGenerator || isAsync) { + if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { var isConstructor = !node.static && checkKeyName(node, "constructor"); var allowsDirectSuper = isConstructor && constructorAllowsSuper; // Couldn't move this check into the 'parseClassMethod' method for backward compatibility. @@ -1459,19 +1474,19 @@ return node }; - pp$1.isClassElementNameStart = function() { + pp$8.isClassElementNameStart = function() { return ( - this.type === types.name || - this.type === types.privateId || - this.type === types.num || - this.type === types.string || - this.type === types.bracketL || + this.type === types$1.name || + this.type === types$1.privateId || + this.type === types$1.num || + this.type === types$1.string || + this.type === types$1.bracketL || this.type.keyword ) }; - pp$1.parseClassElementName = function(element) { - if (this.type === types.privateId) { + pp$8.parseClassElementName = function(element) { + if (this.type === types$1.privateId) { if (this.value === "constructor") { this.raise(this.start, "Classes can't have an element named '#constructor'"); } @@ -1482,7 +1497,7 @@ } }; - pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { // Check key and flags var key = method.key; if (method.kind === "constructor") { @@ -1506,14 +1521,14 @@ return this.finishNode(method, "MethodDefinition") }; - pp$1.parseClassField = function(field) { + pp$8.parseClassField = function(field) { if (checkKeyName(field, "constructor")) { this.raise(field.key.start, "Classes can't have a field named 'constructor'"); } else if (field.static && checkKeyName(field, "prototype")) { this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); } - if (this.eat(types.eq)) { + if (this.eat(types$1.eq)) { // To raise SyntaxError if 'arguments' exists in the initializer. var scope = this.currentThisScope(); var inClassFieldInit = scope.inClassFieldInit; @@ -1528,13 +1543,13 @@ return this.finishNode(field, "PropertyDefinition") }; - pp$1.parseClassStaticBlock = function(node) { + pp$8.parseClassStaticBlock = function(node) { node.body = []; var oldLabels = this.labels; this.labels = []; this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); - while (this.type !== types.braceR) { + while (this.type !== types$1.braceR) { var stmt = this.parseStatement(null); node.body.push(stmt); } @@ -1545,8 +1560,8 @@ return this.finishNode(node, "StaticBlock") }; - pp$1.parseClassId = function(node, isStatement) { - if (this.type === types.name) { + pp$8.parseClassId = function(node, isStatement) { + if (this.type === types$1.name) { node.id = this.parseIdent(); if (isStatement) { this.checkLValSimple(node.id, BIND_LEXICAL, false); } @@ -1557,17 +1572,17 @@ } }; - pp$1.parseClassSuper = function(node) { - node.superClass = this.eat(types._extends) ? this.parseExprSubscripts(false) : null; + pp$8.parseClassSuper = function(node) { + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null; }; - pp$1.enterClassBody = function() { + pp$8.enterClassBody = function() { var element = {declared: Object.create(null), used: []}; this.privateNameStack.push(element); return element.declared }; - pp$1.exitClassBody = function() { + pp$8.exitClassBody = function() { var ref = this.privateNameStack.pop(); var declared = ref.declared; var used = ref.used; @@ -1575,7 +1590,7 @@ var parent = len === 0 ? null : this.privateNameStack[len - 1]; for (var i = 0; i < used.length; ++i) { var id = used[i]; - if (!has(declared, id.name)) { + if (!hasOwn(declared, id.name)) { if (parent) { parent.used.push(id); } else { @@ -1622,33 +1637,33 @@ // Parses module export declaration. - pp$1.parseExport = function(node, exports) { + pp$8.parseExport = function(node, exports) { this.next(); // export * from '...' - if (this.eat(types.star)) { + if (this.eat(types$1.star)) { if (this.options.ecmaVersion >= 11) { if (this.eatContextual("as")) { - node.exported = this.parseIdent(true); + node.exported = this.parseModuleExportName(); this.checkExport(exports, node.exported.name, this.lastTokStart); } else { node.exported = null; } } this.expectContextual("from"); - if (this.type !== types.string) { this.unexpected(); } + if (this.type !== types$1.string) { this.unexpected(); } node.source = this.parseExprAtom(); this.semicolon(); return this.finishNode(node, "ExportAllDeclaration") } - if (this.eat(types._default)) { // export default ... + if (this.eat(types$1._default)) { // export default ... this.checkExport(exports, "default", this.lastTokStart); var isAsync; - if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { var fNode = this.startNode(); this.next(); if (isAsync) { this.next(); } node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); - } else if (this.type === types._class) { + } else if (this.type === types$1._class) { var cNode = this.startNode(); node.declaration = this.parseClass(cNode, "nullableID"); } else { @@ -1670,7 +1685,7 @@ node.declaration = null; node.specifiers = this.parseExportSpecifiers(exports); if (this.eatContextual("from")) { - if (this.type !== types.string) { this.unexpected(); } + if (this.type !== types$1.string) { this.unexpected(); } node.source = this.parseExprAtom(); } else { for (var i = 0, list = node.specifiers; i < list.length; i += 1) { @@ -1680,6 +1695,10 @@ this.checkUnreserved(spec.local); // check if export is defined this.checkLocalExport(spec.local); + + if (spec.local.type === "Literal") { + this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); + } } node.source = null; @@ -1689,14 +1708,14 @@ return this.finishNode(node, "ExportNamedDeclaration") }; - pp$1.checkExport = function(exports, name, pos) { + pp$8.checkExport = function(exports, name, pos) { if (!exports) { return } - if (has(exports, name)) + if (hasOwn(exports, name)) { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } exports[name] = true; }; - pp$1.checkPatternExport = function(exports, pat) { + pp$8.checkPatternExport = function(exports, pat) { var type = pat.type; if (type === "Identifier") { this.checkExport(exports, pat.name, pat.start); } @@ -1723,7 +1742,7 @@ { this.checkPatternExport(exports, pat.expression); } }; - pp$1.checkVariableExport = function(exports, decls) { + pp$8.checkVariableExport = function(exports, decls) { if (!exports) { return } for (var i = 0, list = decls; i < list.length; i += 1) { @@ -1733,7 +1752,7 @@ } }; - pp$1.shouldParseExportStatement = function() { + pp$8.shouldParseExportStatement = function() { return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || @@ -1744,20 +1763,24 @@ // Parses a comma-separated list of module exports. - pp$1.parseExportSpecifiers = function(exports) { + pp$8.parseExportSpecifiers = function(exports) { var nodes = [], first = true; // export { x, y as z } [from '...'] - this.expect(types.braceL); - while (!this.eat(types.braceR)) { + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var node = this.startNode(); - node.local = this.parseIdent(true); - node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; - this.checkExport(exports, node.exported.name, node.exported.start); + node.local = this.parseModuleExportName(); + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports, + node.exported[node.exported.type === "Identifier" ? "name" : "value"], + node.exported.start + ); nodes.push(this.finishNode(node, "ExportSpecifier")); } return nodes @@ -1765,16 +1788,16 @@ // Parses import declaration. - pp$1.parseImport = function(node) { + pp$8.parseImport = function(node) { this.next(); // import '...' - if (this.type === types.string) { - node.specifiers = empty; + if (this.type === types$1.string) { + node.specifiers = empty$1; node.source = this.parseExprAtom(); } else { node.specifiers = this.parseImportSpecifiers(); this.expectContextual("from"); - node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); + node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); } this.semicolon(); return this.finishNode(node, "ImportDeclaration") @@ -1782,17 +1805,17 @@ // Parses a comma-separated list of module imports. - pp$1.parseImportSpecifiers = function() { + pp$8.parseImportSpecifiers = function() { var nodes = [], first = true; - if (this.type === types.name) { + if (this.type === types$1.name) { // import defaultObj, { x, y as z } from '...' var node = this.startNode(); node.local = this.parseIdent(); this.checkLValSimple(node.local, BIND_LEXICAL); nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); - if (!this.eat(types.comma)) { return nodes } + if (!this.eat(types$1.comma)) { return nodes } } - if (this.type === types.star) { + if (this.type === types$1.star) { var node$1 = this.startNode(); this.next(); this.expectContextual("as"); @@ -1801,15 +1824,15 @@ nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); return nodes } - this.expect(types.braceL); - while (!this.eat(types.braceR)) { + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var node$2 = this.startNode(); - node$2.imported = this.parseIdent(true); + node$2.imported = this.parseModuleExportName(); if (this.eatContextual("as")) { node$2.local = this.parseIdent(); } else { @@ -1822,13 +1845,24 @@ return nodes }; + pp$8.parseModuleExportName = function() { + if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { + var stringLiteral = this.parseLiteral(this.value); + if (loneSurrogate.test(stringLiteral.value)) { + this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); + } + return stringLiteral + } + return this.parseIdent(true) + }; + // Set `ExpressionStatement#directive` property for directive prologues. - pp$1.adaptDirectivePrologue = function(statements) { + pp$8.adaptDirectivePrologue = function(statements) { for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { statements[i].directive = statements[i].expression.raw.slice(1, -1); } }; - pp$1.isDirectiveCandidate = function(statement) { + pp$8.isDirectiveCandidate = function(statement) { return ( statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && @@ -1838,12 +1872,12 @@ ) }; - var pp$2 = Parser.prototype; + var pp$7 = Parser.prototype; // Convert existing expression atom to assignable pattern // if possible. - pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { + pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { if (this.options.ecmaVersion >= 6 && node) { switch (node.type) { case "Identifier": @@ -1924,7 +1958,7 @@ // Convert list of expression atoms to binding list. - pp$2.toAssignableList = function(exprList, isBinding) { + pp$7.toAssignableList = function(exprList, isBinding) { var end = exprList.length; for (var i = 0; i < end; i++) { var elt = exprList[i]; @@ -1940,19 +1974,19 @@ // Parses spread element. - pp$2.parseSpread = function(refDestructuringErrors) { + pp$7.parseSpread = function(refDestructuringErrors) { var node = this.startNode(); this.next(); node.argument = this.parseMaybeAssign(false, refDestructuringErrors); return this.finishNode(node, "SpreadElement") }; - pp$2.parseRestBinding = function() { + pp$7.parseRestBinding = function() { var node = this.startNode(); this.next(); // RestElement inside of a function parameter must be an identifier - if (this.options.ecmaVersion === 6 && this.type !== types.name) + if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { this.unexpected(); } node.argument = this.parseBindingAtom(); @@ -1962,36 +1996,36 @@ // Parses lvalue (assignable) atom. - pp$2.parseBindingAtom = function() { + pp$7.parseBindingAtom = function() { if (this.options.ecmaVersion >= 6) { switch (this.type) { - case types.bracketL: + case types$1.bracketL: var node = this.startNode(); this.next(); - node.elements = this.parseBindingList(types.bracketR, true, true); + node.elements = this.parseBindingList(types$1.bracketR, true, true); return this.finishNode(node, "ArrayPattern") - case types.braceL: + case types$1.braceL: return this.parseObj(true) } } return this.parseIdent() }; - pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) { var elts = [], first = true; while (!this.eat(close)) { if (first) { first = false; } - else { this.expect(types.comma); } - if (allowEmpty && this.type === types.comma) { + else { this.expect(types$1.comma); } + if (allowEmpty && this.type === types$1.comma) { elts.push(null); } else if (allowTrailingComma && this.afterTrailingComma(close)) { break - } else if (this.type === types.ellipsis) { + } else if (this.type === types$1.ellipsis) { var rest = this.parseRestBinding(); this.parseBindingListItem(rest); elts.push(rest); - if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } this.expect(close); break } else { @@ -2003,15 +2037,15 @@ return elts }; - pp$2.parseBindingListItem = function(param) { + pp$7.parseBindingListItem = function(param) { return param }; // Parses assignment pattern around given atom if possible. - pp$2.parseMaybeDefault = function(startPos, startLoc, left) { + pp$7.parseMaybeDefault = function(startPos, startLoc, left) { left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left } var node = this.startNodeAt(startPos, startLoc); node.left = left; node.right = this.parseMaybeAssign(); @@ -2082,7 +2116,7 @@ // duplicate argument names. checkClashes is ignored if the provided construct // is an assignment (i.e., bindingType is BIND_NONE). - pp$2.checkLValSimple = function(expr, bindingType, checkClashes) { + pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; var isBind = bindingType !== BIND_NONE; @@ -2095,7 +2129,7 @@ if (bindingType === BIND_LEXICAL && expr.name === "let") { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } if (checkClashes) { - if (has(checkClashes, expr.name)) + if (hasOwn(checkClashes, expr.name)) { this.raiseRecoverable(expr.start, "Argument name clash"); } checkClashes[expr.name] = true; } @@ -2120,7 +2154,7 @@ } }; - pp$2.checkLValPattern = function(expr, bindingType, checkClashes) { + pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; switch (expr.type) { @@ -2145,7 +2179,7 @@ } }; - pp$2.checkLValInnerPattern = function(expr, bindingType, checkClashes) { + pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; switch (expr.type) { @@ -2177,7 +2211,7 @@ this.generator = !!generator; }; - var types$1 = { + var types = { b_stat: new TokContext("{", false), b_expr: new TokContext("{", true), b_tmpl: new TokContext("${", false), @@ -2190,38 +2224,38 @@ f_gen: new TokContext("function", false, false, null, true) }; - var pp$3 = Parser.prototype; + var pp$6 = Parser.prototype; - pp$3.initialContext = function() { - return [types$1.b_stat] + pp$6.initialContext = function() { + return [types.b_stat] }; - pp$3.curContext = function() { + pp$6.curContext = function() { return this.context[this.context.length - 1] }; - pp$3.braceIsBlock = function(prevType) { + pp$6.braceIsBlock = function(prevType) { var parent = this.curContext(); - if (parent === types$1.f_expr || parent === types$1.f_stat) + if (parent === types.f_expr || parent === types.f_stat) { return true } - if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) + if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) { return !parent.isExpr } // The check for `tt.name && exprAllowed` detects whether we are // after a `yield` or `of` construct. See the `updateContext` for // `tt.name`. - if (prevType === types._return || prevType === types.name && this.exprAllowed) + if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } - if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) + if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) { return true } - if (prevType === types.braceL) - { return parent === types$1.b_stat } - if (prevType === types._var || prevType === types._const || prevType === types.name) + if (prevType === types$1.braceL) + { return parent === types.b_stat } + if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) { return false } return !this.exprAllowed }; - pp$3.inGeneratorContext = function() { + pp$6.inGeneratorContext = function() { for (var i = this.context.length - 1; i >= 1; i--) { var context = this.context[i]; if (context.token === "function") @@ -2230,9 +2264,9 @@ return false }; - pp$3.updateContext = function(prevType) { + pp$6.updateContext = function(prevType) { var update, type = this.type; - if (type.keyword && prevType === types.dot) + if (type.keyword && prevType === types$1.dot) { this.exprAllowed = false; } else if (update = type.updateContext) { update.call(this, prevType); } @@ -2241,7 +2275,7 @@ }; // Used to handle egde case when token context could not be inferred correctly in tokenize phase - pp$3.overrideContext = function(tokenCtx) { + pp$6.overrideContext = function(tokenCtx) { if (this.curContext() !== tokenCtx) { this.context[this.context.length - 1] = tokenCtx; } @@ -2249,71 +2283,71 @@ // Token-specific context update code - types.parenR.updateContext = types.braceR.updateContext = function() { + types$1.parenR.updateContext = types$1.braceR.updateContext = function() { if (this.context.length === 1) { this.exprAllowed = true; return } var out = this.context.pop(); - if (out === types$1.b_stat && this.curContext().token === "function") { + if (out === types.b_stat && this.curContext().token === "function") { out = this.context.pop(); } this.exprAllowed = !out.isExpr; }; - types.braceL.updateContext = function(prevType) { - this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); + types$1.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); this.exprAllowed = true; }; - types.dollarBraceL.updateContext = function() { - this.context.push(types$1.b_tmpl); + types$1.dollarBraceL.updateContext = function() { + this.context.push(types.b_tmpl); this.exprAllowed = true; }; - types.parenL.updateContext = function(prevType) { - var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; - this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); + types$1.parenL.updateContext = function(prevType) { + var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; + this.context.push(statementParens ? types.p_stat : types.p_expr); this.exprAllowed = true; }; - types.incDec.updateContext = function() { + types$1.incDec.updateContext = function() { // tokExprAllowed stays unchanged }; - types._function.updateContext = types._class.updateContext = function(prevType) { - if (prevType.beforeExpr && prevType !== types._else && - !(prevType === types.semi && this.curContext() !== types$1.p_stat) && - !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && - !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) - { this.context.push(types$1.f_expr); } + types$1._function.updateContext = types$1._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types$1._else && + !(prevType === types$1.semi && this.curContext() !== types.p_stat) && + !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && + !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) + { this.context.push(types.f_expr); } else - { this.context.push(types$1.f_stat); } + { this.context.push(types.f_stat); } this.exprAllowed = false; }; - types.backQuote.updateContext = function() { - if (this.curContext() === types$1.q_tmpl) + types$1.backQuote.updateContext = function() { + if (this.curContext() === types.q_tmpl) { this.context.pop(); } else - { this.context.push(types$1.q_tmpl); } + { this.context.push(types.q_tmpl); } this.exprAllowed = false; }; - types.star.updateContext = function(prevType) { - if (prevType === types._function) { + types$1.star.updateContext = function(prevType) { + if (prevType === types$1._function) { var index = this.context.length - 1; - if (this.context[index] === types$1.f_expr) - { this.context[index] = types$1.f_expr_gen; } + if (this.context[index] === types.f_expr) + { this.context[index] = types.f_expr_gen; } else - { this.context[index] = types$1.f_gen; } + { this.context[index] = types.f_gen; } } this.exprAllowed = true; }; - types.name.updateContext = function(prevType) { + types$1.name.updateContext = function(prevType) { var allowed = false; - if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { + if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { allowed = true; } @@ -2323,14 +2357,14 @@ // A recursive descent parser operates by defining functions for all - var pp$4 = Parser.prototype; + var pp$5 = Parser.prototype; // Check if property name clashes with already added. // Object/class getters and setters are not allowed to clash — // either with each other or with an init property — and in // strict mode, init properties are also not allowed to be repeated. - pp$4.checkPropClash = function(prop, propHash, refDestructuringErrors) { + pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { return } if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) @@ -2347,10 +2381,12 @@ if (name === "__proto__" && kind === "init") { if (propHash.proto) { if (refDestructuringErrors) { - if (refDestructuringErrors.doubleProto < 0) - { refDestructuringErrors.doubleProto = key.start; } - // Backwards-compat kludge. Can be removed in version 6.0 - } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + if (refDestructuringErrors.doubleProto < 0) { + refDestructuringErrors.doubleProto = key.start; + } + } else { + this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); + } } propHash.proto = true; } @@ -2392,13 +2428,13 @@ // and object pattern might appear (so it's possible to raise // delayed syntax error at correct position). - pp$4.parseExpression = function(forInit, refDestructuringErrors) { + pp$5.parseExpression = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); - if (this.type === types.comma) { + if (this.type === types$1.comma) { var node = this.startNodeAt(startPos, startLoc); node.expressions = [expr]; - while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } + while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } return this.finishNode(node, "SequenceExpression") } return expr @@ -2407,7 +2443,7 @@ // Parse an assignment expression. This includes applications of // operators like `+=`. - pp$4.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { + pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { if (this.isContextual("yield")) { if (this.inGenerator) { return this.parseYield(forInit) } // The tokenizer will assume an expression is allowed after @@ -2415,10 +2451,11 @@ else { this.exprAllowed = false; } } - var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; if (refDestructuringErrors) { oldParenAssign = refDestructuringErrors.parenthesizedAssign; oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; } else { refDestructuringErrors = new DestructuringErrors; @@ -2426,7 +2463,7 @@ } var startPos = this.start, startLoc = this.startLoc; - if (this.type === types.parenL || this.type === types.name) { + if (this.type === types$1.parenL || this.type === types$1.name) { this.potentialArrowAt = this.start; this.potentialArrowInForAwait = forInit === "await"; } @@ -2435,20 +2472,21 @@ if (this.type.isAssign) { var node = this.startNodeAt(startPos, startLoc); node.operator = this.value; - if (this.type === types.eq) + if (this.type === types$1.eq) { left = this.toAssignable(left, false, refDestructuringErrors); } if (!ownDestructuringErrors) { refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; } if (refDestructuringErrors.shorthandAssign >= left.start) { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly - if (this.type === types.eq) + if (this.type === types$1.eq) { this.checkLValPattern(left); } else { this.checkLValSimple(left); } node.left = left; this.next(); node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; } return this.finishNode(node, "AssignmentExpression") } else { if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } @@ -2460,15 +2498,15 @@ // Parse a ternary conditional (`?:`) operator. - pp$4.parseMaybeConditional = function(forInit, refDestructuringErrors) { + pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseExprOps(forInit, refDestructuringErrors); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - if (this.eat(types.question)) { + if (this.eat(types$1.question)) { var node = this.startNodeAt(startPos, startLoc); node.test = expr; node.consequent = this.parseMaybeAssign(); - this.expect(types.colon); + this.expect(types$1.colon); node.alternate = this.parseMaybeAssign(forInit); return this.finishNode(node, "ConditionalExpression") } @@ -2477,7 +2515,7 @@ // Start the precedence parser. - pp$4.parseExprOps = function(forInit, refDestructuringErrors) { + pp$5.parseExprOps = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } @@ -2490,23 +2528,23 @@ // defer further parser to one of its callers when it encounters an // operator that has a lower precedence than the set it is parsing. - pp$4.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { + pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { var prec = this.type.binop; - if (prec != null && (!forInit || this.type !== types._in)) { + if (prec != null && (!forInit || this.type !== types$1._in)) { if (prec > minPrec) { - var logical = this.type === types.logicalOR || this.type === types.logicalAND; - var coalesce = this.type === types.coalesce; + var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; + var coalesce = this.type === types$1.coalesce; if (coalesce) { // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. - prec = types.logicalAND.binop; + prec = types$1.logicalAND.binop; } var op = this.value; this.next(); var startPos = this.start, startLoc = this.startLoc; var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); - if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) { + if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) { this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); } return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit) @@ -2515,7 +2553,8 @@ return left }; - pp$4.buildBinary = function(startPos, startLoc, left, right, op, logical) { + pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { + if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); } var node = this.startNodeAt(startPos, startLoc); node.left = left; node.operator = op; @@ -2525,13 +2564,13 @@ // Parse unary operators, both prefix and postfix. - pp$4.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { + pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { var startPos = this.start, startLoc = this.startLoc, expr; if (this.isContextual("await") && this.canAwait) { expr = this.parseAwait(forInit); sawUnary = true; } else if (this.type.prefix) { - var node = this.startNode(), update = this.type === types.incDec; + var node = this.startNode(), update = this.type === types$1.incDec; node.operator = this.value; node.prefix = true; this.next(); @@ -2545,6 +2584,11 @@ { this.raiseRecoverable(node.start, "Private fields can not be deleted"); } else { sawUnary = true; } expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else if (!sawUnary && this.type === types$1.privateId) { + if (forInit || this.privateNameStack.length === 0) { this.unexpected(); } + expr = this.parsePrivateIdent(); + // only could be private fields in 'in', such as #x in obj + if (this.type !== types$1._in) { this.unexpected(); } } else { expr = this.parseExprSubscripts(refDestructuringErrors, forInit); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } @@ -2559,7 +2603,7 @@ } } - if (!incDec && this.eat(types.starstar)) { + if (!incDec && this.eat(types$1.starstar)) { if (sawUnary) { this.unexpected(this.lastTokStart); } else @@ -2578,7 +2622,7 @@ // Parse call, dot, and `[]`-subscript expressions. - pp$4.parseExprSubscripts = function(refDestructuringErrors, forInit) { + pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseExprAtom(refDestructuringErrors, forInit); if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") @@ -2592,7 +2636,7 @@ return result }; - pp$4.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { + pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.potentialArrowAt === base.start; @@ -2615,19 +2659,19 @@ } }; - pp$4.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { + pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { var optionalSupported = this.options.ecmaVersion >= 11; - var optional = optionalSupported && this.eat(types.questionDot); + var optional = optionalSupported && this.eat(types$1.questionDot); if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } - var computed = this.eat(types.bracketL); - if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) { + var computed = this.eat(types$1.bracketL); + if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) { var node = this.startNodeAt(startPos, startLoc); node.object = base; if (computed) { node.property = this.parseExpression(); - this.expect(types.bracketR); - } else if (this.type === types.privateId && base.type !== "Super") { + this.expect(types$1.bracketR); + } else if (this.type === types$1.privateId && base.type !== "Super") { node.property = this.parsePrivateIdent(); } else { node.property = this.parseIdent(this.options.allowReserved !== "never"); @@ -2637,13 +2681,13 @@ node.optional = optional; } base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.eat(types.parenL)) { + } else if (!noCalls && this.eat(types$1.parenL)) { var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; - var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); - if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) { + var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); if (this.awaitIdentPos > 0) @@ -2664,7 +2708,7 @@ node$1.optional = optional; } base = this.finishNode(node$1, "CallExpression"); - } else if (this.type === types.backQuote) { + } else if (this.type === types$1.backQuote) { if (optional || optionalChained) { this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); } @@ -2681,19 +2725,19 @@ // `new`, or an expression wrapped in punctuation like `()`, `[]`, // or `{}`. - pp$4.parseExprAtom = function(refDestructuringErrors, forInit) { + pp$5.parseExprAtom = function(refDestructuringErrors, forInit) { // If a division operator appears in an expression position, the // tokenizer got confused, and we force it to read a regexp instead. - if (this.type === types.slash) { this.readRegexp(); } + if (this.type === types$1.slash) { this.readRegexp(); } var node, canBeArrow = this.potentialArrowAt === this.start; switch (this.type) { - case types._super: + case types$1._super: if (!this.allowSuper) { this.raise(this.start, "'super' keyword outside a method"); } node = this.startNode(); this.next(); - if (this.type === types.parenL && !this.allowDirectSuper) + if (this.type === types$1.parenL && !this.allowDirectSuper) { this.raise(node.start, "super() call outside constructor of a subclass"); } // The `super` keyword can appear at below: // SuperProperty: @@ -2701,52 +2745,52 @@ // super . IdentifierName // SuperCall: // super ( Arguments ) - if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) { this.unexpected(); } return this.finishNode(node, "Super") - case types._this: + case types$1._this: node = this.startNode(); this.next(); return this.finishNode(node, "ThisExpression") - case types.name: + case types$1.name: var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; var id = this.parseIdent(false); - if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) { - this.overrideContext(types$1.f_expr); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { + this.overrideContext(types.f_expr); return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit) } if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(types.arrow)) + if (this.eat(types$1.arrow)) { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) } - if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc && + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { id = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(types.arrow)) + if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) { this.unexpected(); } return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit) } } return id - case types.regexp: + case types$1.regexp: var value = this.value; node = this.parseLiteral(value.value); node.regex = {pattern: value.pattern, flags: value.flags}; return node - case types.num: case types.string: + case types$1.num: case types$1.string: return this.parseLiteral(this.value) - case types._null: case types._true: case types._false: + case types$1._null: case types$1._true: case types$1._false: node = this.startNode(); - node.value = this.type === types._null ? null : this.type === types._true; + node.value = this.type === types$1._null ? null : this.type === types$1._true; node.raw = this.type.keyword; this.next(); return this.finishNode(node, "Literal") - case types.parenL: + case types$1.parenL: var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); if (refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) @@ -2756,31 +2800,31 @@ } return expr - case types.bracketL: + case types$1.bracketL: node = this.startNode(); this.next(); - node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); + node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); return this.finishNode(node, "ArrayExpression") - case types.braceL: - this.overrideContext(types$1.b_expr); + case types$1.braceL: + this.overrideContext(types.b_expr); return this.parseObj(false, refDestructuringErrors) - case types._function: + case types$1._function: node = this.startNode(); this.next(); return this.parseFunction(node, 0) - case types._class: + case types$1._class: return this.parseClass(this.startNode(), false) - case types._new: + case types$1._new: return this.parseNew() - case types.backQuote: + case types$1.backQuote: return this.parseTemplate() - case types._import: + case types$1._import: if (this.options.ecmaVersion >= 11) { return this.parseExprImport() } else { @@ -2792,7 +2836,7 @@ } }; - pp$4.parseExprImport = function() { + pp$5.parseExprImport = function() { var node = this.startNode(); // Consume `import` as an identifier for `import.meta`. @@ -2801,9 +2845,9 @@ var meta = this.parseIdent(true); switch (this.type) { - case types.parenL: + case types$1.parenL: return this.parseDynamicImport(node) - case types.dot: + case types$1.dot: node.meta = meta; return this.parseImportMeta(node) default: @@ -2811,16 +2855,16 @@ } }; - pp$4.parseDynamicImport = function(node) { + pp$5.parseDynamicImport = function(node) { this.next(); // skip `(` // Parse node.source. node.source = this.parseMaybeAssign(); // Verify ending. - if (!this.eat(types.parenR)) { + if (!this.eat(types$1.parenR)) { var errorPos = this.start; - if (this.eat(types.comma) && this.eat(types.parenR)) { + if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); } else { this.unexpected(errorPos); @@ -2830,7 +2874,7 @@ return this.finishNode(node, "ImportExpression") }; - pp$4.parseImportMeta = function(node) { + pp$5.parseImportMeta = function(node) { this.next(); // skip `.` var containsEsc = this.containsEsc; @@ -2846,7 +2890,7 @@ return this.finishNode(node, "MetaProperty") }; - pp$4.parseLiteral = function(value) { + pp$5.parseLiteral = function(value) { var node = this.startNode(); node.value = value; node.raw = this.input.slice(this.start, this.end); @@ -2855,14 +2899,14 @@ return this.finishNode(node, "Literal") }; - pp$4.parseParenExpression = function() { - this.expect(types.parenL); + pp$5.parseParenExpression = function() { + this.expect(types$1.parenL); var val = this.parseExpression(); - this.expect(types.parenR); + this.expect(types$1.parenR); return val }; - pp$4.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { + pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; if (this.options.ecmaVersion >= 6) { this.next(); @@ -2873,24 +2917,24 @@ this.yieldPos = 0; this.awaitPos = 0; // Do not save awaitIdentPos to allow checking awaits nested in parameters - while (this.type !== types.parenR) { - first ? first = false : this.expect(types.comma); - if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) { + while (this.type !== types$1.parenR) { + first ? first = false : this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { lastIsComma = true; break - } else if (this.type === types.ellipsis) { + } else if (this.type === types$1.ellipsis) { spreadStart = this.start; exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } break } else { exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); } } var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; - this.expect(types.parenR); + this.expect(types$1.parenR); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); this.yieldPos = oldYieldPos; @@ -2924,12 +2968,12 @@ } }; - pp$4.parseParenItem = function(item) { + pp$5.parseParenItem = function(item) { return item }; - pp$4.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, forInit) + pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit) }; // New's precedence is slightly tricky. It must allow its argument to @@ -2938,13 +2982,13 @@ // argument to parseSubscripts to prevent it from consuming the // argument list. - var empty$1 = []; + var empty = []; - pp$4.parseNew = function() { + pp$5.parseNew = function() { if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } var node = this.startNode(); var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { node.meta = meta; var containsEsc = this.containsEsc; node.property = this.parseIdent(true); @@ -2956,23 +3000,23 @@ { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); } return this.finishNode(node, "MetaProperty") } - var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import; + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import; node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); if (isImport && node.callee.type === "ImportExpression") { this.raise(startPos, "Cannot use new with import()"); } - if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } - else { node.arguments = empty$1; } + if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); } + else { node.arguments = empty; } return this.finishNode(node, "NewExpression") }; // Parse template expression. - pp$4.parseTemplateElement = function(ref) { + pp$5.parseTemplateElement = function(ref) { var isTagged = ref.isTagged; var elem = this.startNode(); - if (this.type === types.invalidTemplate) { + if (this.type === types$1.invalidTemplate) { if (!isTagged) { this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); } @@ -2987,11 +3031,11 @@ }; } this.next(); - elem.tail = this.type === types.backQuote; + elem.tail = this.type === types$1.backQuote; return this.finishNode(elem, "TemplateElement") }; - pp$4.parseTemplate = function(ref) { + pp$5.parseTemplate = function(ref) { if ( ref === void 0 ) ref = {}; var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; @@ -3001,32 +3045,32 @@ var curElt = this.parseTemplateElement({isTagged: isTagged}); node.quasis = [curElt]; while (!curElt.tail) { - if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); } - this.expect(types.dollarBraceL); + if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); } + this.expect(types$1.dollarBraceL); node.expressions.push(this.parseExpression()); - this.expect(types.braceR); + this.expect(types$1.braceR); node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); } this.next(); return this.finishNode(node, "TemplateLiteral") }; - pp$4.isAsyncProp = function(prop) { + pp$5.isAsyncProp = function(prop) { return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && - (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; // Parse an object literal or binding pattern. - pp$4.parseObj = function(isPattern, refDestructuringErrors) { + pp$5.parseObj = function(isPattern, refDestructuringErrors) { var node = this.startNode(), first = true, propHash = {}; node.properties = []; this.next(); - while (!this.eat(types.braceR)) { + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var prop = this.parseProperty(isPattern, refDestructuringErrors); @@ -3036,18 +3080,18 @@ return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") }; - pp$4.parseProperty = function(isPattern, refDestructuringErrors) { + pp$5.parseProperty = function(isPattern, refDestructuringErrors) { var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; - if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { if (isPattern) { prop.argument = this.parseIdent(false); - if (this.type === types.comma) { + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } return this.finishNode(prop, "RestElement") } // To disallow parenthesized identifier via `this.toAssignable()`. - if (this.type === types.parenL && refDestructuringErrors) { + if (this.type === types$1.parenL && refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0) { refDestructuringErrors.parenthesizedAssign = this.start; } @@ -3058,7 +3102,7 @@ // Parse argument. prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); // To disallow trailing comma via `this.toAssignable()`. - if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } // Finish @@ -3072,13 +3116,13 @@ startLoc = this.startLoc; } if (!isPattern) - { isGenerator = this.eat(types.star); } + { isGenerator = this.eat(types$1.star); } } var containsEsc = this.containsEsc; this.parsePropertyName(prop); if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); this.parsePropertyName(prop, refDestructuringErrors); } else { isAsync = false; @@ -3087,14 +3131,14 @@ return this.finishNode(prop, "Property") }; - pp$4.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { - if ((isGenerator || isAsync) && this.type === types.colon) + pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types$1.colon) { this.unexpected(); } - if (this.eat(types.colon)) { + if (this.eat(types$1.colon)) { prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); prop.kind = "init"; - } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { if (isPattern) { this.unexpected(); } prop.kind = "init"; prop.method = true; @@ -3102,7 +3146,7 @@ } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && - (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) { + (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { if (isGenerator || isAsync) { this.unexpected(); } prop.kind = prop.key.name; this.parsePropertyName(prop); @@ -3126,7 +3170,7 @@ prop.kind = "init"; if (isPattern) { prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); - } else if (this.type === types.eq && refDestructuringErrors) { + } else if (this.type === types$1.eq && refDestructuringErrors) { if (refDestructuringErrors.shorthandAssign < 0) { refDestructuringErrors.shorthandAssign = this.start; } prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); @@ -3137,23 +3181,23 @@ } else { this.unexpected(); } }; - pp$4.parsePropertyName = function(prop) { + pp$5.parsePropertyName = function(prop) { if (this.options.ecmaVersion >= 6) { - if (this.eat(types.bracketL)) { + if (this.eat(types$1.bracketL)) { prop.computed = true; prop.key = this.parseMaybeAssign(); - this.expect(types.bracketR); + this.expect(types$1.bracketR); return prop.key } else { prop.computed = false; } } - return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") + return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") }; // Initialize empty function node. - pp$4.initFunction = function(node) { + pp$5.initFunction = function(node) { node.id = null; if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } if (this.options.ecmaVersion >= 8) { node.async = false; } @@ -3161,7 +3205,7 @@ // Parse object or class method. - pp$4.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.initFunction(node); @@ -3175,8 +3219,8 @@ this.awaitIdentPos = 0; this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); this.parseFunctionBody(node, false, true, false); @@ -3188,7 +3232,7 @@ // Parse arrow function expression with given parameters. - pp$4.parseArrowExpression = function(node, params, isAsync, forInit) { + pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); @@ -3210,8 +3254,8 @@ // Parse function body and check parameters. - pp$4.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { - var isExpression = isArrowFunction && this.type !== types.braceL; + pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { + var isExpression = isArrowFunction && this.type !== types$1.braceL; var oldStrict = this.strict, useStrict = false; if (isExpression) { @@ -3247,7 +3291,7 @@ this.exitScope(); }; - pp$4.isSimpleParamList = function(params) { + pp$5.isSimpleParamList = function(params) { for (var i = 0, list = params; i < list.length; i += 1) { var param = list[i]; @@ -3260,7 +3304,7 @@ // Checks function params for various disallowed patterns such as using "eval" // or "arguments" and duplicate parameters. - pp$4.checkParams = function(node, allowDuplicates) { + pp$5.checkParams = function(node, allowDuplicates) { var nameHash = Object.create(null); for (var i = 0, list = node.params; i < list.length; i += 1) { @@ -3276,20 +3320,20 @@ // nothing in between them to be parsed as `null` (which is needed // for array literals). - pp$4.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { var elts = [], first = true; while (!this.eat(close)) { if (!first) { - this.expect(types.comma); + this.expect(types$1.comma); if (allowTrailingComma && this.afterTrailingComma(close)) { break } } else { first = false; } var elt = (void 0); - if (allowEmpty && this.type === types.comma) + if (allowEmpty && this.type === types$1.comma) { elt = null; } - else if (this.type === types.ellipsis) { + else if (this.type === types$1.ellipsis) { elt = this.parseSpread(refDestructuringErrors); - if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0) + if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } } else { elt = this.parseMaybeAssign(false, refDestructuringErrors); @@ -3299,7 +3343,7 @@ return elts }; - pp$4.checkUnreserved = function(ref) { + pp$5.checkUnreserved = function(ref) { var start = ref.start; var end = ref.end; var name = ref.name; @@ -3328,9 +3372,9 @@ // when parsing properties), it will also convert keywords into // identifiers. - pp$4.parseIdent = function(liberal, isBinding) { + pp$5.parseIdent = function(liberal, isBinding) { var node = this.startNode(); - if (this.type === types.name) { + if (this.type === types$1.name) { node.name = this.value; } else if (this.type.keyword) { node.name = this.type.keyword; @@ -3356,9 +3400,9 @@ return node }; - pp$4.parsePrivateIdent = function() { + pp$5.parsePrivateIdent = function() { var node = this.startNode(); - if (this.type === types.privateId) { + if (this.type === types$1.privateId) { node.name = this.value; } else { this.unexpected(); @@ -3378,22 +3422,22 @@ // Parses yield expression inside generator. - pp$4.parseYield = function(forInit) { + pp$5.parseYield = function(forInit) { if (!this.yieldPos) { this.yieldPos = this.start; } var node = this.startNode(); this.next(); - if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { + if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) { node.delegate = false; node.argument = null; } else { - node.delegate = this.eat(types.star); + node.delegate = this.eat(types$1.star); node.argument = this.parseMaybeAssign(forInit); } return this.finishNode(node, "YieldExpression") }; - pp$4.parseAwait = function(forInit) { + pp$5.parseAwait = function(forInit) { if (!this.awaitPos) { this.awaitPos = this.start; } var node = this.startNode(); @@ -3402,7 +3446,7 @@ return this.finishNode(node, "AwaitExpression") }; - var pp$5 = Parser.prototype; + var pp$4 = Parser.prototype; // This function is used to raise exceptions on parse errors. It // takes an offset integer (into the current `input`) to indicate @@ -3410,7 +3454,7 @@ // of the error message, and then raises a `SyntaxError` with that // message. - pp$5.raise = function(pos, message) { + pp$4.raise = function(pos, message) { var loc = getLineInfo(this.input, pos); message += " (" + loc.line + ":" + loc.column + ")"; var err = new SyntaxError(message); @@ -3418,15 +3462,15 @@ throw err }; - pp$5.raiseRecoverable = pp$5.raise; + pp$4.raiseRecoverable = pp$4.raise; - pp$5.curPosition = function() { + pp$4.curPosition = function() { if (this.options.locations) { return new Position(this.curLine, this.pos - this.lineStart) } }; - var pp$6 = Parser.prototype; + var pp$3 = Parser.prototype; var Scope = function Scope(flags) { this.flags = flags; @@ -3442,22 +3486,22 @@ // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. - pp$6.enterScope = function(flags) { + pp$3.enterScope = function(flags) { this.scopeStack.push(new Scope(flags)); }; - pp$6.exitScope = function() { + pp$3.exitScope = function() { this.scopeStack.pop(); }; // The spec says: // > At the top level of a function, or script, function declarations are // > treated like var declarations rather than like lexical declarations. - pp$6.treatFunctionsAsVarInScope = function(scope) { + pp$3.treatFunctionsAsVarInScope = function(scope) { return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) }; - pp$6.declareName = function(name, bindingType, pos) { + pp$3.declareName = function(name, bindingType, pos) { var redeclared = false; if (bindingType === BIND_LEXICAL) { var scope = this.currentScope(); @@ -3492,7 +3536,7 @@ if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } }; - pp$6.checkLocalExport = function(id) { + pp$3.checkLocalExport = function(id) { // scope.functions must be empty as Module code is always strict. if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { @@ -3500,11 +3544,11 @@ } }; - pp$6.currentScope = function() { + pp$3.currentScope = function() { return this.scopeStack[this.scopeStack.length - 1] }; - pp$6.currentVarScope = function() { + pp$3.currentVarScope = function() { for (var i = this.scopeStack.length - 1;; i--) { var scope = this.scopeStack[i]; if (scope.flags & SCOPE_VAR) { return scope } @@ -3512,7 +3556,7 @@ }; // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. - pp$6.currentThisScope = function() { + pp$3.currentThisScope = function() { for (var i = this.scopeStack.length - 1;; i--) { var scope = this.scopeStack[i]; if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } @@ -3533,13 +3577,13 @@ // Start an AST node, attaching a start offset. - var pp$7 = Parser.prototype; + var pp$2 = Parser.prototype; - pp$7.startNode = function() { + pp$2.startNode = function() { return new Node(this, this.start, this.startLoc) }; - pp$7.startNodeAt = function(pos, loc) { + pp$2.startNodeAt = function(pos, loc) { return new Node(this, pos, loc) }; @@ -3555,17 +3599,17 @@ return node } - pp$7.finishNode = function(node, type) { + pp$2.finishNode = function(node, type) { return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) }; // Finish node at given position - pp$7.finishNodeAt = function(node, type, pos, loc) { + pp$2.finishNodeAt = function(node, type, pos, loc) { return finishNodeAt.call(this, node, type, pos, loc) }; - pp$7.copyNode = function(node) { + pp$2.copyNode = function(node) { var newNode = new Node(this, node.start, this.startLoc); for (var prop in node) { newNode[prop] = node[prop]; } return newNode @@ -3580,26 +3624,30 @@ var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; var ecma11BinaryProperties = ecma10BinaryProperties; var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; + var ecma13BinaryProperties = ecma12BinaryProperties; var unicodeBinaryProperties = { 9: ecma9BinaryProperties, 10: ecma10BinaryProperties, 11: ecma11BinaryProperties, - 12: ecma12BinaryProperties + 12: ecma12BinaryProperties, + 13: ecma13BinaryProperties }; // #table-unicode-general-category-values var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; // #table-unicode-script-values - var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; + var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; var unicodeScriptValues = { 9: ecma9ScriptValues, 10: ecma10ScriptValues, 11: ecma11ScriptValues, - 12: ecma12ScriptValues + 12: ecma12ScriptValues, + 13: ecma13ScriptValues }; var data = {}; @@ -3617,17 +3665,19 @@ d.nonBinary.sc = d.nonBinary.Script; d.nonBinary.scx = d.nonBinary.Script_Extensions; } - buildUnicodeData(9); - buildUnicodeData(10); - buildUnicodeData(11); - buildUnicodeData(12); - var pp$8 = Parser.prototype; + for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) { + var ecmaVersion = list[i]; + + buildUnicodeData(ecmaVersion); + } + + var pp$1 = Parser.prototype; var RegExpValidationState = function RegExpValidationState(parser) { this.parser = parser; this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); - this.unicodeProperties = data[parser.options.ecmaVersion >= 12 ? 12 : parser.options.ecmaVersion]; + this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; this.source = ""; this.flags = ""; this.start = 0; @@ -3718,7 +3768,7 @@ return false }; - function codePointToString(ch) { + function codePointToString$1(ch) { if (ch <= 0xFFFF) { return String.fromCharCode(ch) } ch -= 0x10000; return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) @@ -3730,7 +3780,7 @@ * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ - pp$8.validateRegExpFlags = function(state) { + pp$1.validateRegExpFlags = function(state) { var validFlags = state.validFlags; var flags = state.flags; @@ -3751,7 +3801,7 @@ * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ - pp$8.validateRegExpPattern = function(state) { + pp$1.validateRegExpPattern = function(state) { this.regexp_pattern(state); // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of @@ -3766,7 +3816,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern - pp$8.regexp_pattern = function(state) { + pp$1.regexp_pattern = function(state) { state.pos = 0; state.lastIntValue = 0; state.lastStringValue = ""; @@ -3800,7 +3850,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction - pp$8.regexp_disjunction = function(state) { + pp$1.regexp_disjunction = function(state) { this.regexp_alternative(state); while (state.eat(0x7C /* | */)) { this.regexp_alternative(state); @@ -3816,13 +3866,13 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative - pp$8.regexp_alternative = function(state) { + pp$1.regexp_alternative = function(state) { while (state.pos < state.source.length && this.regexp_eatTerm(state)) { } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term - pp$8.regexp_eatTerm = function(state) { + pp$1.regexp_eatTerm = function(state) { if (this.regexp_eatAssertion(state)) { // Handle `QuantifiableAssertion Quantifier` alternative. // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion @@ -3845,7 +3895,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion - pp$8.regexp_eatAssertion = function(state) { + pp$1.regexp_eatAssertion = function(state) { var start = state.pos; state.lastAssertionIsQuantifiable = false; @@ -3883,7 +3933,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier - pp$8.regexp_eatQuantifier = function(state, noError) { + pp$1.regexp_eatQuantifier = function(state, noError) { if ( noError === void 0 ) noError = false; if (this.regexp_eatQuantifierPrefix(state, noError)) { @@ -3894,7 +3944,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix - pp$8.regexp_eatQuantifierPrefix = function(state, noError) { + pp$1.regexp_eatQuantifierPrefix = function(state, noError) { return ( state.eat(0x2A /* * */) || state.eat(0x2B /* + */) || @@ -3902,7 +3952,7 @@ this.regexp_eatBracedQuantifier(state, noError) ) }; - pp$8.regexp_eatBracedQuantifier = function(state, noError) { + pp$1.regexp_eatBracedQuantifier = function(state, noError) { var start = state.pos; if (state.eat(0x7B /* { */)) { var min = 0, max = -1; @@ -3928,7 +3978,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom - pp$8.regexp_eatAtom = function(state) { + pp$1.regexp_eatAtom = function(state) { return ( this.regexp_eatPatternCharacters(state) || state.eat(0x2E /* . */) || @@ -3938,7 +3988,7 @@ this.regexp_eatCapturingGroup(state) ) }; - pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { + pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { if (this.regexp_eatAtomEscape(state)) { @@ -3948,7 +3998,7 @@ } return false }; - pp$8.regexp_eatUncapturingGroup = function(state) { + pp$1.regexp_eatUncapturingGroup = function(state) { var start = state.pos; if (state.eat(0x28 /* ( */)) { if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { @@ -3962,7 +4012,7 @@ } return false }; - pp$8.regexp_eatCapturingGroup = function(state) { + pp$1.regexp_eatCapturingGroup = function(state) { if (state.eat(0x28 /* ( */)) { if (this.options.ecmaVersion >= 9) { this.regexp_groupSpecifier(state); @@ -3980,7 +4030,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom - pp$8.regexp_eatExtendedAtom = function(state) { + pp$1.regexp_eatExtendedAtom = function(state) { return ( state.eat(0x2E /* . */) || this.regexp_eatReverseSolidusAtomEscape(state) || @@ -3993,7 +4043,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier - pp$8.regexp_eatInvalidBracedQuantifier = function(state) { + pp$1.regexp_eatInvalidBracedQuantifier = function(state) { if (this.regexp_eatBracedQuantifier(state, true)) { state.raise("Nothing to repeat"); } @@ -4001,7 +4051,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter - pp$8.regexp_eatSyntaxCharacter = function(state) { + pp$1.regexp_eatSyntaxCharacter = function(state) { var ch = state.current(); if (isSyntaxCharacter(ch)) { state.lastIntValue = ch; @@ -4023,7 +4073,7 @@ // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter // But eat eager. - pp$8.regexp_eatPatternCharacters = function(state) { + pp$1.regexp_eatPatternCharacters = function(state) { var start = state.pos; var ch = 0; while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { @@ -4033,7 +4083,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter - pp$8.regexp_eatExtendedPatternCharacter = function(state) { + pp$1.regexp_eatExtendedPatternCharacter = function(state) { var ch = state.current(); if ( ch !== -1 && @@ -4054,7 +4104,7 @@ // GroupSpecifier :: // [empty] // `?` GroupName - pp$8.regexp_groupSpecifier = function(state) { + pp$1.regexp_groupSpecifier = function(state) { if (state.eat(0x3F /* ? */)) { if (this.regexp_eatGroupName(state)) { if (state.groupNames.indexOf(state.lastStringValue) !== -1) { @@ -4070,7 +4120,7 @@ // GroupName :: // `<` RegExpIdentifierName `>` // Note: this updates `state.lastStringValue` property with the eaten name. - pp$8.regexp_eatGroupName = function(state) { + pp$1.regexp_eatGroupName = function(state) { state.lastStringValue = ""; if (state.eat(0x3C /* < */)) { if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { @@ -4085,12 +4135,12 @@ // RegExpIdentifierStart // RegExpIdentifierName RegExpIdentifierPart // Note: this updates `state.lastStringValue` property with the eaten name. - pp$8.regexp_eatRegExpIdentifierName = function(state) { + pp$1.regexp_eatRegExpIdentifierName = function(state) { state.lastStringValue = ""; if (this.regexp_eatRegExpIdentifierStart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); + state.lastStringValue += codePointToString$1(state.lastIntValue); while (this.regexp_eatRegExpIdentifierPart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); + state.lastStringValue += codePointToString$1(state.lastIntValue); } return true } @@ -4102,7 +4152,7 @@ // `$` // `_` // `\` RegExpUnicodeEscapeSequence[+U] - pp$8.regexp_eatRegExpIdentifierStart = function(state) { + pp$1.regexp_eatRegExpIdentifierStart = function(state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); @@ -4130,7 +4180,7 @@ // `\` RegExpUnicodeEscapeSequence[+U] // // - pp$8.regexp_eatRegExpIdentifierPart = function(state) { + pp$1.regexp_eatRegExpIdentifierPart = function(state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); @@ -4152,7 +4202,7 @@ } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape - pp$8.regexp_eatAtomEscape = function(state) { + pp$1.regexp_eatAtomEscape = function(state) { if ( this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || @@ -4170,7 +4220,7 @@ } return false }; - pp$8.regexp_eatBackReference = function(state) { + pp$1.regexp_eatBackReference = function(state) { var start = state.pos; if (this.regexp_eatDecimalEscape(state)) { var n = state.lastIntValue; @@ -4188,7 +4238,7 @@ } return false }; - pp$8.regexp_eatKGroupName = function(state) { + pp$1.regexp_eatKGroupName = function(state) { if (state.eat(0x6B /* k */)) { if (this.regexp_eatGroupName(state)) { state.backReferenceNames.push(state.lastStringValue); @@ -4200,7 +4250,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape - pp$8.regexp_eatCharacterEscape = function(state) { + pp$1.regexp_eatCharacterEscape = function(state) { return ( this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || @@ -4211,7 +4261,7 @@ this.regexp_eatIdentityEscape(state) ) }; - pp$8.regexp_eatCControlLetter = function(state) { + pp$1.regexp_eatCControlLetter = function(state) { var start = state.pos; if (state.eat(0x63 /* c */)) { if (this.regexp_eatControlLetter(state)) { @@ -4221,7 +4271,7 @@ } return false }; - pp$8.regexp_eatZero = function(state) { + pp$1.regexp_eatZero = function(state) { if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { state.lastIntValue = 0; state.advance(); @@ -4231,7 +4281,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape - pp$8.regexp_eatControlEscape = function(state) { + pp$1.regexp_eatControlEscape = function(state) { var ch = state.current(); if (ch === 0x74 /* t */) { state.lastIntValue = 0x09; /* \t */ @@ -4262,7 +4312,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter - pp$8.regexp_eatControlLetter = function(state) { + pp$1.regexp_eatControlLetter = function(state) { var ch = state.current(); if (isControlLetter(ch)) { state.lastIntValue = ch % 0x20; @@ -4279,7 +4329,7 @@ } // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence - pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { if ( forceU === void 0 ) forceU = false; var start = state.pos; @@ -4324,7 +4374,7 @@ } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape - pp$8.regexp_eatIdentityEscape = function(state) { + pp$1.regexp_eatIdentityEscape = function(state) { if (state.switchU) { if (this.regexp_eatSyntaxCharacter(state)) { return true @@ -4347,7 +4397,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape - pp$8.regexp_eatDecimalEscape = function(state) { + pp$1.regexp_eatDecimalEscape = function(state) { state.lastIntValue = 0; var ch = state.current(); if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { @@ -4361,7 +4411,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape - pp$8.regexp_eatCharacterClassEscape = function(state) { + pp$1.regexp_eatCharacterClassEscape = function(state) { var ch = state.current(); if (isCharacterClassEscape(ch)) { @@ -4403,7 +4453,7 @@ // UnicodePropertyValueExpression :: // UnicodePropertyName `=` UnicodePropertyValue // LoneUnicodePropertyNameOrValue - pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { + pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { var start = state.pos; // UnicodePropertyName `=` UnicodePropertyValue @@ -4425,24 +4475,24 @@ } return false }; - pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { - if (!has(state.unicodeProperties.nonBinary, name)) + pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!hasOwn(state.unicodeProperties.nonBinary, name)) { state.raise("Invalid property name"); } if (!state.unicodeProperties.nonBinary[name].test(value)) { state.raise("Invalid property value"); } }; - pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { if (!state.unicodeProperties.binary.test(nameOrValue)) { state.raise("Invalid property name"); } }; // UnicodePropertyName :: // UnicodePropertyNameCharacters - pp$8.regexp_eatUnicodePropertyName = function(state) { + pp$1.regexp_eatUnicodePropertyName = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyNameCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); + state.lastStringValue += codePointToString$1(ch); state.advance(); } return state.lastStringValue !== "" @@ -4453,11 +4503,11 @@ // UnicodePropertyValue :: // UnicodePropertyValueCharacters - pp$8.regexp_eatUnicodePropertyValue = function(state) { + pp$1.regexp_eatUnicodePropertyValue = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyValueCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); + state.lastStringValue += codePointToString$1(ch); state.advance(); } return state.lastStringValue !== "" @@ -4468,12 +4518,12 @@ // LoneUnicodePropertyNameOrValue :: // UnicodePropertyValueCharacters - pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { return this.regexp_eatUnicodePropertyValue(state) }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass - pp$8.regexp_eatCharacterClass = function(state) { + pp$1.regexp_eatCharacterClass = function(state) { if (state.eat(0x5B /* [ */)) { state.eat(0x5E /* ^ */); this.regexp_classRanges(state); @@ -4489,7 +4539,7 @@ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash - pp$8.regexp_classRanges = function(state) { + pp$1.regexp_classRanges = function(state) { while (this.regexp_eatClassAtom(state)) { var left = state.lastIntValue; if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { @@ -4506,7 +4556,7 @@ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash - pp$8.regexp_eatClassAtom = function(state) { + pp$1.regexp_eatClassAtom = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { @@ -4535,7 +4585,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape - pp$8.regexp_eatClassEscape = function(state) { + pp$1.regexp_eatClassEscape = function(state) { var start = state.pos; if (state.eat(0x62 /* b */)) { @@ -4562,7 +4612,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter - pp$8.regexp_eatClassControlLetter = function(state) { + pp$1.regexp_eatClassControlLetter = function(state) { var ch = state.current(); if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { state.lastIntValue = ch % 0x20; @@ -4573,7 +4623,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence - pp$8.regexp_eatHexEscapeSequence = function(state) { + pp$1.regexp_eatHexEscapeSequence = function(state) { var start = state.pos; if (state.eat(0x78 /* x */)) { if (this.regexp_eatFixedHexDigits(state, 2)) { @@ -4588,7 +4638,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits - pp$8.regexp_eatDecimalDigits = function(state) { + pp$1.regexp_eatDecimalDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; @@ -4603,7 +4653,7 @@ } // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits - pp$8.regexp_eatHexDigits = function(state) { + pp$1.regexp_eatHexDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; @@ -4632,7 +4682,7 @@ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence // Allows only 0-377(octal) i.e. 0-255(decimal). - pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { + pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { if (this.regexp_eatOctalDigit(state)) { var n1 = state.lastIntValue; if (this.regexp_eatOctalDigit(state)) { @@ -4651,7 +4701,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit - pp$8.regexp_eatOctalDigit = function(state) { + pp$1.regexp_eatOctalDigit = function(state) { var ch = state.current(); if (isOctalDigit(ch)) { state.lastIntValue = ch - 0x30; /* 0 */ @@ -4668,7 +4718,7 @@ // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence - pp$8.regexp_eatFixedHexDigits = function(state, length) { + pp$1.regexp_eatFixedHexDigits = function(state, length) { var start = state.pos; state.lastIntValue = 0; for (var i = 0; i < length; ++i) { @@ -4700,11 +4750,11 @@ // ## Tokenizer - var pp$9 = Parser.prototype; + var pp = Parser.prototype; // Move to the next token - pp$9.next = function(ignoreEscapeSequenceInKeyword) { + pp.next = function(ignoreEscapeSequenceInKeyword) { if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } if (this.options.onToken) @@ -4717,21 +4767,21 @@ this.nextToken(); }; - pp$9.getToken = function() { + pp.getToken = function() { this.next(); return new Token(this) }; // If we're in an ES6 environment, make parsers iterable if (typeof Symbol !== "undefined") - { pp$9[Symbol.iterator] = function() { - var this$1 = this; + { pp[Symbol.iterator] = function() { + var this$1$1 = this; return { next: function () { - var token = this$1.getToken(); + var token = this$1$1.getToken(); return { - done: token.type === types.eof, + done: token.type === types$1.eof, value: token } } @@ -4744,19 +4794,19 @@ // Read a single token, updating the parser object's token-related // properties. - pp$9.nextToken = function() { + pp.nextToken = function() { var curContext = this.curContext(); if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } this.start = this.pos; if (this.options.locations) { this.startLoc = this.curPosition(); } - if (this.pos >= this.input.length) { return this.finishToken(types.eof) } + if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) } if (curContext.override) { return curContext.override(this) } else { this.readToken(this.fullCharCodeAtPos()); } }; - pp$9.readToken = function(code) { + pp.readToken = function(code) { // Identifier or keyword. '\uXXXX' sequences are allowed in // identifiers, so '\' also dispatches to that. if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) @@ -4765,24 +4815,22 @@ return this.getTokenFromCode(code) }; - pp$9.fullCharCodeAtPos = function() { + pp.fullCharCodeAtPos = function() { var code = this.input.charCodeAt(this.pos); if (code <= 0xd7ff || code >= 0xdc00) { return code } var next = this.input.charCodeAt(this.pos + 1); return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00 }; - pp$9.skipBlockComment = function() { + pp.skipBlockComment = function() { var startLoc = this.options.onComment && this.curPosition(); var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } this.pos = end + 2; if (this.options.locations) { - lineBreakG.lastIndex = start; - var match; - while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) { ++this.curLine; - this.lineStart = match.index + match[0].length; + pos = this.lineStart = nextBreak; } } if (this.options.onComment) @@ -4790,7 +4838,7 @@ startLoc, this.curPosition()); } }; - pp$9.skipLineComment = function(startSkip) { + pp.skipLineComment = function(startSkip) { var start = this.pos; var startLoc = this.options.onComment && this.curPosition(); var ch = this.input.charCodeAt(this.pos += startSkip); @@ -4805,7 +4853,7 @@ // Called at the start of the parse and after every token. Skips // whitespace and comments, and. - pp$9.skipSpace = function() { + pp.skipSpace = function() { loop: while (this.pos < this.input.length) { var ch = this.input.charCodeAt(this.pos); switch (ch) { @@ -4850,7 +4898,7 @@ // the token, so that the next one's `start` will point at the // right position. - pp$9.finishToken = function(type, val) { + pp.finishToken = function(type, val) { this.end = this.pos; if (this.options.locations) { this.endLoc = this.curPosition(); } var prevType = this.type; @@ -4869,62 +4917,62 @@ // // All in the name of speed. // - pp$9.readToken_dot = function() { + pp.readToken_dot = function() { var next = this.input.charCodeAt(this.pos + 1); if (next >= 48 && next <= 57) { return this.readNumber(true) } var next2 = this.input.charCodeAt(this.pos + 2); if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' this.pos += 3; - return this.finishToken(types.ellipsis) + return this.finishToken(types$1.ellipsis) } else { ++this.pos; - return this.finishToken(types.dot) + return this.finishToken(types$1.dot) } }; - pp$9.readToken_slash = function() { // '/' + pp.readToken_slash = function() { // '/' var next = this.input.charCodeAt(this.pos + 1); if (this.exprAllowed) { ++this.pos; return this.readRegexp() } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.slash, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.slash, 1) }; - pp$9.readToken_mult_modulo_exp = function(code) { // '%*' + pp.readToken_mult_modulo_exp = function(code) { // '%*' var next = this.input.charCodeAt(this.pos + 1); var size = 1; - var tokentype = code === 42 ? types.star : types.modulo; + var tokentype = code === 42 ? types$1.star : types$1.modulo; // exponentiation operator ** and **= if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { ++size; - tokentype = types.starstar; + tokentype = types$1.starstar; next = this.input.charCodeAt(this.pos + 2); } - if (next === 61) { return this.finishOp(types.assign, size + 1) } + if (next === 61) { return this.finishOp(types$1.assign, size + 1) } return this.finishOp(tokentype, size) }; - pp$9.readToken_pipe_amp = function(code) { // '|&' + pp.readToken_pipe_amp = function(code) { // '|&' var next = this.input.charCodeAt(this.pos + 1); if (next === code) { if (this.options.ecmaVersion >= 12) { var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 === 61) { return this.finishOp(types.assign, 3) } + if (next2 === 61) { return this.finishOp(types$1.assign, 3) } } - return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) + return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2) } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1) }; - pp$9.readToken_caret = function() { // '^' + pp.readToken_caret = function() { // '^' var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.bitwiseXOR, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.bitwiseXOR, 1) }; - pp$9.readToken_plus_min = function(code) { // '+-' + pp.readToken_plus_min = function(code) { // '+-' var next = this.input.charCodeAt(this.pos + 1); if (next === code) { if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && @@ -4934,19 +4982,19 @@ this.skipSpace(); return this.nextToken() } - return this.finishOp(types.incDec, 2) + return this.finishOp(types$1.incDec, 2) } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.plusMin, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.plusMin, 1) }; - pp$9.readToken_lt_gt = function(code) { // '<>' + pp.readToken_lt_gt = function(code) { // '<>' var next = this.input.charCodeAt(this.pos + 1); var size = 1; if (next === code) { size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(types.bitShift, size) + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } + return this.finishOp(types$1.bitShift, size) } if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { @@ -4956,53 +5004,53 @@ return this.nextToken() } if (next === 61) { size = 2; } - return this.finishOp(types.relational, size) + return this.finishOp(types$1.relational, size) }; - pp$9.readToken_eq_excl = function(code) { // '=!' + pp.readToken_eq_excl = function(code) { // '=!' var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) } + if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) } if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>' this.pos += 2; - return this.finishToken(types.arrow) + return this.finishToken(types$1.arrow) } - return this.finishOp(code === 61 ? types.eq : types.prefix, 1) + return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1) }; - pp$9.readToken_question = function() { // '?' + pp.readToken_question = function() { // '?' var ecmaVersion = this.options.ecmaVersion; if (ecmaVersion >= 11) { var next = this.input.charCodeAt(this.pos + 1); if (next === 46) { var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 < 48 || next2 > 57) { return this.finishOp(types.questionDot, 2) } + if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) } } if (next === 63) { if (ecmaVersion >= 12) { var next2$1 = this.input.charCodeAt(this.pos + 2); - if (next2$1 === 61) { return this.finishOp(types.assign, 3) } + if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) } } - return this.finishOp(types.coalesce, 2) + return this.finishOp(types$1.coalesce, 2) } } - return this.finishOp(types.question, 1) + return this.finishOp(types$1.question, 1) }; - pp$9.readToken_numberSign = function() { // '#' + pp.readToken_numberSign = function() { // '#' var ecmaVersion = this.options.ecmaVersion; var code = 35; // '#' if (ecmaVersion >= 13) { ++this.pos; code = this.fullCharCodeAtPos(); if (isIdentifierStart(code, true) || code === 92 /* '\' */) { - return this.finishToken(types.privateId, this.readWord1()) + return this.finishToken(types$1.privateId, this.readWord1()) } } - this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'"); + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); }; - pp$9.getTokenFromCode = function(code) { + pp.getTokenFromCode = function(code) { switch (code) { // The interpretation of a dot depends on whether it is followed // by a digit or another two dots. @@ -5010,20 +5058,20 @@ return this.readToken_dot() // Punctuation tokens. - case 40: ++this.pos; return this.finishToken(types.parenL) - case 41: ++this.pos; return this.finishToken(types.parenR) - case 59: ++this.pos; return this.finishToken(types.semi) - case 44: ++this.pos; return this.finishToken(types.comma) - case 91: ++this.pos; return this.finishToken(types.bracketL) - case 93: ++this.pos; return this.finishToken(types.bracketR) - case 123: ++this.pos; return this.finishToken(types.braceL) - case 125: ++this.pos; return this.finishToken(types.braceR) - case 58: ++this.pos; return this.finishToken(types.colon) + case 40: ++this.pos; return this.finishToken(types$1.parenL) + case 41: ++this.pos; return this.finishToken(types$1.parenR) + case 59: ++this.pos; return this.finishToken(types$1.semi) + case 44: ++this.pos; return this.finishToken(types$1.comma) + case 91: ++this.pos; return this.finishToken(types$1.bracketL) + case 93: ++this.pos; return this.finishToken(types$1.bracketR) + case 123: ++this.pos; return this.finishToken(types$1.braceL) + case 125: ++this.pos; return this.finishToken(types$1.braceR) + case 58: ++this.pos; return this.finishToken(types$1.colon) case 96: // '`' if (this.options.ecmaVersion < 6) { break } ++this.pos; - return this.finishToken(types.backQuote) + return this.finishToken(types$1.backQuote) case 48: // '0' var next = this.input.charCodeAt(this.pos + 1); @@ -5046,7 +5094,6 @@ // often referred to. `finishOp` simply skips the amount of // characters it is given as second argument, and returns a token // of the type given by its first argument. - case 47: // '/' return this.readToken_slash() @@ -5072,22 +5119,22 @@ return this.readToken_question() case 126: // '~' - return this.finishOp(types.prefix, 1) + return this.finishOp(types$1.prefix, 1) case 35: // '#' return this.readToken_numberSign() } - this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'"); + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); }; - pp$9.finishOp = function(type, size) { + pp.finishOp = function(type, size) { var str = this.input.slice(this.pos, this.pos + size); this.pos += size; return this.finishToken(type, str) }; - pp$9.readRegexp = function() { + pp.readRegexp = function() { var escaped, inClass, start = this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); } @@ -5122,14 +5169,14 @@ // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral } - return this.finishToken(types.regexp, {pattern: pattern, flags: flags, value: value}) + return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value}) }; // Read an integer in the given radix. Return null if zero digits // were read, the integer value otherwise. When `len` is given, this // will return `null` unless the integer has exactly `len` digits. - pp$9.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { + pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { // `len` is used for character escape sequences. In that case, disallow separators. var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined; @@ -5183,7 +5230,7 @@ return BigInt(str.replace(/_/g, "")) } - pp$9.readRadixNumber = function(radix) { + pp.readRadixNumber = function(radix) { var start = this.pos; this.pos += 2; // 0x var val = this.readInt(radix); @@ -5192,12 +5239,12 @@ val = stringToBigInt(this.input.slice(start, this.pos)); ++this.pos; } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } - return this.finishToken(types.num, val) + return this.finishToken(types$1.num, val) }; // Read an integer, octal integer, or floating-point number. - pp$9.readNumber = function(startsWithDot) { + pp.readNumber = function(startsWithDot) { var start = this.pos; if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); } var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48; @@ -5207,7 +5254,7 @@ var val$1 = stringToBigInt(this.input.slice(start, this.pos)); ++this.pos; if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } - return this.finishToken(types.num, val$1) + return this.finishToken(types$1.num, val$1) } if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; } if (next === 46 && !octal) { // '.' @@ -5223,12 +5270,12 @@ if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } var val = stringToNumber(this.input.slice(start, this.pos), octal); - return this.finishToken(types.num, val) + return this.finishToken(types$1.num, val) }; // Read a string value, interpreting backslash-escapes. - pp$9.readCodePoint = function() { + pp.readCodePoint = function() { var ch = this.input.charCodeAt(this.pos), code; if (ch === 123) { // '{' @@ -5243,14 +5290,14 @@ return code }; - function codePointToString$1(code) { + function codePointToString(code) { // UTF-16 Decoding if (code <= 0xFFFF) { return String.fromCharCode(code) } code -= 0x10000; return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00) } - pp$9.readString = function(quote) { + pp.readString = function(quote) { var out = "", chunkStart = ++this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); } @@ -5273,14 +5320,14 @@ } } out += this.input.slice(chunkStart, this.pos++); - return this.finishToken(types.string, out) + return this.finishToken(types$1.string, out) }; // Reads template string tokens. var INVALID_TEMPLATE_ESCAPE_ERROR = {}; - pp$9.tryReadTemplateToken = function() { + pp.tryReadTemplateToken = function() { this.inTemplateElement = true; try { this.readTmplToken(); @@ -5295,7 +5342,7 @@ this.inTemplateElement = false; }; - pp$9.invalidStringToken = function(position, message) { + pp.invalidStringToken = function(position, message) { if (this.inTemplateElement && this.options.ecmaVersion >= 9) { throw INVALID_TEMPLATE_ESCAPE_ERROR } else { @@ -5303,23 +5350,23 @@ } }; - pp$9.readTmplToken = function() { + pp.readTmplToken = function() { var out = "", chunkStart = this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); } var ch = this.input.charCodeAt(this.pos); if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${' - if (this.pos === this.start && (this.type === types.template || this.type === types.invalidTemplate)) { + if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { if (ch === 36) { this.pos += 2; - return this.finishToken(types.dollarBraceL) + return this.finishToken(types$1.dollarBraceL) } else { ++this.pos; - return this.finishToken(types.backQuote) + return this.finishToken(types$1.backQuote) } } out += this.input.slice(chunkStart, this.pos); - return this.finishToken(types.template, out) + return this.finishToken(types$1.template, out) } if (ch === 92) { // '\' out += this.input.slice(chunkStart, this.pos); @@ -5350,7 +5397,7 @@ }; // Reads a template token to search for the end, without validating any escape sequences - pp$9.readInvalidTemplateToken = function() { + pp.readInvalidTemplateToken = function() { for (; this.pos < this.input.length; this.pos++) { switch (this.input[this.pos]) { case "\\": @@ -5361,10 +5408,10 @@ if (this.input[this.pos + 1] !== "{") { break } - // falls through + // falls through case "`": - return this.finishToken(types.invalidTemplate, this.input.slice(this.start, this.pos)) + return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)) // no default } @@ -5374,14 +5421,14 @@ // Used to read escaped characters - pp$9.readEscapedChar = function(inTemplate) { + pp.readEscapedChar = function(inTemplate) { var ch = this.input.charCodeAt(++this.pos); ++this.pos; switch (ch) { case 110: return "\n" // 'n' -> '\n' case 114: return "\r" // 'r' -> '\r' case 120: return String.fromCharCode(this.readHexChar(2)) // 'x' - case 117: return codePointToString$1(this.readCodePoint()) // 'u' + case 117: return codePointToString(this.readCodePoint()) // 'u' case 116: return "\t" // 't' -> '\t' case 98: return "\b" // 'b' -> '\b' case 118: return "\u000b" // 'v' -> '\u000b' @@ -5439,7 +5486,7 @@ // Used to read character escape sequences ('\x', '\u', '\U'). - pp$9.readHexChar = function(len) { + pp.readHexChar = function(len) { var codePos = this.pos; var n = this.readInt(16, len); if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); } @@ -5452,7 +5499,7 @@ // Incrementally adds only escaped chars, adding other chunks as-is // as a micro-optimization. - pp$9.readWord1 = function() { + pp.readWord1 = function() { this.containsEsc = false; var word = "", first = true, chunkStart = this.pos; var astral = this.options.ecmaVersion >= 6; @@ -5470,7 +5517,7 @@ var esc = this.readCodePoint(); if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { this.invalidStringToken(escStart, "Invalid Unicode escape"); } - word += codePointToString$1(esc); + word += codePointToString(esc); chunkStart = this.pos; } else { break @@ -5483,18 +5530,18 @@ // Read an identifier or keyword token. Will check for reserved // words when necessary. - pp$9.readWord = function() { + pp.readWord = function() { var word = this.readWord1(); - var type = types.name; + var type = types$1.name; if (this.keywords.test(word)) { - type = keywords$1[word]; + type = keywords[word]; } return this.finishToken(type, word) }; // Acorn is a tiny, fast JavaScript parser written in JavaScript. - var version = "8.5.0"; + var version = "8.7.0"; Parser.acorn = { Parser: Parser, @@ -5505,10 +5552,10 @@ getLineInfo: getLineInfo, Node: Node, TokenType: TokenType, - tokTypes: types, - keywordTypes: keywords$1, + tokTypes: types$1, + keywordTypes: keywords, TokContext: TokContext, - tokContexts: types$1, + tokContexts: types, isIdentifierChar: isIdentifierChar, isIdentifierStart: isIdentifierStart, Token: Token, @@ -5556,17 +5603,17 @@ exports.isIdentifierChar = isIdentifierChar; exports.isIdentifierStart = isIdentifierStart; exports.isNewLine = isNewLine; - exports.keywordTypes = keywords$1; + exports.keywordTypes = keywords; exports.lineBreak = lineBreak; exports.lineBreakG = lineBreakG; exports.nonASCIIwhitespace = nonASCIIwhitespace; exports.parse = parse; exports.parseExpressionAt = parseExpressionAt; - exports.tokContexts = types$1; - exports.tokTypes = types; + exports.tokContexts = types; + exports.tokTypes = types$1; exports.tokenizer = tokenizer; exports.version = version; Object.defineProperty(exports, '__esModule', { value: true }); -}))); +})); diff --git a/node_modules/ava/node_modules/acorn/dist/acorn.mjs b/node_modules/ava/node_modules/acorn/dist/acorn.mjs index 96a8294589..e99e9b30e1 100644 --- a/node_modules/ava/node_modules/acorn/dist/acorn.mjs +++ b/node_modules/ava/node_modules/acorn/dist/acorn.mjs @@ -12,7 +12,7 @@ var reservedWords = { var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; -var keywords = { +var keywords$1 = { 5: ecma5AndLessKeywords, "5module": ecma5AndLessKeywords + " export import", 6: ecma5AndLessKeywords + " const class extends export import super" @@ -27,8 +27,8 @@ var keywordRelationalOperator = /^in(stanceof)?$/; // are only applied when a character is found to actually have a // code point above 128. // Generated by `bin/generate-identifier-regex.js`. -var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; +var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); @@ -42,10 +42,10 @@ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; // generated by bin/generate-identifier-regex.js // eslint-disable-next-line comma-spacing -var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938]; +var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2637,96,16,1070,4050,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,46,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,482,44,11,6,17,0,322,29,19,43,1269,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4152,8,221,3,5761,15,7472,3104,541,1507,4938]; // eslint-disable-next-line comma-spacing -var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239]; +var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,357,0,62,13,1495,6,110,6,6,9,4759,9,787719,239]; // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is @@ -131,17 +131,17 @@ var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}; // Map keyword names to token types. -var keywords$1 = {}; +var keywords = {}; // Succinct definitions of keyword token types function kw(name, options) { if ( options === void 0 ) options = {}; options.keyword = name; - return keywords$1[name] = new TokenType(name, options) + return keywords[name] = new TokenType(name, options) } -var types = { +var types$1 = { num: new TokenType("num", startsExpr), regexp: new TokenType("regexp", startsExpr), string: new TokenType("string", startsExpr), @@ -250,6 +250,17 @@ function isNewLine(code) { return code === 10 || code === 13 || code === 0x2028 || code === 0x2029 } +function nextLineBreak(code, from, end) { + if ( end === void 0 ) end = code.length; + + for (var i = from; i < end; i++) { + var next = code.charCodeAt(i); + if (isNewLine(next)) + { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 } + } + return -1 +} + var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; @@ -258,11 +269,9 @@ var ref = Object.prototype; var hasOwnProperty = ref.hasOwnProperty; var toString = ref.toString; -// Checks if an object has a property. - -function has(obj, propName) { - return hasOwnProperty.call(obj, propName) -} +var hasOwn = Object.hasOwn || (function (obj, propName) { return ( + hasOwnProperty.call(obj, propName) +); }); var isArray = Array.isArray || (function (obj) { return ( toString.call(obj) === "[object Array]" @@ -272,6 +281,8 @@ function wordsRegexp(words) { return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") } +var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; + // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. @@ -298,14 +309,10 @@ var SourceLocation = function SourceLocation(p, start, end) { function getLineInfo(input, offset) { for (var line = 1, cur = 0;;) { - lineBreakG.lastIndex = cur; - var match = lineBreakG.exec(input); - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else { - return new Position(line, offset - cur) - } + var nextBreak = nextLineBreak(input, cur, offset); + if (nextBreak < 0) { return new Position(line, offset - cur) } + ++line; + cur = nextBreak; } } @@ -411,7 +418,7 @@ function getOptions(opts) { var options = {}; for (var opt in defaultOptions) - { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } + { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; } if (options.ecmaVersion === "latest") { options.ecmaVersion = 1e8; @@ -483,7 +490,7 @@ var var Parser = function Parser(options, input, startPos) { this.options = options = getOptions(options); this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); var reserved = ""; if (options.allowReserved !== true) { reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; @@ -514,7 +521,7 @@ var Parser = function Parser(options, input, startPos) { // Properties of the current token: // Its type - this.type = types.eof; + this.type = types$1.eof; // For tokens that include more information than their type, the value this.value = null; // Its start and end offset @@ -574,8 +581,11 @@ Parser.prototype.parse = function parse () { }; prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; + prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit }; + prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit }; + prototypeAccessors.canAwait.get = function () { for (var i = this.scopeStack.length - 1; i >= 0; i--) { var scope = this.scopeStack[i]; @@ -584,20 +594,25 @@ prototypeAccessors.canAwait.get = function () { } return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction }; + prototypeAccessors.allowSuper.get = function () { var ref = this.currentThisScope(); var flags = ref.flags; var inClassFieldInit = ref.inClassFieldInit; return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod }; + prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; + prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; + prototypeAccessors.allowNewDotTarget.get = function () { var ref = this.currentThisScope(); var flags = ref.flags; var inClassFieldInit = ref.inClassFieldInit; return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit }; + prototypeAccessors.inClassStaticBlock.get = function () { return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0 }; @@ -627,12 +642,12 @@ Parser.tokenizer = function tokenizer (input, options) { Object.defineProperties( Parser.prototype, prototypeAccessors ); -var pp = Parser.prototype; +var pp$9 = Parser.prototype; // ## Parser utilities var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; -pp.strictDirective = function(start) { +pp$9.strictDirective = function(start) { for (;;) { // Try to find string literal. skipWhiteSpace.lastIndex = start; @@ -660,7 +675,7 @@ pp.strictDirective = function(start) { // Predicate that tests whether the next token is of the given // type, and if yes, consumes it as a side effect. -pp.eat = function(type) { +pp$9.eat = function(type) { if (this.type === type) { this.next(); return true @@ -671,13 +686,13 @@ pp.eat = function(type) { // Tests whether parsed token is a contextual keyword. -pp.isContextual = function(name) { - return this.type === types.name && this.value === name && !this.containsEsc +pp$9.isContextual = function(name) { + return this.type === types$1.name && this.value === name && !this.containsEsc }; // Consumes contextual keyword if possible. -pp.eatContextual = function(name) { +pp$9.eatContextual = function(name) { if (!this.isContextual(name)) { return false } this.next(); return true @@ -685,19 +700,19 @@ pp.eatContextual = function(name) { // Asserts that following token is given contextual keyword. -pp.expectContextual = function(name) { +pp$9.expectContextual = function(name) { if (!this.eatContextual(name)) { this.unexpected(); } }; // Test whether a semicolon can be inserted at the current position. -pp.canInsertSemicolon = function() { - return this.type === types.eof || - this.type === types.braceR || +pp$9.canInsertSemicolon = function() { + return this.type === types$1.eof || + this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; -pp.insertSemicolon = function() { +pp$9.insertSemicolon = function() { if (this.canInsertSemicolon()) { if (this.options.onInsertedSemicolon) { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } @@ -708,11 +723,11 @@ pp.insertSemicolon = function() { // Consume a semicolon, or, failing that, see if we are allowed to // pretend that there is a semicolon at this position. -pp.semicolon = function() { - if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } +pp$9.semicolon = function() { + if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); } }; -pp.afterTrailingComma = function(tokType, notNext) { +pp$9.afterTrailingComma = function(tokType, notNext) { if (this.type === tokType) { if (this.options.onTrailingComma) { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } @@ -725,13 +740,13 @@ pp.afterTrailingComma = function(tokType, notNext) { // Expect a token of a given type. If found, consume it, otherwise, // raise an unexpected token error. -pp.expect = function(type) { +pp$9.expect = function(type) { this.eat(type) || this.unexpected(); }; // Raise an unexpected token error. -pp.unexpected = function(pos) { +pp$9.unexpected = function(pos) { this.raise(pos != null ? pos : this.start, "Unexpected token"); }; @@ -744,7 +759,7 @@ function DestructuringErrors() { -1; } -pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { +pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { if (!refDestructuringErrors) { return } if (refDestructuringErrors.trailingComma > -1) { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } @@ -752,7 +767,7 @@ pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } }; -pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { +pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { if (!refDestructuringErrors) { return false } var shorthandAssign = refDestructuringErrors.shorthandAssign; var doubleProto = refDestructuringErrors.doubleProto; @@ -763,20 +778,20 @@ pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } }; -pp.checkYieldAwaitInDefaultParams = function() { +pp$9.checkYieldAwaitInDefaultParams = function() { if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } if (this.awaitPos) { this.raise(this.awaitPos, "Await expression cannot be a default value"); } }; -pp.isSimpleAssignTarget = function(expr) { +pp$9.isSimpleAssignTarget = function(expr) { if (expr.type === "ParenthesizedExpression") { return this.isSimpleAssignTarget(expr.expression) } return expr.type === "Identifier" || expr.type === "MemberExpression" }; -var pp$1 = Parser.prototype; +var pp$8 = Parser.prototype; // ### Statement parsing @@ -785,10 +800,10 @@ var pp$1 = Parser.prototype; // `program` argument. If present, the statements will be appended // to its body instead of creating a new node. -pp$1.parseTopLevel = function(node) { +pp$8.parseTopLevel = function(node) { var exports = Object.create(null); if (!node.body) { node.body = []; } - while (this.type !== types.eof) { + while (this.type !== types$1.eof) { var stmt = this.parseStatement(null, true, exports); node.body.push(stmt); } @@ -807,7 +822,7 @@ pp$1.parseTopLevel = function(node) { var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; -pp$1.isLet = function(context) { +pp$8.isLet = function(context) { if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); @@ -833,7 +848,7 @@ pp$1.isLet = function(context) { // check 'async [no LineTerminator here] function' // - 'async /*foo*/ function' is OK. // - 'async /*\n*/ function' is invalid. -pp$1.isAsyncFunction = function() { +pp$8.isAsyncFunction = function() { if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { return false } @@ -853,11 +868,11 @@ pp$1.isAsyncFunction = function() { // `if (foo) /blah/.exec(foo)`, where looking at the previous token // does not help. -pp$1.parseStatement = function(context, topLevel, exports) { +pp$8.parseStatement = function(context, topLevel, exports) { var starttype = this.type, node = this.startNode(), kind; if (this.isLet(context)) { - starttype = types._var; + starttype = types$1._var; kind = "let"; } @@ -866,35 +881,35 @@ pp$1.parseStatement = function(context, topLevel, exports) { // complexity. switch (starttype) { - case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) - case types._debugger: return this.parseDebuggerStatement(node) - case types._do: return this.parseDoStatement(node) - case types._for: return this.parseForStatement(node) - case types._function: + case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types$1._debugger: return this.parseDebuggerStatement(node) + case types$1._do: return this.parseDoStatement(node) + case types$1._for: return this.parseForStatement(node) + case types$1._function: // Function as sole body of either an if statement or a labeled statement // works, but not when it is part of a labeled statement that is the sole // body of an if statement. if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } return this.parseFunctionStatement(node, false, !context) - case types._class: + case types$1._class: if (context) { this.unexpected(); } return this.parseClass(node, true) - case types._if: return this.parseIfStatement(node) - case types._return: return this.parseReturnStatement(node) - case types._switch: return this.parseSwitchStatement(node) - case types._throw: return this.parseThrowStatement(node) - case types._try: return this.parseTryStatement(node) - case types._const: case types._var: + case types$1._if: return this.parseIfStatement(node) + case types$1._return: return this.parseReturnStatement(node) + case types$1._switch: return this.parseSwitchStatement(node) + case types$1._throw: return this.parseThrowStatement(node) + case types$1._try: return this.parseTryStatement(node) + case types$1._const: case types$1._var: kind = kind || this.value; if (context && kind !== "var") { this.unexpected(); } return this.parseVarStatement(node, kind) - case types._while: return this.parseWhileStatement(node) - case types._with: return this.parseWithStatement(node) - case types.braceL: return this.parseBlock(true, node) - case types.semi: return this.parseEmptyStatement(node) - case types._export: - case types._import: - if (this.options.ecmaVersion > 10 && starttype === types._import) { + case types$1._while: return this.parseWhileStatement(node) + case types$1._with: return this.parseWithStatement(node) + case types$1.braceL: return this.parseBlock(true, node) + case types$1.semi: return this.parseEmptyStatement(node) + case types$1._export: + case types$1._import: + if (this.options.ecmaVersion > 10 && starttype === types$1._import) { skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); @@ -908,7 +923,7 @@ pp$1.parseStatement = function(context, topLevel, exports) { if (!this.inModule) { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } } - return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) + return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports) // If the statement does not start with a statement keyword or a // brace, it's an ExpressionStatement or LabeledStatement. We @@ -923,17 +938,17 @@ pp$1.parseStatement = function(context, topLevel, exports) { } var maybeName = this.value, expr = this.parseExpression(); - if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) { return this.parseLabeledStatement(node, maybeName, expr, context) } else { return this.parseExpressionStatement(node, expr) } } }; -pp$1.parseBreakContinueStatement = function(node, keyword) { +pp$8.parseBreakContinueStatement = function(node, keyword) { var isBreak = keyword === "break"; this.next(); - if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } - else if (this.type !== types.name) { this.unexpected(); } + if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types$1.name) { this.unexpected(); } else { node.label = this.parseIdent(); this.semicolon(); @@ -953,21 +968,21 @@ pp$1.parseBreakContinueStatement = function(node, keyword) { return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") }; -pp$1.parseDebuggerStatement = function(node) { +pp$8.parseDebuggerStatement = function(node) { this.next(); this.semicolon(); return this.finishNode(node, "DebuggerStatement") }; -pp$1.parseDoStatement = function(node) { +pp$8.parseDoStatement = function(node) { this.next(); this.labels.push(loopLabel); node.body = this.parseStatement("do"); this.labels.pop(); - this.expect(types._while); + this.expect(types$1._while); node.test = this.parseParenExpression(); if (this.options.ecmaVersion >= 6) - { this.eat(types.semi); } + { this.eat(types$1.semi); } else { this.semicolon(); } return this.finishNode(node, "DoWhileStatement") @@ -981,25 +996,25 @@ pp$1.parseDoStatement = function(node) { // part (semicolon immediately after the opening parenthesis), it // is a regular `for` loop. -pp$1.parseForStatement = function(node) { +pp$8.parseForStatement = function(node) { this.next(); var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1; this.labels.push(loopLabel); this.enterScope(0); - this.expect(types.parenL); - if (this.type === types.semi) { + this.expect(types$1.parenL); + if (this.type === types$1.semi) { if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, null) } var isLet = this.isLet(); - if (this.type === types._var || this.type === types._const || isLet) { + if (this.type === types$1._var || this.type === types$1._const || isLet) { var init$1 = this.startNode(), kind = isLet ? "let" : this.value; this.next(); this.parseVar(init$1, true, kind); this.finishNode(init$1, "VariableDeclaration"); - if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { + if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { if (this.options.ecmaVersion >= 9) { - if (this.type === types._in) { + if (this.type === types$1._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } @@ -1011,9 +1026,9 @@ pp$1.parseForStatement = function(node) { var startsWithLet = this.isContextual("let"), isForOf = false; var refDestructuringErrors = new DestructuringErrors; var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); - if (this.type === types._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { if (this.options.ecmaVersion >= 9) { - if (this.type === types._in) { + if (this.type === types$1._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } @@ -1028,21 +1043,21 @@ pp$1.parseForStatement = function(node) { return this.parseFor(node, init) }; -pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { +pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { this.next(); return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) }; -pp$1.parseIfStatement = function(node) { +pp$8.parseIfStatement = function(node) { this.next(); node.test = this.parseParenExpression(); // allow function declarations in branches, but only in non-strict mode node.consequent = this.parseStatement("if"); - node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; + node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; return this.finishNode(node, "IfStatement") }; -pp$1.parseReturnStatement = function(node) { +pp$8.parseReturnStatement = function(node) { if (!this.inFunction && !this.options.allowReturnOutsideFunction) { this.raise(this.start, "'return' outside of function"); } this.next(); @@ -1051,16 +1066,16 @@ pp$1.parseReturnStatement = function(node) { // optional arguments, we eagerly look for a semicolon or the // possibility to insert one. - if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; } else { node.argument = this.parseExpression(); this.semicolon(); } return this.finishNode(node, "ReturnStatement") }; -pp$1.parseSwitchStatement = function(node) { +pp$8.parseSwitchStatement = function(node) { this.next(); node.discriminant = this.parseParenExpression(); node.cases = []; - this.expect(types.braceL); + this.expect(types$1.braceL); this.labels.push(switchLabel); this.enterScope(0); @@ -1069,9 +1084,9 @@ pp$1.parseSwitchStatement = function(node) { // adding statements to. var cur; - for (var sawDefault = false; this.type !== types.braceR;) { - if (this.type === types._case || this.type === types._default) { - var isCase = this.type === types._case; + for (var sawDefault = false; this.type !== types$1.braceR;) { + if (this.type === types$1._case || this.type === types$1._default) { + var isCase = this.type === types$1._case; if (cur) { this.finishNode(cur, "SwitchCase"); } node.cases.push(cur = this.startNode()); cur.consequent = []; @@ -1083,7 +1098,7 @@ pp$1.parseSwitchStatement = function(node) { sawDefault = true; cur.test = null; } - this.expect(types.colon); + this.expect(types$1.colon); } else { if (!cur) { this.unexpected(); } cur.consequent.push(this.parseStatement(null)); @@ -1096,7 +1111,7 @@ pp$1.parseSwitchStatement = function(node) { return this.finishNode(node, "SwitchStatement") }; -pp$1.parseThrowStatement = function(node) { +pp$8.parseThrowStatement = function(node) { this.next(); if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { this.raise(this.lastTokEnd, "Illegal newline after throw"); } @@ -1107,21 +1122,21 @@ pp$1.parseThrowStatement = function(node) { // Reused empty array added for node fields that are always empty. -var empty = []; +var empty$1 = []; -pp$1.parseTryStatement = function(node) { +pp$8.parseTryStatement = function(node) { this.next(); node.block = this.parseBlock(); node.handler = null; - if (this.type === types._catch) { + if (this.type === types$1._catch) { var clause = this.startNode(); this.next(); - if (this.eat(types.parenL)) { + if (this.eat(types$1.parenL)) { clause.param = this.parseBindingAtom(); var simple = clause.param.type === "Identifier"; this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); - this.expect(types.parenR); + this.expect(types$1.parenR); } else { if (this.options.ecmaVersion < 10) { this.unexpected(); } clause.param = null; @@ -1131,20 +1146,20 @@ pp$1.parseTryStatement = function(node) { this.exitScope(); node.handler = this.finishNode(clause, "CatchClause"); } - node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; + node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { this.raise(node.start, "Missing catch or finally clause"); } return this.finishNode(node, "TryStatement") }; -pp$1.parseVarStatement = function(node, kind) { +pp$8.parseVarStatement = function(node, kind) { this.next(); this.parseVar(node, false, kind); this.semicolon(); return this.finishNode(node, "VariableDeclaration") }; -pp$1.parseWhileStatement = function(node) { +pp$8.parseWhileStatement = function(node) { this.next(); node.test = this.parseParenExpression(); this.labels.push(loopLabel); @@ -1153,7 +1168,7 @@ pp$1.parseWhileStatement = function(node) { return this.finishNode(node, "WhileStatement") }; -pp$1.parseWithStatement = function(node) { +pp$8.parseWithStatement = function(node) { if (this.strict) { this.raise(this.start, "'with' in strict mode"); } this.next(); node.object = this.parseParenExpression(); @@ -1161,12 +1176,12 @@ pp$1.parseWithStatement = function(node) { return this.finishNode(node, "WithStatement") }; -pp$1.parseEmptyStatement = function(node) { +pp$8.parseEmptyStatement = function(node) { this.next(); return this.finishNode(node, "EmptyStatement") }; -pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { +pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) { var label = list[i$1]; @@ -1174,7 +1189,7 @@ pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { if (label.name === maybeName) { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); } } - var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; for (var i = this.labels.length - 1; i >= 0; i--) { var label$1 = this.labels[i]; if (label$1.statementStart === node.start) { @@ -1190,7 +1205,7 @@ pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { return this.finishNode(node, "LabeledStatement") }; -pp$1.parseExpressionStatement = function(node, expr) { +pp$8.parseExpressionStatement = function(node, expr) { node.expression = expr; this.semicolon(); return this.finishNode(node, "ExpressionStatement") @@ -1200,14 +1215,14 @@ pp$1.parseExpressionStatement = function(node, expr) { // strict"` declarations when `allowStrict` is true (used for // function bodies). -pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) { +pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; if ( node === void 0 ) node = this.startNode(); node.body = []; - this.expect(types.braceL); + this.expect(types$1.braceL); if (createNewLexicalScope) { this.enterScope(0); } - while (this.type !== types.braceR) { + while (this.type !== types$1.braceR) { var stmt = this.parseStatement(null); node.body.push(stmt); } @@ -1221,13 +1236,13 @@ pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) { // `parseStatement` will already have parsed the init statement or // expression. -pp$1.parseFor = function(node, init) { +pp$8.parseFor = function(node, init) { node.init = init; - this.expect(types.semi); - node.test = this.type === types.semi ? null : this.parseExpression(); - this.expect(types.semi); - node.update = this.type === types.parenR ? null : this.parseExpression(); - this.expect(types.parenR); + this.expect(types$1.semi); + node.test = this.type === types$1.semi ? null : this.parseExpression(); + this.expect(types$1.semi); + node.update = this.type === types$1.parenR ? null : this.parseExpression(); + this.expect(types$1.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); @@ -1237,8 +1252,8 @@ pp$1.parseFor = function(node, init) { // Parse a `for`/`in` and `for`/`of` loop, which are almost // same from parser's perspective. -pp$1.parseForIn = function(node, init) { - var isForIn = this.type === types._in; +pp$8.parseForIn = function(node, init) { + var isForIn = this.type === types$1._in; this.next(); if ( @@ -1259,7 +1274,7 @@ pp$1.parseForIn = function(node, init) { } node.left = init; node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); - this.expect(types.parenR); + this.expect(types$1.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); @@ -1268,28 +1283,28 @@ pp$1.parseForIn = function(node, init) { // Parse a list of variable declarations. -pp$1.parseVar = function(node, isFor, kind) { +pp$8.parseVar = function(node, isFor, kind) { node.declarations = []; node.kind = kind; for (;;) { var decl = this.startNode(); this.parseVarId(decl, kind); - if (this.eat(types.eq)) { + if (this.eat(types$1.eq)) { decl.init = this.parseMaybeAssign(isFor); - } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { + } else if (kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { this.unexpected(); - } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) { + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); } else { decl.init = null; } node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(types.comma)) { break } + if (!this.eat(types$1.comma)) { break } } return node }; -pp$1.parseVarId = function(decl, kind) { +pp$8.parseVarId = function(decl, kind) { decl.id = this.parseBindingAtom(); this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); }; @@ -1300,18 +1315,18 @@ var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; // `statement & FUNC_STATEMENT`). // Remove `allowExpressionBody` for 7.0.0, as it is only called with false -pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { +pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { this.initFunction(node); if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { - if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) + if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT)) { this.unexpected(); } - node.generator = this.eat(types.star); + node.generator = this.eat(types$1.star); } if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } if (statement & FUNC_STATEMENT) { - node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent(); if (node.id && !(statement & FUNC_HANGING_STATEMENT)) // If it is a regular function declaration in sloppy mode, then it is // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding @@ -1327,7 +1342,7 @@ pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync, for this.enterScope(functionFlags(node.async, node.generator)); if (!(statement & FUNC_STATEMENT)) - { node.id = this.type === types.name ? this.parseIdent() : null; } + { node.id = this.type === types$1.name ? this.parseIdent() : null; } this.parseFunctionParams(node); this.parseFunctionBody(node, allowExpressionBody, false, forInit); @@ -1338,16 +1353,16 @@ pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync, for return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") }; -pp$1.parseFunctionParams = function(node) { - this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); +pp$8.parseFunctionParams = function(node) { + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); }; // Parse a class declaration or literal (depending on the // `isStatement` parameter). -pp$1.parseClass = function(node, isStatement) { +pp$8.parseClass = function(node, isStatement) { this.next(); // ecma-262 14.6 Class Definitions @@ -1361,8 +1376,8 @@ pp$1.parseClass = function(node, isStatement) { var classBody = this.startNode(); var hadConstructor = false; classBody.body = []; - this.expect(types.braceL); - while (this.type !== types.braceR) { + this.expect(types$1.braceL); + while (this.type !== types$1.braceR) { var element = this.parseClassElement(node.superClass !== null); if (element) { classBody.body.push(element); @@ -1381,8 +1396,8 @@ pp$1.parseClass = function(node, isStatement) { return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") }; -pp$1.parseClassElement = function(constructorAllowsSuper) { - if (this.eat(types.semi)) { return null } +pp$8.parseClassElement = function(constructorAllowsSuper) { + if (this.eat(types$1.semi)) { return null } var ecmaVersion = this.options.ecmaVersion; var node = this.startNode(); @@ -1394,11 +1409,11 @@ pp$1.parseClassElement = function(constructorAllowsSuper) { if (this.eatContextual("static")) { // Parse static init block - if (ecmaVersion >= 13 && this.eat(types.braceL)) { + if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { this.parseClassStaticBlock(node); return node } - if (this.isClassElementNameStart() || this.type === types.star) { + if (this.isClassElementNameStart() || this.type === types$1.star) { isStatic = true; } else { keyName = "static"; @@ -1406,13 +1421,13 @@ pp$1.parseClassElement = function(constructorAllowsSuper) { } node.static = isStatic; if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { - if ((this.isClassElementNameStart() || this.type === types.star) && !this.canInsertSemicolon()) { + if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { isAsync = true; } else { keyName = "async"; } } - if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types.star)) { + if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { isGenerator = true; } if (!keyName && !isAsync && !isGenerator) { @@ -1439,7 +1454,7 @@ pp$1.parseClassElement = function(constructorAllowsSuper) { } // Parse element value - if (ecmaVersion < 13 || this.type === types.parenL || kind !== "method" || isGenerator || isAsync) { + if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { var isConstructor = !node.static && checkKeyName(node, "constructor"); var allowsDirectSuper = isConstructor && constructorAllowsSuper; // Couldn't move this check into the 'parseClassMethod' method for backward compatibility. @@ -1453,19 +1468,19 @@ pp$1.parseClassElement = function(constructorAllowsSuper) { return node }; -pp$1.isClassElementNameStart = function() { +pp$8.isClassElementNameStart = function() { return ( - this.type === types.name || - this.type === types.privateId || - this.type === types.num || - this.type === types.string || - this.type === types.bracketL || + this.type === types$1.name || + this.type === types$1.privateId || + this.type === types$1.num || + this.type === types$1.string || + this.type === types$1.bracketL || this.type.keyword ) }; -pp$1.parseClassElementName = function(element) { - if (this.type === types.privateId) { +pp$8.parseClassElementName = function(element) { + if (this.type === types$1.privateId) { if (this.value === "constructor") { this.raise(this.start, "Classes can't have an element named '#constructor'"); } @@ -1476,7 +1491,7 @@ pp$1.parseClassElementName = function(element) { } }; -pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { +pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { // Check key and flags var key = method.key; if (method.kind === "constructor") { @@ -1500,14 +1515,14 @@ pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper return this.finishNode(method, "MethodDefinition") }; -pp$1.parseClassField = function(field) { +pp$8.parseClassField = function(field) { if (checkKeyName(field, "constructor")) { this.raise(field.key.start, "Classes can't have a field named 'constructor'"); } else if (field.static && checkKeyName(field, "prototype")) { this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); } - if (this.eat(types.eq)) { + if (this.eat(types$1.eq)) { // To raise SyntaxError if 'arguments' exists in the initializer. var scope = this.currentThisScope(); var inClassFieldInit = scope.inClassFieldInit; @@ -1522,13 +1537,13 @@ pp$1.parseClassField = function(field) { return this.finishNode(field, "PropertyDefinition") }; -pp$1.parseClassStaticBlock = function(node) { +pp$8.parseClassStaticBlock = function(node) { node.body = []; var oldLabels = this.labels; this.labels = []; this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); - while (this.type !== types.braceR) { + while (this.type !== types$1.braceR) { var stmt = this.parseStatement(null); node.body.push(stmt); } @@ -1539,8 +1554,8 @@ pp$1.parseClassStaticBlock = function(node) { return this.finishNode(node, "StaticBlock") }; -pp$1.parseClassId = function(node, isStatement) { - if (this.type === types.name) { +pp$8.parseClassId = function(node, isStatement) { + if (this.type === types$1.name) { node.id = this.parseIdent(); if (isStatement) { this.checkLValSimple(node.id, BIND_LEXICAL, false); } @@ -1551,17 +1566,17 @@ pp$1.parseClassId = function(node, isStatement) { } }; -pp$1.parseClassSuper = function(node) { - node.superClass = this.eat(types._extends) ? this.parseExprSubscripts(false) : null; +pp$8.parseClassSuper = function(node) { + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null; }; -pp$1.enterClassBody = function() { +pp$8.enterClassBody = function() { var element = {declared: Object.create(null), used: []}; this.privateNameStack.push(element); return element.declared }; -pp$1.exitClassBody = function() { +pp$8.exitClassBody = function() { var ref = this.privateNameStack.pop(); var declared = ref.declared; var used = ref.used; @@ -1569,7 +1584,7 @@ pp$1.exitClassBody = function() { var parent = len === 0 ? null : this.privateNameStack[len - 1]; for (var i = 0; i < used.length; ++i) { var id = used[i]; - if (!has(declared, id.name)) { + if (!hasOwn(declared, id.name)) { if (parent) { parent.used.push(id); } else { @@ -1616,33 +1631,33 @@ function checkKeyName(node, name) { // Parses module export declaration. -pp$1.parseExport = function(node, exports) { +pp$8.parseExport = function(node, exports) { this.next(); // export * from '...' - if (this.eat(types.star)) { + if (this.eat(types$1.star)) { if (this.options.ecmaVersion >= 11) { if (this.eatContextual("as")) { - node.exported = this.parseIdent(true); + node.exported = this.parseModuleExportName(); this.checkExport(exports, node.exported.name, this.lastTokStart); } else { node.exported = null; } } this.expectContextual("from"); - if (this.type !== types.string) { this.unexpected(); } + if (this.type !== types$1.string) { this.unexpected(); } node.source = this.parseExprAtom(); this.semicolon(); return this.finishNode(node, "ExportAllDeclaration") } - if (this.eat(types._default)) { // export default ... + if (this.eat(types$1._default)) { // export default ... this.checkExport(exports, "default", this.lastTokStart); var isAsync; - if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { var fNode = this.startNode(); this.next(); if (isAsync) { this.next(); } node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); - } else if (this.type === types._class) { + } else if (this.type === types$1._class) { var cNode = this.startNode(); node.declaration = this.parseClass(cNode, "nullableID"); } else { @@ -1664,7 +1679,7 @@ pp$1.parseExport = function(node, exports) { node.declaration = null; node.specifiers = this.parseExportSpecifiers(exports); if (this.eatContextual("from")) { - if (this.type !== types.string) { this.unexpected(); } + if (this.type !== types$1.string) { this.unexpected(); } node.source = this.parseExprAtom(); } else { for (var i = 0, list = node.specifiers; i < list.length; i += 1) { @@ -1674,6 +1689,10 @@ pp$1.parseExport = function(node, exports) { this.checkUnreserved(spec.local); // check if export is defined this.checkLocalExport(spec.local); + + if (spec.local.type === "Literal") { + this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); + } } node.source = null; @@ -1683,14 +1702,14 @@ pp$1.parseExport = function(node, exports) { return this.finishNode(node, "ExportNamedDeclaration") }; -pp$1.checkExport = function(exports, name, pos) { +pp$8.checkExport = function(exports, name, pos) { if (!exports) { return } - if (has(exports, name)) + if (hasOwn(exports, name)) { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } exports[name] = true; }; -pp$1.checkPatternExport = function(exports, pat) { +pp$8.checkPatternExport = function(exports, pat) { var type = pat.type; if (type === "Identifier") { this.checkExport(exports, pat.name, pat.start); } @@ -1717,7 +1736,7 @@ pp$1.checkPatternExport = function(exports, pat) { { this.checkPatternExport(exports, pat.expression); } }; -pp$1.checkVariableExport = function(exports, decls) { +pp$8.checkVariableExport = function(exports, decls) { if (!exports) { return } for (var i = 0, list = decls; i < list.length; i += 1) { @@ -1727,7 +1746,7 @@ pp$1.checkVariableExport = function(exports, decls) { } }; -pp$1.shouldParseExportStatement = function() { +pp$8.shouldParseExportStatement = function() { return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || @@ -1738,20 +1757,24 @@ pp$1.shouldParseExportStatement = function() { // Parses a comma-separated list of module exports. -pp$1.parseExportSpecifiers = function(exports) { +pp$8.parseExportSpecifiers = function(exports) { var nodes = [], first = true; // export { x, y as z } [from '...'] - this.expect(types.braceL); - while (!this.eat(types.braceR)) { + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var node = this.startNode(); - node.local = this.parseIdent(true); - node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; - this.checkExport(exports, node.exported.name, node.exported.start); + node.local = this.parseModuleExportName(); + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports, + node.exported[node.exported.type === "Identifier" ? "name" : "value"], + node.exported.start + ); nodes.push(this.finishNode(node, "ExportSpecifier")); } return nodes @@ -1759,16 +1782,16 @@ pp$1.parseExportSpecifiers = function(exports) { // Parses import declaration. -pp$1.parseImport = function(node) { +pp$8.parseImport = function(node) { this.next(); // import '...' - if (this.type === types.string) { - node.specifiers = empty; + if (this.type === types$1.string) { + node.specifiers = empty$1; node.source = this.parseExprAtom(); } else { node.specifiers = this.parseImportSpecifiers(); this.expectContextual("from"); - node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); + node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); } this.semicolon(); return this.finishNode(node, "ImportDeclaration") @@ -1776,17 +1799,17 @@ pp$1.parseImport = function(node) { // Parses a comma-separated list of module imports. -pp$1.parseImportSpecifiers = function() { +pp$8.parseImportSpecifiers = function() { var nodes = [], first = true; - if (this.type === types.name) { + if (this.type === types$1.name) { // import defaultObj, { x, y as z } from '...' var node = this.startNode(); node.local = this.parseIdent(); this.checkLValSimple(node.local, BIND_LEXICAL); nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); - if (!this.eat(types.comma)) { return nodes } + if (!this.eat(types$1.comma)) { return nodes } } - if (this.type === types.star) { + if (this.type === types$1.star) { var node$1 = this.startNode(); this.next(); this.expectContextual("as"); @@ -1795,15 +1818,15 @@ pp$1.parseImportSpecifiers = function() { nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); return nodes } - this.expect(types.braceL); - while (!this.eat(types.braceR)) { + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var node$2 = this.startNode(); - node$2.imported = this.parseIdent(true); + node$2.imported = this.parseModuleExportName(); if (this.eatContextual("as")) { node$2.local = this.parseIdent(); } else { @@ -1816,13 +1839,24 @@ pp$1.parseImportSpecifiers = function() { return nodes }; +pp$8.parseModuleExportName = function() { + if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { + var stringLiteral = this.parseLiteral(this.value); + if (loneSurrogate.test(stringLiteral.value)) { + this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); + } + return stringLiteral + } + return this.parseIdent(true) +}; + // Set `ExpressionStatement#directive` property for directive prologues. -pp$1.adaptDirectivePrologue = function(statements) { +pp$8.adaptDirectivePrologue = function(statements) { for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { statements[i].directive = statements[i].expression.raw.slice(1, -1); } }; -pp$1.isDirectiveCandidate = function(statement) { +pp$8.isDirectiveCandidate = function(statement) { return ( statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && @@ -1832,12 +1866,12 @@ pp$1.isDirectiveCandidate = function(statement) { ) }; -var pp$2 = Parser.prototype; +var pp$7 = Parser.prototype; // Convert existing expression atom to assignable pattern // if possible. -pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { +pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { if (this.options.ecmaVersion >= 6 && node) { switch (node.type) { case "Identifier": @@ -1918,7 +1952,7 @@ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { // Convert list of expression atoms to binding list. -pp$2.toAssignableList = function(exprList, isBinding) { +pp$7.toAssignableList = function(exprList, isBinding) { var end = exprList.length; for (var i = 0; i < end; i++) { var elt = exprList[i]; @@ -1934,19 +1968,19 @@ pp$2.toAssignableList = function(exprList, isBinding) { // Parses spread element. -pp$2.parseSpread = function(refDestructuringErrors) { +pp$7.parseSpread = function(refDestructuringErrors) { var node = this.startNode(); this.next(); node.argument = this.parseMaybeAssign(false, refDestructuringErrors); return this.finishNode(node, "SpreadElement") }; -pp$2.parseRestBinding = function() { +pp$7.parseRestBinding = function() { var node = this.startNode(); this.next(); // RestElement inside of a function parameter must be an identifier - if (this.options.ecmaVersion === 6 && this.type !== types.name) + if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { this.unexpected(); } node.argument = this.parseBindingAtom(); @@ -1956,36 +1990,36 @@ pp$2.parseRestBinding = function() { // Parses lvalue (assignable) atom. -pp$2.parseBindingAtom = function() { +pp$7.parseBindingAtom = function() { if (this.options.ecmaVersion >= 6) { switch (this.type) { - case types.bracketL: + case types$1.bracketL: var node = this.startNode(); this.next(); - node.elements = this.parseBindingList(types.bracketR, true, true); + node.elements = this.parseBindingList(types$1.bracketR, true, true); return this.finishNode(node, "ArrayPattern") - case types.braceL: + case types$1.braceL: return this.parseObj(true) } } return this.parseIdent() }; -pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { +pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) { var elts = [], first = true; while (!this.eat(close)) { if (first) { first = false; } - else { this.expect(types.comma); } - if (allowEmpty && this.type === types.comma) { + else { this.expect(types$1.comma); } + if (allowEmpty && this.type === types$1.comma) { elts.push(null); } else if (allowTrailingComma && this.afterTrailingComma(close)) { break - } else if (this.type === types.ellipsis) { + } else if (this.type === types$1.ellipsis) { var rest = this.parseRestBinding(); this.parseBindingListItem(rest); elts.push(rest); - if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } this.expect(close); break } else { @@ -1997,15 +2031,15 @@ pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { return elts }; -pp$2.parseBindingListItem = function(param) { +pp$7.parseBindingListItem = function(param) { return param }; // Parses assignment pattern around given atom if possible. -pp$2.parseMaybeDefault = function(startPos, startLoc, left) { +pp$7.parseMaybeDefault = function(startPos, startLoc, left) { left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left } var node = this.startNodeAt(startPos, startLoc); node.left = left; node.right = this.parseMaybeAssign(); @@ -2076,7 +2110,7 @@ pp$2.parseMaybeDefault = function(startPos, startLoc, left) { // duplicate argument names. checkClashes is ignored if the provided construct // is an assignment (i.e., bindingType is BIND_NONE). -pp$2.checkLValSimple = function(expr, bindingType, checkClashes) { +pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; var isBind = bindingType !== BIND_NONE; @@ -2089,7 +2123,7 @@ pp$2.checkLValSimple = function(expr, bindingType, checkClashes) { if (bindingType === BIND_LEXICAL && expr.name === "let") { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } if (checkClashes) { - if (has(checkClashes, expr.name)) + if (hasOwn(checkClashes, expr.name)) { this.raiseRecoverable(expr.start, "Argument name clash"); } checkClashes[expr.name] = true; } @@ -2114,7 +2148,7 @@ pp$2.checkLValSimple = function(expr, bindingType, checkClashes) { } }; -pp$2.checkLValPattern = function(expr, bindingType, checkClashes) { +pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; switch (expr.type) { @@ -2139,7 +2173,7 @@ pp$2.checkLValPattern = function(expr, bindingType, checkClashes) { } }; -pp$2.checkLValInnerPattern = function(expr, bindingType, checkClashes) { +pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; switch (expr.type) { @@ -2171,7 +2205,7 @@ var TokContext = function TokContext(token, isExpr, preserveSpace, override, gen this.generator = !!generator; }; -var types$1 = { +var types = { b_stat: new TokContext("{", false), b_expr: new TokContext("{", true), b_tmpl: new TokContext("${", false), @@ -2184,38 +2218,38 @@ var types$1 = { f_gen: new TokContext("function", false, false, null, true) }; -var pp$3 = Parser.prototype; +var pp$6 = Parser.prototype; -pp$3.initialContext = function() { - return [types$1.b_stat] +pp$6.initialContext = function() { + return [types.b_stat] }; -pp$3.curContext = function() { +pp$6.curContext = function() { return this.context[this.context.length - 1] }; -pp$3.braceIsBlock = function(prevType) { +pp$6.braceIsBlock = function(prevType) { var parent = this.curContext(); - if (parent === types$1.f_expr || parent === types$1.f_stat) + if (parent === types.f_expr || parent === types.f_stat) { return true } - if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) + if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) { return !parent.isExpr } // The check for `tt.name && exprAllowed` detects whether we are // after a `yield` or `of` construct. See the `updateContext` for // `tt.name`. - if (prevType === types._return || prevType === types.name && this.exprAllowed) + if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } - if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) + if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) { return true } - if (prevType === types.braceL) - { return parent === types$1.b_stat } - if (prevType === types._var || prevType === types._const || prevType === types.name) + if (prevType === types$1.braceL) + { return parent === types.b_stat } + if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) { return false } return !this.exprAllowed }; -pp$3.inGeneratorContext = function() { +pp$6.inGeneratorContext = function() { for (var i = this.context.length - 1; i >= 1; i--) { var context = this.context[i]; if (context.token === "function") @@ -2224,9 +2258,9 @@ pp$3.inGeneratorContext = function() { return false }; -pp$3.updateContext = function(prevType) { +pp$6.updateContext = function(prevType) { var update, type = this.type; - if (type.keyword && prevType === types.dot) + if (type.keyword && prevType === types$1.dot) { this.exprAllowed = false; } else if (update = type.updateContext) { update.call(this, prevType); } @@ -2235,7 +2269,7 @@ pp$3.updateContext = function(prevType) { }; // Used to handle egde case when token context could not be inferred correctly in tokenize phase -pp$3.overrideContext = function(tokenCtx) { +pp$6.overrideContext = function(tokenCtx) { if (this.curContext() !== tokenCtx) { this.context[this.context.length - 1] = tokenCtx; } @@ -2243,71 +2277,71 @@ pp$3.overrideContext = function(tokenCtx) { // Token-specific context update code -types.parenR.updateContext = types.braceR.updateContext = function() { +types$1.parenR.updateContext = types$1.braceR.updateContext = function() { if (this.context.length === 1) { this.exprAllowed = true; return } var out = this.context.pop(); - if (out === types$1.b_stat && this.curContext().token === "function") { + if (out === types.b_stat && this.curContext().token === "function") { out = this.context.pop(); } this.exprAllowed = !out.isExpr; }; -types.braceL.updateContext = function(prevType) { - this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); +types$1.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); this.exprAllowed = true; }; -types.dollarBraceL.updateContext = function() { - this.context.push(types$1.b_tmpl); +types$1.dollarBraceL.updateContext = function() { + this.context.push(types.b_tmpl); this.exprAllowed = true; }; -types.parenL.updateContext = function(prevType) { - var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; - this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); +types$1.parenL.updateContext = function(prevType) { + var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; + this.context.push(statementParens ? types.p_stat : types.p_expr); this.exprAllowed = true; }; -types.incDec.updateContext = function() { +types$1.incDec.updateContext = function() { // tokExprAllowed stays unchanged }; -types._function.updateContext = types._class.updateContext = function(prevType) { - if (prevType.beforeExpr && prevType !== types._else && - !(prevType === types.semi && this.curContext() !== types$1.p_stat) && - !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && - !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) - { this.context.push(types$1.f_expr); } +types$1._function.updateContext = types$1._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types$1._else && + !(prevType === types$1.semi && this.curContext() !== types.p_stat) && + !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && + !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) + { this.context.push(types.f_expr); } else - { this.context.push(types$1.f_stat); } + { this.context.push(types.f_stat); } this.exprAllowed = false; }; -types.backQuote.updateContext = function() { - if (this.curContext() === types$1.q_tmpl) +types$1.backQuote.updateContext = function() { + if (this.curContext() === types.q_tmpl) { this.context.pop(); } else - { this.context.push(types$1.q_tmpl); } + { this.context.push(types.q_tmpl); } this.exprAllowed = false; }; -types.star.updateContext = function(prevType) { - if (prevType === types._function) { +types$1.star.updateContext = function(prevType) { + if (prevType === types$1._function) { var index = this.context.length - 1; - if (this.context[index] === types$1.f_expr) - { this.context[index] = types$1.f_expr_gen; } + if (this.context[index] === types.f_expr) + { this.context[index] = types.f_expr_gen; } else - { this.context[index] = types$1.f_gen; } + { this.context[index] = types.f_gen; } } this.exprAllowed = true; }; -types.name.updateContext = function(prevType) { +types$1.name.updateContext = function(prevType) { var allowed = false; - if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { + if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { allowed = true; } @@ -2317,14 +2351,14 @@ types.name.updateContext = function(prevType) { // A recursive descent parser operates by defining functions for all -var pp$4 = Parser.prototype; +var pp$5 = Parser.prototype; // Check if property name clashes with already added. // Object/class getters and setters are not allowed to clash — // either with each other or with an init property — and in // strict mode, init properties are also not allowed to be repeated. -pp$4.checkPropClash = function(prop, propHash, refDestructuringErrors) { +pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { return } if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) @@ -2341,10 +2375,12 @@ pp$4.checkPropClash = function(prop, propHash, refDestructuringErrors) { if (name === "__proto__" && kind === "init") { if (propHash.proto) { if (refDestructuringErrors) { - if (refDestructuringErrors.doubleProto < 0) - { refDestructuringErrors.doubleProto = key.start; } - // Backwards-compat kludge. Can be removed in version 6.0 - } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + if (refDestructuringErrors.doubleProto < 0) { + refDestructuringErrors.doubleProto = key.start; + } + } else { + this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); + } } propHash.proto = true; } @@ -2386,13 +2422,13 @@ pp$4.checkPropClash = function(prop, propHash, refDestructuringErrors) { // and object pattern might appear (so it's possible to raise // delayed syntax error at correct position). -pp$4.parseExpression = function(forInit, refDestructuringErrors) { +pp$5.parseExpression = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); - if (this.type === types.comma) { + if (this.type === types$1.comma) { var node = this.startNodeAt(startPos, startLoc); node.expressions = [expr]; - while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } + while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } return this.finishNode(node, "SequenceExpression") } return expr @@ -2401,7 +2437,7 @@ pp$4.parseExpression = function(forInit, refDestructuringErrors) { // Parse an assignment expression. This includes applications of // operators like `+=`. -pp$4.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { +pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { if (this.isContextual("yield")) { if (this.inGenerator) { return this.parseYield(forInit) } // The tokenizer will assume an expression is allowed after @@ -2409,10 +2445,11 @@ pp$4.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse else { this.exprAllowed = false; } } - var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; if (refDestructuringErrors) { oldParenAssign = refDestructuringErrors.parenthesizedAssign; oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; } else { refDestructuringErrors = new DestructuringErrors; @@ -2420,7 +2457,7 @@ pp$4.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse } var startPos = this.start, startLoc = this.startLoc; - if (this.type === types.parenL || this.type === types.name) { + if (this.type === types$1.parenL || this.type === types$1.name) { this.potentialArrowAt = this.start; this.potentialArrowInForAwait = forInit === "await"; } @@ -2429,20 +2466,21 @@ pp$4.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse if (this.type.isAssign) { var node = this.startNodeAt(startPos, startLoc); node.operator = this.value; - if (this.type === types.eq) + if (this.type === types$1.eq) { left = this.toAssignable(left, false, refDestructuringErrors); } if (!ownDestructuringErrors) { refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; } if (refDestructuringErrors.shorthandAssign >= left.start) { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly - if (this.type === types.eq) + if (this.type === types$1.eq) { this.checkLValPattern(left); } else { this.checkLValSimple(left); } node.left = left; this.next(); node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; } return this.finishNode(node, "AssignmentExpression") } else { if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } @@ -2454,15 +2492,15 @@ pp$4.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse // Parse a ternary conditional (`?:`) operator. -pp$4.parseMaybeConditional = function(forInit, refDestructuringErrors) { +pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseExprOps(forInit, refDestructuringErrors); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - if (this.eat(types.question)) { + if (this.eat(types$1.question)) { var node = this.startNodeAt(startPos, startLoc); node.test = expr; node.consequent = this.parseMaybeAssign(); - this.expect(types.colon); + this.expect(types$1.colon); node.alternate = this.parseMaybeAssign(forInit); return this.finishNode(node, "ConditionalExpression") } @@ -2471,7 +2509,7 @@ pp$4.parseMaybeConditional = function(forInit, refDestructuringErrors) { // Start the precedence parser. -pp$4.parseExprOps = function(forInit, refDestructuringErrors) { +pp$5.parseExprOps = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } @@ -2484,23 +2522,23 @@ pp$4.parseExprOps = function(forInit, refDestructuringErrors) { // defer further parser to one of its callers when it encounters an // operator that has a lower precedence than the set it is parsing. -pp$4.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { +pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { var prec = this.type.binop; - if (prec != null && (!forInit || this.type !== types._in)) { + if (prec != null && (!forInit || this.type !== types$1._in)) { if (prec > minPrec) { - var logical = this.type === types.logicalOR || this.type === types.logicalAND; - var coalesce = this.type === types.coalesce; + var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; + var coalesce = this.type === types$1.coalesce; if (coalesce) { // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. - prec = types.logicalAND.binop; + prec = types$1.logicalAND.binop; } var op = this.value; this.next(); var startPos = this.start, startLoc = this.startLoc; var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); - if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) { + if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) { this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); } return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit) @@ -2509,7 +2547,8 @@ pp$4.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) return left }; -pp$4.buildBinary = function(startPos, startLoc, left, right, op, logical) { +pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { + if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); } var node = this.startNodeAt(startPos, startLoc); node.left = left; node.operator = op; @@ -2519,13 +2558,13 @@ pp$4.buildBinary = function(startPos, startLoc, left, right, op, logical) { // Parse unary operators, both prefix and postfix. -pp$4.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { +pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { var startPos = this.start, startLoc = this.startLoc, expr; if (this.isContextual("await") && this.canAwait) { expr = this.parseAwait(forInit); sawUnary = true; } else if (this.type.prefix) { - var node = this.startNode(), update = this.type === types.incDec; + var node = this.startNode(), update = this.type === types$1.incDec; node.operator = this.value; node.prefix = true; this.next(); @@ -2539,6 +2578,11 @@ pp$4.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni { this.raiseRecoverable(node.start, "Private fields can not be deleted"); } else { sawUnary = true; } expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else if (!sawUnary && this.type === types$1.privateId) { + if (forInit || this.privateNameStack.length === 0) { this.unexpected(); } + expr = this.parsePrivateIdent(); + // only could be private fields in 'in', such as #x in obj + if (this.type !== types$1._in) { this.unexpected(); } } else { expr = this.parseExprSubscripts(refDestructuringErrors, forInit); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } @@ -2553,7 +2597,7 @@ pp$4.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni } } - if (!incDec && this.eat(types.starstar)) { + if (!incDec && this.eat(types$1.starstar)) { if (sawUnary) { this.unexpected(this.lastTokStart); } else @@ -2572,7 +2616,7 @@ function isPrivateFieldAccess(node) { // Parse call, dot, and `[]`-subscript expressions. -pp$4.parseExprSubscripts = function(refDestructuringErrors, forInit) { +pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseExprAtom(refDestructuringErrors, forInit); if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") @@ -2586,7 +2630,7 @@ pp$4.parseExprSubscripts = function(refDestructuringErrors, forInit) { return result }; -pp$4.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { +pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.potentialArrowAt === base.start; @@ -2609,19 +2653,19 @@ pp$4.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { } }; -pp$4.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { +pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { var optionalSupported = this.options.ecmaVersion >= 11; - var optional = optionalSupported && this.eat(types.questionDot); + var optional = optionalSupported && this.eat(types$1.questionDot); if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } - var computed = this.eat(types.bracketL); - if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) { + var computed = this.eat(types$1.bracketL); + if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) { var node = this.startNodeAt(startPos, startLoc); node.object = base; if (computed) { node.property = this.parseExpression(); - this.expect(types.bracketR); - } else if (this.type === types.privateId && base.type !== "Super") { + this.expect(types$1.bracketR); + } else if (this.type === types$1.privateId && base.type !== "Super") { node.property = this.parsePrivateIdent(); } else { node.property = this.parseIdent(this.options.allowReserved !== "never"); @@ -2631,13 +2675,13 @@ pp$4.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro node.optional = optional; } base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.eat(types.parenL)) { + } else if (!noCalls && this.eat(types$1.parenL)) { var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; - var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); - if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) { + var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); if (this.awaitIdentPos > 0) @@ -2658,7 +2702,7 @@ pp$4.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro node$1.optional = optional; } base = this.finishNode(node$1, "CallExpression"); - } else if (this.type === types.backQuote) { + } else if (this.type === types$1.backQuote) { if (optional || optionalChained) { this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); } @@ -2675,19 +2719,19 @@ pp$4.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro // `new`, or an expression wrapped in punctuation like `()`, `[]`, // or `{}`. -pp$4.parseExprAtom = function(refDestructuringErrors, forInit) { +pp$5.parseExprAtom = function(refDestructuringErrors, forInit) { // If a division operator appears in an expression position, the // tokenizer got confused, and we force it to read a regexp instead. - if (this.type === types.slash) { this.readRegexp(); } + if (this.type === types$1.slash) { this.readRegexp(); } var node, canBeArrow = this.potentialArrowAt === this.start; switch (this.type) { - case types._super: + case types$1._super: if (!this.allowSuper) { this.raise(this.start, "'super' keyword outside a method"); } node = this.startNode(); this.next(); - if (this.type === types.parenL && !this.allowDirectSuper) + if (this.type === types$1.parenL && !this.allowDirectSuper) { this.raise(node.start, "super() call outside constructor of a subclass"); } // The `super` keyword can appear at below: // SuperProperty: @@ -2695,52 +2739,52 @@ pp$4.parseExprAtom = function(refDestructuringErrors, forInit) { // super . IdentifierName // SuperCall: // super ( Arguments ) - if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) { this.unexpected(); } return this.finishNode(node, "Super") - case types._this: + case types$1._this: node = this.startNode(); this.next(); return this.finishNode(node, "ThisExpression") - case types.name: + case types$1.name: var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; var id = this.parseIdent(false); - if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) { - this.overrideContext(types$1.f_expr); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { + this.overrideContext(types.f_expr); return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit) } if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(types.arrow)) + if (this.eat(types$1.arrow)) { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) } - if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc && + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { id = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(types.arrow)) + if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) { this.unexpected(); } return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit) } } return id - case types.regexp: + case types$1.regexp: var value = this.value; node = this.parseLiteral(value.value); node.regex = {pattern: value.pattern, flags: value.flags}; return node - case types.num: case types.string: + case types$1.num: case types$1.string: return this.parseLiteral(this.value) - case types._null: case types._true: case types._false: + case types$1._null: case types$1._true: case types$1._false: node = this.startNode(); - node.value = this.type === types._null ? null : this.type === types._true; + node.value = this.type === types$1._null ? null : this.type === types$1._true; node.raw = this.type.keyword; this.next(); return this.finishNode(node, "Literal") - case types.parenL: + case types$1.parenL: var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); if (refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) @@ -2750,31 +2794,31 @@ pp$4.parseExprAtom = function(refDestructuringErrors, forInit) { } return expr - case types.bracketL: + case types$1.bracketL: node = this.startNode(); this.next(); - node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); + node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); return this.finishNode(node, "ArrayExpression") - case types.braceL: - this.overrideContext(types$1.b_expr); + case types$1.braceL: + this.overrideContext(types.b_expr); return this.parseObj(false, refDestructuringErrors) - case types._function: + case types$1._function: node = this.startNode(); this.next(); return this.parseFunction(node, 0) - case types._class: + case types$1._class: return this.parseClass(this.startNode(), false) - case types._new: + case types$1._new: return this.parseNew() - case types.backQuote: + case types$1.backQuote: return this.parseTemplate() - case types._import: + case types$1._import: if (this.options.ecmaVersion >= 11) { return this.parseExprImport() } else { @@ -2786,7 +2830,7 @@ pp$4.parseExprAtom = function(refDestructuringErrors, forInit) { } }; -pp$4.parseExprImport = function() { +pp$5.parseExprImport = function() { var node = this.startNode(); // Consume `import` as an identifier for `import.meta`. @@ -2795,9 +2839,9 @@ pp$4.parseExprImport = function() { var meta = this.parseIdent(true); switch (this.type) { - case types.parenL: + case types$1.parenL: return this.parseDynamicImport(node) - case types.dot: + case types$1.dot: node.meta = meta; return this.parseImportMeta(node) default: @@ -2805,16 +2849,16 @@ pp$4.parseExprImport = function() { } }; -pp$4.parseDynamicImport = function(node) { +pp$5.parseDynamicImport = function(node) { this.next(); // skip `(` // Parse node.source. node.source = this.parseMaybeAssign(); // Verify ending. - if (!this.eat(types.parenR)) { + if (!this.eat(types$1.parenR)) { var errorPos = this.start; - if (this.eat(types.comma) && this.eat(types.parenR)) { + if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); } else { this.unexpected(errorPos); @@ -2824,7 +2868,7 @@ pp$4.parseDynamicImport = function(node) { return this.finishNode(node, "ImportExpression") }; -pp$4.parseImportMeta = function(node) { +pp$5.parseImportMeta = function(node) { this.next(); // skip `.` var containsEsc = this.containsEsc; @@ -2840,7 +2884,7 @@ pp$4.parseImportMeta = function(node) { return this.finishNode(node, "MetaProperty") }; -pp$4.parseLiteral = function(value) { +pp$5.parseLiteral = function(value) { var node = this.startNode(); node.value = value; node.raw = this.input.slice(this.start, this.end); @@ -2849,14 +2893,14 @@ pp$4.parseLiteral = function(value) { return this.finishNode(node, "Literal") }; -pp$4.parseParenExpression = function() { - this.expect(types.parenL); +pp$5.parseParenExpression = function() { + this.expect(types$1.parenL); var val = this.parseExpression(); - this.expect(types.parenR); + this.expect(types$1.parenR); return val }; -pp$4.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { +pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; if (this.options.ecmaVersion >= 6) { this.next(); @@ -2867,24 +2911,24 @@ pp$4.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { this.yieldPos = 0; this.awaitPos = 0; // Do not save awaitIdentPos to allow checking awaits nested in parameters - while (this.type !== types.parenR) { - first ? first = false : this.expect(types.comma); - if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) { + while (this.type !== types$1.parenR) { + first ? first = false : this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { lastIsComma = true; break - } else if (this.type === types.ellipsis) { + } else if (this.type === types$1.ellipsis) { spreadStart = this.start; exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } break } else { exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); } } var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; - this.expect(types.parenR); + this.expect(types$1.parenR); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); this.yieldPos = oldYieldPos; @@ -2918,12 +2962,12 @@ pp$4.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { } }; -pp$4.parseParenItem = function(item) { +pp$5.parseParenItem = function(item) { return item }; -pp$4.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, forInit) +pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit) }; // New's precedence is slightly tricky. It must allow its argument to @@ -2932,13 +2976,13 @@ pp$4.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { // argument to parseSubscripts to prevent it from consuming the // argument list. -var empty$1 = []; +var empty = []; -pp$4.parseNew = function() { +pp$5.parseNew = function() { if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } var node = this.startNode(); var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { node.meta = meta; var containsEsc = this.containsEsc; node.property = this.parseIdent(true); @@ -2950,23 +2994,23 @@ pp$4.parseNew = function() { { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); } return this.finishNode(node, "MetaProperty") } - var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import; + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import; node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); if (isImport && node.callee.type === "ImportExpression") { this.raise(startPos, "Cannot use new with import()"); } - if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } - else { node.arguments = empty$1; } + if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); } + else { node.arguments = empty; } return this.finishNode(node, "NewExpression") }; // Parse template expression. -pp$4.parseTemplateElement = function(ref) { +pp$5.parseTemplateElement = function(ref) { var isTagged = ref.isTagged; var elem = this.startNode(); - if (this.type === types.invalidTemplate) { + if (this.type === types$1.invalidTemplate) { if (!isTagged) { this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); } @@ -2981,11 +3025,11 @@ pp$4.parseTemplateElement = function(ref) { }; } this.next(); - elem.tail = this.type === types.backQuote; + elem.tail = this.type === types$1.backQuote; return this.finishNode(elem, "TemplateElement") }; -pp$4.parseTemplate = function(ref) { +pp$5.parseTemplate = function(ref) { if ( ref === void 0 ) ref = {}; var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; @@ -2995,32 +3039,32 @@ pp$4.parseTemplate = function(ref) { var curElt = this.parseTemplateElement({isTagged: isTagged}); node.quasis = [curElt]; while (!curElt.tail) { - if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); } - this.expect(types.dollarBraceL); + if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); } + this.expect(types$1.dollarBraceL); node.expressions.push(this.parseExpression()); - this.expect(types.braceR); + this.expect(types$1.braceR); node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); } this.next(); return this.finishNode(node, "TemplateLiteral") }; -pp$4.isAsyncProp = function(prop) { +pp$5.isAsyncProp = function(prop) { return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && - (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; // Parse an object literal or binding pattern. -pp$4.parseObj = function(isPattern, refDestructuringErrors) { +pp$5.parseObj = function(isPattern, refDestructuringErrors) { var node = this.startNode(), first = true, propHash = {}; node.properties = []; this.next(); - while (!this.eat(types.braceR)) { + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var prop = this.parseProperty(isPattern, refDestructuringErrors); @@ -3030,18 +3074,18 @@ pp$4.parseObj = function(isPattern, refDestructuringErrors) { return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") }; -pp$4.parseProperty = function(isPattern, refDestructuringErrors) { +pp$5.parseProperty = function(isPattern, refDestructuringErrors) { var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; - if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { if (isPattern) { prop.argument = this.parseIdent(false); - if (this.type === types.comma) { + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } return this.finishNode(prop, "RestElement") } // To disallow parenthesized identifier via `this.toAssignable()`. - if (this.type === types.parenL && refDestructuringErrors) { + if (this.type === types$1.parenL && refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0) { refDestructuringErrors.parenthesizedAssign = this.start; } @@ -3052,7 +3096,7 @@ pp$4.parseProperty = function(isPattern, refDestructuringErrors) { // Parse argument. prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); // To disallow trailing comma via `this.toAssignable()`. - if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } // Finish @@ -3066,13 +3110,13 @@ pp$4.parseProperty = function(isPattern, refDestructuringErrors) { startLoc = this.startLoc; } if (!isPattern) - { isGenerator = this.eat(types.star); } + { isGenerator = this.eat(types$1.star); } } var containsEsc = this.containsEsc; this.parsePropertyName(prop); if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); this.parsePropertyName(prop, refDestructuringErrors); } else { isAsync = false; @@ -3081,14 +3125,14 @@ pp$4.parseProperty = function(isPattern, refDestructuringErrors) { return this.finishNode(prop, "Property") }; -pp$4.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { - if ((isGenerator || isAsync) && this.type === types.colon) +pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types$1.colon) { this.unexpected(); } - if (this.eat(types.colon)) { + if (this.eat(types$1.colon)) { prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); prop.kind = "init"; - } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { if (isPattern) { this.unexpected(); } prop.kind = "init"; prop.method = true; @@ -3096,7 +3140,7 @@ pp$4.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && - (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) { + (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { if (isGenerator || isAsync) { this.unexpected(); } prop.kind = prop.key.name; this.parsePropertyName(prop); @@ -3120,7 +3164,7 @@ pp$4.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP prop.kind = "init"; if (isPattern) { prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); - } else if (this.type === types.eq && refDestructuringErrors) { + } else if (this.type === types$1.eq && refDestructuringErrors) { if (refDestructuringErrors.shorthandAssign < 0) { refDestructuringErrors.shorthandAssign = this.start; } prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); @@ -3131,23 +3175,23 @@ pp$4.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP } else { this.unexpected(); } }; -pp$4.parsePropertyName = function(prop) { +pp$5.parsePropertyName = function(prop) { if (this.options.ecmaVersion >= 6) { - if (this.eat(types.bracketL)) { + if (this.eat(types$1.bracketL)) { prop.computed = true; prop.key = this.parseMaybeAssign(); - this.expect(types.bracketR); + this.expect(types$1.bracketR); return prop.key } else { prop.computed = false; } } - return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") + return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") }; // Initialize empty function node. -pp$4.initFunction = function(node) { +pp$5.initFunction = function(node) { node.id = null; if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } if (this.options.ecmaVersion >= 8) { node.async = false; } @@ -3155,7 +3199,7 @@ pp$4.initFunction = function(node) { // Parse object or class method. -pp$4.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { +pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.initFunction(node); @@ -3169,8 +3213,8 @@ pp$4.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { this.awaitIdentPos = 0; this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); this.parseFunctionBody(node, false, true, false); @@ -3182,7 +3226,7 @@ pp$4.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { // Parse arrow function expression with given parameters. -pp$4.parseArrowExpression = function(node, params, isAsync, forInit) { +pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); @@ -3204,8 +3248,8 @@ pp$4.parseArrowExpression = function(node, params, isAsync, forInit) { // Parse function body and check parameters. -pp$4.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { - var isExpression = isArrowFunction && this.type !== types.braceL; +pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { + var isExpression = isArrowFunction && this.type !== types$1.braceL; var oldStrict = this.strict, useStrict = false; if (isExpression) { @@ -3241,7 +3285,7 @@ pp$4.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { this.exitScope(); }; -pp$4.isSimpleParamList = function(params) { +pp$5.isSimpleParamList = function(params) { for (var i = 0, list = params; i < list.length; i += 1) { var param = list[i]; @@ -3254,7 +3298,7 @@ pp$4.isSimpleParamList = function(params) { // Checks function params for various disallowed patterns such as using "eval" // or "arguments" and duplicate parameters. -pp$4.checkParams = function(node, allowDuplicates) { +pp$5.checkParams = function(node, allowDuplicates) { var nameHash = Object.create(null); for (var i = 0, list = node.params; i < list.length; i += 1) { @@ -3270,20 +3314,20 @@ pp$4.checkParams = function(node, allowDuplicates) { // nothing in between them to be parsed as `null` (which is needed // for array literals). -pp$4.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { +pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { var elts = [], first = true; while (!this.eat(close)) { if (!first) { - this.expect(types.comma); + this.expect(types$1.comma); if (allowTrailingComma && this.afterTrailingComma(close)) { break } } else { first = false; } var elt = (void 0); - if (allowEmpty && this.type === types.comma) + if (allowEmpty && this.type === types$1.comma) { elt = null; } - else if (this.type === types.ellipsis) { + else if (this.type === types$1.ellipsis) { elt = this.parseSpread(refDestructuringErrors); - if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0) + if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } } else { elt = this.parseMaybeAssign(false, refDestructuringErrors); @@ -3293,7 +3337,7 @@ pp$4.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestruct return elts }; -pp$4.checkUnreserved = function(ref) { +pp$5.checkUnreserved = function(ref) { var start = ref.start; var end = ref.end; var name = ref.name; @@ -3322,9 +3366,9 @@ pp$4.checkUnreserved = function(ref) { // when parsing properties), it will also convert keywords into // identifiers. -pp$4.parseIdent = function(liberal, isBinding) { +pp$5.parseIdent = function(liberal, isBinding) { var node = this.startNode(); - if (this.type === types.name) { + if (this.type === types$1.name) { node.name = this.value; } else if (this.type.keyword) { node.name = this.type.keyword; @@ -3350,9 +3394,9 @@ pp$4.parseIdent = function(liberal, isBinding) { return node }; -pp$4.parsePrivateIdent = function() { +pp$5.parsePrivateIdent = function() { var node = this.startNode(); - if (this.type === types.privateId) { + if (this.type === types$1.privateId) { node.name = this.value; } else { this.unexpected(); @@ -3372,22 +3416,22 @@ pp$4.parsePrivateIdent = function() { // Parses yield expression inside generator. -pp$4.parseYield = function(forInit) { +pp$5.parseYield = function(forInit) { if (!this.yieldPos) { this.yieldPos = this.start; } var node = this.startNode(); this.next(); - if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { + if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) { node.delegate = false; node.argument = null; } else { - node.delegate = this.eat(types.star); + node.delegate = this.eat(types$1.star); node.argument = this.parseMaybeAssign(forInit); } return this.finishNode(node, "YieldExpression") }; -pp$4.parseAwait = function(forInit) { +pp$5.parseAwait = function(forInit) { if (!this.awaitPos) { this.awaitPos = this.start; } var node = this.startNode(); @@ -3396,7 +3440,7 @@ pp$4.parseAwait = function(forInit) { return this.finishNode(node, "AwaitExpression") }; -var pp$5 = Parser.prototype; +var pp$4 = Parser.prototype; // This function is used to raise exceptions on parse errors. It // takes an offset integer (into the current `input`) to indicate @@ -3404,7 +3448,7 @@ var pp$5 = Parser.prototype; // of the error message, and then raises a `SyntaxError` with that // message. -pp$5.raise = function(pos, message) { +pp$4.raise = function(pos, message) { var loc = getLineInfo(this.input, pos); message += " (" + loc.line + ":" + loc.column + ")"; var err = new SyntaxError(message); @@ -3412,15 +3456,15 @@ pp$5.raise = function(pos, message) { throw err }; -pp$5.raiseRecoverable = pp$5.raise; +pp$4.raiseRecoverable = pp$4.raise; -pp$5.curPosition = function() { +pp$4.curPosition = function() { if (this.options.locations) { return new Position(this.curLine, this.pos - this.lineStart) } }; -var pp$6 = Parser.prototype; +var pp$3 = Parser.prototype; var Scope = function Scope(flags) { this.flags = flags; @@ -3436,22 +3480,22 @@ var Scope = function Scope(flags) { // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. -pp$6.enterScope = function(flags) { +pp$3.enterScope = function(flags) { this.scopeStack.push(new Scope(flags)); }; -pp$6.exitScope = function() { +pp$3.exitScope = function() { this.scopeStack.pop(); }; // The spec says: // > At the top level of a function, or script, function declarations are // > treated like var declarations rather than like lexical declarations. -pp$6.treatFunctionsAsVarInScope = function(scope) { +pp$3.treatFunctionsAsVarInScope = function(scope) { return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) }; -pp$6.declareName = function(name, bindingType, pos) { +pp$3.declareName = function(name, bindingType, pos) { var redeclared = false; if (bindingType === BIND_LEXICAL) { var scope = this.currentScope(); @@ -3486,7 +3530,7 @@ pp$6.declareName = function(name, bindingType, pos) { if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } }; -pp$6.checkLocalExport = function(id) { +pp$3.checkLocalExport = function(id) { // scope.functions must be empty as Module code is always strict. if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { @@ -3494,11 +3538,11 @@ pp$6.checkLocalExport = function(id) { } }; -pp$6.currentScope = function() { +pp$3.currentScope = function() { return this.scopeStack[this.scopeStack.length - 1] }; -pp$6.currentVarScope = function() { +pp$3.currentVarScope = function() { for (var i = this.scopeStack.length - 1;; i--) { var scope = this.scopeStack[i]; if (scope.flags & SCOPE_VAR) { return scope } @@ -3506,7 +3550,7 @@ pp$6.currentVarScope = function() { }; // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. -pp$6.currentThisScope = function() { +pp$3.currentThisScope = function() { for (var i = this.scopeStack.length - 1;; i--) { var scope = this.scopeStack[i]; if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } @@ -3527,13 +3571,13 @@ var Node = function Node(parser, pos, loc) { // Start an AST node, attaching a start offset. -var pp$7 = Parser.prototype; +var pp$2 = Parser.prototype; -pp$7.startNode = function() { +pp$2.startNode = function() { return new Node(this, this.start, this.startLoc) }; -pp$7.startNodeAt = function(pos, loc) { +pp$2.startNodeAt = function(pos, loc) { return new Node(this, pos, loc) }; @@ -3549,17 +3593,17 @@ function finishNodeAt(node, type, pos, loc) { return node } -pp$7.finishNode = function(node, type) { +pp$2.finishNode = function(node, type) { return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) }; // Finish node at given position -pp$7.finishNodeAt = function(node, type, pos, loc) { +pp$2.finishNodeAt = function(node, type, pos, loc) { return finishNodeAt.call(this, node, type, pos, loc) }; -pp$7.copyNode = function(node) { +pp$2.copyNode = function(node) { var newNode = new Node(this, node.start, this.startLoc); for (var prop in node) { newNode[prop] = node[prop]; } return newNode @@ -3574,26 +3618,30 @@ var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Ass var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; var ecma11BinaryProperties = ecma10BinaryProperties; var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; +var ecma13BinaryProperties = ecma12BinaryProperties; var unicodeBinaryProperties = { 9: ecma9BinaryProperties, 10: ecma10BinaryProperties, 11: ecma11BinaryProperties, - 12: ecma12BinaryProperties + 12: ecma12BinaryProperties, + 13: ecma13BinaryProperties }; // #table-unicode-general-category-values var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; // #table-unicode-script-values -var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; +var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; +var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; var unicodeScriptValues = { 9: ecma9ScriptValues, 10: ecma10ScriptValues, 11: ecma11ScriptValues, - 12: ecma12ScriptValues + 12: ecma12ScriptValues, + 13: ecma13ScriptValues }; var data = {}; @@ -3611,17 +3659,19 @@ function buildUnicodeData(ecmaVersion) { d.nonBinary.sc = d.nonBinary.Script; d.nonBinary.scx = d.nonBinary.Script_Extensions; } -buildUnicodeData(9); -buildUnicodeData(10); -buildUnicodeData(11); -buildUnicodeData(12); -var pp$8 = Parser.prototype; +for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) { + var ecmaVersion = list[i]; + + buildUnicodeData(ecmaVersion); +} + +var pp$1 = Parser.prototype; var RegExpValidationState = function RegExpValidationState(parser) { this.parser = parser; this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); - this.unicodeProperties = data[parser.options.ecmaVersion >= 12 ? 12 : parser.options.ecmaVersion]; + this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; this.source = ""; this.flags = ""; this.start = 0; @@ -3712,7 +3762,7 @@ RegExpValidationState.prototype.eat = function eat (ch, forceU) { return false }; -function codePointToString(ch) { +function codePointToString$1(ch) { if (ch <= 0xFFFF) { return String.fromCharCode(ch) } ch -= 0x10000; return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) @@ -3724,7 +3774,7 @@ function codePointToString(ch) { * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ -pp$8.validateRegExpFlags = function(state) { +pp$1.validateRegExpFlags = function(state) { var validFlags = state.validFlags; var flags = state.flags; @@ -3745,7 +3795,7 @@ pp$8.validateRegExpFlags = function(state) { * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ -pp$8.validateRegExpPattern = function(state) { +pp$1.validateRegExpPattern = function(state) { this.regexp_pattern(state); // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of @@ -3760,7 +3810,7 @@ pp$8.validateRegExpPattern = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern -pp$8.regexp_pattern = function(state) { +pp$1.regexp_pattern = function(state) { state.pos = 0; state.lastIntValue = 0; state.lastStringValue = ""; @@ -3794,7 +3844,7 @@ pp$8.regexp_pattern = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction -pp$8.regexp_disjunction = function(state) { +pp$1.regexp_disjunction = function(state) { this.regexp_alternative(state); while (state.eat(0x7C /* | */)) { this.regexp_alternative(state); @@ -3810,13 +3860,13 @@ pp$8.regexp_disjunction = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative -pp$8.regexp_alternative = function(state) { +pp$1.regexp_alternative = function(state) { while (state.pos < state.source.length && this.regexp_eatTerm(state)) { } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term -pp$8.regexp_eatTerm = function(state) { +pp$1.regexp_eatTerm = function(state) { if (this.regexp_eatAssertion(state)) { // Handle `QuantifiableAssertion Quantifier` alternative. // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion @@ -3839,7 +3889,7 @@ pp$8.regexp_eatTerm = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion -pp$8.regexp_eatAssertion = function(state) { +pp$1.regexp_eatAssertion = function(state) { var start = state.pos; state.lastAssertionIsQuantifiable = false; @@ -3877,7 +3927,7 @@ pp$8.regexp_eatAssertion = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier -pp$8.regexp_eatQuantifier = function(state, noError) { +pp$1.regexp_eatQuantifier = function(state, noError) { if ( noError === void 0 ) noError = false; if (this.regexp_eatQuantifierPrefix(state, noError)) { @@ -3888,7 +3938,7 @@ pp$8.regexp_eatQuantifier = function(state, noError) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix -pp$8.regexp_eatQuantifierPrefix = function(state, noError) { +pp$1.regexp_eatQuantifierPrefix = function(state, noError) { return ( state.eat(0x2A /* * */) || state.eat(0x2B /* + */) || @@ -3896,7 +3946,7 @@ pp$8.regexp_eatQuantifierPrefix = function(state, noError) { this.regexp_eatBracedQuantifier(state, noError) ) }; -pp$8.regexp_eatBracedQuantifier = function(state, noError) { +pp$1.regexp_eatBracedQuantifier = function(state, noError) { var start = state.pos; if (state.eat(0x7B /* { */)) { var min = 0, max = -1; @@ -3922,7 +3972,7 @@ pp$8.regexp_eatBracedQuantifier = function(state, noError) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom -pp$8.regexp_eatAtom = function(state) { +pp$1.regexp_eatAtom = function(state) { return ( this.regexp_eatPatternCharacters(state) || state.eat(0x2E /* . */) || @@ -3932,7 +3982,7 @@ pp$8.regexp_eatAtom = function(state) { this.regexp_eatCapturingGroup(state) ) }; -pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { +pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { if (this.regexp_eatAtomEscape(state)) { @@ -3942,7 +3992,7 @@ pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { } return false }; -pp$8.regexp_eatUncapturingGroup = function(state) { +pp$1.regexp_eatUncapturingGroup = function(state) { var start = state.pos; if (state.eat(0x28 /* ( */)) { if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { @@ -3956,7 +4006,7 @@ pp$8.regexp_eatUncapturingGroup = function(state) { } return false }; -pp$8.regexp_eatCapturingGroup = function(state) { +pp$1.regexp_eatCapturingGroup = function(state) { if (state.eat(0x28 /* ( */)) { if (this.options.ecmaVersion >= 9) { this.regexp_groupSpecifier(state); @@ -3974,7 +4024,7 @@ pp$8.regexp_eatCapturingGroup = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom -pp$8.regexp_eatExtendedAtom = function(state) { +pp$1.regexp_eatExtendedAtom = function(state) { return ( state.eat(0x2E /* . */) || this.regexp_eatReverseSolidusAtomEscape(state) || @@ -3987,7 +4037,7 @@ pp$8.regexp_eatExtendedAtom = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier -pp$8.regexp_eatInvalidBracedQuantifier = function(state) { +pp$1.regexp_eatInvalidBracedQuantifier = function(state) { if (this.regexp_eatBracedQuantifier(state, true)) { state.raise("Nothing to repeat"); } @@ -3995,7 +4045,7 @@ pp$8.regexp_eatInvalidBracedQuantifier = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter -pp$8.regexp_eatSyntaxCharacter = function(state) { +pp$1.regexp_eatSyntaxCharacter = function(state) { var ch = state.current(); if (isSyntaxCharacter(ch)) { state.lastIntValue = ch; @@ -4017,7 +4067,7 @@ function isSyntaxCharacter(ch) { // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter // But eat eager. -pp$8.regexp_eatPatternCharacters = function(state) { +pp$1.regexp_eatPatternCharacters = function(state) { var start = state.pos; var ch = 0; while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { @@ -4027,7 +4077,7 @@ pp$8.regexp_eatPatternCharacters = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter -pp$8.regexp_eatExtendedPatternCharacter = function(state) { +pp$1.regexp_eatExtendedPatternCharacter = function(state) { var ch = state.current(); if ( ch !== -1 && @@ -4048,7 +4098,7 @@ pp$8.regexp_eatExtendedPatternCharacter = function(state) { // GroupSpecifier :: // [empty] // `?` GroupName -pp$8.regexp_groupSpecifier = function(state) { +pp$1.regexp_groupSpecifier = function(state) { if (state.eat(0x3F /* ? */)) { if (this.regexp_eatGroupName(state)) { if (state.groupNames.indexOf(state.lastStringValue) !== -1) { @@ -4064,7 +4114,7 @@ pp$8.regexp_groupSpecifier = function(state) { // GroupName :: // `<` RegExpIdentifierName `>` // Note: this updates `state.lastStringValue` property with the eaten name. -pp$8.regexp_eatGroupName = function(state) { +pp$1.regexp_eatGroupName = function(state) { state.lastStringValue = ""; if (state.eat(0x3C /* < */)) { if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { @@ -4079,12 +4129,12 @@ pp$8.regexp_eatGroupName = function(state) { // RegExpIdentifierStart // RegExpIdentifierName RegExpIdentifierPart // Note: this updates `state.lastStringValue` property with the eaten name. -pp$8.regexp_eatRegExpIdentifierName = function(state) { +pp$1.regexp_eatRegExpIdentifierName = function(state) { state.lastStringValue = ""; if (this.regexp_eatRegExpIdentifierStart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); + state.lastStringValue += codePointToString$1(state.lastIntValue); while (this.regexp_eatRegExpIdentifierPart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); + state.lastStringValue += codePointToString$1(state.lastIntValue); } return true } @@ -4096,7 +4146,7 @@ pp$8.regexp_eatRegExpIdentifierName = function(state) { // `$` // `_` // `\` RegExpUnicodeEscapeSequence[+U] -pp$8.regexp_eatRegExpIdentifierStart = function(state) { +pp$1.regexp_eatRegExpIdentifierStart = function(state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); @@ -4124,7 +4174,7 @@ function isRegExpIdentifierStart(ch) { // `\` RegExpUnicodeEscapeSequence[+U] // // -pp$8.regexp_eatRegExpIdentifierPart = function(state) { +pp$1.regexp_eatRegExpIdentifierPart = function(state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); @@ -4146,7 +4196,7 @@ function isRegExpIdentifierPart(ch) { } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape -pp$8.regexp_eatAtomEscape = function(state) { +pp$1.regexp_eatAtomEscape = function(state) { if ( this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || @@ -4164,7 +4214,7 @@ pp$8.regexp_eatAtomEscape = function(state) { } return false }; -pp$8.regexp_eatBackReference = function(state) { +pp$1.regexp_eatBackReference = function(state) { var start = state.pos; if (this.regexp_eatDecimalEscape(state)) { var n = state.lastIntValue; @@ -4182,7 +4232,7 @@ pp$8.regexp_eatBackReference = function(state) { } return false }; -pp$8.regexp_eatKGroupName = function(state) { +pp$1.regexp_eatKGroupName = function(state) { if (state.eat(0x6B /* k */)) { if (this.regexp_eatGroupName(state)) { state.backReferenceNames.push(state.lastStringValue); @@ -4194,7 +4244,7 @@ pp$8.regexp_eatKGroupName = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape -pp$8.regexp_eatCharacterEscape = function(state) { +pp$1.regexp_eatCharacterEscape = function(state) { return ( this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || @@ -4205,7 +4255,7 @@ pp$8.regexp_eatCharacterEscape = function(state) { this.regexp_eatIdentityEscape(state) ) }; -pp$8.regexp_eatCControlLetter = function(state) { +pp$1.regexp_eatCControlLetter = function(state) { var start = state.pos; if (state.eat(0x63 /* c */)) { if (this.regexp_eatControlLetter(state)) { @@ -4215,7 +4265,7 @@ pp$8.regexp_eatCControlLetter = function(state) { } return false }; -pp$8.regexp_eatZero = function(state) { +pp$1.regexp_eatZero = function(state) { if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { state.lastIntValue = 0; state.advance(); @@ -4225,7 +4275,7 @@ pp$8.regexp_eatZero = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape -pp$8.regexp_eatControlEscape = function(state) { +pp$1.regexp_eatControlEscape = function(state) { var ch = state.current(); if (ch === 0x74 /* t */) { state.lastIntValue = 0x09; /* \t */ @@ -4256,7 +4306,7 @@ pp$8.regexp_eatControlEscape = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter -pp$8.regexp_eatControlLetter = function(state) { +pp$1.regexp_eatControlLetter = function(state) { var ch = state.current(); if (isControlLetter(ch)) { state.lastIntValue = ch % 0x20; @@ -4273,7 +4323,7 @@ function isControlLetter(ch) { } // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence -pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { +pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { if ( forceU === void 0 ) forceU = false; var start = state.pos; @@ -4318,7 +4368,7 @@ function isValidUnicode(ch) { } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape -pp$8.regexp_eatIdentityEscape = function(state) { +pp$1.regexp_eatIdentityEscape = function(state) { if (state.switchU) { if (this.regexp_eatSyntaxCharacter(state)) { return true @@ -4341,7 +4391,7 @@ pp$8.regexp_eatIdentityEscape = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape -pp$8.regexp_eatDecimalEscape = function(state) { +pp$1.regexp_eatDecimalEscape = function(state) { state.lastIntValue = 0; var ch = state.current(); if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { @@ -4355,7 +4405,7 @@ pp$8.regexp_eatDecimalEscape = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape -pp$8.regexp_eatCharacterClassEscape = function(state) { +pp$1.regexp_eatCharacterClassEscape = function(state) { var ch = state.current(); if (isCharacterClassEscape(ch)) { @@ -4397,7 +4447,7 @@ function isCharacterClassEscape(ch) { // UnicodePropertyValueExpression :: // UnicodePropertyName `=` UnicodePropertyValue // LoneUnicodePropertyNameOrValue -pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { +pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { var start = state.pos; // UnicodePropertyName `=` UnicodePropertyValue @@ -4419,24 +4469,24 @@ pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { } return false }; -pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { - if (!has(state.unicodeProperties.nonBinary, name)) +pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!hasOwn(state.unicodeProperties.nonBinary, name)) { state.raise("Invalid property name"); } if (!state.unicodeProperties.nonBinary[name].test(value)) { state.raise("Invalid property value"); } }; -pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { +pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { if (!state.unicodeProperties.binary.test(nameOrValue)) { state.raise("Invalid property name"); } }; // UnicodePropertyName :: // UnicodePropertyNameCharacters -pp$8.regexp_eatUnicodePropertyName = function(state) { +pp$1.regexp_eatUnicodePropertyName = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyNameCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); + state.lastStringValue += codePointToString$1(ch); state.advance(); } return state.lastStringValue !== "" @@ -4447,11 +4497,11 @@ function isUnicodePropertyNameCharacter(ch) { // UnicodePropertyValue :: // UnicodePropertyValueCharacters -pp$8.regexp_eatUnicodePropertyValue = function(state) { +pp$1.regexp_eatUnicodePropertyValue = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyValueCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); + state.lastStringValue += codePointToString$1(ch); state.advance(); } return state.lastStringValue !== "" @@ -4462,12 +4512,12 @@ function isUnicodePropertyValueCharacter(ch) { // LoneUnicodePropertyNameOrValue :: // UnicodePropertyValueCharacters -pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { +pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { return this.regexp_eatUnicodePropertyValue(state) }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass -pp$8.regexp_eatCharacterClass = function(state) { +pp$1.regexp_eatCharacterClass = function(state) { if (state.eat(0x5B /* [ */)) { state.eat(0x5E /* ^ */); this.regexp_classRanges(state); @@ -4483,7 +4533,7 @@ pp$8.regexp_eatCharacterClass = function(state) { // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash -pp$8.regexp_classRanges = function(state) { +pp$1.regexp_classRanges = function(state) { while (this.regexp_eatClassAtom(state)) { var left = state.lastIntValue; if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { @@ -4500,7 +4550,7 @@ pp$8.regexp_classRanges = function(state) { // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash -pp$8.regexp_eatClassAtom = function(state) { +pp$1.regexp_eatClassAtom = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { @@ -4529,7 +4579,7 @@ pp$8.regexp_eatClassAtom = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape -pp$8.regexp_eatClassEscape = function(state) { +pp$1.regexp_eatClassEscape = function(state) { var start = state.pos; if (state.eat(0x62 /* b */)) { @@ -4556,7 +4606,7 @@ pp$8.regexp_eatClassEscape = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter -pp$8.regexp_eatClassControlLetter = function(state) { +pp$1.regexp_eatClassControlLetter = function(state) { var ch = state.current(); if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { state.lastIntValue = ch % 0x20; @@ -4567,7 +4617,7 @@ pp$8.regexp_eatClassControlLetter = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence -pp$8.regexp_eatHexEscapeSequence = function(state) { +pp$1.regexp_eatHexEscapeSequence = function(state) { var start = state.pos; if (state.eat(0x78 /* x */)) { if (this.regexp_eatFixedHexDigits(state, 2)) { @@ -4582,7 +4632,7 @@ pp$8.regexp_eatHexEscapeSequence = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits -pp$8.regexp_eatDecimalDigits = function(state) { +pp$1.regexp_eatDecimalDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; @@ -4597,7 +4647,7 @@ function isDecimalDigit(ch) { } // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits -pp$8.regexp_eatHexDigits = function(state) { +pp$1.regexp_eatHexDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; @@ -4626,7 +4676,7 @@ function hexToInt(ch) { // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence // Allows only 0-377(octal) i.e. 0-255(decimal). -pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { +pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { if (this.regexp_eatOctalDigit(state)) { var n1 = state.lastIntValue; if (this.regexp_eatOctalDigit(state)) { @@ -4645,7 +4695,7 @@ pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit -pp$8.regexp_eatOctalDigit = function(state) { +pp$1.regexp_eatOctalDigit = function(state) { var ch = state.current(); if (isOctalDigit(ch)) { state.lastIntValue = ch - 0x30; /* 0 */ @@ -4662,7 +4712,7 @@ function isOctalDigit(ch) { // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence -pp$8.regexp_eatFixedHexDigits = function(state, length) { +pp$1.regexp_eatFixedHexDigits = function(state, length) { var start = state.pos; state.lastIntValue = 0; for (var i = 0; i < length; ++i) { @@ -4694,11 +4744,11 @@ var Token = function Token(p) { // ## Tokenizer -var pp$9 = Parser.prototype; +var pp = Parser.prototype; // Move to the next token -pp$9.next = function(ignoreEscapeSequenceInKeyword) { +pp.next = function(ignoreEscapeSequenceInKeyword) { if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } if (this.options.onToken) @@ -4711,21 +4761,21 @@ pp$9.next = function(ignoreEscapeSequenceInKeyword) { this.nextToken(); }; -pp$9.getToken = function() { +pp.getToken = function() { this.next(); return new Token(this) }; // If we're in an ES6 environment, make parsers iterable if (typeof Symbol !== "undefined") - { pp$9[Symbol.iterator] = function() { - var this$1 = this; + { pp[Symbol.iterator] = function() { + var this$1$1 = this; return { next: function () { - var token = this$1.getToken(); + var token = this$1$1.getToken(); return { - done: token.type === types.eof, + done: token.type === types$1.eof, value: token } } @@ -4738,19 +4788,19 @@ if (typeof Symbol !== "undefined") // Read a single token, updating the parser object's token-related // properties. -pp$9.nextToken = function() { +pp.nextToken = function() { var curContext = this.curContext(); if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } this.start = this.pos; if (this.options.locations) { this.startLoc = this.curPosition(); } - if (this.pos >= this.input.length) { return this.finishToken(types.eof) } + if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) } if (curContext.override) { return curContext.override(this) } else { this.readToken(this.fullCharCodeAtPos()); } }; -pp$9.readToken = function(code) { +pp.readToken = function(code) { // Identifier or keyword. '\uXXXX' sequences are allowed in // identifiers, so '\' also dispatches to that. if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) @@ -4759,24 +4809,22 @@ pp$9.readToken = function(code) { return this.getTokenFromCode(code) }; -pp$9.fullCharCodeAtPos = function() { +pp.fullCharCodeAtPos = function() { var code = this.input.charCodeAt(this.pos); if (code <= 0xd7ff || code >= 0xdc00) { return code } var next = this.input.charCodeAt(this.pos + 1); return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00 }; -pp$9.skipBlockComment = function() { +pp.skipBlockComment = function() { var startLoc = this.options.onComment && this.curPosition(); var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } this.pos = end + 2; if (this.options.locations) { - lineBreakG.lastIndex = start; - var match; - while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) { ++this.curLine; - this.lineStart = match.index + match[0].length; + pos = this.lineStart = nextBreak; } } if (this.options.onComment) @@ -4784,7 +4832,7 @@ pp$9.skipBlockComment = function() { startLoc, this.curPosition()); } }; -pp$9.skipLineComment = function(startSkip) { +pp.skipLineComment = function(startSkip) { var start = this.pos; var startLoc = this.options.onComment && this.curPosition(); var ch = this.input.charCodeAt(this.pos += startSkip); @@ -4799,7 +4847,7 @@ pp$9.skipLineComment = function(startSkip) { // Called at the start of the parse and after every token. Skips // whitespace and comments, and. -pp$9.skipSpace = function() { +pp.skipSpace = function() { loop: while (this.pos < this.input.length) { var ch = this.input.charCodeAt(this.pos); switch (ch) { @@ -4844,7 +4892,7 @@ pp$9.skipSpace = function() { // the token, so that the next one's `start` will point at the // right position. -pp$9.finishToken = function(type, val) { +pp.finishToken = function(type, val) { this.end = this.pos; if (this.options.locations) { this.endLoc = this.curPosition(); } var prevType = this.type; @@ -4863,62 +4911,62 @@ pp$9.finishToken = function(type, val) { // // All in the name of speed. // -pp$9.readToken_dot = function() { +pp.readToken_dot = function() { var next = this.input.charCodeAt(this.pos + 1); if (next >= 48 && next <= 57) { return this.readNumber(true) } var next2 = this.input.charCodeAt(this.pos + 2); if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' this.pos += 3; - return this.finishToken(types.ellipsis) + return this.finishToken(types$1.ellipsis) } else { ++this.pos; - return this.finishToken(types.dot) + return this.finishToken(types$1.dot) } }; -pp$9.readToken_slash = function() { // '/' +pp.readToken_slash = function() { // '/' var next = this.input.charCodeAt(this.pos + 1); if (this.exprAllowed) { ++this.pos; return this.readRegexp() } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.slash, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.slash, 1) }; -pp$9.readToken_mult_modulo_exp = function(code) { // '%*' +pp.readToken_mult_modulo_exp = function(code) { // '%*' var next = this.input.charCodeAt(this.pos + 1); var size = 1; - var tokentype = code === 42 ? types.star : types.modulo; + var tokentype = code === 42 ? types$1.star : types$1.modulo; // exponentiation operator ** and **= if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { ++size; - tokentype = types.starstar; + tokentype = types$1.starstar; next = this.input.charCodeAt(this.pos + 2); } - if (next === 61) { return this.finishOp(types.assign, size + 1) } + if (next === 61) { return this.finishOp(types$1.assign, size + 1) } return this.finishOp(tokentype, size) }; -pp$9.readToken_pipe_amp = function(code) { // '|&' +pp.readToken_pipe_amp = function(code) { // '|&' var next = this.input.charCodeAt(this.pos + 1); if (next === code) { if (this.options.ecmaVersion >= 12) { var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 === 61) { return this.finishOp(types.assign, 3) } + if (next2 === 61) { return this.finishOp(types$1.assign, 3) } } - return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) + return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2) } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1) }; -pp$9.readToken_caret = function() { // '^' +pp.readToken_caret = function() { // '^' var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.bitwiseXOR, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.bitwiseXOR, 1) }; -pp$9.readToken_plus_min = function(code) { // '+-' +pp.readToken_plus_min = function(code) { // '+-' var next = this.input.charCodeAt(this.pos + 1); if (next === code) { if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && @@ -4928,19 +4976,19 @@ pp$9.readToken_plus_min = function(code) { // '+-' this.skipSpace(); return this.nextToken() } - return this.finishOp(types.incDec, 2) + return this.finishOp(types$1.incDec, 2) } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.plusMin, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.plusMin, 1) }; -pp$9.readToken_lt_gt = function(code) { // '<>' +pp.readToken_lt_gt = function(code) { // '<>' var next = this.input.charCodeAt(this.pos + 1); var size = 1; if (next === code) { size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(types.bitShift, size) + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } + return this.finishOp(types$1.bitShift, size) } if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { @@ -4950,53 +4998,53 @@ pp$9.readToken_lt_gt = function(code) { // '<>' return this.nextToken() } if (next === 61) { size = 2; } - return this.finishOp(types.relational, size) + return this.finishOp(types$1.relational, size) }; -pp$9.readToken_eq_excl = function(code) { // '=!' +pp.readToken_eq_excl = function(code) { // '=!' var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) } + if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) } if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>' this.pos += 2; - return this.finishToken(types.arrow) + return this.finishToken(types$1.arrow) } - return this.finishOp(code === 61 ? types.eq : types.prefix, 1) + return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1) }; -pp$9.readToken_question = function() { // '?' +pp.readToken_question = function() { // '?' var ecmaVersion = this.options.ecmaVersion; if (ecmaVersion >= 11) { var next = this.input.charCodeAt(this.pos + 1); if (next === 46) { var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 < 48 || next2 > 57) { return this.finishOp(types.questionDot, 2) } + if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) } } if (next === 63) { if (ecmaVersion >= 12) { var next2$1 = this.input.charCodeAt(this.pos + 2); - if (next2$1 === 61) { return this.finishOp(types.assign, 3) } + if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) } } - return this.finishOp(types.coalesce, 2) + return this.finishOp(types$1.coalesce, 2) } } - return this.finishOp(types.question, 1) + return this.finishOp(types$1.question, 1) }; -pp$9.readToken_numberSign = function() { // '#' +pp.readToken_numberSign = function() { // '#' var ecmaVersion = this.options.ecmaVersion; var code = 35; // '#' if (ecmaVersion >= 13) { ++this.pos; code = this.fullCharCodeAtPos(); if (isIdentifierStart(code, true) || code === 92 /* '\' */) { - return this.finishToken(types.privateId, this.readWord1()) + return this.finishToken(types$1.privateId, this.readWord1()) } } - this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'"); + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); }; -pp$9.getTokenFromCode = function(code) { +pp.getTokenFromCode = function(code) { switch (code) { // The interpretation of a dot depends on whether it is followed // by a digit or another two dots. @@ -5004,20 +5052,20 @@ pp$9.getTokenFromCode = function(code) { return this.readToken_dot() // Punctuation tokens. - case 40: ++this.pos; return this.finishToken(types.parenL) - case 41: ++this.pos; return this.finishToken(types.parenR) - case 59: ++this.pos; return this.finishToken(types.semi) - case 44: ++this.pos; return this.finishToken(types.comma) - case 91: ++this.pos; return this.finishToken(types.bracketL) - case 93: ++this.pos; return this.finishToken(types.bracketR) - case 123: ++this.pos; return this.finishToken(types.braceL) - case 125: ++this.pos; return this.finishToken(types.braceR) - case 58: ++this.pos; return this.finishToken(types.colon) + case 40: ++this.pos; return this.finishToken(types$1.parenL) + case 41: ++this.pos; return this.finishToken(types$1.parenR) + case 59: ++this.pos; return this.finishToken(types$1.semi) + case 44: ++this.pos; return this.finishToken(types$1.comma) + case 91: ++this.pos; return this.finishToken(types$1.bracketL) + case 93: ++this.pos; return this.finishToken(types$1.bracketR) + case 123: ++this.pos; return this.finishToken(types$1.braceL) + case 125: ++this.pos; return this.finishToken(types$1.braceR) + case 58: ++this.pos; return this.finishToken(types$1.colon) case 96: // '`' if (this.options.ecmaVersion < 6) { break } ++this.pos; - return this.finishToken(types.backQuote) + return this.finishToken(types$1.backQuote) case 48: // '0' var next = this.input.charCodeAt(this.pos + 1); @@ -5040,7 +5088,6 @@ pp$9.getTokenFromCode = function(code) { // often referred to. `finishOp` simply skips the amount of // characters it is given as second argument, and returns a token // of the type given by its first argument. - case 47: // '/' return this.readToken_slash() @@ -5066,22 +5113,22 @@ pp$9.getTokenFromCode = function(code) { return this.readToken_question() case 126: // '~' - return this.finishOp(types.prefix, 1) + return this.finishOp(types$1.prefix, 1) case 35: // '#' return this.readToken_numberSign() } - this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'"); + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); }; -pp$9.finishOp = function(type, size) { +pp.finishOp = function(type, size) { var str = this.input.slice(this.pos, this.pos + size); this.pos += size; return this.finishToken(type, str) }; -pp$9.readRegexp = function() { +pp.readRegexp = function() { var escaped, inClass, start = this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); } @@ -5116,14 +5163,14 @@ pp$9.readRegexp = function() { // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral } - return this.finishToken(types.regexp, {pattern: pattern, flags: flags, value: value}) + return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value}) }; // Read an integer in the given radix. Return null if zero digits // were read, the integer value otherwise. When `len` is given, this // will return `null` unless the integer has exactly `len` digits. -pp$9.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { +pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { // `len` is used for character escape sequences. In that case, disallow separators. var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined; @@ -5177,7 +5224,7 @@ function stringToBigInt(str) { return BigInt(str.replace(/_/g, "")) } -pp$9.readRadixNumber = function(radix) { +pp.readRadixNumber = function(radix) { var start = this.pos; this.pos += 2; // 0x var val = this.readInt(radix); @@ -5186,12 +5233,12 @@ pp$9.readRadixNumber = function(radix) { val = stringToBigInt(this.input.slice(start, this.pos)); ++this.pos; } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } - return this.finishToken(types.num, val) + return this.finishToken(types$1.num, val) }; // Read an integer, octal integer, or floating-point number. -pp$9.readNumber = function(startsWithDot) { +pp.readNumber = function(startsWithDot) { var start = this.pos; if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); } var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48; @@ -5201,7 +5248,7 @@ pp$9.readNumber = function(startsWithDot) { var val$1 = stringToBigInt(this.input.slice(start, this.pos)); ++this.pos; if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } - return this.finishToken(types.num, val$1) + return this.finishToken(types$1.num, val$1) } if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; } if (next === 46 && !octal) { // '.' @@ -5217,12 +5264,12 @@ pp$9.readNumber = function(startsWithDot) { if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } var val = stringToNumber(this.input.slice(start, this.pos), octal); - return this.finishToken(types.num, val) + return this.finishToken(types$1.num, val) }; // Read a string value, interpreting backslash-escapes. -pp$9.readCodePoint = function() { +pp.readCodePoint = function() { var ch = this.input.charCodeAt(this.pos), code; if (ch === 123) { // '{' @@ -5237,14 +5284,14 @@ pp$9.readCodePoint = function() { return code }; -function codePointToString$1(code) { +function codePointToString(code) { // UTF-16 Decoding if (code <= 0xFFFF) { return String.fromCharCode(code) } code -= 0x10000; return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00) } -pp$9.readString = function(quote) { +pp.readString = function(quote) { var out = "", chunkStart = ++this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); } @@ -5267,14 +5314,14 @@ pp$9.readString = function(quote) { } } out += this.input.slice(chunkStart, this.pos++); - return this.finishToken(types.string, out) + return this.finishToken(types$1.string, out) }; // Reads template string tokens. var INVALID_TEMPLATE_ESCAPE_ERROR = {}; -pp$9.tryReadTemplateToken = function() { +pp.tryReadTemplateToken = function() { this.inTemplateElement = true; try { this.readTmplToken(); @@ -5289,7 +5336,7 @@ pp$9.tryReadTemplateToken = function() { this.inTemplateElement = false; }; -pp$9.invalidStringToken = function(position, message) { +pp.invalidStringToken = function(position, message) { if (this.inTemplateElement && this.options.ecmaVersion >= 9) { throw INVALID_TEMPLATE_ESCAPE_ERROR } else { @@ -5297,23 +5344,23 @@ pp$9.invalidStringToken = function(position, message) { } }; -pp$9.readTmplToken = function() { +pp.readTmplToken = function() { var out = "", chunkStart = this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); } var ch = this.input.charCodeAt(this.pos); if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${' - if (this.pos === this.start && (this.type === types.template || this.type === types.invalidTemplate)) { + if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { if (ch === 36) { this.pos += 2; - return this.finishToken(types.dollarBraceL) + return this.finishToken(types$1.dollarBraceL) } else { ++this.pos; - return this.finishToken(types.backQuote) + return this.finishToken(types$1.backQuote) } } out += this.input.slice(chunkStart, this.pos); - return this.finishToken(types.template, out) + return this.finishToken(types$1.template, out) } if (ch === 92) { // '\' out += this.input.slice(chunkStart, this.pos); @@ -5344,7 +5391,7 @@ pp$9.readTmplToken = function() { }; // Reads a template token to search for the end, without validating any escape sequences -pp$9.readInvalidTemplateToken = function() { +pp.readInvalidTemplateToken = function() { for (; this.pos < this.input.length; this.pos++) { switch (this.input[this.pos]) { case "\\": @@ -5355,10 +5402,10 @@ pp$9.readInvalidTemplateToken = function() { if (this.input[this.pos + 1] !== "{") { break } - // falls through + // falls through case "`": - return this.finishToken(types.invalidTemplate, this.input.slice(this.start, this.pos)) + return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)) // no default } @@ -5368,14 +5415,14 @@ pp$9.readInvalidTemplateToken = function() { // Used to read escaped characters -pp$9.readEscapedChar = function(inTemplate) { +pp.readEscapedChar = function(inTemplate) { var ch = this.input.charCodeAt(++this.pos); ++this.pos; switch (ch) { case 110: return "\n" // 'n' -> '\n' case 114: return "\r" // 'r' -> '\r' case 120: return String.fromCharCode(this.readHexChar(2)) // 'x' - case 117: return codePointToString$1(this.readCodePoint()) // 'u' + case 117: return codePointToString(this.readCodePoint()) // 'u' case 116: return "\t" // 't' -> '\t' case 98: return "\b" // 'b' -> '\b' case 118: return "\u000b" // 'v' -> '\u000b' @@ -5433,7 +5480,7 @@ pp$9.readEscapedChar = function(inTemplate) { // Used to read character escape sequences ('\x', '\u', '\U'). -pp$9.readHexChar = function(len) { +pp.readHexChar = function(len) { var codePos = this.pos; var n = this.readInt(16, len); if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); } @@ -5446,7 +5493,7 @@ pp$9.readHexChar = function(len) { // Incrementally adds only escaped chars, adding other chunks as-is // as a micro-optimization. -pp$9.readWord1 = function() { +pp.readWord1 = function() { this.containsEsc = false; var word = "", first = true, chunkStart = this.pos; var astral = this.options.ecmaVersion >= 6; @@ -5464,7 +5511,7 @@ pp$9.readWord1 = function() { var esc = this.readCodePoint(); if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { this.invalidStringToken(escStart, "Invalid Unicode escape"); } - word += codePointToString$1(esc); + word += codePointToString(esc); chunkStart = this.pos; } else { break @@ -5477,18 +5524,18 @@ pp$9.readWord1 = function() { // Read an identifier or keyword token. Will check for reserved // words when necessary. -pp$9.readWord = function() { +pp.readWord = function() { var word = this.readWord1(); - var type = types.name; + var type = types$1.name; if (this.keywords.test(word)) { - type = keywords$1[word]; + type = keywords[word]; } return this.finishToken(type, word) }; // Acorn is a tiny, fast JavaScript parser written in JavaScript. -var version = "8.5.0"; +var version = "8.7.0"; Parser.acorn = { Parser: Parser, @@ -5499,10 +5546,10 @@ Parser.acorn = { getLineInfo: getLineInfo, Node: Node, TokenType: TokenType, - tokTypes: types, - keywordTypes: keywords$1, + tokTypes: types$1, + keywordTypes: keywords, TokContext: TokContext, - tokContexts: types$1, + tokContexts: types, isIdentifierChar: isIdentifierChar, isIdentifierStart: isIdentifierStart, Token: Token, @@ -5538,4 +5585,4 @@ function tokenizer(input, options) { return Parser.tokenizer(input, options) } -export { Node, Parser, Position, SourceLocation, TokContext, Token, TokenType, defaultOptions, getLineInfo, isIdentifierChar, isIdentifierStart, isNewLine, keywords$1 as keywordTypes, lineBreak, lineBreakG, nonASCIIwhitespace, parse, parseExpressionAt, types$1 as tokContexts, types as tokTypes, tokenizer, version }; +export { Node, Parser, Position, SourceLocation, TokContext, Token, TokenType, defaultOptions, getLineInfo, isIdentifierChar, isIdentifierStart, isNewLine, keywords as keywordTypes, lineBreak, lineBreakG, nonASCIIwhitespace, parse, parseExpressionAt, types as tokContexts, types$1 as tokTypes, tokenizer, version }; diff --git a/node_modules/ava/node_modules/acorn/dist/bin.js b/node_modules/ava/node_modules/acorn/dist/bin.js index d35d6ee990..8e64500945 100644 --- a/node_modules/ava/node_modules/acorn/dist/bin.js +++ b/node_modules/ava/node_modules/acorn/dist/bin.js @@ -4,13 +4,33 @@ var path = require('path'); var fs = require('fs'); var acorn = require('./acorn.js'); +function _interopNamespace(e) { + if (e && e.__esModule) return e; + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n["default"] = e; + return Object.freeze(n); +} + +var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn); + var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false; var options = {}; function help(status) { var print = (status === 0) ? console.log : console.error; print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|...|--ecma2015|--ecma2016|--ecma2017|--ecma2018|...]"); - print(" [--tokenize] [--locations] [---allow-hash-bang] [--allow-await-outside-function] [--compact] [--silent] [--module] [--help] [--] [...]"); + print(" [--tokenize] [--locations] [--allow-hash-bang] [--allow-await-outside-function] [--compact] [--silent] [--module] [--help] [--] [...]"); process.exit(status); } @@ -44,14 +64,14 @@ function run(codeList) { codeList.forEach(function (code, idx) { fileIdx = idx; if (!tokenize) { - result = acorn.parse(code, options); + result = acorn__namespace.parse(code, options); options.program = result; } else { - var tokenizer = acorn.tokenizer(code, options), token; + var tokenizer = acorn__namespace.tokenizer(code, options), token; do { token = tokenizer.getToken(); result.push(token); - } while (token.type !== acorn.tokTypes.eof) + } while (token.type !== acorn__namespace.tokTypes.eof) } }); } catch (e) { diff --git a/node_modules/ava/node_modules/acorn/package.json b/node_modules/ava/node_modules/acorn/package.json index 0318df900a..2f3bdf3187 100644 --- a/node_modules/ava/node_modules/acorn/package.json +++ b/node_modules/ava/node_modules/acorn/package.json @@ -16,7 +16,7 @@ ], "./package.json": "./package.json" }, - "version": "8.5.0", + "version": "8.7.0", "engines": { "node": ">=0.4.0" }, @@ -42,7 +42,7 @@ }, "license": "MIT", "scripts": { - "prepare": "cd ..; npm run build:main && npm run build:bin" + "prepare": "cd ..; npm run build:main" }, "bin": { "acorn": "./bin/acorn" diff --git a/node_modules/ava/node_modules/aggregate-error/index.d.ts b/node_modules/ava/node_modules/aggregate-error/index.d.ts new file mode 100644 index 0000000000..b46cff9088 --- /dev/null +++ b/node_modules/ava/node_modules/aggregate-error/index.d.ts @@ -0,0 +1,47 @@ +/** +Create an error from multiple errors. +*/ +export default class AggregateError extends Error { + readonly name: 'AggregateError'; + + readonly errors: readonly [T]; + + /** + @param errors - If a string, a new `Error` is created with the string as the error message. If a non-Error object, a new `Error` is created with all properties from the object copied over. + + @example + ``` + import AggregateError from 'aggregate-error'; + + const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]); + + throw error; + + // AggregateError: + // Error: foo + // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:33) + // Error: bar + // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + // Error: baz + // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + // at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3) + // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + // at Module._compile (module.js:556:32) + // at Object.Module._extensions..js (module.js:565:10) + // at Module.load (module.js:473:32) + // at tryModuleLoad (module.js:432:12) + // at Function.Module._load (module.js:424:3) + // at Module.runMain (module.js:590:10) + // at run (bootstrap_node.js:394:7) + // at startup (bootstrap_node.js:149:9) + + for (const individualError of error.errors) { + console.log(individualError); + } + //=> [Error: foo] + //=> [Error: bar] + //=> [Error: baz] + ``` + */ + constructor(errors: ReadonlyArray | string>); +} diff --git a/node_modules/ava/node_modules/aggregate-error/index.js b/node_modules/ava/node_modules/aggregate-error/index.js new file mode 100644 index 0000000000..f38734b9f1 --- /dev/null +++ b/node_modules/ava/node_modules/aggregate-error/index.js @@ -0,0 +1,44 @@ +import indentString from 'indent-string'; +import cleanStack from 'clean-stack'; + +const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, ''); + +export default class AggregateError extends Error { + #errors; + + name = 'AggregateError'; + + constructor(errors) { + if (!Array.isArray(errors)) { + throw new TypeError(`Expected input to be an Array, got ${typeof errors}`); + } + + errors = errors.map(error => { + if (error instanceof Error) { + return error; + } + + if (error !== null && typeof error === 'object') { + // Handle plain error objects with message property and/or possibly other metadata + return Object.assign(new Error(error.message), error); + } + + return new Error(error); + }); + + let message = errors + .map(error => { + // The `stack` property is not standardized, so we can't assume it exists + return typeof error.stack === 'string' ? cleanInternalStack(cleanStack(error.stack)) : String(error); + }) + .join('\n'); + message = '\n' + indentString(message, 4); + super(message); + + this.#errors = errors; + } + + get errors() { + return this.#errors.slice(); + } +} diff --git a/node_modules/boxen/license b/node_modules/ava/node_modules/aggregate-error/license similarity index 100% rename from node_modules/boxen/license rename to node_modules/ava/node_modules/aggregate-error/license diff --git a/node_modules/ava/node_modules/aggregate-error/package.json b/node_modules/ava/node_modules/aggregate-error/package.json new file mode 100644 index 0000000000..ceeea16b83 --- /dev/null +++ b/node_modules/ava/node_modules/aggregate-error/package.json @@ -0,0 +1,45 @@ +{ + "name": "aggregate-error", + "version": "4.0.0", + "description": "Create an error from multiple errors", + "license": "MIT", + "repository": "sindresorhus/aggregate-error", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "//test": "xo && ava && tsd", + "test": "ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "aggregate", + "error", + "combine", + "multiple", + "many", + "collection", + "iterable", + "iterator" + ], + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + } +} \ No newline at end of file diff --git a/node_modules/ava/node_modules/aggregate-error/readme.md b/node_modules/ava/node_modules/aggregate-error/readme.md new file mode 100644 index 0000000000..2c24ad0da0 --- /dev/null +++ b/node_modules/ava/node_modules/aggregate-error/readme.md @@ -0,0 +1,60 @@ +# aggregate-error + +> Create an error from multiple errors + +*Note: With [Node.js 15](https://medium.com/@nodejs/node-js-v15-0-0-is-here-deb00750f278), there's now a built-in [`AggregateError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError) type.* + +## Install + +``` +$ npm install aggregate-error +``` + +## Usage + +```js +import AggregateError from 'aggregate-error'; + +const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]); + +throw error; +/* +AggregateError: + Error: foo + at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:33) + Error: bar + at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + Error: baz + at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3) + at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + at Module._compile (module.js:556:32) + at Object.Module._extensions..js (module.js:565:10) + at Module.load (module.js:473:32) + at tryModuleLoad (module.js:432:12) + at Function.Module._load (module.js:424:3) + at Module.runMain (module.js:590:10) + at run (bootstrap_node.js:394:7) + at startup (bootstrap_node.js:149:9) +*/ + +for (const individualError of error.errors) { + console.log(individualError); +} +//=> [Error: foo] +//=> [Error: bar] +//=> [Error: baz] +``` + +## API + +### AggregateError(errors) + +Returns an `Error`. + +#### errors + +Type: `Array` + +If a string, a new `Error` is created with the string as the error message.\ +If a non-Error object, a new `Error` is created with all properties from the object copied over. diff --git a/node_modules/ava/node_modules/ansi-regex/index.d.ts b/node_modules/ava/node_modules/ansi-regex/index.d.ts new file mode 100644 index 0000000000..50ef64dc35 --- /dev/null +++ b/node_modules/ava/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,33 @@ +export interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + readonly onlyFirst: boolean; +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex from 'ansi-regex'; + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +export default function ansiRegex(options?: Options): RegExp; diff --git a/node_modules/ava/node_modules/ansi-regex/index.js b/node_modules/ava/node_modules/ansi-regex/index.js new file mode 100644 index 0000000000..130a0929b8 --- /dev/null +++ b/node_modules/ava/node_modules/ansi-regex/index.js @@ -0,0 +1,8 @@ +export default function ansiRegex({onlyFirst = false} = {}) { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +} diff --git a/node_modules/cacheable-request/node_modules/get-stream/license b/node_modules/ava/node_modules/ansi-regex/license similarity index 100% rename from node_modules/cacheable-request/node_modules/get-stream/license rename to node_modules/ava/node_modules/ansi-regex/license diff --git a/node_modules/ava/node_modules/ansi-regex/package.json b/node_modules/ava/node_modules/ansi-regex/package.json new file mode 100644 index 0000000000..dded7ec0e6 --- /dev/null +++ b/node_modules/ava/node_modules/ansi-regex/package.json @@ -0,0 +1,58 @@ +{ + "name": "ansi-regex", + "version": "6.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "funding": "https://github.com/chalk/ansi-regex?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + } +} \ No newline at end of file diff --git a/node_modules/ava/node_modules/ansi-regex/readme.md b/node_modules/ava/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000000..0e17e23808 --- /dev/null +++ b/node_modules/ava/node_modules/ansi-regex/readme.md @@ -0,0 +1,72 @@ +# ansi-regex + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + +## Install + +``` +$ npm install ansi-regex +``` + +## Usage + +```js +import ansiRegex from 'ansi-regex'; + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`\ +Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/ava/node_modules/ansi-styles/index.d.ts b/node_modules/ava/node_modules/ansi-styles/index.d.ts index e0170aa3d8..951bb95239 100644 --- a/node_modules/ava/node_modules/ansi-styles/index.d.ts +++ b/node_modules/ava/node_modules/ansi-styles/index.d.ts @@ -1,167 +1,190 @@ -declare namespace ansiStyles { - interface CSPair { - /** - The ANSI terminal control sequence for starting this style. - */ - readonly open: string; - - /** - The ANSI terminal control sequence for ending this style. - */ - readonly close: string; - } - - interface ColorBase { - /** - The ANSI terminal control sequence for ending this color. - */ - readonly close: string; - - ansi256(code: number): string; - - ansi16m(red: number, green: number, blue: number): string; - } - - interface Modifier { - /** - Resets the current color chain. - */ - readonly reset: CSPair; - - /** - Make text bold. - */ - readonly bold: CSPair; - - /** - Emitting only a small amount of light. - */ - readonly dim: CSPair; - - /** - Make text italic. (Not widely supported) - */ - readonly italic: CSPair; - - /** - Make text underline. (Not widely supported) - */ - readonly underline: CSPair; - - /** - Make text overline. - - Supported on VTE-based terminals, the GNOME terminal, mintty, and Git Bash. - */ - readonly overline: CSPair; - - /** - Inverse background and foreground colors. - */ - readonly inverse: CSPair; - - /** - Prints the text, but makes it invisible. - */ - readonly hidden: CSPair; - - /** - Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: CSPair; - } - - interface ForegroundColor { - readonly black: CSPair; - readonly red: CSPair; - readonly green: CSPair; - readonly yellow: CSPair; - readonly blue: CSPair; - readonly cyan: CSPair; - readonly magenta: CSPair; - readonly white: CSPair; - - /** - Alias for `blackBright`. - */ - readonly gray: CSPair; - - /** - Alias for `blackBright`. - */ - readonly grey: CSPair; - - readonly blackBright: CSPair; - readonly redBright: CSPair; - readonly greenBright: CSPair; - readonly yellowBright: CSPair; - readonly blueBright: CSPair; - readonly cyanBright: CSPair; - readonly magentaBright: CSPair; - readonly whiteBright: CSPair; - } - - interface BackgroundColor { - readonly bgBlack: CSPair; - readonly bgRed: CSPair; - readonly bgGreen: CSPair; - readonly bgYellow: CSPair; - readonly bgBlue: CSPair; - readonly bgCyan: CSPair; - readonly bgMagenta: CSPair; - readonly bgWhite: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGray: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGrey: CSPair; - - readonly bgBlackBright: CSPair; - readonly bgRedBright: CSPair; - readonly bgGreenBright: CSPair; - readonly bgYellowBright: CSPair; - readonly bgBlueBright: CSPair; - readonly bgCyanBright: CSPair; - readonly bgMagentaBright: CSPair; - readonly bgWhiteBright: CSPair; - } - - interface ConvertColor { - /** - Convert from the RGB color space to the ANSI 256 color space. - - @param red - (`0...255`) - @param green - (`0...255`) - @param blue - (`0...255`) - */ - rgbToAnsi256(red: number, green: number, blue: number): number; - - /** - Convert from the RGB HEX color space to the RGB color space. - - @param hex - A hexadecimal string containing RGB data. - */ - hexToRgb(hex: string): [red: number, green: number, blue: number]; - - /** - Convert from the RGB HEX color space to the ANSI 256 color space. - - @param hex - A hexadecimal string containing RGB data. - */ - hexToAnsi256(hex: string): number; - } +export interface CSPair { + /** + The ANSI terminal control sequence for starting this style. + */ + readonly open: string; + + /** + The ANSI terminal control sequence for ending this style. + */ + readonly close: string; +} + +export interface ColorBase { + /** + The ANSI terminal control sequence for ending this color. + */ + readonly close: string; + + ansi(code: number): string; + + ansi256(code: number): string; + + ansi16m(red: number, green: number, blue: number): string; +} + +export interface Modifier { + /** + Resets the current color chain. + */ + readonly reset: CSPair; + + /** + Make text bold. + */ + readonly bold: CSPair; + + /** + Emitting only a small amount of light. + */ + readonly dim: CSPair; + + /** + Make text italic. (Not widely supported) + */ + readonly italic: CSPair; + + /** + Make text underline. (Not widely supported) + */ + readonly underline: CSPair; + + /** + Make text overline. + + Supported on VTE-based terminals, the GNOME terminal, mintty, and Git Bash. + */ + readonly overline: CSPair; + + /** + Inverse background and foreground colors. + */ + readonly inverse: CSPair; + + /** + Prints the text, but makes it invisible. + */ + readonly hidden: CSPair; + + /** + Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: CSPair; +} + +export interface ForegroundColor { + readonly black: CSPair; + readonly red: CSPair; + readonly green: CSPair; + readonly yellow: CSPair; + readonly blue: CSPair; + readonly cyan: CSPair; + readonly magenta: CSPair; + readonly white: CSPair; + + /** + Alias for `blackBright`. + */ + readonly gray: CSPair; + + /** + Alias for `blackBright`. + */ + readonly grey: CSPair; + + readonly blackBright: CSPair; + readonly redBright: CSPair; + readonly greenBright: CSPair; + readonly yellowBright: CSPair; + readonly blueBright: CSPair; + readonly cyanBright: CSPair; + readonly magentaBright: CSPair; + readonly whiteBright: CSPair; +} + +export interface BackgroundColor { + readonly bgBlack: CSPair; + readonly bgRed: CSPair; + readonly bgGreen: CSPair; + readonly bgYellow: CSPair; + readonly bgBlue: CSPair; + readonly bgCyan: CSPair; + readonly bgMagenta: CSPair; + readonly bgWhite: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGray: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGrey: CSPair; + + readonly bgBlackBright: CSPair; + readonly bgRedBright: CSPair; + readonly bgGreenBright: CSPair; + readonly bgYellowBright: CSPair; + readonly bgBlueBright: CSPair; + readonly bgCyanBright: CSPair; + readonly bgMagentaBright: CSPair; + readonly bgWhiteBright: CSPair; +} + +export interface ConvertColor { + /** + Convert from the RGB color space to the ANSI 256 color space. + + @param red - (`0...255`) + @param green - (`0...255`) + @param blue - (`0...255`) + */ + rgbToAnsi256(red: number, green: number, blue: number): number; + + /** + Convert from the RGB HEX color space to the RGB color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hexToRgb(hex: string): [red: number, green: number, blue: number]; + + /** + Convert from the RGB HEX color space to the ANSI 256 color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hexToAnsi256(hex: string): number; + + /** + Convert from the ANSI 256 color space to the ANSI 16 color space. + + @param code - A number representing the ANSI 256 color. + */ + ansi256ToAnsi(code: number): number; + + /** + Convert from the RGB color space to the ANSI 16 color space. + + @param red - (`0...255`) + @param green - (`0...255`) + @param blue - (`0...255`) + */ + rgbToAnsi(red: number, green: number, blue: number): number; + + /** + Convert from the RGB HEX color space to the ANSI 16 color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hexToAnsi(hex: string): number; } declare const ansiStyles: { - readonly modifier: ansiStyles.Modifier; - readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; - readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; + readonly modifier: Modifier; + readonly color: ColorBase & ForegroundColor; + readonly bgColor: ColorBase & BackgroundColor; readonly codes: ReadonlyMap; -} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier & ansiStyles.ConvertColor; +} & ForegroundColor & BackgroundColor & Modifier & ConvertColor; -export = ansiStyles; +export default ansiStyles; diff --git a/node_modules/ava/node_modules/ansi-styles/index.js b/node_modules/ava/node_modules/ansi-styles/index.js index a9eac58955..e732c06534 100644 --- a/node_modules/ava/node_modules/ansi-styles/index.js +++ b/node_modules/ava/node_modules/ansi-styles/index.js @@ -1,7 +1,7 @@ -'use strict'; - const ANSI_BACKGROUND_OFFSET = 10; +const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`; + const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`; const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`; @@ -95,8 +95,10 @@ function assembleStyles() { styles.color.close = '\u001B[39m'; styles.bgColor.close = '\u001B[49m'; + styles.color.ansi = wrapAnsi16(); styles.color.ansi256 = wrapAnsi256(); styles.color.ansi16m = wrapAnsi16m(); + styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); @@ -151,14 +153,64 @@ function assembleStyles() { hexToAnsi256: { value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)), enumerable: false + }, + ansi256ToAnsi: { + value: code => { + if (code < 8) { + return 30 + code; + } + + if (code < 16) { + return 90 + (code - 8); + } + + let red; + let green; + let blue; + + if (code >= 232) { + red = (((code - 232) * 10) + 8) / 255; + green = red; + blue = red; + } else { + code -= 16; + + const remainder = code % 36; + + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = (remainder % 6) / 5; + } + + const value = Math.max(red, green, blue) * 2; + + if (value === 0) { + return 30; + } + + let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red)); + + if (value === 2) { + result += 60; + } + + return result; + }, + enumerable: false + }, + rgbToAnsi: { + value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), + enumerable: false + }, + hexToAnsi: { + value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), + enumerable: false } }); return styles; } -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); +const ansiStyles = assembleStyles(); + +export default ansiStyles; diff --git a/node_modules/ava/node_modules/ansi-styles/license b/node_modules/ava/node_modules/ansi-styles/license index e7af2f7710..fa7ceba3eb 100644 --- a/node_modules/ava/node_modules/ansi-styles/license +++ b/node_modules/ava/node_modules/ansi-styles/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/node_modules/ava/node_modules/ansi-styles/package.json b/node_modules/ava/node_modules/ansi-styles/package.json index b80b62dcd5..84a225913e 100644 --- a/node_modules/ava/node_modules/ansi-styles/package.json +++ b/node_modules/ava/node_modules/ansi-styles/package.json @@ -1,6 +1,6 @@ { "name": "ansi-styles", - "version": "5.2.0", + "version": "6.1.0", "description": "ANSI escape codes for styling strings in the terminal", "license": "MIT", "repository": "chalk/ansi-styles", @@ -10,8 +10,10 @@ "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, + "type": "module", + "exports": "./index.js", "engines": { - "node": ">=10" + "node": ">=12" }, "scripts": { "test": "xo && ava && tsd", @@ -44,9 +46,9 @@ "text" ], "devDependencies": { - "ava": "^2.4.0", + "ava": "^3.15.0", "svg-term-cli": "^2.1.1", "tsd": "^0.14.0", - "xo": "^0.37.1" + "xo": "^0.38.2" } } \ No newline at end of file diff --git a/node_modules/ava/node_modules/ansi-styles/readme.md b/node_modules/ava/node_modules/ansi-styles/readme.md index 7d1246652d..4b07dbbf2a 100644 --- a/node_modules/ava/node_modules/ansi-styles/readme.md +++ b/node_modules/ava/node_modules/ansi-styles/readme.md @@ -15,9 +15,9 @@ $ npm install ansi-styles ## Usage ```js -const style = require('ansi-styles'); +import styles from 'ansi-styles'; -console.log(`${style.green.open}Hello world!${style.green.close}`); +console.log(`${styles.green.open}Hello world!${styles.green.close}`); // Color conversion between 256/truecolor @@ -25,8 +25,9 @@ console.log(`${style.green.open}Hello world!${style.green.close}`); // may be degraded to fit the new color palette. This means terminals // that do not support 16 million colors will best-match the // original color. -console.log(`${style.color.ansi256(style.rgbToAnsi256(199, 20, 250))}Hello World${style.color.close}`) -console.log(`${style.color.ansi16m(...style.hexToRgb('#abcdef'))}Hello World${style.color.close}`) +console.log(`${styles.color.ansi(styles.rgbToAnsi(199, 20, 250))}Hello World${styles.color.close}`) +console.log(`${styles.color.ansi256(styles.rgbToAnsi256(199, 20, 250))}Hello World${styles.color.close}`) +console.log(`${styles.color.ansi16m(...styles.hexToRgb('#abcdef'))}Hello World${styles.color.close}`) ``` ## API @@ -89,43 +90,53 @@ Each style has an `open` and `close` property. By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. -- `style.modifier` -- `style.color` -- `style.bgColor` +- `styles.modifier` +- `styles.color` +- `styles.bgColor` ###### Example ```js -console.log(style.color.green.open); +import styles from 'ansi-styles'; + +console.log(styles.color.green.open); ``` -Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `styles.codes`, which returns a `Map` with the open codes as keys and close codes as values. ###### Example ```js -console.log(style.codes.get(36)); +import styles from 'ansi-styles'; + +console.log(styles.codes.get(36)); //=> 39 ``` -## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) +## 16 / 256 / 16 million (TrueColor) support -`ansi-styles` allows converting between various color formats and ANSI escapes, with support for 256 and 16 million colors. +`ansi-styles` allows converting between various color formats and ANSI escapes, with support for 16, 256 and [16 million colors](https://gist.github.com/XVilka/8346728). -The following color spaces from `color-convert` are supported: +The following color spaces are supported: - `rgb` - `hex` - `ansi256` +- `ansi` To use these, call the associated conversion function with the intended output, for example: ```js -style.color.ansi256(style.rgbToAnsi256(100, 200, 15)); // RGB to 256 color ansi foreground code -style.bgColor.ansi256(style.hexToAnsi256('#C0FFEE')); // HEX to 256 color ansi foreground code +import styles from 'ansi-styles'; + +styles.color.ansi(styles.rgbToAnsi(100, 200, 15)); // RGB to 16 color ansi foreground code +styles.bgColor.ansi(styles.hexToAnsi('#C0FFEE')); // HEX to 16 color ansi foreground code + +styles.color.ansi256(styles.rgbToAnsi256(100, 200, 15)); // RGB to 256 color ansi foreground code +styles.bgColor.ansi256(styles.hexToAnsi256('#C0FFEE')); // HEX to 256 color ansi foreground code -style.color.ansi16m(100, 200, 15); // RGB to 16 million color foreground code -style.bgColor.ansi16m(...style.hexToRgb('#C0FFEE')); // Hex (RGB) to 16 million color foreground code +styles.color.ansi16m(100, 200, 15); // RGB to 16 million color foreground code +styles.bgColor.ansi16m(...styles.hexToRgb('#C0FFEE')); // Hex (RGB) to 16 million color foreground code ``` ## Related diff --git a/node_modules/ava/node_modules/array-union/index.d.ts b/node_modules/ava/node_modules/array-union/index.d.ts new file mode 100644 index 0000000000..379fc1d2f5 --- /dev/null +++ b/node_modules/ava/node_modules/array-union/index.d.ts @@ -0,0 +1,25 @@ +/** +Create an array of unique values, in order, from the input arrays. + +@example +``` +import arrayUnion = require('array-union'); + +arrayUnion([1, 1, 2, 3], [2, 3]); +//=> [1, 2, 3] + +arrayUnion(['foo', 'foo', 'bar']); +//=> ['foo', 'bar'] + +arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']); +//=> ['🐱', '🦄', '🐻', '🌈'] + +arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']); +//=> ['🐱', '🦄', '🐻', '🐶', '🌈'] +``` +*/ +declare function arrayUnion( + ...arguments: readonly ArgumentsType[] +): ArgumentsType; + +export = arrayUnion; diff --git a/node_modules/ava/node_modules/array-union/index.js b/node_modules/ava/node_modules/array-union/index.js new file mode 100644 index 0000000000..a5a3df85f5 --- /dev/null +++ b/node_modules/ava/node_modules/array-union/index.js @@ -0,0 +1,3 @@ +const arrayUnion = (...arguments_) => [...new Set(arguments_.flat())]; + +export default arrayUnion; diff --git a/node_modules/camelcase/license b/node_modules/ava/node_modules/array-union/license similarity index 100% rename from node_modules/camelcase/license rename to node_modules/ava/node_modules/array-union/license diff --git a/node_modules/ava/node_modules/array-union/package.json b/node_modules/ava/node_modules/array-union/package.json new file mode 100644 index 0000000000..e3bce3eb9a --- /dev/null +++ b/node_modules/ava/node_modules/array-union/package.json @@ -0,0 +1,46 @@ +{ + "name": "array-union", + "version": "3.0.1", + "description": "Create an array of unique values, in order, from the input arrays", + "license": "MIT", + "repository": "sindresorhus/array-union", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "array", + "set", + "uniq", + "unique", + "duplicate", + "remove", + "union", + "combine", + "merge" + ], + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + }, + "tsd": { + "compilerOptions": { + "esModuleInterop": true + } + } +} \ No newline at end of file diff --git a/node_modules/ava/node_modules/array-union/readme.md b/node_modules/ava/node_modules/array-union/readme.md new file mode 100644 index 0000000000..b0b67fbdff --- /dev/null +++ b/node_modules/ava/node_modules/array-union/readme.md @@ -0,0 +1,39 @@ +# array-union + +> Create an array of unique values, in order, from the input arrays + +## Install + +``` +$ npm install array-union +``` + +## Usage + +```js +import arrayUnion from 'array-union'; + +arrayUnion([1, 1, 2, 3], [2, 3]); +//=> [1, 2, 3] + +arrayUnion(['foo', 'foo', 'bar']); +//=> ['foo', 'bar'] + +arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']); +//=> ['🐱', '🦄', '🐻', '🌈'] + +arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']); +//=> ['🐱', '🦄', '🐻', '🐶', '🌈'] +``` + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/ava/node_modules/arrify/index.d.ts b/node_modules/ava/node_modules/arrify/index.d.ts new file mode 100644 index 0000000000..2d83215dc9 --- /dev/null +++ b/node_modules/ava/node_modules/arrify/index.d.ts @@ -0,0 +1,36 @@ +/** +Convert a value to an array. + +_Specifying `null` or `undefined` results in an empty array._ + +@example +``` +import arrify from 'arrify'; + +arrify('🦄'); +//=> ['🦄'] + +arrify(['🦄']); +//=> ['🦄'] + +arrify(new Set(['🦄'])); +//=> ['🦄'] + +arrify(null); +//=> [] + +arrify(undefined); +//=> [] +``` +*/ +export default function arrify( + value: ValueType +): ValueType extends (null | undefined) + ? [] // eslint-disable-line @typescript-eslint/ban-types + : ValueType extends string + ? [string] + : ValueType extends readonly unknown[] + ? ValueType + : ValueType extends Iterable + ? T[] + : [ValueType]; diff --git a/node_modules/ava/node_modules/arrify/index.js b/node_modules/ava/node_modules/arrify/index.js new file mode 100644 index 0000000000..b2c8f6bbb2 --- /dev/null +++ b/node_modules/ava/node_modules/arrify/index.js @@ -0,0 +1,19 @@ +export default function arrify(value) { + if (value === null || value === undefined) { + return []; + } + + if (Array.isArray(value)) { + return value; + } + + if (typeof value === 'string') { + return [value]; + } + + if (typeof value[Symbol.iterator] === 'function') { + return [...value]; + } + + return [value]; +} diff --git a/node_modules/cli-boxes/license b/node_modules/ava/node_modules/arrify/license similarity index 100% rename from node_modules/cli-boxes/license rename to node_modules/ava/node_modules/arrify/license diff --git a/node_modules/@concordance/react/node_modules/arrify/package.json b/node_modules/ava/node_modules/arrify/package.json similarity index 53% rename from node_modules/@concordance/react/node_modules/arrify/package.json rename to node_modules/ava/node_modules/arrify/package.json index d60245659d..b56bf128e7 100644 --- a/node_modules/@concordance/react/node_modules/arrify/package.json +++ b/node_modules/ava/node_modules/arrify/package.json @@ -1,33 +1,38 @@ { "name": "arrify", - "version": "1.0.1", + "version": "3.0.0", "description": "Convert a value to an array", "license": "MIT", "repository": "sindresorhus/arrify", + "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "https://sindresorhus.com" }, + "type": "module", + "exports": "./index.js", "engines": { - "node": ">=0.10.0" + "node": ">=12" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava && tsd" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "keywords": [ "array", - "arr", "arrify", "arrayify", "convert", - "value" + "value", + "ensure" ], "devDependencies": { - "ava": "*", - "xo": "*" + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.39.1" } } \ No newline at end of file diff --git a/node_modules/ava/node_modules/arrify/readme.md b/node_modules/ava/node_modules/arrify/readme.md new file mode 100644 index 0000000000..7c5e0457f3 --- /dev/null +++ b/node_modules/ava/node_modules/arrify/readme.md @@ -0,0 +1,44 @@ +# arrify + +> Convert a value to an array + +## Install + +``` +$ npm install arrify +``` + +## Usage + +```js +import arrify from 'arrify'; + +arrify('🦄'); +//=> ['🦄'] + +arrify(['🦄']); +//=> ['🦄'] + +arrify(new Set(['🦄'])); +//=> ['🦄'] + +arrify(null); +//=> [] + +arrify(undefined); +//=> [] +``` + +*Specifying `null` or `undefined` results in an empty array.* + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/ava/node_modules/callsites/index.d.ts b/node_modules/ava/node_modules/callsites/index.d.ts new file mode 100644 index 0000000000..cf4d5fc481 --- /dev/null +++ b/node_modules/ava/node_modules/callsites/index.d.ts @@ -0,0 +1,87 @@ +type AnyFunction = (...args: any[]) => any; + +export interface CallSite { + /** + Returns the value of `this`. + */ + getThis(): unknown | undefined; + + /** + Returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property. + */ + getTypeName(): string | null; + + /** + Returns the current function. + */ + getFunction(): AnyFunction | undefined; + + /** + Returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + Returns the name of the property of `this` or one of its prototypes that holds the current function. + */ + getMethodName(): string | undefined; + + /** + Returns the name of the script if this function was defined in a script. + */ + getFileName(): string | null; + + /** + Returns the current line number if this function was defined in a script. + */ + getLineNumber(): number | null; + + /** + Returns the current column number if this function was defined in a script. + */ + getColumnNumber(): number | null; + + /** + Returns a string representing the location where `eval` was called if this function was created using a call to `eval`. + */ + getEvalOrigin(): string | undefined; + + /** + Returns `true` if this is a top-level invocation, that is, if it's a global object. + */ + isToplevel(): boolean; + + /** + Returns `true` if this call takes place in code defined by a call to `eval`. + */ + isEval(): boolean; + + /** + Returns `true` if this call is in native V8 code. + */ + isNative(): boolean; + + /** + Returns `true` if this is a constructor call. + */ + isConstructor(): boolean; +} + +/** +Get callsites from the V8 stack trace API. + +@returns An array of `CallSite` objects. + +@example +``` +import callsites from 'callsites'; + +function unicorn() { + console.log(callsites()[0].getFileName()); + //=> '/Users/sindresorhus/dev/callsites/test.js' +} + +unicorn(); +``` +*/ +export default function callsites(): CallSite[]; diff --git a/node_modules/ava/node_modules/callsites/index.js b/node_modules/ava/node_modules/callsites/index.js new file mode 100644 index 0000000000..513c6fdbe0 --- /dev/null +++ b/node_modules/ava/node_modules/callsites/index.js @@ -0,0 +1,7 @@ +export default function callsites() { + const _prepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = (_, stack) => stack; + const stack = new Error().stack.slice(1); // eslint-disable-line unicorn/error-message + Error.prepareStackTrace = _prepareStackTrace; + return stack; +} diff --git a/node_modules/cli-spinners/license b/node_modules/ava/node_modules/callsites/license similarity index 100% rename from node_modules/cli-spinners/license rename to node_modules/ava/node_modules/callsites/license diff --git a/node_modules/ava/node_modules/callsites/package.json b/node_modules/ava/node_modules/callsites/package.json new file mode 100644 index 0000000000..8ce19f3f7a --- /dev/null +++ b/node_modules/ava/node_modules/callsites/package.json @@ -0,0 +1,42 @@ +{ + "name": "callsites", + "version": "4.0.0", + "description": "Get callsites from the V8 stack trace API", + "license": "MIT", + "repository": "sindresorhus/callsites", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12.20" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "stacktrace", + "v8", + "callsite", + "callsites", + "stack", + "trace", + "function", + "file", + "line", + "debug" + ], + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.17.0", + "xo": "^0.44.0" + } +} \ No newline at end of file diff --git a/node_modules/ava/node_modules/callsites/readme.md b/node_modules/ava/node_modules/callsites/readme.md new file mode 100644 index 0000000000..cd4f0f68ab --- /dev/null +++ b/node_modules/ava/node_modules/callsites/readme.md @@ -0,0 +1,52 @@ +# callsites + +> Get callsites from the [V8 stack trace API](https://v8.dev/docs/stack-trace-api) + +## Install + +``` +$ npm install callsites +``` + +## Usage + +```js +import callsites from 'callsites'; + +function unicorn() { + console.log(callsites()[0].getFileName()); + //=> '/Users/sindresorhus/dev/callsites/test.js' +} + +unicorn(); +``` + +## API + +Returns an array of callsite objects with the following methods: + +- `getThis`: Returns the value of `this`. +- `getTypeName`: Returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property. +- `getFunction`: Returns the current function. +- `getFunctionName`: Returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context. +- `getMethodName`: Returns the name of the property of `this` or one of its prototypes that holds the current function. +- `getFileName`: If this function was defined in a script returns the name of the script. +- `getLineNumber`: If this function was defined in a script returns the current line number. +- `getColumnNumber`: If this function was defined in a script returns the current column number +- `getEvalOrigin`: If this function was created using a call to `eval` returns a string representing the location where `eval` was called. +- `isToplevel`: Is this a top-level invocation, that is, is this the global object? +- `isEval`: Does this call take place in code defined by a call to `eval`? +- `isNative`: Is this call in native V8 code? +- `isConstructor`: Is this a constructor call? + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/ava/node_modules/chalk/index.d.ts b/node_modules/ava/node_modules/chalk/index.d.ts deleted file mode 100644 index 9cd88f38be..0000000000 --- a/node_modules/ava/node_modules/chalk/index.d.ts +++ /dev/null @@ -1,415 +0,0 @@ -/** -Basic foreground colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type ForegroundColor = - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'gray' - | 'grey' - | 'blackBright' - | 'redBright' - | 'greenBright' - | 'yellowBright' - | 'blueBright' - | 'magentaBright' - | 'cyanBright' - | 'whiteBright'; - -/** -Basic background colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type BackgroundColor = - | 'bgBlack' - | 'bgRed' - | 'bgGreen' - | 'bgYellow' - | 'bgBlue' - | 'bgMagenta' - | 'bgCyan' - | 'bgWhite' - | 'bgGray' - | 'bgGrey' - | 'bgBlackBright' - | 'bgRedBright' - | 'bgGreenBright' - | 'bgYellowBright' - | 'bgBlueBright' - | 'bgMagentaBright' - | 'bgCyanBright' - | 'bgWhiteBright'; - -/** -Basic colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type Color = ForegroundColor | BackgroundColor; - -declare type Modifiers = - | 'reset' - | 'bold' - | 'dim' - | 'italic' - | 'underline' - | 'inverse' - | 'hidden' - | 'strikethrough' - | 'visible'; - -declare namespace chalk { - /** - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - type Level = 0 | 1 | 2 | 3; - - interface Options { - /** - Specify the color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level?: Level; - } - - /** - Return a new Chalk instance. - */ - type Instance = new (options?: Options) => Chalk; - - /** - Detect whether the terminal supports color. - */ - interface ColorSupport { - /** - The color level used by Chalk. - */ - level: Level; - - /** - Return whether Chalk supports basic 16 colors. - */ - hasBasic: boolean; - - /** - Return whether Chalk supports ANSI 256 colors. - */ - has256: boolean; - - /** - Return whether Chalk supports Truecolor 16 million colors. - */ - has16m: boolean; - } - - interface ChalkFunction { - /** - Use a template string. - - @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) - - @example - ``` - import chalk = require('chalk'); - - log(chalk` - CPU: {red ${cpu.totalPercent}%} - RAM: {green ${ram.used / ram.total * 100}%} - DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} - `); - ``` - - @example - ``` - import chalk = require('chalk'); - - log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`) - ``` - */ - (text: TemplateStringsArray, ...placeholders: unknown[]): string; - - (...text: unknown[]): string; - } - - interface Chalk extends ChalkFunction { - /** - Return a new Chalk instance. - */ - Instance: Instance; - - /** - The color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level: Level; - - /** - Use HEX value to set text color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.hex('#DEADED'); - ``` - */ - hex(color: string): Chalk; - - /** - Use keyword color value to set text color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.keyword('orange'); - ``` - */ - keyword(color: string): Chalk; - - /** - Use RGB values to set text color. - */ - rgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set text color. - */ - hsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set text color. - */ - hsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set text color. - */ - hwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - */ - ansi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(index: number): Chalk; - - /** - Use HEX value to set background color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgHex('#DEADED'); - ``` - */ - bgHex(color: string): Chalk; - - /** - Use keyword color value to set background color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgKeyword('orange'); - ``` - */ - bgKeyword(color: string): Chalk; - - /** - Use RGB values to set background color. - */ - bgRgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set background color. - */ - bgHsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set background color. - */ - bgHsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set background color. - */ - bgHwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - Use the foreground code, not the background code (for example, not 41, nor 101). - */ - bgAnsi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. - */ - bgAnsi256(index: number): Chalk; - - /** - Modifier: Resets the current color chain. - */ - readonly reset: Chalk; - - /** - Modifier: Make text bold. - */ - readonly bold: Chalk; - - /** - Modifier: Emitting only a small amount of light. - */ - readonly dim: Chalk; - - /** - Modifier: Make text italic. (Not widely supported) - */ - readonly italic: Chalk; - - /** - Modifier: Make text underline. (Not widely supported) - */ - readonly underline: Chalk; - - /** - Modifier: Inverse background and foreground colors. - */ - readonly inverse: Chalk; - - /** - Modifier: Prints the text, but makes it invisible. - */ - readonly hidden: Chalk; - - /** - Modifier: Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: Chalk; - - /** - Modifier: Prints the text only when Chalk has a color support level > 0. - Can be useful for things that are purely cosmetic. - */ - readonly visible: Chalk; - - readonly black: Chalk; - readonly red: Chalk; - readonly green: Chalk; - readonly yellow: Chalk; - readonly blue: Chalk; - readonly magenta: Chalk; - readonly cyan: Chalk; - readonly white: Chalk; - - /* - Alias for `blackBright`. - */ - readonly gray: Chalk; - - /* - Alias for `blackBright`. - */ - readonly grey: Chalk; - - readonly blackBright: Chalk; - readonly redBright: Chalk; - readonly greenBright: Chalk; - readonly yellowBright: Chalk; - readonly blueBright: Chalk; - readonly magentaBright: Chalk; - readonly cyanBright: Chalk; - readonly whiteBright: Chalk; - - readonly bgBlack: Chalk; - readonly bgRed: Chalk; - readonly bgGreen: Chalk; - readonly bgYellow: Chalk; - readonly bgBlue: Chalk; - readonly bgMagenta: Chalk; - readonly bgCyan: Chalk; - readonly bgWhite: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGray: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGrey: Chalk; - - readonly bgBlackBright: Chalk; - readonly bgRedBright: Chalk; - readonly bgGreenBright: Chalk; - readonly bgYellowBright: Chalk; - readonly bgBlueBright: Chalk; - readonly bgMagentaBright: Chalk; - readonly bgCyanBright: Chalk; - readonly bgWhiteBright: Chalk; - } -} - -/** -Main Chalk object that allows to chain styles together. -Call the last one as a method with a string argument. -Order doesn't matter, and later styles take precedent in case of a conflict. -This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. -*/ -declare const chalk: chalk.Chalk & chalk.ChalkFunction & { - supportsColor: chalk.ColorSupport | false; - Level: chalk.Level; - Color: Color; - ForegroundColor: ForegroundColor; - BackgroundColor: BackgroundColor; - Modifiers: Modifiers; - stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false}; -}; - -export = chalk; diff --git a/node_modules/ava/node_modules/chalk/license b/node_modules/ava/node_modules/chalk/license index e7af2f7710..fa7ceba3eb 100644 --- a/node_modules/ava/node_modules/chalk/license +++ b/node_modules/ava/node_modules/chalk/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/index.d.ts b/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/index.d.ts deleted file mode 100644 index 44a907e580..0000000000 --- a/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/index.d.ts +++ /dev/null @@ -1,345 +0,0 @@ -declare type CSSColor = - | 'aliceblue' - | 'antiquewhite' - | 'aqua' - | 'aquamarine' - | 'azure' - | 'beige' - | 'bisque' - | 'black' - | 'blanchedalmond' - | 'blue' - | 'blueviolet' - | 'brown' - | 'burlywood' - | 'cadetblue' - | 'chartreuse' - | 'chocolate' - | 'coral' - | 'cornflowerblue' - | 'cornsilk' - | 'crimson' - | 'cyan' - | 'darkblue' - | 'darkcyan' - | 'darkgoldenrod' - | 'darkgray' - | 'darkgreen' - | 'darkgrey' - | 'darkkhaki' - | 'darkmagenta' - | 'darkolivegreen' - | 'darkorange' - | 'darkorchid' - | 'darkred' - | 'darksalmon' - | 'darkseagreen' - | 'darkslateblue' - | 'darkslategray' - | 'darkslategrey' - | 'darkturquoise' - | 'darkviolet' - | 'deeppink' - | 'deepskyblue' - | 'dimgray' - | 'dimgrey' - | 'dodgerblue' - | 'firebrick' - | 'floralwhite' - | 'forestgreen' - | 'fuchsia' - | 'gainsboro' - | 'ghostwhite' - | 'gold' - | 'goldenrod' - | 'gray' - | 'green' - | 'greenyellow' - | 'grey' - | 'honeydew' - | 'hotpink' - | 'indianred' - | 'indigo' - | 'ivory' - | 'khaki' - | 'lavender' - | 'lavenderblush' - | 'lawngreen' - | 'lemonchiffon' - | 'lightblue' - | 'lightcoral' - | 'lightcyan' - | 'lightgoldenrodyellow' - | 'lightgray' - | 'lightgreen' - | 'lightgrey' - | 'lightpink' - | 'lightsalmon' - | 'lightseagreen' - | 'lightskyblue' - | 'lightslategray' - | 'lightslategrey' - | 'lightsteelblue' - | 'lightyellow' - | 'lime' - | 'limegreen' - | 'linen' - | 'magenta' - | 'maroon' - | 'mediumaquamarine' - | 'mediumblue' - | 'mediumorchid' - | 'mediumpurple' - | 'mediumseagreen' - | 'mediumslateblue' - | 'mediumspringgreen' - | 'mediumturquoise' - | 'mediumvioletred' - | 'midnightblue' - | 'mintcream' - | 'mistyrose' - | 'moccasin' - | 'navajowhite' - | 'navy' - | 'oldlace' - | 'olive' - | 'olivedrab' - | 'orange' - | 'orangered' - | 'orchid' - | 'palegoldenrod' - | 'palegreen' - | 'paleturquoise' - | 'palevioletred' - | 'papayawhip' - | 'peachpuff' - | 'peru' - | 'pink' - | 'plum' - | 'powderblue' - | 'purple' - | 'rebeccapurple' - | 'red' - | 'rosybrown' - | 'royalblue' - | 'saddlebrown' - | 'salmon' - | 'sandybrown' - | 'seagreen' - | 'seashell' - | 'sienna' - | 'silver' - | 'skyblue' - | 'slateblue' - | 'slategray' - | 'slategrey' - | 'snow' - | 'springgreen' - | 'steelblue' - | 'tan' - | 'teal' - | 'thistle' - | 'tomato' - | 'turquoise' - | 'violet' - | 'wheat' - | 'white' - | 'whitesmoke' - | 'yellow' - | 'yellowgreen'; - -declare namespace ansiStyles { - interface ColorConvert { - /** - The RGB color space. - - @param red - (`0`-`255`) - @param green - (`0`-`255`) - @param blue - (`0`-`255`) - */ - rgb(red: number, green: number, blue: number): string; - - /** - The RGB HEX color space. - - @param hex - A hexadecimal string containing RGB data. - */ - hex(hex: string): string; - - /** - @param keyword - A CSS color name. - */ - keyword(keyword: CSSColor): string; - - /** - The HSL color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param lightness - (`0`-`100`) - */ - hsl(hue: number, saturation: number, lightness: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param value - (`0`-`100`) - */ - hsv(hue: number, saturation: number, value: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param whiteness - (`0`-`100`) - @param blackness - (`0`-`100`) - */ - hwb(hue: number, whiteness: number, blackness: number): string; - - /** - Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. - */ - ansi(ansi: number): string; - - /** - Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(ansi: number): string; - } - - interface CSPair { - /** - The ANSI terminal control sequence for starting this style. - */ - readonly open: string; - - /** - The ANSI terminal control sequence for ending this style. - */ - readonly close: string; - } - - interface ColorBase { - readonly ansi: ColorConvert; - readonly ansi256: ColorConvert; - readonly ansi16m: ColorConvert; - - /** - The ANSI terminal control sequence for ending this color. - */ - readonly close: string; - } - - interface Modifier { - /** - Resets the current color chain. - */ - readonly reset: CSPair; - - /** - Make text bold. - */ - readonly bold: CSPair; - - /** - Emitting only a small amount of light. - */ - readonly dim: CSPair; - - /** - Make text italic. (Not widely supported) - */ - readonly italic: CSPair; - - /** - Make text underline. (Not widely supported) - */ - readonly underline: CSPair; - - /** - Inverse background and foreground colors. - */ - readonly inverse: CSPair; - - /** - Prints the text, but makes it invisible. - */ - readonly hidden: CSPair; - - /** - Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: CSPair; - } - - interface ForegroundColor { - readonly black: CSPair; - readonly red: CSPair; - readonly green: CSPair; - readonly yellow: CSPair; - readonly blue: CSPair; - readonly cyan: CSPair; - readonly magenta: CSPair; - readonly white: CSPair; - - /** - Alias for `blackBright`. - */ - readonly gray: CSPair; - - /** - Alias for `blackBright`. - */ - readonly grey: CSPair; - - readonly blackBright: CSPair; - readonly redBright: CSPair; - readonly greenBright: CSPair; - readonly yellowBright: CSPair; - readonly blueBright: CSPair; - readonly cyanBright: CSPair; - readonly magentaBright: CSPair; - readonly whiteBright: CSPair; - } - - interface BackgroundColor { - readonly bgBlack: CSPair; - readonly bgRed: CSPair; - readonly bgGreen: CSPair; - readonly bgYellow: CSPair; - readonly bgBlue: CSPair; - readonly bgCyan: CSPair; - readonly bgMagenta: CSPair; - readonly bgWhite: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGray: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGrey: CSPair; - - readonly bgBlackBright: CSPair; - readonly bgRedBright: CSPair; - readonly bgGreenBright: CSPair; - readonly bgYellowBright: CSPair; - readonly bgBlueBright: CSPair; - readonly bgCyanBright: CSPair; - readonly bgMagentaBright: CSPair; - readonly bgWhiteBright: CSPair; - } -} - -declare const ansiStyles: { - readonly modifier: ansiStyles.Modifier; - readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; - readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; - readonly codes: ReadonlyMap; -} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; - -export = ansiStyles; diff --git a/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/index.js b/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/index.js deleted file mode 100644 index 5d82581a13..0000000000 --- a/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); -}; - -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = require('color-convert'); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } - - return styles; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/package.json deleted file mode 100644 index ec506b2fd5..0000000000 --- a/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "ansi-styles", - "version": "4.3.0", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": "chalk/ansi-styles", - "funding": "https://github.com/chalk/ansi-styles?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "color-convert": "^2.0.1" - }, - "devDependencies": { - "@types/color-convert": "^1.9.0", - "ava": "^2.3.0", - "svg-term-cli": "^2.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" - } -} \ No newline at end of file diff --git a/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/readme.md b/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/readme.md deleted file mode 100644 index 24883de808..0000000000 --- a/node_modules/ava/node_modules/chalk/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,152 +0,0 @@ -# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) - -> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal - -You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - - - -## Install - -``` -$ npm install ansi-styles -``` - -## Usage - -```js -const style = require('ansi-styles'); - -console.log(`${style.green.open}Hello world!${style.green.close}`); - - -// Color conversion between 16/256/truecolor -// NOTE: If conversion goes to 16 colors or 256 colors, the original color -// may be degraded to fit that color palette. This means terminals -// that do not support 16 million colors will best-match the -// original color. -console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); -console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); -``` - -## API - -Each style has an `open` and `close` property. - -## Styles - -### Modifiers - -- `reset` -- `bold` -- `dim` -- `italic` *(Not widely supported)* -- `underline` -- `inverse` -- `hidden` -- `strikethrough` *(Not widely supported)* - -### Colors - -- `black` -- `red` -- `green` -- `yellow` -- `blue` -- `magenta` -- `cyan` -- `white` -- `blackBright` (alias: `gray`, `grey`) -- `redBright` -- `greenBright` -- `yellowBright` -- `blueBright` -- `magentaBright` -- `cyanBright` -- `whiteBright` - -### Background colors - -- `bgBlack` -- `bgRed` -- `bgGreen` -- `bgYellow` -- `bgBlue` -- `bgMagenta` -- `bgCyan` -- `bgWhite` -- `bgBlackBright` (alias: `bgGray`, `bgGrey`) -- `bgRedBright` -- `bgGreenBright` -- `bgYellowBright` -- `bgBlueBright` -- `bgMagentaBright` -- `bgCyanBright` -- `bgWhiteBright` - -## Advanced usage - -By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. - -- `style.modifier` -- `style.color` -- `style.bgColor` - -###### Example - -```js -console.log(style.color.green.open); -``` - -Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. - -###### Example - -```js -console.log(style.codes.get(36)); -//=> 39 -``` - -## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) - -`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. - -The following color spaces from `color-convert` are supported: - -- `rgb` -- `hex` -- `keyword` -- `hsl` -- `hsv` -- `hwb` -- `ansi` -- `ansi256` - -To use these, call the associated conversion function with the intended output, for example: - -```js -style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code -style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code - -style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code -style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code - -style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code -style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code -``` - -## Related - -- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - -## For enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/ava/node_modules/chalk/package.json b/node_modules/ava/node_modules/chalk/package.json index df5b74e54c..c9c72e727c 100644 --- a/node_modules/ava/node_modules/chalk/package.json +++ b/node_modules/ava/node_modules/chalk/package.json @@ -1,21 +1,30 @@ { "name": "chalk", - "version": "4.1.2", + "version": "5.0.0", "description": "Terminal string styling done right", "license": "MIT", "repository": "chalk/chalk", "funding": "https://github.com/chalk/chalk?sponsor=1", - "main": "source", + "type": "module", + "exports": "./source/index.js", + "imports": { + "#ansi-styles": "./source/vendor/ansi-styles/index.js", + "#supports-color": { + "node": "./source/vendor/supports-color/index.js", + "default": "./source/vendor/supports-color/browser.js" + } + }, + "types": "./source/index.d.ts", "engines": { - "node": ">=10" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "scripts": { - "test": "xo && nyc ava && tsd", + "test": "xo && c8 ava && tsd", "bench": "matcha benchmark.js" }, "files": [ "source", - "index.d.ts" + "!source/index.test-d.ts" ], "keywords": [ "color", @@ -25,7 +34,6 @@ "console", "cli", "string", - "str", "ansi", "style", "styles", @@ -40,29 +48,30 @@ "command-line", "text" ], - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, "devDependencies": { - "ava": "^2.4.0", - "coveralls": "^3.0.7", - "execa": "^4.0.0", - "import-fresh": "^3.1.0", + "@types/node": "^16.11.10", + "ava": "^3.15.0", + "c8": "^7.10.0", + "color-convert": "^2.0.1", + "execa": "^6.0.0", + "log-update": "^5.0.0", "matcha": "^0.7.0", - "nyc": "^15.0.0", - "resolve-from": "^5.0.0", - "tsd": "^0.7.4", - "xo": "^0.28.2" + "tsd": "^0.19.0", + "xo": "^0.47.0", + "yoctodelay": "^2.0.0" }, "xo": { "rules": { - "unicorn/prefer-string-slice": "off", - "unicorn/prefer-includes": "off", - "@typescript-eslint/member-ordering": "off", - "no-redeclare": "off", - "unicorn/string-content": "off", - "unicorn/better-regex": "off" + "unicorn/prefer-string-slice": "off" } + }, + "c8": { + "reporter": [ + "text", + "lcov" + ], + "exclude": [ + "source/vendor" + ] } } \ No newline at end of file diff --git a/node_modules/ava/node_modules/chalk/readme.md b/node_modules/ava/node_modules/chalk/readme.md index a055d21c97..f6adc80eef 100644 --- a/node_modules/ava/node_modules/chalk/readme.md +++ b/node_modules/ava/node_modules/chalk/readme.md @@ -9,7 +9,10 @@ > Terminal string styling done right -[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk) +[![Coverage Status](https://codecov.io/gh/chalk/chalk/branch/main/graph/badge.svg)](https://codecov.io/gh/chalk/chalk) +[![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) +[![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk) +[![Support Chalk on DEV](https://badge.devprotocol.xyz/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15/descriptive)](https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15) @@ -49,9 +52,13 @@
- +
- UI Bakery + Strapi +
+ Strapi is the leading open-source headless CMS. +
+ It’s 100% JavaScript, fully customizable, and developer-first.

@@ -65,24 +72,27 @@ - Expressive API - Highly performant +- No dependencies - Ability to nest styles - [256/Truecolor color support](#256-and-truecolor-color-support) - Auto-detects color support - Doesn't extend `String.prototype` - Clean and focused - Actively maintained -- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020 +- [Used by ~76,000 packages](https://www.npmjs.com/browse/depended/chalk) as of October 26, 2021 ## Install -```console -$ npm install chalk +```sh +npm install chalk ``` +**IMPORTANT:** Chalk 5 is ESM. If you want to use Chalk with TypeScript or a build tool, you will probably want to use Chalk 4 for now. [Read more.](https://github.com/chalk/chalk/releases/tag/v5.0.0) + ## Usage ```js -const chalk = require('chalk'); +import chalk from 'chalk'; console.log(chalk.blue('Hello world!')); ``` @@ -90,7 +100,8 @@ console.log(chalk.blue('Hello world!')); Chalk comes with an easy to use composable API where you just chain and nest the styles you want. ```js -const chalk = require('chalk'); +import chalk from 'chalk'; + const log = console.log; // Combine styled and normal strings @@ -119,15 +130,7 @@ RAM: ${chalk.green('40%')} DISK: ${chalk.yellow('70%')} `); -// ES2015 tagged template literal -log(chalk` -CPU: {red ${cpu.totalPercent}%} -RAM: {green ${ram.used / ram.total * 100}%} -DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} -`); - // Use RGB colors in terminal emulators that support it. -log(chalk.keyword('orange')('Yay for orange colored text!')); log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); log(chalk.hex('#DEADED').bold('Bold gray!')); ``` @@ -135,10 +138,10 @@ log(chalk.hex('#DEADED').bold('Bold gray!')); Easily define your own themes: ```js -const chalk = require('chalk'); +import chalk from 'chalk'; const error = chalk.bold.red; -const warning = chalk.keyword('orange'); +const warning = chalk.hex('#FFA500'); // Orange color console.log(error('Error!')); console.log(warning('Warning!')); @@ -147,6 +150,8 @@ console.log(warning('Warning!')); Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): ```js +import chalk from 'chalk'; + const name = 'Sindre'; console.log(chalk.green('Hello %s'), name); //=> 'Hello Sindre' @@ -171,7 +176,9 @@ Color support is automatically detected, but you can override it by setting the If you need to change this in a reusable module, create a new instance: ```js -const ctx = new chalk.Instance({level: 0}); +import {Chalk} from 'chalk'; + +const customChalk = new Chalk({level: 0}); ``` | Level | Description | @@ -181,7 +188,7 @@ const ctx = new chalk.Instance({level: 0}); | `2` | 256 color support | | `3` | Truecolor support (16 million colors) | -### chalk.supportsColor +### supportsColor Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience. @@ -189,23 +196,24 @@ Can be overridden by the user with the flags `--color` and `--no-color`. For sit Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. -### chalk.stderr and chalk.stderr.supportsColor +### chalkStderr and supportsColorStderr -`chalk.stderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `chalk.supportsColor` apply to this too. `chalk.stderr.supportsColor` is exposed for convenience. +`chalkStderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `supportsColor` apply to this too. `supportsColorStderr` is exposed for convenience. ## Styles ### Modifiers -- `reset` - Resets the current color chain. -- `bold` - Make text bold. -- `dim` - Emitting only a small amount of light. -- `italic` - Make text italic. *(Not widely supported)* -- `underline` - Make text underline. *(Not widely supported)* -- `inverse`- Inverse background and foreground colors. -- `hidden` - Prints the text, but makes it invisible. +- `reset` - Reset the current style. +- `bold` - Make the text bold. +- `dim` - Make the text have lower opacity. +- `italic` - Make the text italic. *(Not widely supported)* +- `underline` - Put a horizontal line below the text. *(Not widely supported)* +- `overline` - Put a horizontal line above the text. *(Not widely supported)* +- `inverse`- Invert background and foreground colors. +- `hidden` - Print the text but make it invisible. - `strikethrough` - Puts a horizontal line through the center of the text. *(Not widely supported)* -- `visible`- Prints the text only when Chalk has a color level > 0. Can be useful for things that are purely cosmetic. +- `visible`- Print the text only when Chalk has a color level above zero. Can be useful for things that are purely cosmetic. ### Colors @@ -245,36 +253,6 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color= - `bgCyanBright` - `bgWhiteBright` -## Tagged template literal - -Chalk can be used as a [tagged template literal](https://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals). - -```js -const chalk = require('chalk'); - -const miles = 18; -const calculateFeet = miles => miles * 5280; - -console.log(chalk` - There are {bold 5280 feet} in a mile. - In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}. -`); -``` - -Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`). - -Template styles are chained exactly like normal Chalk styles. The following three statements are equivalent: - -```js -console.log(chalk.bold.rgb(10, 100, 200)('Hello!')); -console.log(chalk.bold.rgb(10, 100, 200)`Hello!`); -console.log(chalk`{bold.rgb(10,100,200) Hello!}`); -``` - -Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters. - -All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped. - ## 256 and Truecolor color support Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps. @@ -284,26 +262,23 @@ Colors are downsampled from 16 million RGB values to an ANSI color format that i Examples: - `chalk.hex('#DEADED').underline('Hello, world!')` -- `chalk.keyword('orange')('Some orange text')` - `chalk.rgb(15, 100, 204).inverse('Hello!')` -Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors). +Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `hex` for foreground colors and `bgHex` for background colors). - `chalk.bgHex('#DEADED').underline('Hello, world!')` -- `chalk.bgKeyword('orange')('Some orange text')` - `chalk.bgRgb(15, 100, 204).inverse('Hello!')` The following color models can be used: - [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')` - [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')` -- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')` -- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')` -- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')` -- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')` -- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')` - [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')` +## Browser support + +Since Chrome 69, ANSI escape codes are natively supported in the developer console. + ## Windows If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`. @@ -320,6 +295,7 @@ The maintainers of chalk and thousands of other packages are working with Tideli ## Related +- [chalk-template](https://github.com/chalk/chalk-template) - [Tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) support for this module - [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module - [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal - [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color diff --git a/node_modules/ava/node_modules/chalk/source/index.d.ts b/node_modules/ava/node_modules/chalk/source/index.d.ts new file mode 100644 index 0000000000..b2408c6ede --- /dev/null +++ b/node_modules/ava/node_modules/chalk/source/index.d.ts @@ -0,0 +1,318 @@ +// TODO: Make it this when TS suports that. +// import {ColorInfo, ColorSupportLevel} from '#supports-color'; +import {ColorInfo, ColorSupportLevel} from './vendor/supports-color/index.js'; + +/** +Basic foreground colors. + +[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support) +*/ +export type ForegroundColor = + | 'black' + | 'red' + | 'green' + | 'yellow' + | 'blue' + | 'magenta' + | 'cyan' + | 'white' + | 'gray' + | 'grey' + | 'blackBright' + | 'redBright' + | 'greenBright' + | 'yellowBright' + | 'blueBright' + | 'magentaBright' + | 'cyanBright' + | 'whiteBright'; + +/** +Basic background colors. + +[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support) +*/ +export type BackgroundColor = + | 'bgBlack' + | 'bgRed' + | 'bgGreen' + | 'bgYellow' + | 'bgBlue' + | 'bgMagenta' + | 'bgCyan' + | 'bgWhite' + | 'bgGray' + | 'bgGrey' + | 'bgBlackBright' + | 'bgRedBright' + | 'bgGreenBright' + | 'bgYellowBright' + | 'bgBlueBright' + | 'bgMagentaBright' + | 'bgCyanBright' + | 'bgWhiteBright'; + +/** +Basic colors. + +[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support) +*/ +export type Color = ForegroundColor | BackgroundColor; + +export type Modifiers = + | 'reset' + | 'bold' + | 'dim' + | 'italic' + | 'underline' + | 'overline' + | 'inverse' + | 'hidden' + | 'strikethrough' + | 'visible'; + +export interface Options { + /** + Specify the color support for Chalk. + + By default, color support is automatically detected based on the environment. + + Levels: + - `0` - All colors disabled. + - `1` - Basic 16 colors support. + - `2` - ANSI 256 colors support. + - `3` - Truecolor 16 million colors support. + */ + readonly level?: ColorSupportLevel; +} + +/** +Return a new Chalk instance. +*/ +export const Chalk: new (options?: Options) => ChalkInstance; // eslint-disable-line @typescript-eslint/naming-convention + +export interface ChalkInstance { + (...text: unknown[]): string; + + /** + The color support for Chalk. + + By default, color support is automatically detected based on the environment. + + Levels: + - `0` - All colors disabled. + - `1` - Basic 16 colors support. + - `2` - ANSI 256 colors support. + - `3` - Truecolor 16 million colors support. + */ + level: ColorSupportLevel; + + /** + Use RGB values to set text color. + + @example + ``` + import chalk from 'chalk'; + + chalk.rgb(222, 173, 237); + ``` + */ + rgb: (red: number, green: number, blue: number) => this; + + /** + Use HEX value to set text color. + + @param color - Hexadecimal value representing the desired color. + + @example + ``` + import chalk from 'chalk'; + + chalk.hex('#DEADED'); + ``` + */ + hex: (color: string) => this; + + /** + Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. + + @example + ``` + import chalk from 'chalk'; + + chalk.ansi256(201); + ``` + */ + ansi256: (index: number) => this; + + /** + Use RGB values to set background color. + + @example + ``` + import chalk from 'chalk'; + + chalk.bgRgb(222, 173, 237); + ``` + */ + bgRgb: (red: number, green: number, blue: number) => this; + + /** + Use HEX value to set background color. + + @param color - Hexadecimal value representing the desired color. + + @example + ``` + import chalk from 'chalk'; + + chalk.bgHex('#DEADED'); + ``` + */ + bgHex: (color: string) => this; + + /** + Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. + + @example + ``` + import chalk from 'chalk'; + + chalk.bgAnsi256(201); + ``` + */ + bgAnsi256: (index: number) => this; + + /** + Modifier: Reset the current style. + */ + readonly reset: this; + + /** + Modifier: Make the text bold. + */ + readonly bold: this; + + /** + Modifier: Make the text have lower opacity. + */ + readonly dim: this; + + /** + Modifier: Make the text italic. *(Not widely supported)* + */ + readonly italic: this; + + /** + Modifier: Put a horizontal line below the text. *(Not widely supported)* + */ + readonly underline: this; + + /** + Modifier: Put a horizontal line above the text. *(Not widely supported)* + */ + readonly overline: this; + + /** + Modifier: Invert background and foreground colors. + */ + readonly inverse: this; + + /** + Modifier: Print the text but make it invisible. + */ + readonly hidden: this; + + /** + Modifier: Puts a horizontal line through the center of the text. *(Not widely supported)* + */ + readonly strikethrough: this; + + /** + Modifier: Print the text only when Chalk has a color level above zero. + + Can be useful for things that are purely cosmetic. + */ + readonly visible: this; + + readonly black: this; + readonly red: this; + readonly green: this; + readonly yellow: this; + readonly blue: this; + readonly magenta: this; + readonly cyan: this; + readonly white: this; + + /* + Alias for `blackBright`. + */ + readonly gray: this; + + /* + Alias for `blackBright`. + */ + readonly grey: this; + + readonly blackBright: this; + readonly redBright: this; + readonly greenBright: this; + readonly yellowBright: this; + readonly blueBright: this; + readonly magentaBright: this; + readonly cyanBright: this; + readonly whiteBright: this; + + readonly bgBlack: this; + readonly bgRed: this; + readonly bgGreen: this; + readonly bgYellow: this; + readonly bgBlue: this; + readonly bgMagenta: this; + readonly bgCyan: this; + readonly bgWhite: this; + + /* + Alias for `bgBlackBright`. + */ + readonly bgGray: this; + + /* + Alias for `bgBlackBright`. + */ + readonly bgGrey: this; + + readonly bgBlackBright: this; + readonly bgRedBright: this; + readonly bgGreenBright: this; + readonly bgYellowBright: this; + readonly bgBlueBright: this; + readonly bgMagentaBright: this; + readonly bgCyanBright: this; + readonly bgWhiteBright: this; +} + +/** +Main Chalk object that allows to chain styles together. + +Call the last one as a method with a string argument. + +Order doesn't matter, and later styles take precedent in case of a conflict. + +This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. +*/ +declare const chalk: ChalkInstance; + +export const supportsColor: ColorInfo; + +export const chalkStderr: typeof chalk; +export const supportsColorStderr: typeof supportsColor; + +export { + ColorInfo, + ColorSupport, + ColorSupportLevel, +// } from '#supports-color'; +} from './vendor/supports-color/index.js'; + +export default chalk; diff --git a/node_modules/ava/node_modules/chalk/source/index.js b/node_modules/ava/node_modules/chalk/source/index.js index 75ec663505..302024b632 100644 --- a/node_modules/ava/node_modules/chalk/source/index.js +++ b/node_modules/ava/node_modules/chalk/source/index.js @@ -1,19 +1,22 @@ -'use strict'; -const ansiStyles = require('ansi-styles'); -const {stdout: stdoutColor, stderr: stderrColor} = require('supports-color'); -const { +import ansiStyles from '#ansi-styles'; +import supportsColor from '#supports-color'; +import { // eslint-disable-line import/order stringReplaceAll, - stringEncaseCRLFWithFirstIndex -} = require('./util'); + stringEncaseCRLFWithFirstIndex, +} from './utilities.js'; -const {isArray} = Array; +const {stdout: stdoutColor, stderr: stderrColor} = supportsColor; + +const GENERATOR = Symbol('GENERATOR'); +const STYLER = Symbol('STYLER'); +const IS_EMPTY = Symbol('IS_EMPTY'); // `supportsColor.level` → `ansiStyles.color[name]` mapping const levelMapping = [ 'ansi', 'ansi', 'ansi256', - 'ansi16m' + 'ansi16m', ]; const styles = Object.create(null); @@ -28,7 +31,7 @@ const applyOptions = (object, options = {}) => { object.level = options.level === undefined ? colorLevel : options.level; }; -class ChalkClass { +export class Chalk { constructor(options) { // eslint-disable-next-line no-constructor-return return chalkFactory(options); @@ -36,69 +39,80 @@ class ChalkClass { } const chalkFactory = options => { - const chalk = {}; + const chalk = (...strings) => strings.join(' '); applyOptions(chalk, options); - chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); - - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); - - chalk.template.constructor = () => { - throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); - }; - - chalk.template.Instance = ChalkClass; + Object.setPrototypeOf(chalk, createChalk.prototype); - return chalk.template; + return chalk; }; -function Chalk(options) { +function createChalk(options) { return chalkFactory(options); } +Object.setPrototypeOf(createChalk.prototype, Function.prototype); + for (const [styleName, style] of Object.entries(ansiStyles)) { styles[styleName] = { get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); + const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]); Object.defineProperty(this, styleName, {value: builder}); return builder; - } + }, }; } styles.visible = { get() { - const builder = createBuilder(this, this._styler, true); + const builder = createBuilder(this, this[STYLER], true); Object.defineProperty(this, 'visible', {value: builder}); return builder; + }, +}; + +const getModelAnsi = (model, level, type, ...arguments_) => { + if (model === 'rgb') { + if (level === 'ansi16m') { + return ansiStyles[type].ansi16m(...arguments_); + } + + if (level === 'ansi256') { + return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_)); + } + + return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_)); } + + if (model === 'hex') { + return getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_)); + } + + return ansiStyles[type][model](...arguments_); }; -const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; +const usedModels = ['rgb', 'hex', 'ansi256']; for (const model of usedModels) { styles[model] = { get() { const {level} = this; return function (...arguments_) { - const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); - return createBuilder(this, styler, this._isEmpty); + const styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); }; - } + }, }; -} -for (const model of usedModels) { const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); styles[bgModel] = { get() { const {level} = this; return function (...arguments_) { - const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); - return createBuilder(this, styler, this._isEmpty); + const styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); }; - } + }, }; } @@ -107,12 +121,12 @@ const proto = Object.defineProperties(() => {}, { level: { enumerable: true, get() { - return this._generator.level; + return this[GENERATOR].level; }, set(level) { - this._generator.level = level; - } - } + this[GENERATOR].level = level; + }, + }, }); const createStyler = (open, close, parent) => { @@ -131,46 +145,39 @@ const createStyler = (open, close, parent) => { close, openAll, closeAll, - parent + parent, }; }; const createBuilder = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => { - if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { - // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}` - return applyStyle(builder, chalkTag(builder, ...arguments_)); - } - - // Single argument is hot path, implicit coercion is faster than anything - // eslint-disable-next-line no-implicit-coercion - return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); - }; + // Single argument is hot path, implicit coercion is faster than anything + // eslint-disable-next-line no-implicit-coercion + const builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); // We alter the prototype because we must return a function, but there is // no way to create a function with a different prototype Object.setPrototypeOf(builder, proto); - builder._generator = self; - builder._styler = _styler; - builder._isEmpty = _isEmpty; + builder[GENERATOR] = self; + builder[STYLER] = _styler; + builder[IS_EMPTY] = _isEmpty; return builder; }; const applyStyle = (self, string) => { if (self.level <= 0 || !string) { - return self._isEmpty ? '' : string; + return self[IS_EMPTY] ? '' : string; } - let styler = self._styler; + let styler = self[STYLER]; if (styler === undefined) { return string; } const {openAll, closeAll} = styler; - if (string.indexOf('\u001B') !== -1) { + if (string.includes('\u001B')) { while (styler !== undefined) { // Replace any instances already present with a re-opening code // otherwise only the part of the string until said closing code @@ -192,38 +199,14 @@ const applyStyle = (self, string) => { return openAll + string + closeAll; }; -let template; -const chalkTag = (chalk, ...strings) => { - const [firstString] = strings; - - if (!isArray(firstString) || !isArray(firstString.raw)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return strings.join(' '); - } +Object.defineProperties(createChalk.prototype, styles); - const arguments_ = strings.slice(1); - const parts = [firstString.raw[0]]; - - for (let i = 1; i < firstString.length; i++) { - parts.push( - String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), - String(firstString.raw[i]) - ); - } +const chalk = createChalk(); +export const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0}); - if (template === undefined) { - template = require('./templates'); - } - - return template(chalk, parts.join('')); +export { + stdoutColor as supportsColor, + stderrColor as supportsColorStderr, }; -Object.defineProperties(Chalk.prototype, styles); - -const chalk = Chalk(); // eslint-disable-line new-cap -chalk.supportsColor = stdoutColor; -chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap -chalk.stderr.supportsColor = stderrColor; - -module.exports = chalk; +export default chalk; diff --git a/node_modules/ava/node_modules/chalk/source/templates.js b/node_modules/ava/node_modules/chalk/source/templates.js deleted file mode 100644 index b130949d64..0000000000 --- a/node_modules/ava/node_modules/chalk/source/templates.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; -const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; -const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; -const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; -const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; - -const ESCAPES = new Map([ - ['n', '\n'], - ['r', '\r'], - ['t', '\t'], - ['b', '\b'], - ['f', '\f'], - ['v', '\v'], - ['0', '\0'], - ['\\', '\\'], - ['e', '\u001B'], - ['a', '\u0007'] -]); - -function unescape(c) { - const u = c[0] === 'u'; - const bracket = c[1] === '{'; - - if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { - return String.fromCharCode(parseInt(c.slice(1), 16)); - } - - if (u && bracket) { - return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); - } - - return ESCAPES.get(c) || c; -} - -function parseArguments(name, arguments_) { - const results = []; - const chunks = arguments_.trim().split(/\s*,\s*/g); - let matches; - - for (const chunk of chunks) { - const number = Number(chunk); - if (!Number.isNaN(number)) { - results.push(number); - } else if ((matches = chunk.match(STRING_REGEX))) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } - } - - return results; -} - -function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; - - const results = []; - let matches; - - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; - - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } - } - - return results; -} - -function buildStyle(chalk, styles) { - const enabled = {}; - - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } - } - - let current = chalk; - for (const [styleName, styles] of Object.entries(enabled)) { - if (!Array.isArray(styles)) { - continue; - } - - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } - - current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; - } - - return current; -} - -module.exports = (chalk, temporary) => { - const styles = []; - const chunks = []; - let chunk = []; - - // eslint-disable-next-line max-params - temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { - if (escapeCharacter) { - chunk.push(unescape(escapeCharacter)); - } else if (style) { - const string = chunk.join(''); - chunk = []; - chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); - styles.push({inverse, styles: parseStyle(style)}); - } else if (close) { - if (styles.length === 0) { - throw new Error('Found extraneous } in Chalk template literal'); - } - - chunks.push(buildStyle(chalk, styles)(chunk.join(''))); - chunk = []; - styles.pop(); - } else { - chunk.push(character); - } - }); - - chunks.push(chunk.join('')); - - if (styles.length > 0) { - const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; - throw new Error(errMessage); - } - - return chunks.join(''); -}; diff --git a/node_modules/ava/node_modules/chalk/source/util.js b/node_modules/ava/node_modules/chalk/source/util.js deleted file mode 100644 index ca466fd466..0000000000 --- a/node_modules/ava/node_modules/chalk/source/util.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const stringReplaceAll = (string, substring, replacer) => { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } - - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ''; - do { - returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); - - returnValue += string.substr(endIndex); - return returnValue; -}; - -const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { - let endIndex = 0; - let returnValue = ''; - do { - const gotCR = string[index - 1] === '\r'; - returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix; - endIndex = index + 1; - index = string.indexOf('\n', endIndex); - } while (index !== -1); - - returnValue += string.substr(endIndex); - return returnValue; -}; - -module.exports = { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -}; diff --git a/node_modules/log-symbols/node_modules/chalk/source/util.js b/node_modules/ava/node_modules/chalk/source/utilities.js similarity index 69% rename from node_modules/log-symbols/node_modules/chalk/source/util.js rename to node_modules/ava/node_modules/chalk/source/utilities.js index ca466fd466..5d49dad357 100644 --- a/node_modules/log-symbols/node_modules/chalk/source/util.js +++ b/node_modules/ava/node_modules/chalk/source/utilities.js @@ -1,6 +1,5 @@ -'use strict'; - -const stringReplaceAll = (string, substring, replacer) => { +// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`. +export function stringReplaceAll(string, substring, replacer) { let index = string.indexOf(substring); if (index === -1) { return string; @@ -15,11 +14,11 @@ const stringReplaceAll = (string, substring, replacer) => { index = string.indexOf(substring, endIndex); } while (index !== -1); - returnValue += string.substr(endIndex); + returnValue += string.slice(endIndex); return returnValue; -}; +} -const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { +export function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) { let endIndex = 0; let returnValue = ''; do { @@ -29,11 +28,6 @@ const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { index = string.indexOf('\n', endIndex); } while (index !== -1); - returnValue += string.substr(endIndex); + returnValue += string.slice(endIndex); return returnValue; -}; - -module.exports = { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -}; +} diff --git a/node_modules/ava/node_modules/chalk/source/vendor/ansi-styles/index.d.ts b/node_modules/ava/node_modules/chalk/source/vendor/ansi-styles/index.d.ts new file mode 100644 index 0000000000..7518d2a362 --- /dev/null +++ b/node_modules/ava/node_modules/chalk/source/vendor/ansi-styles/index.d.ts @@ -0,0 +1,190 @@ +export interface CSPair { // eslint-disable-line @typescript-eslint/naming-convention + /** + The ANSI terminal control sequence for starting this style. + */ + readonly open: string; + + /** + The ANSI terminal control sequence for ending this style. + */ + readonly close: string; +} + +export interface ColorBase { + /** + The ANSI terminal control sequence for ending this color. + */ + readonly close: string; + + ansi(code: number): string; + + ansi256(code: number): string; + + ansi16m(red: number, green: number, blue: number): string; +} + +export interface Modifier { + /** + Resets the current color chain. + */ + readonly reset: CSPair; + + /** + Make text bold. + */ + readonly bold: CSPair; + + /** + Emitting only a small amount of light. + */ + readonly dim: CSPair; + + /** + Make text italic. (Not widely supported) + */ + readonly italic: CSPair; + + /** + Make text underline. (Not widely supported) + */ + readonly underline: CSPair; + + /** + Make text overline. + + Supported on VTE-based terminals, the GNOME terminal, mintty, and Git Bash. + */ + readonly overline: CSPair; + + /** + Inverse background and foreground colors. + */ + readonly inverse: CSPair; + + /** + Prints the text, but makes it invisible. + */ + readonly hidden: CSPair; + + /** + Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: CSPair; +} + +export interface ForegroundColor { + readonly black: CSPair; + readonly red: CSPair; + readonly green: CSPair; + readonly yellow: CSPair; + readonly blue: CSPair; + readonly cyan: CSPair; + readonly magenta: CSPair; + readonly white: CSPair; + + /** + Alias for `blackBright`. + */ + readonly gray: CSPair; + + /** + Alias for `blackBright`. + */ + readonly grey: CSPair; + + readonly blackBright: CSPair; + readonly redBright: CSPair; + readonly greenBright: CSPair; + readonly yellowBright: CSPair; + readonly blueBright: CSPair; + readonly cyanBright: CSPair; + readonly magentaBright: CSPair; + readonly whiteBright: CSPair; +} + +export interface BackgroundColor { + readonly bgBlack: CSPair; + readonly bgRed: CSPair; + readonly bgGreen: CSPair; + readonly bgYellow: CSPair; + readonly bgBlue: CSPair; + readonly bgCyan: CSPair; + readonly bgMagenta: CSPair; + readonly bgWhite: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGray: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGrey: CSPair; + + readonly bgBlackBright: CSPair; + readonly bgRedBright: CSPair; + readonly bgGreenBright: CSPair; + readonly bgYellowBright: CSPair; + readonly bgBlueBright: CSPair; + readonly bgCyanBright: CSPair; + readonly bgMagentaBright: CSPair; + readonly bgWhiteBright: CSPair; +} + +export interface ConvertColor { + /** + Convert from the RGB color space to the ANSI 256 color space. + + @param red - (`0...255`) + @param green - (`0...255`) + @param blue - (`0...255`) + */ + rgbToAnsi256(red: number, green: number, blue: number): number; + + /** + Convert from the RGB HEX color space to the RGB color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hexToRgb(hex: string): [red: number, green: number, blue: number]; + + /** + Convert from the RGB HEX color space to the ANSI 256 color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hexToAnsi256(hex: string): number; + + /** + Convert from the ANSI 256 color space to the ANSI 16 color space. + + @param code - A number representing the ANSI 256 color. + */ + ansi256ToAnsi(code: number): number; + + /** + Convert from the RGB color space to the ANSI 16 color space. + + @param red - (`0...255`) + @param green - (`0...255`) + @param blue - (`0...255`) + */ + rgbToAnsi(red: number, green: number, blue: number): number; + + /** + Convert from the RGB HEX color space to the ANSI 16 color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hexToAnsi(hex: string): number; +} + +declare const ansiStyles: { + readonly modifier: Modifier; + readonly color: ColorBase & ForegroundColor; + readonly bgColor: ColorBase & BackgroundColor; + readonly codes: ReadonlyMap; +} & ForegroundColor & BackgroundColor & Modifier & ConvertColor; + +export default ansiStyles; diff --git a/node_modules/ava/node_modules/chalk/source/vendor/ansi-styles/index.js b/node_modules/ava/node_modules/chalk/source/vendor/ansi-styles/index.js new file mode 100644 index 0000000000..57465372be --- /dev/null +++ b/node_modules/ava/node_modules/chalk/source/vendor/ansi-styles/index.js @@ -0,0 +1,219 @@ +const ANSI_BACKGROUND_OFFSET = 10; + +const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`; + +const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`; + +const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29], + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39], + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49], + }, + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m`, + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false, + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false, + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi = wrapAnsi16(); + styles.color.ansi256 = wrapAnsi256(); + styles.color.ansi16m = wrapAnsi16m(); + styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); + + // From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js + Object.defineProperties(styles, { + rgbToAnsi256: { + value: (red, green, blue) => { + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (red === green && green === blue) { + if (red < 8) { + return 16; + } + + if (red > 248) { + return 231; + } + + return Math.round(((red - 8) / 247) * 24) + 232; + } + + return 16 + + (36 * Math.round(red / 255 * 5)) + + (6 * Math.round(green / 255 * 5)) + + Math.round(blue / 255 * 5); + }, + enumerable: false, + }, + hexToRgb: { + value: hex => { + const matches = /(?[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + + let {colorString} = matches.groups; + + if (colorString.length === 3) { + colorString = [...colorString].map(character => character + character).join(''); + } + + const integer = Number.parseInt(colorString, 16); + + return [ + /* eslint-disable no-bitwise */ + (integer >> 16) & 0xFF, + (integer >> 8) & 0xFF, + integer & 0xFF, + /* eslint-enable no-bitwise */ + ]; + }, + enumerable: false, + }, + hexToAnsi256: { + value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)), + enumerable: false, + }, + ansi256ToAnsi: { + value: code => { + if (code < 8) { + return 30 + code; + } + + if (code < 16) { + return 90 + (code - 8); + } + + let red; + let green; + let blue; + + if (code >= 232) { + red = (((code - 232) * 10) + 8) / 255; + green = red; + blue = red; + } else { + code -= 16; + + const remainder = code % 36; + + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = (remainder % 6) / 5; + } + + const value = Math.max(red, green, blue) * 2; + + if (value === 0) { + return 30; + } + + // eslint-disable-next-line no-bitwise + let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red)); + + if (value === 2) { + result += 60; + } + + return result; + }, + enumerable: false, + }, + rgbToAnsi: { + value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), + enumerable: false, + }, + hexToAnsi: { + value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), + enumerable: false, + }, + }); + + return styles; +} + +const ansiStyles = assembleStyles(); + +export default ansiStyles; diff --git a/node_modules/ava/node_modules/chalk/source/vendor/supports-color/browser.d.ts b/node_modules/ava/node_modules/chalk/source/vendor/supports-color/browser.d.ts new file mode 100644 index 0000000000..0e8a9ccb86 --- /dev/null +++ b/node_modules/ava/node_modules/chalk/source/vendor/supports-color/browser.d.ts @@ -0,0 +1 @@ +export {default} from './index.js'; diff --git a/node_modules/ava/node_modules/chalk/source/vendor/supports-color/browser.js b/node_modules/ava/node_modules/chalk/source/vendor/supports-color/browser.js new file mode 100644 index 0000000000..f4e9acd91d --- /dev/null +++ b/node_modules/ava/node_modules/chalk/source/vendor/supports-color/browser.js @@ -0,0 +1,17 @@ +/* eslint-env browser */ + +const isBlinkBasedBrowser = /\b(Chrome|Chromium)\//.test(navigator.userAgent); + +const colorSupport = isBlinkBasedBrowser ? { + level: 1, + hasBasic: true, + has256: false, + has16m: false, +} : false; + +const supportsColor = { + stdout: colorSupport, + stderr: colorSupport, +}; + +export default supportsColor; diff --git a/node_modules/ava/node_modules/chalk/source/vendor/supports-color/index.d.ts b/node_modules/ava/node_modules/chalk/source/vendor/supports-color/index.d.ts new file mode 100644 index 0000000000..98e3618728 --- /dev/null +++ b/node_modules/ava/node_modules/chalk/source/vendor/supports-color/index.d.ts @@ -0,0 +1,55 @@ +import {WriteStream} from 'node:tty'; + +export interface Options { + /** + Whether `process.argv` should be sniffed for `--color` and `--no-color` flags. + + @default true + */ + readonly sniffFlags?: boolean; +} + +/** +Levels: +- `0` - All colors disabled. +- `1` - Basic 16 colors support. +- `2` - ANSI 256 colors support. +- `3` - Truecolor 16 million colors support. +*/ +export type ColorSupportLevel = 0 | 1 | 2 | 3; + +/** +Detect whether the terminal supports color. +*/ +export interface ColorSupport { + /** + The color level. + */ + level: ColorSupportLevel; + + /** + Whether basic 16 colors are supported. + */ + hasBasic: boolean; + + /** + Whether ANSI 256 colors are supported. + */ + has256: boolean; + + /** + Whether Truecolor 16 million colors are supported. + */ + has16m: boolean; +} + +export type ColorInfo = ColorSupport | false; + +export function createSupportsColor(stream: WriteStream, options?: Options): ColorInfo; + +declare const supportsColor: { + stdout: ColorInfo; + stderr: ColorInfo; +}; + +export default supportsColor; diff --git a/node_modules/ava/node_modules/chalk/source/vendor/supports-color/index.js b/node_modules/ava/node_modules/chalk/source/vendor/supports-color/index.js new file mode 100644 index 0000000000..55f813c48d --- /dev/null +++ b/node_modules/ava/node_modules/chalk/source/vendor/supports-color/index.js @@ -0,0 +1,169 @@ +import process from 'node:process'; +import os from 'node:os'; +import tty from 'node:tty'; + +// From: https://github.com/sindresorhus/has-flag/blob/main/index.js +function hasFlag(flag, argv = process.argv) { + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +} + +const {env} = process; + +let flagForceColor; +if ( + hasFlag('no-color') + || hasFlag('no-colors') + || hasFlag('color=false') + || hasFlag('color=never') +) { + flagForceColor = 0; +} else if ( + hasFlag('color') + || hasFlag('colors') + || hasFlag('color=true') + || hasFlag('color=always') +) { + flagForceColor = 1; +} + +function envForceColor() { + if ('FORCE_COLOR' in env) { + if (env.FORCE_COLOR === 'true') { + return 1; + } + + if (env.FORCE_COLOR === 'false') { + return 0; + } + + return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); + } +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3, + }; +} + +function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) { + const noFlagForceColor = envForceColor(); + if (noFlagForceColor !== undefined) { + flagForceColor = noFlagForceColor; + } + + const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; + + if (forceColor === 0) { + return 0; + } + + if (sniffFlags) { + if (hasFlag('color=16m') + || hasFlag('color=full') + || hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + } + + if (haveStream && !streamIsTTY && forceColor === undefined) { + return 0; + } + + const min = forceColor || 0; + + if (env.TERM === 'dumb') { + return min; + } + + if (process.platform === 'win32') { + // Windows 10 build 10586 is the first Windows release that supports 256 colors. + // Windows 10 build 14931 is the first release that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(osRelease[0]) >= 10 + && Number(osRelease[2]) >= 10_586 + ) { + return Number(osRelease[2]) >= 14_931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + // Check for Azure DevOps pipelines + if ('TF_BUILD' in env && 'AGENT_NAME' in env) { + return 1; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + return min; +} + +export function createSupportsColor(stream, options = {}) { + const level = _supportsColor(stream, { + streamIsTTY: stream && stream.isTTY, + ...options, + }); + + return translateLevel(level); +} + +const supportsColor = { + stdout: createSupportsColor({isTTY: tty.isatty(1)}), + stderr: createSupportsColor({isTTY: tty.isatty(2)}), +}; + +export default supportsColor; diff --git a/node_modules/ava/node_modules/clean-stack/index.d.ts b/node_modules/ava/node_modules/clean-stack/index.d.ts new file mode 100644 index 0000000000..233f618608 --- /dev/null +++ b/node_modules/ava/node_modules/clean-stack/index.d.ts @@ -0,0 +1,50 @@ +export interface Options { + /** + Prettify the file paths in the stack: + + `/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15` → `~/dev/clean-stack/unicorn.js:2:15` + + @default false + */ + readonly pretty?: boolean; + + /** + Remove the given base path from stack trace file paths, effectively turning absolute paths into relative ones. + + Example with `'/Users/sindresorhus/dev/clean-stack/'` as `basePath`: + + `/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15` → `unicorn.js:2:15` + */ + readonly basePath?: string; +} + +/** +Clean up error stack traces. Removes the mostly unhelpful internal Node.js entries. + +@param stack - The `stack` property of an `Error`. +@returns The cleaned stack or `undefined` if the given `stack` is `undefined`. + +@example +``` +import cleanStack from 'clean-stack'; + +const error = new Error('Missing unicorn'); + +console.log(error.stack); + +// Error: Missing unicorn +// at Object. (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15) +// at Module._compile (module.js:409:26) +// at Object.Module._extensions..js (module.js:416:10) +// at Module.load (module.js:343:32) +// at Function.Module._load (module.js:300:12) +// at Function.Module.runMain (module.js:441:10) +// at startup (node.js:139:18) + +console.log(cleanStack(error.stack)); + +// Error: Missing unicorn +// at Object. (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15) +``` +*/ +export default function cleanStack(stack: T, options?: Options): T; diff --git a/node_modules/ava/node_modules/clean-stack/index.js b/node_modules/ava/node_modules/clean-stack/index.js new file mode 100644 index 0000000000..6bc7b1ba42 --- /dev/null +++ b/node_modules/ava/node_modules/clean-stack/index.js @@ -0,0 +1,48 @@ +import os from 'os'; +import escapeStringRegexp from 'escape-string-regexp'; + +const extractPathRegex = /\s+at.*[(\s](.*)\)?/; +const pathRegex = /^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/; +const homeDir = typeof os.homedir === 'undefined' ? '' : os.homedir().replace(/\\/g, '/'); + +export default function cleanStack(stack, {pretty = false, basePath} = {}) { + const basePathRegex = basePath && new RegExp(`(at | \\()${escapeStringRegexp(basePath.replace(/\\/g, '/'))}`, 'g'); + + if (typeof stack !== 'string') { + return undefined; + } + + return stack.replace(/\\/g, '/') + .split('\n') + .filter(line => { + const pathMatches = line.match(extractPathRegex); + if (pathMatches === null || !pathMatches[1]) { + return true; + } + + const match = pathMatches[1]; + + // Electron + if ( + match.includes('.app/Contents/Resources/electron.asar') || + match.includes('.app/Contents/Resources/default_app.asar') + ) { + return false; + } + + return !pathRegex.test(match); + }) + .filter(line => line.trim() !== '') + .map(line => { + if (basePathRegex) { + line = line.replace(basePathRegex, '$1'); + } + + if (pretty) { + line = line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, '~'))); + } + + return line; + }) + .join('\n'); +} diff --git a/node_modules/global-dirs/license b/node_modules/ava/node_modules/clean-stack/license similarity index 100% rename from node_modules/global-dirs/license rename to node_modules/ava/node_modules/clean-stack/license diff --git a/node_modules/ava/node_modules/clean-stack/package.json b/node_modules/ava/node_modules/clean-stack/package.json new file mode 100644 index 0000000000..7fe788d45a --- /dev/null +++ b/node_modules/ava/node_modules/clean-stack/package.json @@ -0,0 +1,44 @@ +{ + "name": "clean-stack", + "version": "4.1.0", + "description": "Clean up error stack traces", + "license": "MIT", + "repository": "sindresorhus/clean-stack", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "clean", + "stack", + "trace", + "traces", + "error", + "electron" + ], + "dependencies": { + "escape-string-regexp": "5.0.0" + }, + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + }, + "browser": { + "os": false + } +} \ No newline at end of file diff --git a/node_modules/ava/node_modules/clean-stack/readme.md b/node_modules/ava/node_modules/clean-stack/readme.md new file mode 100644 index 0000000000..d2a541db3a --- /dev/null +++ b/node_modules/ava/node_modules/clean-stack/readme.md @@ -0,0 +1,79 @@ +# clean-stack + +> Clean up error stack traces + +Removes the mostly unhelpful internal Node.js entries. + +Also works in Electron. + +## Install + +``` +$ npm install clean-stack +``` + +## Usage + +```js +import cleanStack from 'clean-stack'; + +const error = new Error('Missing unicorn'); + +console.log(error.stack); +/* +Error: Missing unicorn + at Object. (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15) + at Module._compile (module.js:409:26) + at Object.Module._extensions..js (module.js:416:10) + at Module.load (module.js:343:32) + at Function.Module._load (module.js:300:12) + at Function.Module.runMain (module.js:441:10) + at startup (node.js:139:18) +*/ + +console.log(cleanStack(error.stack)); +/* +Error: Missing unicorn + at Object. (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15) +*/ +``` + +## API + +### cleanStack(stack, options?) + +Returns the cleaned stack or `undefined` if the given `stack` is `undefined`. + +#### stack + +Type: `string | undefined` + +The `stack` property of an [`Error`](https://github.com/microsoft/TypeScript/blob/eac073894b172ec719ca7f28b0b94fc6e6e7d4cf/lib/lib.es5.d.ts#L972-L976). + +#### options + +Type: `object` + +##### pretty + +Type: `boolean`\ +Default: `false` + +Prettify the file paths in the stack: + +`/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15` → `~/dev/clean-stack/unicorn.js:2:15` + +##### basePath + +Type: `string?` + +Remove the given base path from stack trace file paths, effectively turning absolute paths into relative ones. + +Example with `'/Users/sindresorhus/dev/clean-stack/'` as `basePath`: + +`/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15` → `unicorn.js:2:15` + +## Related + +- [extract-stack](https://github.com/sindresorhus/extract-stack) - Extract the actual stack of an error +- [stack-utils](https://github.com/tapjs/stack-utils) - Captures and cleans stack traces diff --git a/node_modules/ava/node_modules/color-convert/CHANGELOG.md b/node_modules/ava/node_modules/color-convert/CHANGELOG.md deleted file mode 100644 index 0a7bce4fd5..0000000000 --- a/node_modules/ava/node_modules/color-convert/CHANGELOG.md +++ /dev/null @@ -1,54 +0,0 @@ -# 1.0.0 - 2016-01-07 - -- Removed: unused speed test -- Added: Automatic routing between previously unsupported conversions -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Removed: `convert()` class -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Changed: all functions to lookup dictionary -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Changed: `ansi` to `ansi256` -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Fixed: argument grouping for functions requiring only one argument -([#27](https://github.com/Qix-/color-convert/pull/27)) - -# 0.6.0 - 2015-07-23 - -- Added: methods to handle -[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors: - - rgb2ansi16 - - rgb2ansi - - hsl2ansi16 - - hsl2ansi - - hsv2ansi16 - - hsv2ansi - - hwb2ansi16 - - hwb2ansi - - cmyk2ansi16 - - cmyk2ansi - - keyword2ansi16 - - keyword2ansi - - ansi162rgb - - ansi162hsl - - ansi162hsv - - ansi162hwb - - ansi162cmyk - - ansi162keyword - - ansi2rgb - - ansi2hsl - - ansi2hsv - - ansi2hwb - - ansi2cmyk - - ansi2keyword -([#18](https://github.com/harthur/color-convert/pull/18)) - -# 0.5.3 - 2015-06-02 - -- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]` -([#15](https://github.com/harthur/color-convert/issues/15)) - ---- - -Check out commit logs for older releases diff --git a/node_modules/ava/node_modules/color-convert/LICENSE b/node_modules/ava/node_modules/color-convert/LICENSE deleted file mode 100644 index 5b4c386f92..0000000000 --- a/node_modules/ava/node_modules/color-convert/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011-2016 Heather Arthur - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/ava/node_modules/color-convert/README.md b/node_modules/ava/node_modules/color-convert/README.md deleted file mode 100644 index d4b08fc369..0000000000 --- a/node_modules/ava/node_modules/color-convert/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# color-convert - -[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) - -Color-convert is a color conversion library for JavaScript and node. -It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): - -```js -var convert = require('color-convert'); - -convert.rgb.hsl(140, 200, 100); // [96, 48, 59] -convert.keyword.rgb('blue'); // [0, 0, 255] - -var rgbChannels = convert.rgb.channels; // 3 -var cmykChannels = convert.cmyk.channels; // 4 -var ansiChannels = convert.ansi16.channels; // 1 -``` - -# Install - -```console -$ npm install color-convert -``` - -# API - -Simply get the property of the _from_ and _to_ conversion that you're looking for. - -All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. - -All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). - -```js -var convert = require('color-convert'); - -// Hex to LAB -convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] -convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] - -// RGB to CMYK -convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] -convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] -``` - -### Arrays -All functions that accept multiple arguments also support passing an array. - -Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) - -```js -var convert = require('color-convert'); - -convert.rgb.hex(123, 45, 67); // '7B2D43' -convert.rgb.hex([123, 45, 67]); // '7B2D43' -``` - -## Routing - -Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex). - -Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js). - -# Contribute - -If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request. - -# License -Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE). diff --git a/node_modules/ava/node_modules/color-convert/conversions.js b/node_modules/ava/node_modules/color-convert/conversions.js deleted file mode 100644 index 2657f265c9..0000000000 --- a/node_modules/ava/node_modules/color-convert/conversions.js +++ /dev/null @@ -1,839 +0,0 @@ -/* MIT license */ -/* eslint-disable no-mixed-operators */ -const cssKeywords = require('color-name'); - -// NOTE: conversions should only return primitive values (i.e. arrays, or -// values that give correct `typeof` results). -// do not use box values types (i.e. Number(), String(), etc.) - -const reverseKeywords = {}; -for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; -} - -const convert = { - rgb: {channels: 3, labels: 'rgb'}, - hsl: {channels: 3, labels: 'hsl'}, - hsv: {channels: 3, labels: 'hsv'}, - hwb: {channels: 3, labels: 'hwb'}, - cmyk: {channels: 4, labels: 'cmyk'}, - xyz: {channels: 3, labels: 'xyz'}, - lab: {channels: 3, labels: 'lab'}, - lch: {channels: 3, labels: 'lch'}, - hex: {channels: 1, labels: ['hex']}, - keyword: {channels: 1, labels: ['keyword']}, - ansi16: {channels: 1, labels: ['ansi16']}, - ansi256: {channels: 1, labels: ['ansi256']}, - hcg: {channels: 3, labels: ['h', 'c', 'g']}, - apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, - gray: {channels: 1, labels: ['gray']} -}; - -module.exports = convert; - -// Hide .channels and .labels properties -for (const model of Object.keys(convert)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } - - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } - - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); - } - - const {channels, labels} = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); -} - -convert.rgb.hsl = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; - - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; - } - - h = Math.min(h * 60, 360); - - if (h < 0) { - h += 360; - } - - const l = (min + max) / 2; - - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); - } - - return [h, s * 100, l * 100]; -}; - -convert.rgb.hsv = function (rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; - - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function (c) { - return (v - c) / 6 / diff + 1 / 2; - }; - - if (diff === 0) { - h = 0; - s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); - - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = (1 / 3) + rdif - bdif; - } else if (b === v) { - h = (2 / 3) + gdif - rdif; - } - - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } - } - - return [ - h * 360, - s * 100, - v * 100 - ]; -}; - -convert.rgb.hwb = function (rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); - - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - - return [h, w * 100, b * 100]; -}; - -convert.rgb.cmyk = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; - - return [c * 100, m * 100, y * 100, k * 100]; -}; - -function comparativeDistance(x, y) { - /* - See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - */ - return ( - ((x[0] - y[0]) ** 2) + - ((x[1] - y[1]) ** 2) + - ((x[2] - y[2]) ** 2) - ); -} - -convert.rgb.keyword = function (rgb) { - const reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; - } - - let currentClosestDistance = Infinity; - let currentClosestKeyword; - - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; - - // Compute comparative distance - const distance = comparativeDistance(rgb, value); - - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } - } - - return currentClosestKeyword; -}; - -convert.keyword.rgb = function (keyword) { - return cssKeywords[keyword]; -}; - -convert.rgb.xyz = function (rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; - - // Assume sRGB - r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); - g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); - b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); - - const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); - - return [x * 100, y * 100, z * 100]; -}; - -convert.rgb.lab = function (rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - - return [l, a, b]; -}; - -convert.hsl.rgb = function (hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; - - if (s === 0) { - val = l * 255; - return [val, val, val]; - } - - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; - } - - const t1 = 2 * l - t2; - - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; - } - - if (t3 > 1) { - t3--; - } - - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; - } - - rgb[i] = val * 255; - } - - return rgb; -}; - -convert.hsl.hsv = function (hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); - - l *= 2; - s *= (l <= 1) ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); - - return [h, sv * 100, v * 100]; -}; - -convert.hsv.rgb = function (hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; - - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - (s * f)); - const t = 255 * v * (1 - (s * (1 - f))); - v *= 255; - - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; - } -}; - -convert.hsv.hsl = function (hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; - - l = (2 - s) * v; - const lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= (lmin <= 1) ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; - - return [h, sl * 100, l * 100]; -}; - -// http://dev.w3.org/csswg/css-color/#hwb-to-rgb -convert.hwb.rgb = function (hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; - - // Wh + bl cant be > 1 - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } - - const i = Math.floor(6 * h); - const v = 1 - bl; - f = 6 * h - i; - - if ((i & 0x01) !== 0) { - f = 1 - f; - } - - const n = wh + f * (v - wh); // Linear interpolation - - let r; - let g; - let b; - /* eslint-disable max-statements-per-line,no-multi-spaces */ - switch (i) { - default: - case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; - } - /* eslint-enable max-statements-per-line,no-multi-spaces */ - - return [r * 255, g * 255, b * 255]; -}; - -convert.cmyk.rgb = function (cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; - - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); - - return [r * 255, g * 255, b * 255]; -}; - -convert.xyz.rgb = function (xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; - - r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); - g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); - b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - - // Assume sRGB - r = r > 0.0031308 - ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) - : r * 12.92; - - g = g > 0.0031308 - ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) - : g * 12.92; - - b = b > 0.0031308 - ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) - : b * 12.92; - - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); - - return [r * 255, g * 255, b * 255]; -}; - -convert.xyz.lab = function (xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - - return [l, a, b]; -}; - -convert.lab.xyz = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; - - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; - - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; - y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; - - x *= 95.047; - y *= 100; - z *= 108.883; - - return [x, y, z]; -}; - -convert.lab.lch = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; - - const hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; - - if (h < 0) { - h += 360; - } - - const c = Math.sqrt(a * a + b * b); - - return [l, c, h]; -}; - -convert.lch.lab = function (lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; - - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); - - return [l, a, b]; -}; - -convert.rgb.ansi16 = function (args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization - - value = Math.round(value / 50); - - if (value === 0) { - return 30; - } - - let ansi = 30 - + ((Math.round(b / 255) << 2) - | (Math.round(g / 255) << 1) - | Math.round(r / 255)); - - if (value === 2) { - ansi += 60; - } - - return ansi; -}; - -convert.hsv.ansi16 = function (args) { - // Optimization here; we already know the value and don't need to get - // it converted for us. - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); -}; - -convert.rgb.ansi256 = function (args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; - - // We use the extended greyscale palette here, with the exception of - // black and white. normal palette only has 4 greyscale shades. - if (r === g && g === b) { - if (r < 8) { - return 16; - } - - if (r > 248) { - return 231; - } - - return Math.round(((r - 8) / 247) * 24) + 232; - } - - const ansi = 16 - + (36 * Math.round(r / 255 * 5)) - + (6 * Math.round(g / 255 * 5)) - + Math.round(b / 255 * 5); - - return ansi; -}; - -convert.ansi16.rgb = function (args) { - let color = args % 10; - - // Handle greyscale - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } - - color = color / 10.5 * 255; - - return [color, color, color]; - } - - const mult = (~~(args > 50) + 1) * 0.5; - const r = ((color & 1) * mult) * 255; - const g = (((color >> 1) & 1) * mult) * 255; - const b = (((color >> 2) & 1) * mult) * 255; - - return [r, g, b]; -}; - -convert.ansi256.rgb = function (args) { - // Handle greyscale - if (args >= 232) { - const c = (args - 232) * 10 + 8; - return [c, c, c]; - } - - args -= 16; - - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = (rem % 6) / 5 * 255; - - return [r, g, b]; -}; - -convert.rgb.hex = function (args) { - const integer = ((Math.round(args[0]) & 0xFF) << 16) - + ((Math.round(args[1]) & 0xFF) << 8) - + (Math.round(args[2]) & 0xFF); - - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; - -convert.hex.rgb = function (args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } - - let colorString = match[0]; - - if (match[0].length === 3) { - colorString = colorString.split('').map(char => { - return char + char; - }).join(''); - } - - const integer = parseInt(colorString, 16); - const r = (integer >> 16) & 0xFF; - const g = (integer >> 8) & 0xFF; - const b = integer & 0xFF; - - return [r, g, b]; -}; - -convert.rgb.hcg = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - const chroma = (max - min); - let grayscale; - let hue; - - if (chroma < 1) { - grayscale = min / (1 - chroma); - } else { - grayscale = 0; - } - - if (chroma <= 0) { - hue = 0; - } else - if (max === r) { - hue = ((g - b) / chroma) % 6; - } else - if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma; - } - - hue /= 6; - hue %= 1; - - return [hue * 360, chroma * 100, grayscale * 100]; -}; - -convert.hsl.hcg = function (hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; - - const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); - - let f = 0; - if (c < 1.0) { - f = (l - 0.5 * c) / (1.0 - c); - } - - return [hsl[0], c * 100, f * 100]; -}; - -convert.hsv.hcg = function (hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; - - const c = s * v; - let f = 0; - - if (c < 1.0) { - f = (v - c) / (1 - c); - } - - return [hsv[0], c * 100, f * 100]; -}; - -convert.hcg.rgb = function (hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - if (c === 0.0) { - return [g * 255, g * 255, g * 255]; - } - - const pure = [0, 0, 0]; - const hi = (h % 1) * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; - - /* eslint-disable max-statements-per-line */ - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; pure[1] = v; pure[2] = 0; break; - case 1: - pure[0] = w; pure[1] = 1; pure[2] = 0; break; - case 2: - pure[0] = 0; pure[1] = 1; pure[2] = v; break; - case 3: - pure[0] = 0; pure[1] = w; pure[2] = 1; break; - case 4: - pure[0] = v; pure[1] = 0; pure[2] = 1; break; - default: - pure[0] = 1; pure[1] = 0; pure[2] = w; - } - /* eslint-enable max-statements-per-line */ - - mg = (1.0 - c) * g; - - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; -}; - -convert.hcg.hsv = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - const v = c + g * (1.0 - c); - let f = 0; - - if (v > 0.0) { - f = c / v; - } - - return [hcg[0], f * 100, v * 100]; -}; - -convert.hcg.hsl = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - const l = g * (1.0 - c) + 0.5 * c; - let s = 0; - - if (l > 0.0 && l < 0.5) { - s = c / (2 * l); - } else - if (l >= 0.5 && l < 1.0) { - s = c / (2 * (1 - l)); - } - - return [hcg[0], s * 100, l * 100]; -}; - -convert.hcg.hwb = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1.0 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; -}; - -convert.hwb.hcg = function (hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; - - if (c < 1) { - g = (v - c) / (1 - c); - } - - return [hwb[0], c * 100, g * 100]; -}; - -convert.apple.rgb = function (apple) { - return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; -}; - -convert.rgb.apple = function (rgb) { - return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; -}; - -convert.gray.rgb = function (args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; -}; - -convert.gray.hsl = function (args) { - return [0, 0, args[0]]; -}; - -convert.gray.hsv = convert.gray.hsl; - -convert.gray.hwb = function (gray) { - return [0, 100, gray[0]]; -}; - -convert.gray.cmyk = function (gray) { - return [0, 0, 0, gray[0]]; -}; - -convert.gray.lab = function (gray) { - return [gray[0], 0, 0]; -}; - -convert.gray.hex = function (gray) { - const val = Math.round(gray[0] / 100 * 255) & 0xFF; - const integer = (val << 16) + (val << 8) + val; - - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; - -convert.rgb.gray = function (rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; -}; diff --git a/node_modules/ava/node_modules/color-convert/index.js b/node_modules/ava/node_modules/color-convert/index.js deleted file mode 100644 index b648e5737b..0000000000 --- a/node_modules/ava/node_modules/color-convert/index.js +++ /dev/null @@ -1,81 +0,0 @@ -const conversions = require('./conversions'); -const route = require('./route'); - -const convert = {}; - -const models = Object.keys(conversions); - -function wrapRaw(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - if (arg0 === undefined || arg0 === null) { - return arg0; - } - - if (arg0.length > 1) { - args = arg0; - } - - return fn(args); - }; - - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -function wrapRounded(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - - if (arg0 === undefined || arg0 === null) { - return arg0; - } - - if (arg0.length > 1) { - args = arg0; - } - - const result = fn(args); - - // We're assuming the result is an array here. - // see notice in conversions.js; don't use box types - // in conversion functions. - if (typeof result === 'object') { - for (let len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } - - return result; - }; - - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -models.forEach(fromModel => { - convert[fromModel] = {}; - - Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); - Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); - - const routes = route(fromModel); - const routeModels = Object.keys(routes); - - routeModels.forEach(toModel => { - const fn = routes[toModel]; - - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); -}); - -module.exports = convert; diff --git a/node_modules/ava/node_modules/color-convert/package.json b/node_modules/ava/node_modules/color-convert/package.json deleted file mode 100644 index d169f869b2..0000000000 --- a/node_modules/ava/node_modules/color-convert/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "color-convert", - "description": "Plain color conversion functions", - "version": "2.0.1", - "author": "Heather Arthur ", - "license": "MIT", - "repository": "Qix-/color-convert", - "scripts": { - "pretest": "xo", - "test": "node test/basic.js" - }, - "engines": { - "node": ">=7.0.0" - }, - "keywords": [ - "color", - "colour", - "convert", - "converter", - "conversion", - "rgb", - "hsl", - "hsv", - "hwb", - "cmyk", - "ansi", - "ansi16" - ], - "files": [ - "index.js", - "conversions.js", - "route.js" - ], - "xo": { - "rules": { - "default-case": 0, - "no-inline-comments": 0, - "operator-linebreak": 0 - } - }, - "devDependencies": { - "chalk": "^2.4.2", - "xo": "^0.24.0" - }, - "dependencies": { - "color-name": "~1.1.4" - } -} \ No newline at end of file diff --git a/node_modules/ava/node_modules/color-convert/route.js b/node_modules/ava/node_modules/color-convert/route.js deleted file mode 100644 index 1a08521b5a..0000000000 --- a/node_modules/ava/node_modules/color-convert/route.js +++ /dev/null @@ -1,97 +0,0 @@ -const conversions = require('./conversions'); - -/* - This function routes a model to all other models. - - all functions that are routed have a property `.conversion` attached - to the returned synthetic function. This property is an array - of strings, each with the steps in between the 'from' and 'to' - color models (inclusive). - - conversions that are not possible simply are not included. -*/ - -function buildGraph() { - const graph = {}; - // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - const models = Object.keys(conversions); - - for (let len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } - - return graph; -} - -// https://en.wikipedia.org/wiki/Breadth-first_search -function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; // Unshift -> queue -> pop - - graph[fromModel].distance = 0; - - while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); - - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; - - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } - } - - return graph; -} - -function link(from, to) { - return function (args) { - return to(from(args)); - }; -} - -function wrapConversion(toModel, graph) { - const path = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; - - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; - } - - fn.conversion = path; - return fn; -} - -module.exports = function (fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; - - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; - - if (node.parent === null) { - // No possible conversion, or this node is the source model. - continue; - } - - conversion[toModel] = wrapConversion(toModel, graph); - } - - return conversion; -}; - diff --git a/node_modules/ava/node_modules/color-name/LICENSE b/node_modules/ava/node_modules/color-name/LICENSE deleted file mode 100644 index c6b1001254..0000000000 --- a/node_modules/ava/node_modules/color-name/LICENSE +++ /dev/null @@ -1,8 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2015 Dmitry Ivanov - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/ava/node_modules/color-name/README.md b/node_modules/ava/node_modules/color-name/README.md deleted file mode 100644 index 932b979176..0000000000 --- a/node_modules/ava/node_modules/color-name/README.md +++ /dev/null @@ -1,11 +0,0 @@ -A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. - -[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) - - -```js -var colors = require('color-name'); -colors.red //[255,0,0] -``` - - diff --git a/node_modules/ava/node_modules/color-name/index.js b/node_modules/ava/node_modules/color-name/index.js deleted file mode 100644 index b7c198a6f3..0000000000 --- a/node_modules/ava/node_modules/color-name/index.js +++ /dev/null @@ -1,152 +0,0 @@ -'use strict' - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; diff --git a/node_modules/ava/node_modules/color-name/package.json b/node_modules/ava/node_modules/color-name/package.json deleted file mode 100644 index fecb8dcfb6..0000000000 --- a/node_modules/ava/node_modules/color-name/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "color-name", - "version": "1.1.4", - "description": "A list of color names and its values", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git@github.com:colorjs/color-name.git" - }, - "keywords": [ - "color-name", - "color", - "color-keyword", - "keyword" - ], - "author": "DY ", - "license": "MIT", - "bugs": { - "url": "https://github.com/colorjs/color-name/issues" - }, - "homepage": "https://github.com/colorjs/color-name" -} \ No newline at end of file diff --git a/node_modules/ava/node_modules/escape-string-regexp/index.d.ts b/node_modules/ava/node_modules/escape-string-regexp/index.d.ts new file mode 100644 index 0000000000..e8f928814c --- /dev/null +++ b/node_modules/ava/node_modules/escape-string-regexp/index.d.ts @@ -0,0 +1,16 @@ +/** +Escape RegExp special characters. + +You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. + +@example +``` +import escapeStringRegexp from 'escape-string-regexp'; + +const escapedString = escapeStringRegexp('How much $ for a 🦄?'); +//=> 'How much \\$ for a 🦄\\?' + +new RegExp(escapedString); +``` +*/ +export default function escapeStringRegexp(string: string): string; diff --git a/node_modules/ava/node_modules/escape-string-regexp/index.js b/node_modules/ava/node_modules/escape-string-regexp/index.js new file mode 100644 index 0000000000..9ce9323ff2 --- /dev/null +++ b/node_modules/ava/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +export default function escapeStringRegexp(string) { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } + + // Escape characters with special meaning either inside or outside character sets. + // Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. + return string + .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') + .replace(/-/g, '\\x2d'); +} diff --git a/node_modules/is-installed-globally/license b/node_modules/ava/node_modules/escape-string-regexp/license similarity index 100% rename from node_modules/is-installed-globally/license rename to node_modules/ava/node_modules/escape-string-regexp/license diff --git a/node_modules/ava/node_modules/escape-string-regexp/package.json b/node_modules/ava/node_modules/escape-string-regexp/package.json new file mode 100644 index 0000000000..4e7d8199b9 --- /dev/null +++ b/node_modules/ava/node_modules/escape-string-regexp/package.json @@ -0,0 +1,40 @@ +{ + "name": "escape-string-regexp", + "version": "5.0.0", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": "sindresorhus/escape-string-regexp", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "escape", + "regex", + "regexp", + "regular", + "expression", + "string", + "special", + "characters" + ], + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + } +} \ No newline at end of file diff --git a/node_modules/ava/node_modules/escape-string-regexp/readme.md b/node_modules/ava/node_modules/escape-string-regexp/readme.md new file mode 100644 index 0000000000..839df6e51c --- /dev/null +++ b/node_modules/ava/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,34 @@ +# escape-string-regexp + +> Escape RegExp special characters + +## Install + +``` +$ npm install escape-string-regexp +``` + +## Usage + +```js +import escapeStringRegexp from 'escape-string-regexp'; + +const escapedString = escapeStringRegexp('How much $ for a 🦄?'); +//=> 'How much \\$ for a 🦄\\?' + +new RegExp(escapedString); +``` + +You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/ava/node_modules/globby/gitignore.js b/node_modules/ava/node_modules/globby/gitignore.js new file mode 100644 index 0000000000..dc26aa252b --- /dev/null +++ b/node_modules/ava/node_modules/globby/gitignore.js @@ -0,0 +1,108 @@ +import process from 'node:process'; +import fs from 'node:fs'; +import path from 'node:path'; +import fastGlob from 'fast-glob'; +import gitIgnore from 'ignore'; +import slash from 'slash'; +import toPath from './to-path.js'; + +const DEFAULT_IGNORE = [ + '**/node_modules/**', + '**/flow-typed/**', + '**/coverage/**', + '**/.git', +]; + +const mapGitIgnorePatternTo = base => ignore => { + if (ignore.startsWith('!')) { + return '!' + path.posix.join(base, ignore.slice(1)); + } + + return path.posix.join(base, ignore); +}; + +const parseGitIgnore = (content, options) => { + const base = slash(path.relative(options.cwd, path.dirname(options.fileName))); + + return content + .split(/\r?\n/) + .filter(Boolean) + .filter(line => !line.startsWith('#')) + .map(mapGitIgnorePatternTo(base)); +}; + +const reduceIgnore = files => { + const ignores = gitIgnore(); + for (const file of files) { + ignores.add(parseGitIgnore(file.content, { + cwd: file.cwd, + fileName: file.filePath, + })); + } + + return ignores; +}; + +const ensureAbsolutePathForCwd = (cwd, p) => { + cwd = slash(cwd); + if (path.isAbsolute(p)) { + if (slash(p).startsWith(cwd)) { + return p; + } + + throw new Error(`Path ${p} is not in cwd ${cwd}`); + } + + return path.join(cwd, p); +}; + +const getIsIgnoredPredicate = (ignores, cwd) => p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, toPath(p.path || p))))); + +const getFile = async (file, cwd) => { + const filePath = path.join(cwd, file); + const content = await fs.promises.readFile(filePath, 'utf8'); + + return { + cwd, + filePath, + content, + }; +}; + +const getFileSync = (file, cwd) => { + const filePath = path.join(cwd, file); + const content = fs.readFileSync(filePath, 'utf8'); + + return { + cwd, + filePath, + content, + }; +}; + +const normalizeOptions = ({ + ignore = [], + cwd = slash(process.cwd()), +} = {}) => ({ignore: [...DEFAULT_IGNORE, ...ignore], cwd: toPath(cwd)}); + +export const isGitIgnored = async options => { + options = normalizeOptions(options); + + const paths = await fastGlob('**/.gitignore', options); + + const files = await Promise.all(paths.map(file => getFile(file, options.cwd))); + const ignores = reduceIgnore(files); + + return getIsIgnoredPredicate(ignores, options.cwd); +}; + +export const isGitIgnoredSync = options => { + options = normalizeOptions(options); + + const paths = fastGlob.sync('**/.gitignore', options); + + const files = paths.map(file => getFileSync(file, options.cwd)); + const ignores = reduceIgnore(files); + + return getIsIgnoredPredicate(ignores, options.cwd); +}; diff --git a/node_modules/ava/node_modules/globby/index.d.ts b/node_modules/ava/node_modules/globby/index.d.ts new file mode 100644 index 0000000000..b9571a663f --- /dev/null +++ b/node_modules/ava/node_modules/globby/index.d.ts @@ -0,0 +1,188 @@ +import {URL} from 'node:url'; // TODO: Remove this when https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34960 is fixed. +import {Options as FastGlobOptions, Entry} from 'fast-glob'; + +export type GlobEntry = Entry; + +export interface GlobTask { + readonly pattern: string; + readonly options: Options; +} + +export type ExpandDirectoriesOption = + | boolean + | readonly string[] + | {files?: readonly string[]; extensions?: readonly string[]}; + +type FastGlobOptionsWithoutCwd = Omit; + +export interface Options extends FastGlobOptionsWithoutCwd { + /** + If set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `Object` with `files` and `extensions` like in the example below. + + Note that if you set this option to `false`, you won't get back matched directories unless you set `onlyFiles: false`. + + @default true + + @example + ``` + import {globby} from 'globby'; + + const paths = await globby('images', { + expandDirectories: { + files: ['cat', 'unicorn', '*.jpg'], + extensions: ['png'] + } + }); + + console.log(paths); + //=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg'] + ``` + */ + readonly expandDirectories?: ExpandDirectoriesOption; + + /** + Respect ignore patterns in `.gitignore` files that apply to the globbed files. + + @default false + */ + readonly gitignore?: boolean; + + /** + The current working directory in which to search. + + @default process.cwd() + */ + readonly cwd?: URL | string; +} + +export interface GitignoreOptions { + readonly cwd?: URL | string; + readonly ignore?: readonly string[]; +} + +export type GlobbyFilterFunction = (path: URL | string) => boolean; + +/** +Find files and directories using glob patterns. + +Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`. + +@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). +@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package. +@returns The matching paths. + +@example +``` +import {globby} from 'globby'; + +const paths = await globby(['*', '!cake']); + +console.log(paths); +//=> ['unicorn', 'rainbow'] +``` +*/ +export function globby( + patterns: string | readonly string[], + options: Options & {objectMode: true} +): Promise; +export function globby( + patterns: string | readonly string[], + options?: Options +): Promise; + +/** +Find files and directories using glob patterns. + +Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`. + +@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). +@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package. +@returns The matching paths. +*/ +export function globbySync( + patterns: string | readonly string[], + options: Options & {objectMode: true} +): GlobEntry[]; +export function globbySync( + patterns: string | readonly string[], + options?: Options +): string[]; + +/** +Find files and directories using glob patterns. + +Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`. + +@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). +@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package. +@returns The stream of matching paths. + +@example +``` +import {globbyStream} from 'globby'; + +for await (const path of globbyStream('*.tmp')) { + console.log(path); +} +``` +*/ +export function globbyStream( + patterns: string | readonly string[], + options?: Options +): NodeJS.ReadableStream; + +/** +Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration. + +@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). +@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package. +@returns An object in the format `{pattern: string, options: object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages. +*/ +export function generateGlobTasks( + patterns: string | readonly string[], + options?: Options +): GlobTask[]; + +/** +Note that the options affect the results. + +This function is backed by [`fast-glob`](https://github.com/mrmlnc/fast-glob#isdynamicpatternpattern-options). + +@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). +@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3). +@returns Whether there are any special glob characters in the `patterns`. +*/ +export function isDynamicPattern( + patterns: string | readonly string[], + options?: FastGlobOptionsWithoutCwd & { + /** + The current working directory in which to search. + + @default process.cwd() + */ + readonly cwd?: URL | string; + } +): boolean; + +/** +`.gitignore` files matched by the ignore config are not used for the resulting filter function. + +@returns A filter function indicating whether a given path is ignored via a `.gitignore` file. + +@example +``` +import {isGitIgnored} from 'globby'; + +const isIgnored = await isGitIgnored(); + +console.log(isIgnored('some/file')); +``` +*/ +export function isGitIgnored(options?: GitignoreOptions): Promise; + +/** +@see isGitIgnored + +@returns A filter function indicating whether a given path is ignored via a `.gitignore` file. +*/ +export function isGitIgnoredSync(options?: GitignoreOptions): GlobbyFilterFunction; diff --git a/node_modules/ava/node_modules/globby/index.js b/node_modules/ava/node_modules/globby/index.js new file mode 100644 index 0000000000..1ebc17257d --- /dev/null +++ b/node_modules/ava/node_modules/globby/index.js @@ -0,0 +1,197 @@ +import fs from 'node:fs'; +import arrayUnion from 'array-union'; +import merge2 from 'merge2'; +import fastGlob from 'fast-glob'; +import dirGlob from 'dir-glob'; +import toPath from './to-path.js'; +import {isGitIgnored, isGitIgnoredSync} from './gitignore.js'; +import {FilterStream, UniqueStream} from './stream-utils.js'; + +const DEFAULT_FILTER = () => false; + +const isNegative = pattern => pattern[0] === '!'; + +const assertPatternsInput = patterns => { + if (!patterns.every(pattern => typeof pattern === 'string')) { + throw new TypeError('Patterns must be a string or an array of strings'); + } +}; + +const checkCwdOption = options => { + if (!options.cwd) { + return; + } + + let stat; + try { + stat = fs.statSync(options.cwd); + } catch { + return; + } + + if (!stat.isDirectory()) { + throw new Error('The `cwd` option must be a path to a directory'); + } +}; + +const getPathString = p => p.stats instanceof fs.Stats ? p.path : p; + +export const generateGlobTasks = (patterns, taskOptions = {}) => { + patterns = arrayUnion([patterns].flat()); + assertPatternsInput(patterns); + + const globTasks = []; + + taskOptions = { + ignore: [], + expandDirectories: true, + ...taskOptions, + cwd: toPath(taskOptions.cwd), + }; + + checkCwdOption(taskOptions); + + for (const [index, pattern] of patterns.entries()) { + if (isNegative(pattern)) { + continue; + } + + const ignore = patterns + .slice(index) + .filter(pattern => isNegative(pattern)) + .map(pattern => pattern.slice(1)); + + const options = { + ...taskOptions, + ignore: [...taskOptions.ignore, ...ignore], + }; + + globTasks.push({pattern, options}); + } + + return globTasks; +}; + +const globDirectories = (task, fn) => { + let options = {}; + if (task.options.cwd) { + options.cwd = task.options.cwd; + } + + if (Array.isArray(task.options.expandDirectories)) { + options = { + ...options, + files: task.options.expandDirectories, + }; + } else if (typeof task.options.expandDirectories === 'object') { + options = { + ...options, + ...task.options.expandDirectories, + }; + } + + return fn(task.pattern, options); +}; + +const getPattern = (task, fn) => task.options.expandDirectories ? globDirectories(task, fn) : [task.pattern]; + +const getFilterSync = options => options && options.gitignore + ? isGitIgnoredSync({cwd: options.cwd, ignore: options.ignore}) + : DEFAULT_FILTER; + +const globToTask = task => async glob => { + const {options} = task; + if (options.ignore && Array.isArray(options.ignore) && options.expandDirectories) { + options.ignore = await dirGlob(options.ignore); + } + + return { + pattern: glob, + options, + }; +}; + +const globToTaskSync = task => glob => { + const {options} = task; + if (options.ignore && Array.isArray(options.ignore) && options.expandDirectories) { + options.ignore = dirGlob.sync(options.ignore); + } + + return { + pattern: glob, + options, + }; +}; + +export const globby = async (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); + + const getFilter = async () => options && options.gitignore + ? isGitIgnored({cwd: options.cwd, ignore: options.ignore}) + : DEFAULT_FILTER; + + const getTasks = async () => { + const tasks = await Promise.all(globTasks.map(async task => { + const globs = await getPattern(task, dirGlob); + return Promise.all(globs.map(globToTask(task))); + })); + + return arrayUnion(...tasks); + }; + + const [filter, tasks] = await Promise.all([getFilter(), getTasks()]); + const paths = await Promise.all(tasks.map(task => fastGlob(task.pattern, task.options))); + + return arrayUnion(...paths).filter(path_ => !filter(getPathString(path_))); +}; + +export const globbySync = (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); + + const tasks = []; + for (const task of globTasks) { + const newTask = getPattern(task, dirGlob.sync).map(globToTaskSync(task)); + tasks.push(...newTask); + } + + const filter = getFilterSync(options); + + let matches = []; + for (const task of tasks) { + matches = arrayUnion(matches, fastGlob.sync(task.pattern, task.options)); + } + + return matches.filter(path_ => !filter(path_)); +}; + +export const globbyStream = (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); + + const tasks = []; + for (const task of globTasks) { + const newTask = getPattern(task, dirGlob.sync).map(globToTaskSync(task)); + tasks.push(...newTask); + } + + const filter = getFilterSync(options); + const filterStream = new FilterStream(p => !filter(p)); + const uniqueStream = new UniqueStream(); + + return merge2(tasks.map(task => fastGlob.stream(task.pattern, task.options))) + .pipe(filterStream) + .pipe(uniqueStream); +}; + +export const isDynamicPattern = (patterns, options = {}) => { + options = { + ...options, + cwd: toPath(options.cwd), + }; + + return [patterns].flat().some(pattern => fastGlob.isDynamicPattern(pattern, options)); +}; + +export { + isGitIgnored, + isGitIgnoredSync, +} from './gitignore.js'; diff --git a/node_modules/is-npm/license b/node_modules/ava/node_modules/globby/license similarity index 100% rename from node_modules/is-npm/license rename to node_modules/ava/node_modules/globby/license diff --git a/node_modules/ava/node_modules/globby/node_modules/slash/index.d.ts b/node_modules/ava/node_modules/globby/node_modules/slash/index.d.ts new file mode 100644 index 0000000000..10438fbe72 --- /dev/null +++ b/node_modules/ava/node_modules/globby/node_modules/slash/index.d.ts @@ -0,0 +1,23 @@ +/** +Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar`. + +[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths and don't contain any non-ascii characters. + +@param path - A Windows backslash path. +@returns A path with forward slashes. + +@example +``` +import path from 'path'; +import slash from 'slash'; + +const string = path.join('foo', 'bar'); +// Unix => foo/bar +// Windows => foo\\bar + +slash(string); +// Unix => foo/bar +// Windows => foo/bar +``` +*/ +export default function slash(path: string): string; diff --git a/node_modules/ava/node_modules/globby/node_modules/slash/index.js b/node_modules/ava/node_modules/globby/node_modules/slash/index.js new file mode 100644 index 0000000000..b52d8de885 --- /dev/null +++ b/node_modules/ava/node_modules/globby/node_modules/slash/index.js @@ -0,0 +1,10 @@ +export default function slash(path) { + const isExtendedLengthPath = /^\\\\\?\\/.test(path); + const hasNonAscii = /[^\u0000-\u0080]+/.test(path); // eslint-disable-line no-control-regex + + if (isExtendedLengthPath || hasNonAscii) { + return path; + } + + return path.replace(/\\/g, '/'); +} diff --git a/node_modules/log-symbols/license b/node_modules/ava/node_modules/globby/node_modules/slash/license similarity index 100% rename from node_modules/log-symbols/license rename to node_modules/ava/node_modules/globby/node_modules/slash/license diff --git a/node_modules/ava/node_modules/globby/node_modules/slash/package.json b/node_modules/ava/node_modules/globby/node_modules/slash/package.json new file mode 100644 index 0000000000..dc722fc742 --- /dev/null +++ b/node_modules/ava/node_modules/globby/node_modules/slash/package.json @@ -0,0 +1,38 @@ +{ + "name": "slash", + "version": "4.0.0", + "description": "Convert Windows backslash paths to slash paths", + "license": "MIT", + "repository": "sindresorhus/slash", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "path", + "seperator", + "slash", + "backslash", + "windows", + "convert" + ], + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + } +} \ No newline at end of file diff --git a/node_modules/ava/node_modules/globby/node_modules/slash/readme.md b/node_modules/ava/node_modules/globby/node_modules/slash/readme.md new file mode 100644 index 0000000000..2a66eefb77 --- /dev/null +++ b/node_modules/ava/node_modules/globby/node_modules/slash/readme.md @@ -0,0 +1,48 @@ +# slash + +> Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar` + +[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths and don't contain any non-ascii characters. + +This was created since the `path` methods in Node.js outputs `\\` paths on Windows. + +## Install + +``` +$ npm install slash +``` + +## Usage + +```js +import path from 'path'; +import slash from 'slash'; + +const string = path.join('foo', 'bar'); +// Unix => foo/bar +// Windows => foo\\bar + +slash(string); +// Unix => foo/bar +// Windows => foo/bar +``` + +## API + +### slash(path) + +Type: `string` + +Accepts a Windows backslash path and returns a path with forward slashes. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/ava/node_modules/globby/package.json b/node_modules/ava/node_modules/globby/package.json new file mode 100644 index 0000000000..bd857c6290 --- /dev/null +++ b/node_modules/ava/node_modules/globby/package.json @@ -0,0 +1,87 @@ +{ + "name": "globby", + "version": "12.2.0", + "description": "User-friendly glob matching", + "license": "MIT", + "repository": "sindresorhus/globby", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "scripts": { + "bench": "npm update glob-stream fast-glob && matcha bench.js", + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts", + "gitignore.js", + "stream-utils.js", + "to-path.js" + ], + "keywords": [ + "all", + "array", + "directories", + "expand", + "files", + "filesystem", + "filter", + "find", + "fnmatch", + "folders", + "fs", + "glob", + "globbing", + "globs", + "gulpfriendly", + "match", + "matcher", + "minimatch", + "multi", + "multiple", + "paths", + "pattern", + "patterns", + "traverse", + "util", + "utility", + "wildcard", + "wildcards", + "promise", + "gitignore", + "git" + ], + "dependencies": { + "array-union": "^3.0.1", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.7", + "ignore": "^5.1.9", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "devDependencies": { + "@types/node": "^16.11.11", + "ava": "^3.15.0", + "get-stream": "^6.0.1", + "glob-stream": "^7.0.0", + "globby": "sindresorhus/globby#main", + "matcha": "^0.7.0", + "rimraf": "^3.0.2", + "tsd": "^0.19.0", + "typescript": "^4.5.2", + "xo": "^0.47.0" + }, + "xo": { + "ignores": [ + "fixtures" + ] + } +} \ No newline at end of file diff --git a/node_modules/ava/node_modules/globby/readme.md b/node_modules/ava/node_modules/globby/readme.md new file mode 100644 index 0000000000..315a53b650 --- /dev/null +++ b/node_modules/ava/node_modules/globby/readme.md @@ -0,0 +1,168 @@ +# globby + +> User-friendly glob matching + +Based on [`fast-glob`](https://github.com/mrmlnc/fast-glob) but adds a bunch of useful features. + +## Features + +- Promise API +- Multiple patterns +- Negated patterns: `['foo*', '!foobar']` +- Expands directories: `foo` → `foo/**/*` +- Supports `.gitignore` +- Supports `URL` as `cwd` + +## Install + +``` +$ npm install globby +``` + +## Usage + +``` +├── unicorn +├── cake +└── rainbow +``` + +```js +import {globby} from 'globby'; + +const paths = await globby(['*', '!cake']); + +console.log(paths); +//=> ['unicorn', 'rainbow'] +``` + +## API + +Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`. + +### globby(patterns, options?) + +Returns a `Promise` of matching paths. + +#### patterns + +Type: `string | string[]` + +See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage). + +#### options + +Type: `object` + +See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones below. + +##### expandDirectories + +Type: `boolean | string[] | object`\ +Default: `true` + +If set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `object` with `files` and `extensions` like below: + +```js +import {globby} from 'globby'; + +(async () => { + const paths = await globby('images', { + expandDirectories: { + files: ['cat', 'unicorn', '*.jpg'], + extensions: ['png'] + } + }); + + console.log(paths); + //=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg'] +})(); +``` + +Note that if you set this option to `false`, you won't get back matched directories unless you set `onlyFiles: false`. + +##### gitignore + +Type: `boolean`\ +Default: `false` + +Respect ignore patterns in `.gitignore` files that apply to the globbed files. + +### globbySync(patterns, options?) + +Returns `string[]` of matching paths. + +### globbyStream(patterns, options?) + +Returns a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_readable_streams) of matching paths. + +Since Node.js 10, [readable streams are iterable](https://nodejs.org/api/stream.html#stream_readable_symbol_asynciterator), so you can loop over glob matches in a [`for await...of` loop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of) like this: + +```js +import {globbyStream} from 'globby'; + +(async () => { + for await (const path of globbyStream('*.tmp')) { + console.log(path); + } +})(); +``` + +### generateGlobTasks(patterns, options?) + +Returns an `object[]` in the format `{pattern: string, options: Object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages. + +Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration. + +### isDynamicPattern(patterns, options?) + +Returns a `boolean` of whether there are any special glob characters in the `patterns`. + +Note that the options affect the results. + +This function is backed by [`fast-glob`](https://github.com/mrmlnc/fast-glob#isdynamicpatternpattern-options). + +### isGitIgnored(options?) + +Returns a `Promise<(path: URL | string) => boolean>` indicating whether a given path is ignored via a `.gitignore` file. + +Takes `cwd?: URL | string` and `ignore?: string[]` as options. `.gitignore` files matched by the ignore config are not used for the resulting filter function. + +```js +import {isGitIgnored} from 'globby'; + +const isIgnored = await isGitIgnored(); + +console.log(isIgnored('some/file')); +``` + +### isGitIgnoredSync(options?) + +Returns a `(path: URL | string) => boolean` indicating whether a given path is ignored via a `.gitignore` file. + +Takes the same options as `isGitIgnored`. + +## Globbing patterns + +Just a quick overview. + +- `*` matches any number of characters, but not `/` +- `?` matches a single character, but not `/` +- `**` matches any number of characters, including `/`, as long as it's the only thing in a path part +- `{}` allows for a comma-separated list of "or" expressions +- `!` at the beginning of a pattern will negate the match + +[Various patterns and expected matches.](https://github.com/sindresorhus/multimatch/blob/main/test/test.js) + +## globby for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of globby and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-globby?utm_source=npm-globby&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Related + +- [multimatch](https://github.com/sindresorhus/multimatch) - Match against a list instead of the filesystem +- [matcher](https://github.com/sindresorhus/matcher) - Simple wildcard matching +- [del](https://github.com/sindresorhus/del) - Delete files and directories +- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed diff --git a/node_modules/ava/node_modules/globby/stream-utils.js b/node_modules/ava/node_modules/globby/stream-utils.js new file mode 100644 index 0000000000..91a99bb961 --- /dev/null +++ b/node_modules/ava/node_modules/globby/stream-utils.js @@ -0,0 +1,40 @@ +import {Transform} from 'node:stream'; + +class ObjectTransform extends Transform { + constructor() { + super({ + objectMode: true, + }); + } +} + +export class FilterStream extends ObjectTransform { + constructor(filter) { + super(); + this._filter = filter; + } + + _transform(data, encoding, callback) { + if (this._filter(data)) { + this.push(data); + } + + callback(); + } +} + +export class UniqueStream extends ObjectTransform { + constructor() { + super(); + this._pushed = new Set(); + } + + _transform(data, encoding, callback) { + if (!this._pushed.has(data)) { + this.push(data); + this._pushed.add(data); + } + + callback(); + } +} diff --git a/node_modules/ava/node_modules/globby/to-path.js b/node_modules/ava/node_modules/globby/to-path.js new file mode 100644 index 0000000000..3914433659 --- /dev/null +++ b/node_modules/ava/node_modules/globby/to-path.js @@ -0,0 +1,15 @@ +import {fileURLToPath} from 'node:url'; + +const toPath = urlOrPath => { + if (!urlOrPath) { + return urlOrPath; + } + + if (urlOrPath instanceof URL) { + urlOrPath = urlOrPath.href; + } + + return urlOrPath.startsWith('file://') ? fileURLToPath(urlOrPath) : urlOrPath; +}; + +export default toPath; diff --git a/node_modules/ava/node_modules/has-flag/index.d.ts b/node_modules/ava/node_modules/has-flag/index.d.ts deleted file mode 100644 index a0a48c8911..0000000000 --- a/node_modules/ava/node_modules/has-flag/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** -Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag. - -@param flag - CLI flag to look for. The `--` prefix is optional. -@param argv - CLI arguments. Default: `process.argv`. -@returns Whether the flag exists. - -@example -``` -// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow - -// foo.ts -import hasFlag = require('has-flag'); - -hasFlag('unicorn'); -//=> true - -hasFlag('--unicorn'); -//=> true - -hasFlag('f'); -//=> true - -hasFlag('-f'); -//=> true - -hasFlag('foo=bar'); -//=> true - -hasFlag('foo'); -//=> false - -hasFlag('rainbow'); -//=> false -``` -*/ -declare function hasFlag(flag: string, argv?: string[]): boolean; - -export = hasFlag; diff --git a/node_modules/ava/node_modules/has-flag/index.js b/node_modules/ava/node_modules/has-flag/index.js deleted file mode 100644 index b6f80b1f8f..0000000000 --- a/node_modules/ava/node_modules/has-flag/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf('--'); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -}; diff --git a/node_modules/ava/node_modules/has-flag/package.json b/node_modules/ava/node_modules/has-flag/package.json deleted file mode 100644 index 55d0058e44..0000000000 --- a/node_modules/ava/node_modules/has-flag/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "has-flag", - "version": "4.0.0", - "description": "Check if argv has a specific flag", - "license": "MIT", - "repository": "sindresorhus/has-flag", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "has", - "check", - "detect", - "contains", - "find", - "flag", - "cli", - "command-line", - "argv", - "process", - "arg", - "args", - "argument", - "arguments", - "getopt", - "minimist", - "optimist" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} \ No newline at end of file diff --git a/node_modules/ava/node_modules/has-flag/readme.md b/node_modules/ava/node_modules/has-flag/readme.md deleted file mode 100644 index 3f72dff29a..0000000000 --- a/node_modules/ava/node_modules/has-flag/readme.md +++ /dev/null @@ -1,89 +0,0 @@ -# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) - -> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag - -Correctly stops looking after an `--` argument terminator. - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- - - -## Install - -``` -$ npm install has-flag -``` - - -## Usage - -```js -// foo.js -const hasFlag = require('has-flag'); - -hasFlag('unicorn'); -//=> true - -hasFlag('--unicorn'); -//=> true - -hasFlag('f'); -//=> true - -hasFlag('-f'); -//=> true - -hasFlag('foo=bar'); -//=> true - -hasFlag('foo'); -//=> false - -hasFlag('rainbow'); -//=> false -``` - -``` -$ node foo.js -f --unicorn --foo=bar -- --rainbow -``` - - -## API - -### hasFlag(flag, [argv]) - -Returns a boolean for whether the flag exists. - -#### flag - -Type: `string` - -CLI flag to look for. The `--` prefix is optional. - -#### argv - -Type: `string[]`
-Default: `process.argv` - -CLI arguments. - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/ava/node_modules/indent-string/index.d.ts b/node_modules/ava/node_modules/indent-string/index.d.ts new file mode 100644 index 0000000000..72b7d776e0 --- /dev/null +++ b/node_modules/ava/node_modules/indent-string/index.d.ts @@ -0,0 +1,38 @@ +export interface Options { + /** + The string to use for the indent. + + @default ' ' + */ + readonly indent?: string; + + /** + Also indent empty lines. + + @default false + */ + readonly includeEmptyLines?: boolean; +} + +/** +Indent each line in a string. + +@param string - The string to indent. +@param count - How many times you want `options.indent` repeated. Default: `1`. + +@example +``` +import indentString from 'indent-string'; + +indentString('Unicorns\nRainbows', 4); +//=> ' Unicorns\n Rainbows' + +indentString('Unicorns\nRainbows', 4, {indent: '♥'}); +//=> '♥♥♥♥Unicorns\n♥♥♥♥Rainbows' +``` +*/ +export default function indentString( + string: string, + count?: number, + options?: Options +): string; diff --git a/node_modules/ava/node_modules/indent-string/index.js b/node_modules/ava/node_modules/indent-string/index.js new file mode 100644 index 0000000000..4861a4ce8a --- /dev/null +++ b/node_modules/ava/node_modules/indent-string/index.js @@ -0,0 +1,38 @@ +export default function indentString(string, count = 1, options = {}) { + const { + indent = ' ', + includeEmptyLines = false + } = options; + + if (typeof string !== 'string') { + throw new TypeError( + `Expected \`input\` to be a \`string\`, got \`${typeof string}\`` + ); + } + + if (typeof count !== 'number') { + throw new TypeError( + `Expected \`count\` to be a \`number\`, got \`${typeof count}\`` + ); + } + + if (count < 0) { + throw new RangeError( + `Expected \`count\` to be at least 0, got \`${count}\`` + ); + } + + if (typeof indent !== 'string') { + throw new TypeError( + `Expected \`options.indent\` to be a \`string\`, got \`${typeof indent}\`` + ); + } + + if (count === 0) { + return string; + } + + const regex = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; + + return string.replace(regex, indent.repeat(count)); +} diff --git a/node_modules/ora/license b/node_modules/ava/node_modules/indent-string/license similarity index 100% rename from node_modules/ora/license rename to node_modules/ava/node_modules/indent-string/license diff --git a/node_modules/is-npm/package.json b/node_modules/ava/node_modules/indent-string/package.json similarity index 53% rename from node_modules/is-npm/package.json rename to node_modules/ava/node_modules/indent-string/package.json index e350335430..85de577e82 100644 --- a/node_modules/is-npm/package.json +++ b/node_modules/ava/node_modules/indent-string/package.json @@ -1,17 +1,19 @@ { - "name": "is-npm", + "name": "indent-string", "version": "5.0.0", - "description": "Check if your code is running as an npm script", + "description": "Indent each line in a string", "license": "MIT", - "repository": "sindresorhus/is-npm", + "repository": "sindresorhus/indent-string", "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, + "type": "module", + "exports": "./index.js", "engines": { - "node": ">=10" + "node": ">=12" }, "scripts": { "test": "xo && ava && tsd" @@ -21,19 +23,18 @@ "index.d.ts" ], "keywords": [ - "npm", - "yarn", - "is", - "check", - "detect", - "env", - "environment", - "run", - "script" + "indent", + "string", + "pad", + "align", + "line", + "text", + "each", + "every" ], "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.11.0", - "xo": "^0.30.0" + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" } } \ No newline at end of file diff --git a/node_modules/ava/node_modules/indent-string/readme.md b/node_modules/ava/node_modules/indent-string/readme.md new file mode 100644 index 0000000000..c1ebd462fe --- /dev/null +++ b/node_modules/ava/node_modules/indent-string/readme.md @@ -0,0 +1,73 @@ +# indent-string + +> Indent each line in a string + +## Install + +``` +$ npm install indent-string +``` + +## Usage + +```js +import indentString from 'indent-string'; + +indentString('Unicorns\nRainbows', 4); +//=> ' Unicorns\n Rainbows' + +indentString('Unicorns\nRainbows', 4, {indent: '♥'}); +//=> '♥♥♥♥Unicorns\n♥♥♥♥Rainbows' +``` + +## API + +### indentString(string, count?, options?) + +#### string + +Type: `string` + +The string to indent. + +#### count + +Type: `number`\ +Default: `1` + +How many times you want `options.indent` repeated. + +#### options + +Type: `object` + +##### indent + +Type: `string`\ +Default: `' '` + +The string to use for the indent. + +##### includeEmptyLines + +Type: `boolean`\ +Default: `false` + +Also indent empty lines. + +## Related + +- [indent-string-cli](https://github.com/sindresorhus/indent-string-cli) - CLI for this module +- [strip-indent](https://github.com/sindresorhus/strip-indent) - Strip leading whitespace from every line in a string + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/ava/node_modules/p-map/index.d.ts b/node_modules/ava/node_modules/p-map/index.d.ts new file mode 100644 index 0000000000..8083ba38e4 --- /dev/null +++ b/node_modules/ava/node_modules/p-map/index.d.ts @@ -0,0 +1,97 @@ +export interface Options { + /** + Number of concurrently pending promises returned by `mapper`. + + Must be an integer from 1 and up or `Infinity`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + When `true`, the first mapper rejection will be rejected back to the consumer. + + When `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [aggregated error](https://github.com/sindresorhus/aggregate-error) containing all the errors from the rejected promises. + + Caveat: When `true`, any already-started async mappers will continue to run until they resolve or reject. In the case of infinite concurrency with sync iterables, *all* mappers are invoked on startup and will continue after the first rejection. [Issue #51](https://github.com/sindresorhus/p-map/issues/51) can be implemented for abort control. + + @default true + */ + readonly stopOnError?: boolean; +} + +/** +Function which is called for every item in `input`. Expected to return a `Promise` or value. + +@param element - Iterated element. +@param index - Index of the element in the source array. +*/ +export type Mapper = ( + element: Element, + index: number +) => NewElement | Promise; + +/** +@param input - Synchronous or asynchronous iterable that is iterated over concurrently, calling the `mapper` function for each element. Each iterated item is `await`'d before the `mapper` is invoked so the iterable may return a `Promise` that resolves to an item. Asynchronous iterables (different from synchronous iterables that return `Promise` that resolves to an item) can be used when the next item may not be ready without waiting for an asynchronous process to complete and/or the end of the iterable may be reached after the asynchronous process completes. For example, reading from a remote queue when the queue has reached empty, or reading lines from a stream. +@param mapper - Function which is called for every item in `input`. Expected to return a `Promise` or value. +@returns A `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order. + +@example +``` +import pMap from 'p-map'; +import got from 'got'; + +const sites = [ + getWebsiteFromUsername('sindresorhus'), //=> Promise + 'https://avajs.dev', + 'https://github.com' +]; + +const mapper = async site => { + const {requestUrl} = await got.head(site); + return requestUrl; +}; + +const result = await pMap(sites, mapper, {concurrency: 2}); + +console.log(result); +//=> ['https://sindresorhus.com/', 'https://avajs.dev/', 'https://github.com/'] +``` +*/ +export default function pMap( + input: AsyncIterable> | Iterable>, + mapper: Mapper, + options?: Options +): Promise>>; + +/** +Return this value from a `mapper` function to skip including the value in the returned array. + +@example +``` +import pMap, {pMapSkip} from 'p-map'; +import got from 'got'; + +const sites = [ + getWebsiteFromUsername('sindresorhus'), //=> Promise + 'https://avajs.dev', + 'https://example.invalid', + 'https://github.com' +]; + +const mapper = async site => { + try { + const {requestUrl} = await got.head(site); + return requestUrl; + } catch { + return pMapSkip; + } +}; + +const result = await pMap(sites, mapper, {concurrency: 2}); + +console.log(result); +//=> ['https://sindresorhus.com/', 'https://avajs.dev/', 'https://github.com/'] +``` +*/ +export const pMapSkip: unique symbol; diff --git a/node_modules/ava/node_modules/p-map/index.js b/node_modules/ava/node_modules/p-map/index.js new file mode 100644 index 0000000000..11cf5f534f --- /dev/null +++ b/node_modules/ava/node_modules/p-map/index.js @@ -0,0 +1,156 @@ +import AggregateError from 'aggregate-error'; + +export default async function pMap( + iterable, + mapper, + { + concurrency = Number.POSITIVE_INFINITY, + stopOnError = true + } = {} +) { + return new Promise((resolve, reject_) => { // eslint-disable-line promise/param-names + if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) { + throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`); + } + + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } + + if (!((Number.isSafeInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency >= 1)) { + throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`); + } + + const result = []; + const errors = []; + const skippedIndexesMap = new Map(); + let isRejected = false; + let isResolved = false; + let isIterableDone = false; + let resolvingCount = 0; + let currentIndex = 0; + const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); + + const reject = reason => { + isRejected = true; + isResolved = true; + reject_(reason); + }; + + const next = async () => { + if (isResolved) { + return; + } + + const nextItem = await iterator.next(); + + const index = currentIndex; + currentIndex++; + + // Note: `iterator.next()` can be called many times in parallel. + // This can cause multiple calls to this `next()` function to + // receive a `nextItem` with `done === true`. + // The shutdown logic that rejects/resolves must be protected + // so it runs only one time as the `skippedIndex` logic is + // non-idempotent. + if (nextItem.done) { + isIterableDone = true; + + if (resolvingCount === 0 && !isResolved) { + if (!stopOnError && errors.length > 0) { + reject(new AggregateError(errors)); + return; + } + + isResolved = true; + + if (!skippedIndexesMap.size) { + resolve(result); + return; + } + + const pureResult = []; + + // Support multiple `pMapSkip`'s. + for (const [index, value] of result.entries()) { + if (skippedIndexesMap.get(index) === pMapSkip) { + continue; + } + + pureResult.push(value); + } + + resolve(pureResult); + } + + return; + } + + resolvingCount++; + + // Intentionally detached + (async () => { + try { + const element = await nextItem.value; + + if (isResolved) { + return; + } + + const value = await mapper(element, index); + + // Use Map to stage the index of the element. + if (value === pMapSkip) { + skippedIndexesMap.set(index, value); + } + + result[index] = value; + + resolvingCount--; + await next(); + } catch (error) { + if (stopOnError) { + reject(error); + } else { + errors.push(error); + resolvingCount--; + + // In that case we can't really continue regardless of `stopOnError` state + // since an iterable is likely to continue throwing after it throws once. + // If we continue calling `next()` indefinitely we will likely end up + // in an infinite loop of failed iteration. + try { + await next(); + } catch (error) { + reject(error); + } + } + } + })(); + }; + + // Create the concurrent runners in a detached (non-awaited) + // promise. We need this so we can await the `next()` calls + // to stop creating runners before hitting the concurrency limit + // if the iterable has already been marked as done. + // NOTE: We *must* do this for async iterators otherwise we'll spin up + // infinite `next()` calls by default and never start the event loop. + (async () => { + for (let index = 0; index < concurrency; index++) { + try { + // eslint-disable-next-line no-await-in-loop + await next(); + } catch (error) { + reject(error); + break; + } + + if (isIterableDone || isRejected) { + break; + } + } + })(); + }); +} + +export const pMapSkip = Symbol('skip'); diff --git a/node_modules/@sindresorhus/is/license b/node_modules/ava/node_modules/p-map/license similarity index 92% rename from node_modules/@sindresorhus/is/license rename to node_modules/ava/node_modules/p-map/license index e7af2f7710..fa7ceba3eb 100644 --- a/node_modules/@sindresorhus/is/license +++ b/node_modules/ava/node_modules/p-map/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/node_modules/ava/node_modules/p-map/package.json b/node_modules/ava/node_modules/p-map/package.json new file mode 100644 index 0000000000..2742862a42 --- /dev/null +++ b/node_modules/ava/node_modules/p-map/package.json @@ -0,0 +1,55 @@ +{ + "name": "p-map", + "version": "5.3.0", + "description": "Map over promises concurrently", + "license": "MIT", + "repository": "sindresorhus/p-map", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "map", + "resolved", + "wait", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "async", + "await", + "promises", + "concurrently", + "concurrency", + "parallel", + "bluebird" + ], + "dependencies": { + "aggregate-error": "^4.0.0" + }, + "devDependencies": { + "ava": "^3.15.0", + "delay": "^5.0.0", + "in-range": "^3.0.0", + "random-int": "^3.0.0", + "time-span": "^5.0.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + } +} \ No newline at end of file diff --git a/node_modules/ava/node_modules/p-map/readme.md b/node_modules/ava/node_modules/p-map/readme.md new file mode 100644 index 0000000000..a59bfa02d0 --- /dev/null +++ b/node_modules/ava/node_modules/p-map/readme.md @@ -0,0 +1,125 @@ +# p-map + +> Map over promises concurrently + +Useful when you need to run promise-returning & async functions multiple times with different inputs concurrently. + +This is different from `Promise.all()` in that you can control the concurrency and also decide whether or not to stop iterating when there's an error. + +## Install + +``` +$ npm install p-map +``` + +## Usage + +```js +import pMap from 'p-map'; +import got from 'got'; + +const sites = [ + getWebsiteFromUsername('sindresorhus'), //=> Promise + 'https://avajs.dev', + 'https://github.com' +]; + +const mapper = async site => { + const {requestUrl} = await got.head(site); + return requestUrl; +}; + +const result = await pMap(sites, mapper, {concurrency: 2}); + +console.log(result); +//=> ['https://sindresorhus.com/', 'https://avajs.dev/', 'https://github.com/'] +``` + +## API + +### pMap(input, mapper, options?) + +Returns a `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order. + +#### input + +Type: `AsyncIterable | unknown> | Iterable | unknown>` + +Synchronous or asynchronous iterable that is iterated over concurrently, calling the `mapper` function for each element. Each iterated item is `await`'d before the `mapper` is invoked so the iterable may return a `Promise` that resolves to an item. + +Asynchronous iterables (different from synchronous iterables that return `Promise` that resolves to an item) can be used when the next item may not be ready without waiting for an asynchronous process to complete and/or the end of the iterable may be reached after the asynchronous process completes. For example, reading from a remote queue when the queue has reached empty, or reading lines from a stream. + +#### mapper(element, index) + +Type: `Function` + +Expected to return a `Promise` or value. + +#### options + +Type: `object` + +##### concurrency + +Type: `number` *(Integer)*\ +Default: `Infinity`\ +Minimum: `1` + +Number of concurrently pending promises returned by `mapper`. + +##### stopOnError + +Type: `boolean`\ +Default: `true` + +When `true`, the first mapper rejection will be rejected back to the consumer. + +When `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [aggregated error](https://github.com/sindresorhus/aggregate-error) containing all the errors from the rejected promises. + +Caveat: When `true`, any already-started async mappers will continue to run until they resolve or reject. In the case of infinite concurrency with sync iterables, *all* mappers are invoked on startup and will continue after the first rejection. [Issue #51](https://github.com/sindresorhus/p-map/issues/51) can be implemented for abort control. + +### pMapSkip + +Return this value from a `mapper` function to skip including the value in the returned array. + +```js +import pMap, {pMapSkip} from 'p-map'; +import got from 'got'; + +const sites = [ + getWebsiteFromUsername('sindresorhus'), //=> Promise + 'https://avajs.dev', + 'https://example.invalid', + 'https://github.com' +]; + +const mapper = async site => { + try { + const {requestUrl} = await got.head(site); + return requestUrl; + } catch { + return pMapSkip; + } +}; + +const result = await pMap(sites, mapper, {concurrency: 2}); + +console.log(result); +//=> ['https://sindresorhus.com/', 'https://avajs.dev/', 'https://github.com/'] +``` + +## p-map for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of p-map and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-p-map?utm_source=npm-p-map&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Related + +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-times](https://github.com/sindresorhus/p-times) - Run promise-returning & async functions a specific number of times concurrently +- [p-props](https://github.com/sindresorhus/p-props) - Like `Promise.all()` but for `Map` and `Object` +- [p-map-series](https://github.com/sindresorhus/p-map-series) - Map over promises serially +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [More…](https://github.com/sindresorhus/promise-fun) diff --git a/node_modules/ava/node_modules/source-map-support/LICENSE.md b/node_modules/ava/node_modules/source-map-support/LICENSE.md deleted file mode 100644 index 6247ca912c..0000000000 --- a/node_modules/ava/node_modules/source-map-support/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Evan Wallace - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/ava/node_modules/source-map-support/README.md b/node_modules/ava/node_modules/source-map-support/README.md deleted file mode 100644 index 40228b7910..0000000000 --- a/node_modules/ava/node_modules/source-map-support/README.md +++ /dev/null @@ -1,284 +0,0 @@ -# Source Map Support -[![Build Status](https://travis-ci.org/evanw/node-source-map-support.svg?branch=master)](https://travis-ci.org/evanw/node-source-map-support) - -This module provides source map support for stack traces in node via the [V8 stack trace API](https://github.com/v8/v8/wiki/Stack-Trace-API). It uses the [source-map](https://github.com/mozilla/source-map) module to replace the paths and line numbers of source-mapped files with their original paths and line numbers. The output mimics node's stack trace format with the goal of making every compile-to-JS language more of a first-class citizen. Source maps are completely general (not specific to any one language) so you can use source maps with multiple compile-to-JS languages in the same node process. - -## Installation and Usage - -#### Node support - -``` -$ npm install source-map-support -``` - -Source maps can be generated using libraries such as [source-map-index-generator](https://github.com/twolfson/source-map-index-generator). Once you have a valid source map, place a source mapping comment somewhere in the file (usually done automatically or with an option by your transpiler): - -``` -//# sourceMappingURL=path/to/source.map -``` - -If multiple sourceMappingURL comments exist in one file, the last sourceMappingURL comment will be -respected (e.g. if a file mentions the comment in code, or went through multiple transpilers). -The path should either be absolute or relative to the compiled file. - -From here you have two options. - -##### CLI Usage - -```bash -node -r source-map-support/register compiled.js -``` - -##### Programmatic Usage - -Put the following line at the top of the compiled file. - -```js -require('source-map-support').install(); -``` - -It is also possible to install the source map support directly by -requiring the `register` module which can be handy with ES6: - -```js -import 'source-map-support/register' - -// Instead of: -import sourceMapSupport from 'source-map-support' -sourceMapSupport.install() -``` -Note: if you're using babel-register, it includes source-map-support already. - -It is also very useful with Mocha: - -``` -$ mocha --require source-map-support/register tests/ -``` - -#### Browser support - -This library also works in Chrome. While the DevTools console already supports source maps, the V8 engine doesn't and `Error.prototype.stack` will be incorrect without this library. Everything will just work if you deploy your source files using [browserify](http://browserify.org/). Just make sure to pass the `--debug` flag to the browserify command so your source maps are included in the bundled code. - -This library also works if you use another build process or just include the source files directly. In this case, include the file `browser-source-map-support.js` in your page and call `sourceMapSupport.install()`. It contains the whole library already bundled for the browser using browserify. - -```html - - -``` - -This library also works if you use AMD (Asynchronous Module Definition), which is used in tools like [RequireJS](http://requirejs.org/). Just list `browser-source-map-support` as a dependency: - -```html - -``` - -## Options - -This module installs two things: a change to the `stack` property on `Error` objects and a handler for uncaught exceptions that mimics node's default exception handler (the handler can be seen in the demos below). You may want to disable the handler if you have your own uncaught exception handler. This can be done by passing an argument to the installer: - -```js -require('source-map-support').install({ - handleUncaughtExceptions: false -}); -``` - -This module loads source maps from the filesystem by default. You can provide alternate loading behavior through a callback as shown below. For example, [Meteor](https://github.com/meteor) keeps all source maps cached in memory to avoid disk access. - -```js -require('source-map-support').install({ - retrieveSourceMap: function(source) { - if (source === 'compiled.js') { - return { - url: 'original.js', - map: fs.readFileSync('compiled.js.map', 'utf8') - }; - } - return null; - } -}); -``` - -The module will by default assume a browser environment if XMLHttpRequest and window are defined. If either of these do not exist it will instead assume a node environment. -In some rare cases, e.g. when running a browser emulation and where both variables are also set, you can explictly specify the environment to be either 'browser' or 'node'. - -```js -require('source-map-support').install({ - environment: 'node' -}); -``` - -To support files with inline source maps, the `hookRequire` options can be specified, which will monitor all source files for inline source maps. - - -```js -require('source-map-support').install({ - hookRequire: true -}); -``` - -This monkey patches the `require` module loading chain, so is not enabled by default and is not recommended for any sort of production usage. - -## Demos - -#### Basic Demo - -original.js: - -```js -throw new Error('test'); // This is the original code -``` - -compiled.js: - -```js -require('source-map-support').install(); - -throw new Error('test'); // This is the compiled code -// The next line defines the sourceMapping. -//# sourceMappingURL=compiled.js.map -``` - -compiled.js.map: - -```json -{ - "version": 3, - "file": "compiled.js", - "sources": ["original.js"], - "names": [], - "mappings": ";;AAAA,MAAM,IAAI" -} -``` - -Run compiled.js using node (notice how the stack trace uses original.js instead of compiled.js): - -``` -$ node compiled.js - -original.js:1 -throw new Error('test'); // This is the original code - ^ -Error: test - at Object. (original.js:1:7) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) - at node.js:901:3 -``` - -#### TypeScript Demo - -demo.ts: - -```typescript -declare function require(name: string); -require('source-map-support').install(); -class Foo { - constructor() { this.bar(); } - bar() { throw new Error('this is a demo'); } -} -new Foo(); -``` - -Compile and run the file using the TypeScript compiler from the terminal: - -``` -$ npm install source-map-support typescript -$ node_modules/typescript/bin/tsc -sourcemap demo.ts -$ node demo.js - -demo.ts:5 - bar() { throw new Error('this is a demo'); } - ^ -Error: this is a demo - at Foo.bar (demo.ts:5:17) - at new Foo (demo.ts:4:24) - at Object. (demo.ts:7:1) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) - at node.js:901:3 -``` - -There is also the option to use `-r source-map-support/register` with typescript, without the need add the `require('source-map-support').install()` in the code base: - -``` -$ npm install source-map-support typescript -$ node_modules/typescript/bin/tsc -sourcemap demo.ts -$ node -r source-map-support/register demo.js - -demo.ts:5 - bar() { throw new Error('this is a demo'); } - ^ -Error: this is a demo - at Foo.bar (demo.ts:5:17) - at new Foo (demo.ts:4:24) - at Object. (demo.ts:7:1) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) - at node.js:901:3 -``` - -#### CoffeeScript Demo - -demo.coffee: - -```coffee -require('source-map-support').install() -foo = -> - bar = -> throw new Error 'this is a demo' - bar() -foo() -``` - -Compile and run the file using the CoffeeScript compiler from the terminal: - -```sh -$ npm install source-map-support coffeescript -$ node_modules/.bin/coffee --map --compile demo.coffee -$ node demo.js - -demo.coffee:3 - bar = -> throw new Error 'this is a demo' - ^ -Error: this is a demo - at bar (demo.coffee:3:22) - at foo (demo.coffee:4:3) - at Object. (demo.coffee:5:1) - at Object. (demo.coffee:1:1) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) -``` - -## Tests - -This repo contains both automated tests for node and manual tests for the browser. The automated tests can be run using mocha (type `mocha` in the root directory). To run the manual tests: - -* Build the tests using `build.js` -* Launch the HTTP server (`npm run serve-tests`) and visit - * http://127.0.0.1:1336/amd-test - * http://127.0.0.1:1336/browser-test - * http://127.0.0.1:1336/browserify-test - **Currently not working** due to a bug with browserify (see [pull request #66](https://github.com/evanw/node-source-map-support/pull/66) for details). -* For `header-test`, run `server.js` inside that directory and visit http://127.0.0.1:1337/ - -## License - -This code is available under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/node_modules/ava/node_modules/source-map-support/browser-source-map-support.js b/node_modules/ava/node_modules/source-map-support/browser-source-map-support.js deleted file mode 100644 index 37ac1882f6..0000000000 --- a/node_modules/ava/node_modules/source-map-support/browser-source-map-support.js +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Support for source maps in V8 stack traces - * https://github.com/evanw/node-source-map-support - */ -/* - The buffer module from node.js, for the browser. - - @author Feross Aboukhadijeh - license MIT -*/ -(this.define||function(G,J){this.sourceMapSupport=J()})("browser-source-map-support",function(G){(function b(n,x,m){function e(d,a){if(!x[d]){if(!n[d]){var l="function"==typeof require&&require;if(!a&&l)return l(d,!0);if(g)return g(d,!0);throw Error("Cannot find module '"+d+"'");}l=x[d]={exports:{}};n[d][0].call(l.exports,function(a){var b=n[d][1][a];return e(b?b:a)},l,l.exports,b,n,x,m)}return x[d].exports}for(var g="function"==typeof require&&require,h=0;hb)return-1;if(58>b)return b-48+52;if(91>b)return b-65;if(123>b)return b-97+26}var g="undefined"!==typeof Uint8Array?Uint8Array:Array;b.toByteArray=function(b){function d(a){r[v++]=a}if(0>16);d((h&65280)>>8);d(h&255)}2===l?(h=e(b.charAt(a))<<2|e(b.charAt(a+1))>>4,d(h&255)):1===l&&(h=e(b.charAt(a))<<10|e(b.charAt(a+1))<<4|e(b.charAt(a+2))>>2,d(h>>8&255),d(h&255));return r};b.fromByteArray=function(b){var d=b.length%3,a="",l;var e=0;for(l=b.length-d;e> -18&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>12&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>6&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63);a+=g}switch(d){case 1:g=b[b.length-1];a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g<<4&63);a+="==";break;case 2:g=(b[b.length-2]<<8)+ -b[b.length-1],a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>10),a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>4&63),a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g<<2&63),a+="="}return a}})("undefined"===typeof m?this.base64js={}:m)},{}],3:[function(n,x,m){},{}],4:[function(n,x,m){(function(b){var e=Object.prototype.toString,g="function"===typeof b.alloc&&"function"===typeof b.allocUnsafe&&"function"=== -typeof b.from;x.exports=function(h,d,a){if("number"===typeof h)throw new TypeError('"value" argument must not be a number');if("ArrayBuffer"===e.call(h).slice(8,-1)){d>>>=0;var l=h.byteLength-d;if(0>l)throw new RangeError("'offset' is out of bounds");if(void 0===a)a=l;else if(a>>>=0,a>l)throw new RangeError("'length' is out of bounds");return g?b.from(h.slice(d,d+a)):new b(new Uint8Array(h.slice(d,d+a)))}if("string"===typeof h){a=d;if("string"!==typeof a||""===a)a="utf8";if(!b.isEncoding(a))throw new TypeError('"encoding" must be a valid string encoding'); -return g?b.from(h,a):new b(h,a)}return g?b.from(h):new b(h)}}).call(this,n("buffer").Buffer)},{buffer:5}],5:[function(n,x,m){function b(f,p,a){if(!(this instanceof b))return new b(f,p,a);var c=typeof f;if("number"===c)var d=0>>0:0;else if("string"===c){if("base64"===p)for(f=(f.trim?f.trim():f.replace(/^\s+|\s+$/g,"")).replace(H,"");0!==f.length%4;)f+="=";d=b.byteLength(f,p)}else if("object"===c&&null!==f)"Buffer"===f.type&&F(f.data)&&(f=f.data),d=0<+f.length?Math.floor(+f.length):0;else throw new TypeError("must start with number, buffer, array or string"); -if(this.length>D)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D.toString(16)+" bytes");if(b.TYPED_ARRAY_SUPPORT)var k=b._augment(new Uint8Array(d));else k=this,k.length=d,k._isBuffer=!0;if(b.TYPED_ARRAY_SUPPORT&&"number"===typeof f.byteLength)k._set(f);else{var C=f;if(F(C)||b.isBuffer(C)||C&&"object"===typeof C&&"number"===typeof C.length)if(b.isBuffer(f))for(p=0;pf)throw new RangeError("offset is not uint");if(f+p>b)throw new RangeError("Trying to access beyond buffer length");}function h(f,p,a,c,d,k){if(!b.isBuffer(f))throw new TypeError("buffer must be a Buffer instance");if(p>d||pf.length)throw new TypeError("index out of range"); -}function d(f,p,b,a){0>p&&(p=65535+p+1);for(var c=0,d=Math.min(f.length-b,2);c>>8*(a?c:1-c)}function a(f,p,b,a){0>p&&(p=4294967295+p+1);for(var c=0,d=Math.min(f.length-b,4);c>>8*(a?c:3-c)&255}function l(f,p,b,a,c,d){if(p>c||pf.length)throw new TypeError("index out of range");}function r(f,p,b,a,c){c||l(f,p,b,4,3.4028234663852886E38,-3.4028234663852886E38);y.write(f,p,b,a,23,4);return b+4}function q(f, -p,b,a,c){c||l(f,p,b,8,1.7976931348623157E308,-1.7976931348623157E308);y.write(f,p,b,a,52,8);return b+8}function v(f){for(var p=[],b=0;b=a)p.push(a);else{var c=b;55296<=a&&57343>=a&&b++;a=encodeURIComponent(f.slice(c,b+1)).substr(1).split("%");for(c=0;c=b.length||d>=f.length);d++)b[d+ -a]=f[d];return d}function k(f){try{return decodeURIComponent(f)}catch(p){return String.fromCharCode(65533)}}var w=n("base64-js"),y=n("ieee754"),F=n("is-array");m.Buffer=b;m.SlowBuffer=b;m.INSPECT_MAX_BYTES=50;b.poolSize=8192;var D=1073741823;b.TYPED_ARRAY_SUPPORT=function(){try{var f=new ArrayBuffer(0),b=new Uint8Array(f);b.foo=function(){return 42};return 42===b.foo()&&"function"===typeof b.subarray&&0===(new Uint8Array(1)).subarray(1,1).byteLength}catch(C){return!1}}();b.isBuffer=function(f){return!(null== -f||!f._isBuffer)};b.compare=function(f,a){if(!b.isBuffer(f)||!b.isBuffer(a))throw new TypeError("Arguments must be Buffers");for(var c=f.length,p=a.length,d=0,k=Math.min(c,p);d>>1;break;case "utf8":case "utf-8":b=v(f).length;break;case "base64":b=w.toByteArray(f).length; -break;default:b=f.length}return b};b.prototype.length=void 0;b.prototype.parent=void 0;b.prototype.toString=function(f,b,a){var c=!1;b>>>=0;a=void 0===a||Infinity===a?this.length:a>>>0;f||(f="utf8");0>b&&(b=0);a>this.length&&(a=this.length);if(a<=b)return"";for(;;)switch(f){case "hex":f=b;b=a;a=this.length;if(!f||0>f)f=0;if(!b||0>b||b>a)b=a;c="";for(a=f;ac?"0"+c.toString(16):c.toString(16),c=f+c;return c;case "utf8":case "utf-8":c=f="";for(a=Math.min(this.length,a);b= -this[b]?(f+=k(c)+String.fromCharCode(this[b]),c=""):c+="%"+this[b].toString(16);return f+k(c);case "ascii":return e(this,b,a);case "binary":return e(this,b,a);case "base64":return b=0===b&&a===this.length?w.fromByteArray(this):w.fromByteArray(this.slice(b,a)),b;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":b=this.slice(b,a);a="";for(f=0;fb&&(f+=" ... "));return""};b.prototype.compare=function(f){if(!b.isBuffer(f))throw new TypeError("Argument must be a Buffer");return b.compare(this,f)};b.prototype.get=function(f){console.log(".get() is deprecated. Access using array indexes instead."); -return this.readUInt8(f)};b.prototype.set=function(f,b){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(f,b)};b.prototype.write=function(f,b,a,d){if(isFinite(b))isFinite(a)||(d=a,a=void 0);else{var p=d;d=b;b=a;a=p}b=Number(b)||0;p=this.length-b;a?(a=Number(a),a>p&&(a=p)):a=p;d=String(d||"utf8").toLowerCase();switch(d){case "hex":b=Number(b)||0;d=this.length-b;a?(a=Number(a),a>d&&(a=d)):a=d;d=f.length;if(0!==d%2)throw Error("Invalid hex string");a>d/ -2&&(a=d/2);for(d=0;d>8;l%=256;p.push(l);p.push(d)}f=c(p,this,b,a,2);break;default:throw new TypeError("Unknown encoding: "+ -d);}return f};b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};b.prototype.slice=function(f,a){var c=this.length;f=~~f;a=void 0===a?c:~~a;0>f?(f+=c,0>f&&(f=0)):f>c&&(f=c);0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c);a>>=0;d||h(this,a,c,1,255,0);b.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));this[c]=a;return c+1};b.prototype.writeUInt16LE=function(a, -c,k){a=+a;c>>>=0;k||h(this,a,c,2,65535,0);b.TYPED_ARRAY_SUPPORT?(this[c]=a,this[c+1]=a>>>8):d(this,a,c,!0);return c+2};b.prototype.writeUInt16BE=function(a,c,k){a=+a;c>>>=0;k||h(this,a,c,2,65535,0);b.TYPED_ARRAY_SUPPORT?(this[c]=a>>>8,this[c+1]=a):d(this,a,c,!1);return c+2};b.prototype.writeUInt32LE=function(f,c,d){f=+f;c>>>=0;d||h(this,f,c,4,4294967295,0);b.TYPED_ARRAY_SUPPORT?(this[c+3]=f>>>24,this[c+2]=f>>>16,this[c+1]=f>>>8,this[c]=f):a(this,f,c,!0);return c+4};b.prototype.writeUInt32BE=function(f, -c,d){f=+f;c>>>=0;d||h(this,f,c,4,4294967295,0);b.TYPED_ARRAY_SUPPORT?(this[c]=f>>>24,this[c+1]=f>>>16,this[c+2]=f>>>8,this[c+3]=f):a(this,f,c,!1);return c+4};b.prototype.writeInt8=function(a,c,d){a=+a;c>>>=0;d||h(this,a,c,1,127,-128);b.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));0>a&&(a=255+a+1);this[c]=a;return c+1};b.prototype.writeInt16LE=function(a,c,k){a=+a;c>>>=0;k||h(this,a,c,2,32767,-32768);b.TYPED_ARRAY_SUPPORT?(this[c]=a,this[c+1]=a>>>8):d(this,a,c,!0);return c+2};b.prototype.writeInt16BE=function(a, -c,k){a=+a;c>>>=0;k||h(this,a,c,2,32767,-32768);b.TYPED_ARRAY_SUPPORT?(this[c]=a>>>8,this[c+1]=a):d(this,a,c,!1);return c+2};b.prototype.writeInt32LE=function(c,d,k){c=+c;d>>>=0;k||h(this,c,d,4,2147483647,-2147483648);b.TYPED_ARRAY_SUPPORT?(this[d]=c,this[d+1]=c>>>8,this[d+2]=c>>>16,this[d+3]=c>>>24):a(this,c,d,!0);return d+4};b.prototype.writeInt32BE=function(c,d,k){c=+c;d>>>=0;k||h(this,c,d,4,2147483647,-2147483648);0>c&&(c=4294967295+c+1);b.TYPED_ARRAY_SUPPORT?(this[d]=c>>>24,this[d+1]=c>>>16,this[d+ -2]=c>>>8,this[d+3]=c):a(this,c,d,!1);return d+4};b.prototype.writeFloatLE=function(a,c,b){return r(this,a,c,!0,b)};b.prototype.writeFloatBE=function(a,c,b){return r(this,a,c,!1,b)};b.prototype.writeDoubleLE=function(a,c,b){return q(this,a,c,!0,b)};b.prototype.writeDoubleBE=function(a,c,b){return q(this,a,c,!1,b)};b.prototype.copy=function(a,c,d,k){d||(d=0);k||0===k||(k=this.length);c||(c=0);if(k!==d&&0!==a.length&&0!==this.length){if(kc||c>=a.length)throw new TypeError("targetStart out of bounds"); -if(0>d||d>=this.length)throw new TypeError("sourceStart out of bounds");if(0>k||k>this.length)throw new TypeError("sourceEnd out of bounds");k>this.length&&(k=this.length);a.length-ck||!b.TYPED_ARRAY_SUPPORT)for(var f=0;fc||c>=this.length)throw new TypeError("start out of bounds"); -if(0>b||b>this.length)throw new TypeError("end out of bounds");if("number"===typeof a)for(;c>1,q=-7;d=g?d-1:0;var v=g?-1:1,u=b[e+d];d+=v;g=u&(1<<-q)-1;u>>=-q;for(q+=a;0>=-q;for(q+=h;0>1,u=23===d?Math.pow(2,-24)-Math.pow(2,-77):0;a=h?0:a-1;var c=h?1:-1,k=0>e||0===e&&0>1/e?1:0;e=Math.abs(e);isNaN(e)||Infinity===e?(e=isNaN(e)?1:0,h=q):(h=Math.floor(Math.log(e)/Math.LN2),1>e*(l=Math.pow(2,-h))&&(h--,l*=2),e=1<=h+v?e+u/l:e+u*Math.pow(2,1-v),2<=e*l&&(h++,l/=2),h+v>=q?(e=0,h=q):1<=h+v?(e=(e*l-1)*Math.pow(2,d),h+=v):(e=e*Math.pow(2,v-1)*Math.pow(2,d),h=0));for(;8<=d;b[g+a]=e&255,a+= -c,e/=256,d-=8);h=h<b?[]:a.slice(c,b-c+1)}a=m.resolve(a).substr(1);b=m.resolve(b).substr(1); -for(var l=d(a.split("/")),v=d(b.split("/")),e=Math.min(l.length,v.length),c=e,k=0;kb&&(b=a.length+b);return a.substr(b,d)}}).call(this,n("g5I+bs"))},{"g5I+bs":9}],9:[function(n,x,m){function b(){}n=x.exports={};n.nextTick=function(){if("undefined"!==typeof window&&window.setImmediate)return function(b){return window.setImmediate(b)};if("undefined"!==typeof window&&window.postMessage&&window.addEventListener){var b=[];window.addEventListener("message",function(e){var g=e.source;g!==window&&null!== -g||"process-tick"!==e.data||(e.stopPropagation(),0e?(-e<<1)+1:e<<1;do e=h&31,h>>>=5,0=d)throw Error("Expected more digits in base 64 VLQ value.");var r=b.decode(e.charCodeAt(g++));if(-1===r)throw Error("Invalid base64 digit: "+e.charAt(g-1));var q=!!(r&32);r&=31;a+=r<>1;h.value=1===(a&1)?-e:e;h.rest=g}},{"./base64":12}],12:[function(n, -x,m){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");m.encode=function(e){if(0<=e&&e=b?b-65:97<=b&&122>=b?b-97+26:48<=b&&57>=b?b-48+52:43==b?62:47==b?63:-1}},{}],13:[function(n,x,m){function b(e,g,h,d,a,l){var r=Math.floor((g-e)/2)+e,q=a(h,d[r],!0);return 0===q?r:0e?-1:e}m.GREATEST_LOWER_BOUND=1;m.LEAST_UPPER_BOUND=2;m.search=function(e,g,h,d){if(0===g.length)return-1;e=b(-1,g.length,e,g,h,d||m.GREATEST_LOWER_BOUND);if(0>e)return-1;for(;0<=e-1&&0===h(g[e],g[e-1],!0);)--e;return e}},{}],14:[function(n,x,m){function b(){this._array=[];this._sorted=!0;this._last={generatedLine:-1,generatedColumn:0}}var e=n("./util");b.prototype.unsortedForEach=function(b,e){this._array.forEach(b,e)};b.prototype.add=function(b){var g=this._last,d=g.generatedLine, -a=b.generatedLine,l=g.generatedColumn,r=b.generatedColumn;a>d||a==d&&r>=l||0>=e.compareByGeneratedPositionsInflated(g,b)?this._last=b:this._sorted=!1;this._array.push(b)};b.prototype.toArray=function(){this._sorted||(this._array.sort(e.compareByGeneratedPositionsInflated),this._sorted=!0);return this._array};m.MappingList=b},{"./util":19}],15:[function(n,x,m){function b(b,e,d){var a=b[e];b[e]=b[d];b[d]=a}function e(g,h,d,a){if(d=h(g[q],r)&&(l+=1,b(g,l,q));b(g,l+1,q);l+=1;e(g,h,d,l-1);e(g,h,l+1,a)}}m.quickSort=function(b,h){e(b,h,0,b.length-1)}},{}],16:[function(n,x,m){function b(a,b){var c=a;"string"===typeof a&&(c=d.parseSourceMapInput(a));return null!=c.sections?new h(c,b):new e(c,b)}function e(a,b){var c=a;"string"===typeof a&&(c=d.parseSourceMapInput(a));var k=d.getArg(c,"version"),e=d.getArg(c,"sources"),v=d.getArg(c,"names",[]),g=d.getArg(c,"sourceRoot",null),h=d.getArg(c,"sourcesContent",null),q=d.getArg(c, -"mappings");c=d.getArg(c,"file",null);if(k!=this._version)throw Error("Unsupported version: "+k);g&&(g=d.normalize(g));e=e.map(String).map(d.normalize).map(function(a){return g&&d.isAbsolute(g)&&d.isAbsolute(a)?d.relative(g,a):a});this._names=l.fromArray(v.map(String),!0);this._sources=l.fromArray(e,!0);this.sourceRoot=g;this.sourcesContent=h;this._mappings=q;this._sourceMapURL=b;this.file=c}function g(){this.generatedColumn=this.generatedLine=0;this.name=this.originalColumn=this.originalLine=this.source= -null}function h(a,e){var c=a;"string"===typeof a&&(c=d.parseSourceMapInput(a));var k=d.getArg(c,"version");c=d.getArg(c,"sections");if(k!=this._version)throw Error("Unsupported version: "+k);this._sources=new l;this._names=new l;var v={line:-1,column:0};this._sections=c.map(function(a){if(a.url)throw Error("Support for url field in sections not implemented.");var c=d.getArg(a,"offset"),k=d.getArg(c,"line"),g=d.getArg(c,"column");if(k=b[c])throw new TypeError("Line must be greater than or equal to 1, got "+ -b[c]);if(0>b[k])throw new TypeError("Column must be greater than or equal to 0, got "+b[k]);return a.search(b,d,e,g)};e.prototype.computeColumnSpans=function(){for(var a=0;a=this._sources.size()&&!this.sourcesContent.some(function(a){return null==a}):!1};e.prototype.sourceContentFor=function(a,b){if(!this.sourcesContent)return null;var c=a;null!=this.sourceRoot&&(c=d.relative(this.sourceRoot,c));if(this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)]; -var k=this.sources,e;for(e=0;e -b||95!==a.charCodeAt(b-1)||95!==a.charCodeAt(b-2)||111!==a.charCodeAt(b-3)||116!==a.charCodeAt(b-4)||111!==a.charCodeAt(b-5)||114!==a.charCodeAt(b-6)||112!==a.charCodeAt(b-7)||95!==a.charCodeAt(b-8)||95!==a.charCodeAt(b-9))return!1;for(b-=10;0<=b;b--)if(36!==a.charCodeAt(b))return!1;return!0}function q(a,b){return a===b?0:null===a?1:null===b?-1:a>b?1:-1}m.getArg=function(a,b,d){if(b in a)return a[b];if(3===arguments.length)return d;throw Error('"'+b+'" is a required argument.');};var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/, -u=/^data:.+,.+$/;m.urlParse=b;m.urlGenerate=e;m.normalize=g;m.join=h;m.isAbsolute=function(a){return"/"===a.charAt(0)||v.test(a)};m.relative=function(a,b){""===a&&(a=".");a=a.replace(/\/$/,"");for(var c=0;0!==b.indexOf(a+"/");){var d=a.lastIndexOf("/");if(0>d)return b;a=a.slice(0,d);if(a.match(/^([^\/]+:\/)?\/*$/))return b;++c}return Array(c+1).join("../")+b.substr(a.length+1)};n=!("__proto__"in Object.create(null));m.toSetString=n?d:a;m.fromSetString=n?d:l;m.compareByOriginalPositions=function(a, -b,d){var c=q(a.source,b.source);if(0!==c)return c;c=a.originalLine-b.originalLine;if(0!==c)return c;c=a.originalColumn-b.originalColumn;if(0!==c||d)return c;c=a.generatedColumn-b.generatedColumn;if(0!==c)return c;c=a.generatedLine-b.generatedLine;return 0!==c?c:q(a.name,b.name)};m.compareByGeneratedPositionsDeflated=function(a,b,d){var c=a.generatedLine-b.generatedLine;if(0!==c)return c;c=a.generatedColumn-b.generatedColumn;if(0!==c||d)return c;c=q(a.source,b.source);if(0!==c)return c;c=a.originalLine- -b.originalLine;if(0!==c)return c;c=a.originalColumn-b.originalColumn;return 0!==c?c:q(a.name,b.name)};m.compareByGeneratedPositionsInflated=function(a,b){var c=a.generatedLine-b.generatedLine;if(0!==c)return c;c=a.generatedColumn-b.generatedColumn;if(0!==c)return c;c=q(a.source,b.source);if(0!==c)return c;c=a.originalLine-b.originalLine;if(0!==c)return c;c=a.originalColumn-b.originalColumn;return 0!==c?c:q(a.name,b.name)};m.parseSourceMapInput=function(a){return JSON.parse(a.replace(/^\)]}'[^\n]*\n/, -""))};m.computeSourceURL=function(a,d,l){d=d||"";a&&("/"!==a[a.length-1]&&"/"!==d[0]&&(a+="/"),d=a+d);if(l){a=b(l);if(!a)throw Error("sourceMapURL could not be parsed");a.path&&(l=a.path.lastIndexOf("/"),0<=l&&(a.path=a.path.substring(0,l+1)));d=h(e(a),d)}return g(d)}},{}],20:[function(n,x,m){m.SourceMapGenerator=n("./lib/source-map-generator").SourceMapGenerator;m.SourceMapConsumer=n("./lib/source-map-consumer").SourceMapConsumer;m.SourceNode=n("./lib/source-node").SourceNode},{"./lib/source-map-consumer":16, -"./lib/source-map-generator":17,"./lib/source-node":18}],21:[function(n,x,m){(function(b){function e(){return"browser"===f?!0:"node"===f?!1:"undefined"!==typeof window&&"function"===typeof XMLHttpRequest&&!(window.require&&window.module&&window.process&&"renderer"===window.process.type)}function g(a){return function(b){for(var c=0;c";b=this.getLineNumber();null!=b&&(a+=":"+b,(b= -this.getColumnNumber())&&(a+=":"+b))}b="";var c=this.getFunctionName(),d=!0,e=this.isConstructor();if(this.isToplevel()||e)e?b+="new "+(c||""):c?b+=c:(b+=a,d=!1);else{e=this.getTypeName();"[object Object]"===e&&(e="null");var f=this.getMethodName();c?(e&&0!=c.indexOf(e)&&(b+=e+"."),b+=c,f&&c.indexOf("."+f)!=c.length-f.length-1&&(b+=" [as "+f+"]")):b+=e+"."+(f||"")}d&&(b+=" ("+a+")");return b}function r(a){var b={};Object.getOwnPropertyNames(Object.getPrototypeOf(a)).forEach(function(c){b[c]= -/^(?:is|get)/.test(c)?function(){return a[c].call(a)}:a[c]});b.toString=l;return b}function q(c,f){void 0===f&&(f={nextPosition:null,curPosition:null});if(c.isNative())return f.curPosition=null,c;var g=c.getFileName()||c.getScriptNameOrSourceURL();if(g){var h=c.getLineNumber(),k=c.getColumnNumber()-1,l=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/.test(b.version)?0:62;1===h&&k>l&&!e()&&!c.isEval()&&(k-=l);var m=d({source:g,line:h,column:k});f.curPosition=m;c=r(c);var p= -c.getFunctionName;c.getFunctionName=function(){return null==f.nextPosition?p():f.nextPosition.name||p()};c.getFileName=function(){return m.source};c.getLineNumber=function(){return m.line};c.getColumnNumber=function(){return m.column+1};c.getScriptNameOrSourceURL=function(){return m.source};return c}var n=c.isEval()&&c.getEvalOrigin();n&&(n=a(n),c=r(c),c.getEvalOrigin=function(){return n});return c}function v(a,b){H&&(p={},C={});for(var c=(a.name||"Error")+": "+(a.message||""),d={nextPosition:null, -curPosition:null},e=[],f=b.length-1;0<=f;f--)e.push("\n at "+q(b[f],d)),d.nextPosition=d.curPosition;d.curPosition=d.nextPosition=null;return c+e.reverse().join("")}function u(a){var b=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(a.stack);if(b){a=b[1];var c=+b[2];b=+b[3];var d=p[a];if(!d&&y&&y.existsSync(a))try{d=y.readFileSync(a,"utf8")}catch(N){d=""}if(d&&(d=d.split(/(?:\r\n|\r|\n)/)[c-1]))return a+":"+c+"\n"+d+"\n"+Array(b).join(" ")+"^"}return null}function c(){var a=b.emit;b.emit=function(c){if("uncaughtException"=== -c){var d=arguments[1]&&arguments[1].stack,e=0 C:/dir/file - '/'; // file:///root-dir/file -> /root-dir/file - }); - } - if (path in fileContentsCache) { - return fileContentsCache[path]; - } - - var contents = ''; - try { - if (!fs) { - // Use SJAX if we are in the browser - var xhr = new XMLHttpRequest(); - xhr.open('GET', path, /** async */ false); - xhr.send(null); - if (xhr.readyState === 4 && xhr.status === 200) { - contents = xhr.responseText; - } - } else if (fs.existsSync(path)) { - // Otherwise, use the filesystem - contents = fs.readFileSync(path, 'utf8'); - } - } catch (er) { - /* ignore any errors */ - } - - return fileContentsCache[path] = contents; -}); - -// Support URLs relative to a directory, but be careful about a protocol prefix -// in case we are in the browser (i.e. directories may start with "http://" or "file:///") -function supportRelativeURL(file, url) { - if (!file) return url; - var dir = path.dirname(file); - var match = /^\w+:\/\/[^\/]*/.exec(dir); - var protocol = match ? match[0] : ''; - var startPath = dir.slice(protocol.length); - if (protocol && /^\/\w\:/.test(startPath)) { - // handle file:///C:/ paths - protocol += '/'; - return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, '/'); - } - return protocol + path.resolve(dir.slice(protocol.length), url); -} - -function retrieveSourceMapURL(source) { - var fileData; - - if (isInBrowser()) { - try { - var xhr = new XMLHttpRequest(); - xhr.open('GET', source, false); - xhr.send(null); - fileData = xhr.readyState === 4 ? xhr.responseText : null; - - // Support providing a sourceMappingURL via the SourceMap header - var sourceMapHeader = xhr.getResponseHeader("SourceMap") || - xhr.getResponseHeader("X-SourceMap"); - if (sourceMapHeader) { - return sourceMapHeader; - } - } catch (e) { - } - } - - // Get the URL of the source map - fileData = retrieveFile(source); - var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg; - // Keep executing the search to find the *last* sourceMappingURL to avoid - // picking up sourceMappingURLs from comments, strings, etc. - var lastMatch, match; - while (match = re.exec(fileData)) lastMatch = match; - if (!lastMatch) return null; - return lastMatch[1]; -}; - -// Can be overridden by the retrieveSourceMap option to install. Takes a -// generated source filename; returns a {map, optional url} object, or null if -// there is no source map. The map field may be either a string or the parsed -// JSON object (ie, it must be a valid argument to the SourceMapConsumer -// constructor). -var retrieveSourceMap = handlerExec(retrieveMapHandlers); -retrieveMapHandlers.push(function(source) { - var sourceMappingURL = retrieveSourceMapURL(source); - if (!sourceMappingURL) return null; - - // Read the contents of the source map - var sourceMapData; - if (reSourceMap.test(sourceMappingURL)) { - // Support source map URL as a data url - var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1); - sourceMapData = bufferFrom(rawData, "base64").toString(); - sourceMappingURL = source; - } else { - // Support source map URLs relative to the source URL - sourceMappingURL = supportRelativeURL(source, sourceMappingURL); - sourceMapData = retrieveFile(sourceMappingURL); - } - - if (!sourceMapData) { - return null; - } - - return { - url: sourceMappingURL, - map: sourceMapData - }; -}); - -function mapSourcePosition(position) { - var sourceMap = sourceMapCache[position.source]; - if (!sourceMap) { - // Call the (overrideable) retrieveSourceMap function to get the source map. - var urlAndMap = retrieveSourceMap(position.source); - if (urlAndMap) { - sourceMap = sourceMapCache[position.source] = { - url: urlAndMap.url, - map: new SourceMapConsumer(urlAndMap.map) - }; - - // Load all sources stored inline with the source map into the file cache - // to pretend like they are already loaded. They may not exist on disk. - if (sourceMap.map.sourcesContent) { - sourceMap.map.sources.forEach(function(source, i) { - var contents = sourceMap.map.sourcesContent[i]; - if (contents) { - var url = supportRelativeURL(sourceMap.url, source); - fileContentsCache[url] = contents; - } - }); - } - } else { - sourceMap = sourceMapCache[position.source] = { - url: null, - map: null - }; - } - } - - // Resolve the source URL relative to the URL of the source map - if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === 'function') { - var originalPosition = sourceMap.map.originalPositionFor(position); - - // Only return the original position if a matching line was found. If no - // matching line is found then we return position instead, which will cause - // the stack trace to print the path and line for the compiled file. It is - // better to give a precise location in the compiled file than a vague - // location in the original file. - if (originalPosition.source !== null) { - originalPosition.source = supportRelativeURL( - sourceMap.url, originalPosition.source); - return originalPosition; - } - } - - return position; -} - -// Parses code generated by FormatEvalOrigin(), a function inside V8: -// https://code.google.com/p/v8/source/browse/trunk/src/messages.js -function mapEvalOrigin(origin) { - // Most eval() calls are in this format - var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin); - if (match) { - var position = mapSourcePosition({ - source: match[2], - line: +match[3], - column: match[4] - 1 - }); - return 'eval at ' + match[1] + ' (' + position.source + ':' + - position.line + ':' + (position.column + 1) + ')'; - } - - // Parse nested eval() calls using recursion - match = /^eval at ([^(]+) \((.+)\)$/.exec(origin); - if (match) { - return 'eval at ' + match[1] + ' (' + mapEvalOrigin(match[2]) + ')'; - } - - // Make sure we still return useful information if we didn't find anything - return origin; -} - -// This is copied almost verbatim from the V8 source code at -// https://code.google.com/p/v8/source/browse/trunk/src/messages.js. The -// implementation of wrapCallSite() used to just forward to the actual source -// code of CallSite.prototype.toString but unfortunately a new release of V8 -// did something to the prototype chain and broke the shim. The only fix I -// could find was copy/paste. -function CallSiteToString() { - var fileName; - var fileLocation = ""; - if (this.isNative()) { - fileLocation = "native"; - } else { - fileName = this.getScriptNameOrSourceURL(); - if (!fileName && this.isEval()) { - fileLocation = this.getEvalOrigin(); - fileLocation += ", "; // Expecting source position to follow. - } - - if (fileName) { - fileLocation += fileName; - } else { - // Source code does not originate from a file and is not native, but we - // can still get the source position inside the source string, e.g. in - // an eval string. - fileLocation += ""; - } - var lineNumber = this.getLineNumber(); - if (lineNumber != null) { - fileLocation += ":" + lineNumber; - var columnNumber = this.getColumnNumber(); - if (columnNumber) { - fileLocation += ":" + columnNumber; - } - } - } - - var line = ""; - var functionName = this.getFunctionName(); - var addSuffix = true; - var isConstructor = this.isConstructor(); - var isMethodCall = !(this.isToplevel() || isConstructor); - if (isMethodCall) { - var typeName = this.getTypeName(); - // Fixes shim to be backward compatable with Node v0 to v4 - if (typeName === "[object Object]") { - typeName = "null"; - } - var methodName = this.getMethodName(); - if (functionName) { - if (typeName && functionName.indexOf(typeName) != 0) { - line += typeName + "."; - } - line += functionName; - if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) { - line += " [as " + methodName + "]"; - } - } else { - line += typeName + "." + (methodName || ""); - } - } else if (isConstructor) { - line += "new " + (functionName || ""); - } else if (functionName) { - line += functionName; - } else { - line += fileLocation; - addSuffix = false; - } - if (addSuffix) { - line += " (" + fileLocation + ")"; - } - return line; -} - -function cloneCallSite(frame) { - var object = {}; - Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) { - object[name] = /^(?:is|get)/.test(name) ? function() { return frame[name].call(frame); } : frame[name]; - }); - object.toString = CallSiteToString; - return object; -} - -function wrapCallSite(frame, state) { - // provides interface backward compatibility - if (state === undefined) { - state = { nextPosition: null, curPosition: null } - } - if(frame.isNative()) { - state.curPosition = null; - return frame; - } - - // Most call sites will return the source file from getFileName(), but code - // passed to eval() ending in "//# sourceURL=..." will return the source file - // from getScriptNameOrSourceURL() instead - var source = frame.getFileName() || frame.getScriptNameOrSourceURL(); - if (source) { - var line = frame.getLineNumber(); - var column = frame.getColumnNumber() - 1; - - // Fix position in Node where some (internal) code is prepended. - // See https://github.com/evanw/node-source-map-support/issues/36 - // Header removed in node at ^10.16 || >=11.11.0 - // v11 is not an LTS candidate, we can just test the one version with it. - // Test node versions for: 10.16-19, 10.20+, 12-19, 20-99, 100+, or 11.11 - var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/; - var headerLength = noHeader.test(process.version) ? 0 : 62; - if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) { - column -= headerLength; - } - - var position = mapSourcePosition({ - source: source, - line: line, - column: column - }); - state.curPosition = position; - frame = cloneCallSite(frame); - var originalFunctionName = frame.getFunctionName; - frame.getFunctionName = function() { - if (state.nextPosition == null) { - return originalFunctionName(); - } - return state.nextPosition.name || originalFunctionName(); - }; - frame.getFileName = function() { return position.source; }; - frame.getLineNumber = function() { return position.line; }; - frame.getColumnNumber = function() { return position.column + 1; }; - frame.getScriptNameOrSourceURL = function() { return position.source; }; - return frame; - } - - // Code called using eval() needs special handling - var origin = frame.isEval() && frame.getEvalOrigin(); - if (origin) { - origin = mapEvalOrigin(origin); - frame = cloneCallSite(frame); - frame.getEvalOrigin = function() { return origin; }; - return frame; - } - - // If we get here then we were unable to change the source position - return frame; -} - -// This function is part of the V8 stack trace API, for more info see: -// https://v8.dev/docs/stack-trace-api -function prepareStackTrace(error, stack) { - if (emptyCacheBetweenOperations) { - fileContentsCache = {}; - sourceMapCache = {}; - } - - var name = error.name || 'Error'; - var message = error.message || ''; - var errorString = name + ": " + message; - - var state = { nextPosition: null, curPosition: null }; - var processedStack = []; - for (var i = stack.length - 1; i >= 0; i--) { - processedStack.push('\n at ' + wrapCallSite(stack[i], state)); - state.nextPosition = state.curPosition; - } - state.curPosition = state.nextPosition = null; - return errorString + processedStack.reverse().join(''); -} - -// Generate position and snippet of original source with pointer -function getErrorSource(error) { - var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack); - if (match) { - var source = match[1]; - var line = +match[2]; - var column = +match[3]; - - // Support the inline sourceContents inside the source map - var contents = fileContentsCache[source]; - - // Support files on disk - if (!contents && fs && fs.existsSync(source)) { - try { - contents = fs.readFileSync(source, 'utf8'); - } catch (er) { - contents = ''; - } - } - - // Format the line from the original source code like node does - if (contents) { - var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1]; - if (code) { - return source + ':' + line + '\n' + code + '\n' + - new Array(column).join(' ') + '^'; - } - } - } - return null; -} - -function printErrorAndExit (error) { - var source = getErrorSource(error); - - // Ensure error is printed synchronously and not truncated - if (process.stderr._handle && process.stderr._handle.setBlocking) { - process.stderr._handle.setBlocking(true); - } - - if (source) { - console.error(); - console.error(source); - } - - console.error(error.stack); - process.exit(1); -} - -function shimEmitUncaughtException () { - var origEmit = process.emit; - - process.emit = function (type) { - if (type === 'uncaughtException') { - var hasStack = (arguments[1] && arguments[1].stack); - var hasListeners = (this.listeners(type).length > 0); - - if (hasStack && !hasListeners) { - return printErrorAndExit(arguments[1]); - } - } - - return origEmit.apply(this, arguments); - }; -} - -var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0); -var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0); - -exports.wrapCallSite = wrapCallSite; -exports.getErrorSource = getErrorSource; -exports.mapSourcePosition = mapSourcePosition; -exports.retrieveSourceMap = retrieveSourceMap; - -exports.install = function(options) { - options = options || {}; - - if (options.environment) { - environment = options.environment; - if (["node", "browser", "auto"].indexOf(environment) === -1) { - throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}") - } - } - - // Allow sources to be found by methods other than reading the files - // directly from disk. - if (options.retrieveFile) { - if (options.overrideRetrieveFile) { - retrieveFileHandlers.length = 0; - } - - retrieveFileHandlers.unshift(options.retrieveFile); - } - - // Allow source maps to be found by methods other than reading the files - // directly from disk. - if (options.retrieveSourceMap) { - if (options.overrideRetrieveSourceMap) { - retrieveMapHandlers.length = 0; - } - - retrieveMapHandlers.unshift(options.retrieveSourceMap); - } - - // Support runtime transpilers that include inline source maps - if (options.hookRequire && !isInBrowser()) { - // Use dynamicRequire to avoid including in browser bundles - var Module = dynamicRequire(module, 'module'); - var $compile = Module.prototype._compile; - - if (!$compile.__sourceMapSupport) { - Module.prototype._compile = function(content, filename) { - fileContentsCache[filename] = content; - sourceMapCache[filename] = undefined; - return $compile.call(this, content, filename); - }; - - Module.prototype._compile.__sourceMapSupport = true; - } - } - - // Configure options - if (!emptyCacheBetweenOperations) { - emptyCacheBetweenOperations = 'emptyCacheBetweenOperations' in options ? - options.emptyCacheBetweenOperations : false; - } - - // Install the error reformatter - if (!errorFormatterInstalled) { - errorFormatterInstalled = true; - Error.prepareStackTrace = prepareStackTrace; - } - - if (!uncaughtShimInstalled) { - var installHandler = 'handleUncaughtExceptions' in options ? - options.handleUncaughtExceptions : true; - - // Do not override 'uncaughtException' with our own handler in Node.js - // Worker threads. Workers pass the error to the main thread as an event, - // rather than printing something to stderr and exiting. - try { - // We need to use `dynamicRequire` because `require` on it's own will be optimized by WebPack/Browserify. - var worker_threads = dynamicRequire(module, 'worker_threads'); - if (worker_threads.isMainThread === false) { - installHandler = false; - } - } catch(e) {} - - // Provide the option to not install the uncaught exception handler. This is - // to support other uncaught exception handlers (in test frameworks, for - // example). If this handler is not installed and there are no other uncaught - // exception handlers, uncaught exceptions will be caught by node's built-in - // exception handler and the process will still be terminated. However, the - // generated JavaScript code will be shown above the stack trace instead of - // the original source code. - if (installHandler && hasGlobalProcessEventEmitter()) { - uncaughtShimInstalled = true; - shimEmitUncaughtException(); - } - } -}; - -exports.resetRetrieveHandlers = function() { - retrieveFileHandlers.length = 0; - retrieveMapHandlers.length = 0; - - retrieveFileHandlers = originalRetrieveFileHandlers.slice(0); - retrieveMapHandlers = originalRetrieveMapHandlers.slice(0); - - retrieveSourceMap = handlerExec(retrieveMapHandlers); - retrieveFile = handlerExec(retrieveFileHandlers); -} diff --git a/node_modules/ava/node_modules/strip-ansi/index.d.ts b/node_modules/ava/node_modules/strip-ansi/index.d.ts new file mode 100644 index 0000000000..44e954d0c7 --- /dev/null +++ b/node_modules/ava/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,15 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi from 'strip-ansi'; + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +export default function stripAnsi(string: string): string; diff --git a/node_modules/ava/node_modules/strip-ansi/index.js b/node_modules/ava/node_modules/strip-ansi/index.js new file mode 100644 index 0000000000..ef3c095f5f --- /dev/null +++ b/node_modules/ava/node_modules/strip-ansi/index.js @@ -0,0 +1,9 @@ +import ansiRegex from 'ansi-regex'; + +export default function stripAnsi(string) { + if (typeof string !== 'string') { + throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); + } + + return string.replace(ansiRegex(), ''); +} diff --git a/node_modules/ava/node_modules/has-flag/license b/node_modules/ava/node_modules/strip-ansi/license similarity index 92% rename from node_modules/ava/node_modules/has-flag/license rename to node_modules/ava/node_modules/strip-ansi/license index e7af2f7710..fa7ceba3eb 100644 --- a/node_modules/ava/node_modules/has-flag/license +++ b/node_modules/ava/node_modules/strip-ansi/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/node_modules/ava/node_modules/strip-ansi/package.json b/node_modules/ava/node_modules/strip-ansi/package.json new file mode 100644 index 0000000000..c5c1bc4f33 --- /dev/null +++ b/node_modules/ava/node_modules/strip-ansi/package.json @@ -0,0 +1,57 @@ +{ + "name": "strip-ansi", + "version": "7.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "funding": "https://github.com/chalk/strip-ansi?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.17.0", + "xo": "^0.44.0" + } +} \ No newline at end of file diff --git a/node_modules/ava/node_modules/strip-ansi/readme.md b/node_modules/ava/node_modules/strip-ansi/readme.md new file mode 100644 index 0000000000..562785107b --- /dev/null +++ b/node_modules/ava/node_modules/strip-ansi/readme.md @@ -0,0 +1,41 @@ +# strip-ansi + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + +## Install + +``` +$ npm install strip-ansi +``` + +## Usage + +```js +import stripAnsi from 'strip-ansi'; + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + +## strip-ansi for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + diff --git a/node_modules/ava/node_modules/supports-color/browser.js b/node_modules/ava/node_modules/supports-color/browser.js deleted file mode 100644 index 62afa3a742..0000000000 --- a/node_modules/ava/node_modules/supports-color/browser.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; -module.exports = { - stdout: false, - stderr: false -}; diff --git a/node_modules/ava/node_modules/supports-color/index.js b/node_modules/ava/node_modules/supports-color/index.js deleted file mode 100644 index 6fada390fb..0000000000 --- a/node_modules/ava/node_modules/supports-color/index.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict'; -const os = require('os'); -const tty = require('tty'); -const hasFlag = require('has-flag'); - -const {env} = process; - -let forceColor; -if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false') || - hasFlag('color=never')) { - forceColor = 0; -} else if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - forceColor = 1; -} - -if ('FORCE_COLOR' in env) { - if (env.FORCE_COLOR === 'true') { - forceColor = 1; - } else if (env.FORCE_COLOR === 'false') { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } -} - -function translateLevel(level) { - if (level === 0) { - return false; - } - - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} - -function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - - if (hasFlag('color=16m') || - hasFlag('color=full') || - hasFlag('color=truecolor')) { - return 3; - } - - if (hasFlag('color=256')) { - return 2; - } - - if (haveStream && !streamIsTTY && forceColor === undefined) { - return 0; - } - - const min = forceColor || 0; - - if (env.TERM === 'dumb') { - return min; - } - - if (process.platform === 'win32') { - // Windows 10 build 10586 is the first Windows release that supports 256 colors. - // Windows 10 build 14931 is the first release that supports 16m/TrueColor. - const osRelease = os.release().split('.'); - if ( - Number(osRelease[0]) >= 10 && - Number(osRelease[2]) >= 10586 - ) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - - return 1; - } - - if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { - return 1; - } - - return min; - } - - if ('TEAMCITY_VERSION' in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - - if (env.COLORTERM === 'truecolor') { - return 3; - } - - if ('TERM_PROGRAM' in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - - switch (env.TERM_PROGRAM) { - case 'iTerm.app': - return version >= 3 ? 3 : 2; - case 'Apple_Terminal': - return 2; - // No default - } - } - - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - - if ('COLORTERM' in env) { - return 1; - } - - return min; -} - -function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); -} - -module.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) -}; diff --git a/node_modules/ava/node_modules/supports-color/package.json b/node_modules/ava/node_modules/supports-color/package.json deleted file mode 100644 index 12d9e2923b..0000000000 --- a/node_modules/ava/node_modules/supports-color/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "supports-color", - "version": "7.2.0", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": "chalk/supports-color", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "browser.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "dependencies": { - "has-flag": "^4.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "import-fresh": "^3.0.0", - "xo": "^0.24.0" - }, - "browser": "browser.js" -} \ No newline at end of file diff --git a/node_modules/ava/node_modules/supports-color/readme.md b/node_modules/ava/node_modules/supports-color/readme.md deleted file mode 100644 index 3654228586..0000000000 --- a/node_modules/ava/node_modules/supports-color/readme.md +++ /dev/null @@ -1,76 +0,0 @@ -# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) - -> Detect whether a terminal supports color - - -## Install - -``` -$ npm install supports-color -``` - - -## Usage - -```js -const supportsColor = require('supports-color'); - -if (supportsColor.stdout) { - console.log('Terminal stdout supports color'); -} - -if (supportsColor.stdout.has256) { - console.log('Terminal stdout supports 256 colors'); -} - -if (supportsColor.stderr.has16m) { - console.log('Terminal stderr supports 16 million colors (truecolor)'); -} -``` - - -## API - -Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. - -The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: - -- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) -- `.level = 2` and `.has256 = true`: 256 color support -- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) - - -## Info - -It obeys the `--color` and `--no-color` CLI flags. - -For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. - -Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. - - -## Related - -- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- diff --git a/node_modules/ava/package.json b/node_modules/ava/package.json index 554da74581..6124938119 100644 --- a/node_modules/ava/package.json +++ b/node_modules/ava/package.json @@ -1,24 +1,38 @@ { "name": "ava", - "version": "3.15.0", + "version": "4.0.1", "description": "Node.js test runner that lets you develop with confidence.", "license": "MIT", "repository": "avajs/ava", "homepage": "https://avajs.dev", - "bin": "cli.js", + "bin": { + "ava": "entrypoints/cli.mjs" + }, + "exports": { + ".": { + "import": "./entrypoints/main.mjs", + "require": "./entrypoints/main.cjs" + }, + "./eslint-plugin-helper": "./entrypoints/eslint-plugin-helper.cjs", + "./plugin": { + "import": "./entrypoints/plugin.mjs", + "require": "./entrypoints/plugin.cjs" + } + }, + "type": "module", "engines": { - "node": ">=10.18.0 <11 || >=12.14.0 <12.17.0 || >=12.17.0 <13 || >=14.0.0 <15 || >=15" + "node": ">=12.22 <13 || >=14.17 <15 || >=16.4 <17 || >=17" }, "scripts": { - "cover": "c8 --report=none tap && c8 --report=none --no-clean test-ava && c8 report", + "cover": "c8 --report=none test-ava && c8 --report=none --no-clean tap && c8 report", "test": "xo && tsd && npm run -s cover" }, "files": [ + "entrypoints", "lib", - "*.js", - "!*.config.js", + "types", "index.d.ts", - "*.d.ts" + "plugin.d.ts" ], "keywords": [ "🦄", @@ -38,7 +52,6 @@ "tap", "qunit", "jasmine", - "babel", "assert", "assertion", "promise", @@ -57,89 +70,79 @@ "typescript" ], "dependencies": { - "@concordance/react": "^2.0.0", - "acorn": "^8.0.4", - "acorn-walk": "^8.0.0", - "ansi-styles": "^5.0.0", + "acorn": "^8.7.0", + "acorn-walk": "^8.2.0", + "ansi-styles": "^6.1.0", "arrgv": "^1.0.2", - "arrify": "^2.0.1", - "callsites": "^3.1.0", - "chalk": "^4.1.0", - "chokidar": "^3.4.3", + "arrify": "^3.0.0", + "callsites": "^4.0.0", + "cbor": "^8.1.0", + "chalk": "^5.0.0", + "chokidar": "^3.5.2", "chunkd": "^2.0.1", - "ci-info": "^2.0.0", + "ci-info": "^3.3.0", "ci-parallel-vars": "^1.0.1", "clean-yaml-object": "^0.1.0", - "cli-cursor": "^3.1.0", - "cli-truncate": "^2.1.0", + "cli-truncate": "^3.1.0", "code-excerpt": "^3.0.0", "common-path-prefix": "^3.0.0", - "concordance": "^5.0.1", - "convert-source-map": "^1.7.0", + "concordance": "^5.0.4", "currently-unhandled": "^0.4.1", - "debug": "^4.3.1", + "debug": "^4.3.3", "del": "^6.0.0", - "emittery": "^0.8.0", - "equal-length": "^1.0.0", - "figures": "^3.2.0", - "globby": "^11.0.1", + "emittery": "^0.10.0", + "figures": "^4.0.0", + "globby": "^12.0.2", "ignore-by-default": "^2.0.0", - "import-local": "^3.0.2", - "indent-string": "^4.0.0", + "indent-string": "^5.0.0", "is-error": "^2.2.2", "is-plain-object": "^5.0.0", "is-promise": "^4.0.0", - "lodash": "^4.17.20", - "matcher": "^3.0.0", - "md5-hex": "^3.0.1", - "mem": "^8.0.0", + "matcher": "^5.0.0", + "mem": "^9.0.1", "ms": "^2.1.3", - "ora": "^5.2.0", - "p-event": "^4.2.0", - "p-map": "^4.0.0", - "picomatch": "^2.2.2", - "pkg-conf": "^3.1.0", - "plur": "^4.0.0", + "p-event": "^5.0.1", + "p-map": "^5.3.0", + "picomatch": "^2.3.0", + "pkg-conf": "^4.0.0", + "plur": "^5.1.0", "pretty-ms": "^7.0.1", - "read-pkg": "^5.2.0", "resolve-cwd": "^3.0.0", "slash": "^3.0.0", - "source-map-support": "^0.5.19", - "stack-utils": "^2.0.3", - "strip-ansi": "^6.0.0", + "stack-utils": "^2.0.5", + "strip-ansi": "^7.0.1", "supertap": "^2.0.0", "temp-dir": "^2.0.0", - "trim-off-newlines": "^1.0.1", - "update-notifier": "^5.0.1", "write-file-atomic": "^3.0.3", - "yargs": "^16.2.0" + "yargs": "^17.3.1" }, "devDependencies": { - "@ava/babel": "^1.0.1", "@ava/test": "github:avajs/test", - "@babel/plugin-proposal-do-expressions": "^7.12.1", - "@sinonjs/fake-timers": "^6.0.1", - "ansi-escapes": "^4.3.1", - "c8": "^7.4.0", - "delay": "^4.4.0", - "esm": "^3.2.25", - "execa": "^5.0.0", - "fs-extra": "^9.0.1", - "get-stream": "^6.0.0", - "it-first": "^1.0.4", - "proxyquire": "^2.1.3", - "react": "^16.14.0", - "react-test-renderer": "^16.14.0", - "replace-string": "^3.1.0", - "sinon": "^9.2.2", - "source-map-fixtures": "^2.1.0", - "tap": "^14.11.0", - "temp-write": "^4.0.0", - "tempy": "^1.0.0", + "@ava/typescript": "^3.0.1", + "@sinonjs/fake-timers": "^8.1.0", + "ansi-escapes": "^5.0.0", + "c8": "^7.11.0", + "delay": "^5.0.0", + "execa": "^6.0.0", + "fs-extra": "^10.0.0", + "get-stream": "^6.0.1", + "replace-string": "^4.0.0", + "sinon": "^12.0.1", + "tap": "^15.1.5", + "temp-write": "^5.0.0", + "tempy": "^2.0.0", "touch": "^3.1.0", - "tsd": "^0.14.0", - "typescript": "^4.1.3", - "xo": "^0.36.1", + "tsd": "^0.19.1", + "typescript": "^4.4.4", + "xo": "^0.47.0", "zen-observable": "^0.8.15" + }, + "peerDependencies": { + "@ava/typescript": "*" + }, + "peerDependenciesMeta": { + "@ava/typescript": { + "optional": true + } } } \ No newline at end of file diff --git a/node_modules/ava/plugin.d.ts b/node_modules/ava/plugin.d.ts index 522bf35c8d..11b2274aac 100644 --- a/node_modules/ava/plugin.d.ts +++ b/node_modules/ava/plugin.d.ts @@ -1,79 +1,77 @@ +import {URL} from 'node:url'; + export namespace SharedWorker { - export type ProtocolIdentifier = 'experimental'; + export type ProtocolIdentifier = 'ava-4'; export type FactoryOptions = { - negotiateProtocol (supported: readonly ['experimental']): Experimental.Protocol; + negotiateProtocol (supported: readonly ['ava-4']): Protocol; // Add overloads for additional protocols. }; export type Factory = (options: FactoryOptions) => void; - export namespace Experimental { - export type Protocol = { - readonly initialData: Data; - readonly protocol: 'experimental'; - broadcast: (data: Data) => BroadcastMessage; - ready: () => Protocol; - subscribe: () => AsyncIterableIterator>; - testWorkers: () => AsyncIterableIterator>; - }; + export type Protocol = { + readonly initialData: Data; + readonly protocol: 'ava-4'; + broadcast: (data: Data) => BroadcastMessage; + ready: () => Protocol; + subscribe: () => AsyncIterableIterator>; + testWorkers: () => AsyncIterableIterator>; + }; - export type BroadcastMessage = { - readonly id: string; - replies: () => AsyncIterableIterator>; - }; + export type BroadcastMessage = { + readonly id: string; + replies: () => AsyncIterableIterator>; + }; - export type PublishedMessage = { - readonly id: string; - replies: () => AsyncIterableIterator>; - }; + export type PublishedMessage = { + readonly id: string; + replies: () => AsyncIterableIterator>; + }; - export type ReceivedMessage = { - readonly data: Data; - readonly id: string; - readonly testWorker: TestWorker; - reply: (data: Data) => PublishedMessage; - }; + export type ReceivedMessage = { + readonly data: Data; + readonly id: string; + readonly testWorker: TestWorker; + reply: (data: Data) => PublishedMessage; + }; - export type TestWorker = { - readonly id: string; - readonly file: string; - publish: (data: Data) => PublishedMessage; - subscribe: () => AsyncIterableIterator>; - teardown: void> (fn: TeardownFn) => TeardownFn; - }; - } + export type TestWorker = { + readonly id: string; + readonly file: string; + publish: (data: Data) => PublishedMessage; + subscribe: () => AsyncIterableIterator>; + teardown: void> (fn: TeardownFn) => TeardownFn; + }; export namespace Plugin { export type RegistrationOptions = { - readonly filename: string; + readonly filename: string | URL; readonly initialData?: Data; readonly supportedProtocols: readonly Identifier[]; readonly teardown?: () => void; }; - export namespace Experimental { - export type Protocol = { - readonly available: Promise; - readonly currentlyAvailable: boolean; - readonly protocol: 'experimental'; - publish: (data: Data) => PublishedMessage; - subscribe: () => AsyncIterableIterator>; - }; + export type Protocol = { + readonly available: Promise; + readonly currentlyAvailable: boolean; + readonly protocol: 'ava-4'; + publish: (data: Data) => PublishedMessage; + subscribe: () => AsyncIterableIterator>; + }; - export type PublishedMessage = { - readonly id: string; - replies: () => AsyncIterableIterator>; - }; + export type PublishedMessage = { + readonly id: string; + replies: () => AsyncIterableIterator>; + }; - export type ReceivedMessage = { - readonly data: Data; - readonly id: string; - reply: (data: Data) => PublishedMessage; - }; - } + export type ReceivedMessage = { + readonly data: Data; + readonly id: string; + reply: (data: Data) => PublishedMessage; + }; } } -export function registerSharedWorker(options: SharedWorker.Plugin.RegistrationOptions<'experimental', Data>): SharedWorker.Plugin.Experimental.Protocol; +export function registerSharedWorker(options: SharedWorker.Plugin.RegistrationOptions<'ava-4', Data>): SharedWorker.Plugin.Protocol; // Add overloads for additional protocols. diff --git a/node_modules/ava/plugin.js b/node_modules/ava/plugin.js deleted file mode 100644 index f8f4c10493..0000000000 --- a/node_modules/ava/plugin.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -const path = require('path'); - -// Ensure the same AVA install is loaded by the test file as by the test worker -if (process.env.AVA_PATH && process.env.AVA_PATH !== __dirname) { - module.exports = require(path.join(process.env.AVA_PATH, 'plugin')); -} else { - module.exports = require('./lib/worker/plugin'); -} diff --git a/node_modules/ava/readme.md b/node_modules/ava/readme.md index e2a8f75d2b..682315ce04 100644 --- a/node_modules/ava/readme.md +++ b/node_modules/ava/readme.md @@ -6,7 +6,7 @@ Follow the [AVA Twitter account](https://twitter.com/ava__js) for updates. Read our [contributing guide](.github/CONTRIBUTING.md) if you're looking to contribute (issues / PRs / etc). -![](media/mini-reporter.gif) +![](media/verbose-reporter.png) Translations: [Español](https://github.com/avajs/ava-docs/blob/master/es_ES/readme.md), [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/readme.md), [Italiano](https://github.com/avajs/ava-docs/blob/master/it_IT/readme.md), [日本語](https://github.com/avajs/ava-docs/blob/master/ja_JP/readme.md), [한국어](https://github.com/avajs/ava-docs/blob/master/ko_KR/readme.md), [Português](https://github.com/avajs/ava-docs/blob/master/pt_BR/readme.md), [Русский](https://github.com/avajs/ava-docs/blob/master/ru_RU/readme.md), [简体中文](https://github.com/avajs/ava-docs/blob/master/zh_CN/readme.md) @@ -22,7 +22,6 @@ Translations: [Español](https://github.com/avajs/ava-docs/blob/master/es_ES/rea - Includes TypeScript definitions - [Magic assert](#magic-assert) - [Isolated environment for each test file](./docs/01-writing-tests.md#process-isolation) -- [Write your tests using the latest JavaScript syntax](https://github.com/avajs/babel) - [Promise support](./docs/01-writing-tests.md#promise-support) - [Async function support](./docs/01-writing-tests.md#async-function-support) - [Observable support](./docs/01-writing-tests.md#observable-support) @@ -148,11 +147,7 @@ We have a growing list of [common pitfalls](docs/08-common-pitfalls.md) you may - [When to use `t.plan()`](docs/recipes/when-to-use-plan.md) - [Browser testing](docs/recipes/browser-testing.md) - [TypeScript](docs/recipes/typescript.md) -- [Flow](docs/recipes/flow.md) -- [Configuring Babel](https://github.com/avajs/babel) -- [Using ES modules](docs/recipes/es-modules.md) - [Passing arguments to your test files](docs/recipes/passing-arguments-to-your-test-files.md) -- [Testing React components](docs/recipes/react.md) - [Testing Vue.js components](docs/recipes/vue.md) - [Debugging tests with Chrome DevTools](docs/recipes/debugging-with-chrome-devtools.md) - [Debugging tests with VSCode](docs/recipes/debugging-with-vscode.md) @@ -189,13 +184,10 @@ It's the [Andromeda galaxy](https://simple.wikipedia.org/wiki/Andromeda_galaxy). ## Related -- [eslint-plugin-ava](https://github.com/avajs/eslint-plugin-ava) - Lint rules for AVA tests -- [sublime-ava](https://github.com/avajs/sublime-ava) - Snippets for AVA tests -- [atom-ava](https://github.com/avajs/atom-ava) - Snippets for AVA tests -- [vscode-ava](https://github.com/samverschueren/vscode-ava) - Snippets for AVA tests -- [gulp-ava](https://github.com/avajs/gulp-ava) - Run tests with gulp -- [grunt-ava](https://github.com/avajs/grunt-ava) - Run tests with grunt -- [More…](https://github.com/avajs/awesome-ava#packages) +- [eslint-plugin-ava](https://github.com/avajs/eslint-plugin-ava) — Lint rules for AVA tests +- [@ava/typescript](https://github.com/avajs/typescript) — Test TypeScript projects +- [@ava/cooperate](https://github.com/avajs/cooperate) — Low-level primitives to enable cooperation between test files +- [@ava/get-port](https://github.com/avajs/get-port) — Reserve a port while testing ## Links diff --git a/node_modules/ava/types/assertions.d.ts b/node_modules/ava/types/assertions.d.ts new file mode 100644 index 0000000000..657ed3d486 --- /dev/null +++ b/node_modules/ava/types/assertions.d.ts @@ -0,0 +1,327 @@ +export type ErrorConstructor = new (...args: any[]) => Error; + +/** Specify one or more expectations the thrown error must satisfy. */ +export type ThrowsExpectation = { + /** The thrown error must have a code that equals the given string or number. */ + code?: string | number; + + /** The thrown error must be an instance of this constructor. */ + instanceOf?: ErrorConstructor; + + /** The thrown error must be strictly equal to this value. */ + is?: Error; + + /** The thrown error must have a message that equals the given string, or matches the regular expression. */ + message?: string | RegExp; + + /** The thrown error must have a name that equals the given string. */ + name?: string; +}; + +export interface Assertions { + /** + * Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), returning a boolean + * indicating whether the assertion passed. + */ + assert: AssertAssertion; + + /** + * Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to + * `expected`, returning a boolean indicating whether the assertion passed. + */ + deepEqual: DeepEqualAssertion; + + /** + * Assert that `value` is like `selector`, returning a boolean indicating whether the assertion passed. + */ + like: LikeAssertion; + + /** Fail the test, always returning `false`. */ + fail: FailAssertion; + + /** + * Assert that `actual` is strictly false, returning a boolean indicating whether the assertion passed. + */ + false: FalseAssertion; + + /** + * Assert that `actual` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy), returning a boolean + * indicating whether the assertion passed. + */ + falsy: FalsyAssertion; + + /** + * Assert that `actual` is [the same + * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`, + * returning a boolean indicating whether the assertion passed. + */ + is: IsAssertion; + + /** + * Assert that `actual` is not [the same + * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`, + * returning a boolean indicating whether the assertion passed. + */ + not: NotAssertion; + + /** + * Assert that `actual` is not [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to + * `expected`, returning a boolean indicating whether the assertion passed. + */ + notDeepEqual: NotDeepEqualAssertion; + + /** + * Assert that `string` does not match the regular expression, returning a boolean indicating whether the assertion + * passed. + */ + notRegex: NotRegexAssertion; + + /** Assert that the function does not throw. */ + notThrows: NotThrowsAssertion; + + /** Assert that the async function does not throw, or that the promise does not reject. Must be awaited. */ + notThrowsAsync: NotThrowsAsyncAssertion; + + /** Count a passing assertion, always returning `true`. */ + pass: PassAssertion; + + /** + * Assert that `string` matches the regular expression, returning a boolean indicating whether the assertion passed. + */ + regex: RegexAssertion; + + /** + * Assert that `expected` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to a + * previously recorded [snapshot](https://github.com/concordancejs/concordance#serialization-details), or if + * necessary record a new snapshot. + */ + snapshot: SnapshotAssertion; + + /** + * Assert that the function throws [an error](https://www.npmjs.com/package/is-error). If so, returns the error value. + */ + throws: ThrowsAssertion; + + /** + * Assert that the async function throws [an error](https://www.npmjs.com/package/is-error), or the promise rejects + * with one. If so, returns a promise for the error value, which must be awaited. + */ + throwsAsync: ThrowsAsyncAssertion; + + /** + * Assert that `actual` is strictly true, returning a boolean indicating whether the assertion passed. + */ + true: TrueAssertion; + + /** + * Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), returning a boolean + * indicating whether the assertion passed. + */ + truthy: TruthyAssertion; +} + +export interface AssertAssertion { + /** + * Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), returning a boolean + * indicating whether the assertion passed. + */ + (actual: any, message?: string): boolean; + + /** Skip this assertion. */ + skip(actual: any, message?: string): void; +} + +export interface DeepEqualAssertion { + /** + * Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to + * `expected`, returning a boolean indicating whether the assertion passed. + */ + (actual: Actual, expected: Expected, message?: string): actual is Expected; + + /** Skip this assertion. */ + skip(actual: any, expected: any, message?: string): void; +} + +export interface LikeAssertion { + /** + * Assert that `value` is like `selector`, returning a boolean indicating whether the assertion passed. + */ + >(value: any, selector: Expected, message?: string): value is Expected; + + /** Skip this assertion. */ + skip(value: any, selector: any, message?: string): void; +} + +export interface FailAssertion { + /** Fail the test, always returning `false`. */ + (message?: string): boolean; + + /** Skip this assertion. */ + skip(message?: string): void; +} + +export interface FalseAssertion { + /** + * Assert that `actual` is strictly false, returning a boolean indicating whether the assertion passed. + */ + (actual: any, message?: string): actual is false; + + /** Skip this assertion. */ + skip(actual: any, message?: string): void; +} + +export interface FalsyAssertion { + /** + * Assert that `actual` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy), returning a boolean + * indicating whether the assertion passed. + */ + (actual: any, message?: string): boolean; + + /** Skip this assertion. */ + skip(actual: any, message?: string): void; +} + +export interface IsAssertion { + /** + * Assert that `actual` is [the same + * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`, + * returning a boolean indicating whether the assertion passed. + */ + (actual: Actual, expected: Expected, message?: string): actual is Expected; + + /** Skip this assertion. */ + skip(actual: any, expected: any, message?: string): void; +} + +export interface NotAssertion { + /** + * Assert that `actual` is not [the same + * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`, + * returning a boolean indicating whether the assertion passed. + */ + (actual: Actual, expected: Expected, message?: string): boolean; + + /** Skip this assertion. */ + skip(actual: any, expected: any, message?: string): void; +} + +export interface NotDeepEqualAssertion { + /** + * Assert that `actual` is not [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to + * `expected`, returning a boolean indicating whether the assertion passed. + */ + (actual: Actual, expected: Expected, message?: string): boolean; + + /** Skip this assertion. */ + skip(actual: any, expected: any, message?: string): void; +} + +export interface NotRegexAssertion { + /** + * Assert that `string` does not match the regular expression, returning a boolean indicating whether the assertion + * passed. + */ + (string: string, regex: RegExp, message?: string): boolean; + + /** Skip this assertion. */ + skip(string: string, regex: RegExp, message?: string): void; +} + +export interface NotThrowsAssertion { + /** Assert that the function does not throw. */ + (fn: () => any, message?: string): void; + + /** Skip this assertion. */ + skip(fn: () => any, message?: string): void; +} + +export interface NotThrowsAsyncAssertion { + /** Assert that the async function does not throw. You must await the result. */ + (fn: () => PromiseLike, message?: string): Promise; + + /** Assert that the promise does not reject. You must await the result. */ + (promise: PromiseLike, message?: string): Promise; // eslint-disable-line @typescript-eslint/unified-signatures + + /** Skip this assertion. */ + skip(nonThrower: any, message?: string): void; +} + +export interface PassAssertion { + /** Count a passing assertion, always returning `true`. */ + (message?: string): boolean; + + /** Skip this assertion. */ + skip(message?: string): void; +} + +export interface RegexAssertion { + /** + * Assert that `string` matches the regular expression, returning a boolean indicating whether the assertion passed. + */ + (string: string, regex: RegExp, message?: string): boolean; + + /** Skip this assertion. */ + skip(string: string, regex: RegExp, message?: string): void; +} + +export interface SnapshotAssertion { + /** + * Assert that `expected` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to a + * previously recorded [snapshot](https://github.com/concordancejs/concordance#serialization-details), or if + * necessary record a new snapshot. + */ + (expected: any, message?: string): void; + + /** Skip this assertion. */ + skip(expected: any, message?: string): void; +} + +export interface ThrowsAssertion { + /** + * Assert that the function throws [an error](https://www.npmjs.com/package/is-error). If so, returns the error value. + * The error must satisfy all expectations. Returns undefined when the assertion fails. + */ + (fn: () => any, expectations?: ThrowsExpectation, message?: string): ThrownError | undefined; + + /** Skip this assertion. */ + skip(fn: () => any, expectations?: any, message?: string): void; +} + +export interface ThrowsAsyncAssertion { + /** + * Assert that the async function throws [an error](https://www.npmjs.com/package/is-error). If so, returns the error + * value. Returns undefined when the assertion fails. You must await the result. The error must satisfy all expectations. + */ + (fn: () => PromiseLike, expectations?: ThrowsExpectation, message?: string): Promise; + + /** + * Assert that the promise rejects with [an error](https://www.npmjs.com/package/is-error). If so, returns the + * rejection reason. Returns undefined when the assertion fails. You must await the result. The error must satisfy all + * expectations. + */ + (promise: PromiseLike, expectations?: ThrowsExpectation, message?: string): Promise; // eslint-disable-line @typescript-eslint/unified-signatures + + /** Skip this assertion. */ + skip(thrower: any, expectations?: any, message?: string): void; +} + +export interface TrueAssertion { + /** + * Assert that `actual` is strictly true, returning a boolean indicating whether the assertion passed. + */ + (actual: any, message?: string): actual is true; + + /** Skip this assertion. */ + skip(actual: any, message?: string): void; +} + +export interface TruthyAssertion { + /** + * Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), returning a boolean + * indicating whether the assertion passed. + */ + (actual: any, message?: string): boolean; + + /** Skip this assertion. */ + skip(actual: any, message?: string): void; +} diff --git a/node_modules/ava/types/subscribable.ts b/node_modules/ava/types/subscribable.ts new file mode 100644 index 0000000000..3a3399bca1 --- /dev/null +++ b/node_modules/ava/types/subscribable.ts @@ -0,0 +1,6 @@ +export interface Subscribable { + subscribe(observer: { + error(error: any): void; + complete(): void; + }): void; +} diff --git a/node_modules/ava/types/test-fn.d.ts b/node_modules/ava/types/test-fn.d.ts new file mode 100644 index 0000000000..bcb9778ab9 --- /dev/null +++ b/node_modules/ava/types/test-fn.d.ts @@ -0,0 +1,231 @@ +import type {Assertions} from './assertions'; +import type {Subscribable} from './subscribable'; +import type {TryFn} from './try-fn'; + +/** The `t` value passed to test & hook implementations. */ +export interface ExecutionContext extends Assertions { + /** Test context, shared with hooks. */ + context: Context; + + /** Title of the test or hook. */ + readonly title: string; + + /** Whether the test has passed. Only accurate in afterEach hooks. */ + readonly passed: boolean; + + readonly log: LogFn; + readonly plan: PlanFn; + readonly teardown: TeardownFn; + readonly timeout: TimeoutFn; + readonly try: TryFn; +} + +export interface LogFn { + /** Log one or more values. */ + (...values: any[]): void; + + /** Skip logging. */ + skip(...values: any[]): void; +} + +export interface PlanFn { + /** + * Plan how many assertion there are in the test. The test will fail if the actual assertion count doesn't match the + * number of planned assertions. See [assertion planning](https://github.com/avajs/ava#assertion-planning). + */ + (count: number): void; + + /** Don't plan assertions. */ + skip(count: number): void; +} + +/** + * Set a timeout for the test, in milliseconds. The test will fail if the timeout is exceeded. + * The timeout is reset each time an assertion is made. + */ +export type TimeoutFn = (ms: number, message?: string) => void; + +/** Declare a function to be run after the test has ended. */ +export type TeardownFn = (fn: () => void) => void; + +export type ImplementationFn = + ((t: ExecutionContext, ...args: Args) => PromiseLike) | + ((t: ExecutionContext, ...args: Args) => Subscribable) | + ((t: ExecutionContext, ...args: Args) => void); + +export type TitleFn = (providedTitle: string | undefined, ...args: Args) => string; + +/** A reusable test or hook implementation. */ +export type Macro = { + /** The function that is executed when the macro is used. */ + readonly exec: ImplementationFn; + + /** Generates a test title when this macro is used. */ + readonly title?: TitleFn; +}; + +/** A test or hook implementation. */ +export type Implementation = ImplementationFn | Macro; + +export interface TestFn { + /** Declare a concurrent test. Additional arguments are passed to the implementation or macro. */ + (title: string, implementation: Implementation, ...args: Args): void; + + /** + * Declare a concurrent test that uses a macro. Additional arguments are passed to the macro. + * The macro is responsible for generating a unique test title. + */ + (macro: Macro, ...args: Args): void; + + after: AfterFn; + afterEach: AfterFn; + before: BeforeFn; + beforeEach: BeforeFn; + failing: FailingFn; + macro: MacroFn; + meta: Meta; + only: OnlyFn; + serial: SerialFn; + skip: SkipFn; + todo: TodoFn; +} + +export interface AfterFn { + /** + * Declare a hook that is run once, after all tests have passed. + * Additional arguments are passed to the implementation or macro. + */ + (title: string, implementation: Implementation, ...args: Args): void; + + /** + * Declare a hook that is run once, after all tests have passed. + * Additional arguments are passed to the implementation or macro. + */ + (implementation: Implementation, ...args: Args): void; + + always: AlwaysInterface; + skip: HookSkipFn; +} + +export interface AlwaysInterface { + /** + * Declare a hook that is run once, after all tests are done. + * Additional arguments are passed to the implementation or macro. + */ + (title: string, implementation: Implementation, ...args: Args): void; + + /** + * Declare a hook that is run once, after all tests are done. + * Additional arguments are passed to the implementation or macro. + */ + (implementation: Implementation, ...args: Args): void; + + skip: HookSkipFn; +} + +export interface BeforeFn { + /** + * Declare a hook that is run once, before all tests. + * Additional arguments are passed to the implementation or macro. + */ + (title: string, implementation: Implementation, ...args: Args): void; + + /** + * Declare a hook that is run once, before all tests. + * Additional arguments are passed to the implementation or macro. + */ + (implementation: Implementation, ...args: Args): void; + + skip: HookSkipFn; +} + +export interface FailingFn { + /** + * Declare a concurrent test that is expected to fail. + * Additional arguments are passed to the implementation or macro. + */ + (title: string, implementation: Implementation, ...args: Args): void; + + /** + * Declare a concurrent test, using a macro, that is expected to fail. + * Additional arguments are passed to the macro. The macro is responsible for generating a unique test title. + */ + (macro: Macro, ...args: Args): void; + + only: OnlyFn; + skip: SkipFn; +} + +export interface HookSkipFn { + /** Skip this hook. */ + (title: string, implementation: Implementation, ...args: Args): void; + + /** Skip this hook. */ + (implementation: Implementation, ...args: Args): void; +} + +export interface OnlyFn { + /** + * Declare a test. Only this test and others declared with `.only()` are run. + * Additional arguments are passed to the implementation or macro. + */ + (title: string, implementation: Implementation, ...args: Args): void; + + /** + * Declare a test that uses a macro. Only this test and others declared with `.only()` are run. + * Additional arguments are passed to the macro. The macro is responsible for generating a unique test title. + */ + (macro: Macro, ...args: Args): void; +} + +export interface SerialFn { + /** Declare a serial test. Additional arguments are passed to the implementation or macro. */ + (title: string, implementation: Implementation, ...args: Args): void; + + /** + * Declare a serial test that uses a macro. The macro is responsible for generating a unique test title. + */ + (macro: Macro, ...args: Args): void; + + after: AfterFn; + afterEach: AfterFn; + before: BeforeFn; + beforeEach: BeforeFn; + failing: FailingFn; + only: OnlyFn; + skip: SkipFn; + todo: TodoFn; +} + +export interface SkipFn { + /** Skip this test. */ + (title: string, implementation: Implementation, ...args: Args): void; + + /** Skip this test. */ + (macro: Macro, ...args: Args): void; +} + +/** Declare a test that should be implemented later. */ +export type TodoFn = (title: string) => void; + +export type MacroDeclarationOptions = { + /** The function that is executed when the macro is used. */ + exec: ImplementationFn; + + /** The function responsible for generating a unique title when the macro is used. */ + title: TitleFn; +}; + +export interface MacroFn { + /** Declare a reusable test implementation. */ + (/** The function that is executed when the macro is used. */ exec: ImplementationFn): Macro; + (declaration: MacroDeclarationOptions): Macro; // eslint-disable-line @typescript-eslint/unified-signatures +} + +export interface Meta { + /** Path to the test file being executed. */ + file: string; + + /** Directory where snapshots are stored. */ + snapshotDirectory: string; +} diff --git a/node_modules/ava/types/try-fn.d.ts b/node_modules/ava/types/try-fn.d.ts new file mode 100644 index 0000000000..41a1664d51 --- /dev/null +++ b/node_modules/ava/types/try-fn.d.ts @@ -0,0 +1,58 @@ +import type {Implementation} from './test-fn'; + +export type CommitDiscardOptions = { + /** + * Whether the logs should be included in those of the parent test. + */ + retainLogs?: boolean; +}; + +export interface AssertionError extends Error {} + +export interface TryResult { + /** + * Title of the attempt, helping you tell attempts aparts. + */ + title: string; + + /** + * Indicates whether all assertions passed, or at least one failed. + */ + passed: boolean; + + /** + * Errors raised for each failed assertion. + */ + errors: AssertionError[]; + + /** + * Logs created during the attempt using `t.log()`. Contains formatted values. + */ + logs: string[]; + + /** + * Commit the attempt. Counts as one assertion for the plan count. If the + * attempt failed, calling this will also cause your test to fail. + */ + commit(options?: CommitDiscardOptions): void; + + /** + * Discard the attempt. + */ + discard(options?: CommitDiscardOptions): void; +} + +export interface TryFn { + /** + * Attempt to run some assertions. The result must be explicitly committed or discarded or else + * the test will fail. The title may help distinguish attempts from one another. + */ + (title: string, fn: Implementation, ...args: Args): Promise; + + /** + * Attempt to run some assertions. The result must be explicitly committed or discarded or else + * the test will fail. + */ + (fn: Implementation, ...args: Args): Promise; +} + diff --git a/node_modules/base64-js/LICENSE b/node_modules/base64-js/LICENSE deleted file mode 100644 index 6d52b8acfb..0000000000 --- a/node_modules/base64-js/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Jameson Little - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/base64-js/README.md b/node_modules/base64-js/README.md deleted file mode 100644 index b42a48f416..0000000000 --- a/node_modules/base64-js/README.md +++ /dev/null @@ -1,34 +0,0 @@ -base64-js -========= - -`base64-js` does basic base64 encoding/decoding in pure JS. - -[![build status](https://secure.travis-ci.org/beatgammit/base64-js.png)](http://travis-ci.org/beatgammit/base64-js) - -Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data. - -Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does. - -## install - -With [npm](https://npmjs.org) do: - -`npm install base64-js` and `var base64js = require('base64-js')` - -For use in web browsers do: - -`` - -[Get supported base64-js with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-base64-js?utm_source=npm-base64-js&utm_medium=referral&utm_campaign=readme) - -## methods - -`base64js` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument. - -* `byteLength` - Takes a base64 string and returns length of byte array -* `toByteArray` - Takes a base64 string and returns a byte array -* `fromByteArray` - Takes a byte array and returns a base64 string - -## license - -MIT diff --git a/node_modules/base64-js/base64js.min.js b/node_modules/base64-js/base64js.min.js deleted file mode 100644 index 908ac83fd1..0000000000 --- a/node_modules/base64-js/base64js.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.base64js=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c>16,j[k++]=255&b>>8,j[k++]=255&b;return 2===h&&(b=l[a.charCodeAt(c)]<<2|l[a.charCodeAt(c+1)]>>4,j[k++]=255&b),1===h&&(b=l[a.charCodeAt(c)]<<10|l[a.charCodeAt(c+1)]<<4|l[a.charCodeAt(c+2)]>>2,j[k++]=255&b>>8,j[k++]=255&b),j}function g(a){return k[63&a>>18]+k[63&a>>12]+k[63&a>>6]+k[63&a]}function h(a,b,c){for(var d,e=[],f=b;fj?j:g+f));return 1===d?(b=a[c-1],e.push(k[b>>2]+k[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(k[b>>10]+k[63&b>>4]+k[63&b<<2]+"=")),e.join("")}c.byteLength=function(a){var b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=f,c.fromByteArray=j;for(var k=[],l=[],m="undefined"==typeof Uint8Array?Array:Uint8Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,p=n.length;o 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('=') - if (validLen === -1) validLen = len - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4) - - return [validLen, placeHoldersLen] -} - -// base64 is 4/3 + up to two characters of the original data -function byteLength (b64) { - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function toByteArray (b64) { - var tmp - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - - var curByte = 0 - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen - - var i - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)] - arr[curByte++] = (tmp >> 16) & 0xFF - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ) - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1] - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ) - } - - return parts.join('') -} diff --git a/node_modules/base64-js/package.json b/node_modules/base64-js/package.json deleted file mode 100644 index eda0bad60d..0000000000 --- a/node_modules/base64-js/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "base64-js", - "description": "Base64 encoding/decoding in pure JS", - "version": "1.5.1", - "author": "T. Jameson Little ", - "typings": "index.d.ts", - "bugs": { - "url": "https://github.com/beatgammit/base64-js/issues" - }, - "devDependencies": { - "babel-minify": "^0.5.1", - "benchmark": "^2.1.4", - "browserify": "^16.3.0", - "standard": "*", - "tape": "4.x" - }, - "homepage": "https://github.com/beatgammit/base64-js", - "keywords": [ - "base64" - ], - "license": "MIT", - "main": "index.js", - "repository": { - "type": "git", - "url": "git://github.com/beatgammit/base64-js.git" - }, - "scripts": { - "build": "browserify -s base64js -r ./ | minify > base64js.min.js", - "lint": "standard", - "test": "npm run lint && npm run unit", - "unit": "tape test/*.js" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] -} \ No newline at end of file diff --git a/node_modules/bl/.travis.yml b/node_modules/bl/.travis.yml deleted file mode 100644 index 016eaf5562..0000000000 --- a/node_modules/bl/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -sudo: false -arch: - - amd64 - - ppc64le -language: node_js -node_js: - - '6' - - '8' - - '10' - - '12' - - '14' - - '15' - - lts/* -notifications: - email: - - rod@vagg.org - - matteo.collina@gmail.com diff --git a/node_modules/bl/BufferList.js b/node_modules/bl/BufferList.js deleted file mode 100644 index 471ee77889..0000000000 --- a/node_modules/bl/BufferList.js +++ /dev/null @@ -1,396 +0,0 @@ -'use strict' - -const { Buffer } = require('buffer') -const symbol = Symbol.for('BufferList') - -function BufferList (buf) { - if (!(this instanceof BufferList)) { - return new BufferList(buf) - } - - BufferList._init.call(this, buf) -} - -BufferList._init = function _init (buf) { - Object.defineProperty(this, symbol, { value: true }) - - this._bufs = [] - this.length = 0 - - if (buf) { - this.append(buf) - } -} - -BufferList.prototype._new = function _new (buf) { - return new BufferList(buf) -} - -BufferList.prototype._offset = function _offset (offset) { - if (offset === 0) { - return [0, 0] - } - - let tot = 0 - - for (let i = 0; i < this._bufs.length; i++) { - const _t = tot + this._bufs[i].length - if (offset < _t || i === this._bufs.length - 1) { - return [i, offset - tot] - } - tot = _t - } -} - -BufferList.prototype._reverseOffset = function (blOffset) { - const bufferId = blOffset[0] - let offset = blOffset[1] - - for (let i = 0; i < bufferId; i++) { - offset += this._bufs[i].length - } - - return offset -} - -BufferList.prototype.get = function get (index) { - if (index > this.length || index < 0) { - return undefined - } - - const offset = this._offset(index) - - return this._bufs[offset[0]][offset[1]] -} - -BufferList.prototype.slice = function slice (start, end) { - if (typeof start === 'number' && start < 0) { - start += this.length - } - - if (typeof end === 'number' && end < 0) { - end += this.length - } - - return this.copy(null, 0, start, end) -} - -BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { - if (typeof srcStart !== 'number' || srcStart < 0) { - srcStart = 0 - } - - if (typeof srcEnd !== 'number' || srcEnd > this.length) { - srcEnd = this.length - } - - if (srcStart >= this.length) { - return dst || Buffer.alloc(0) - } - - if (srcEnd <= 0) { - return dst || Buffer.alloc(0) - } - - const copy = !!dst - const off = this._offset(srcStart) - const len = srcEnd - srcStart - let bytes = len - let bufoff = (copy && dstStart) || 0 - let start = off[1] - - // copy/slice everything - if (srcStart === 0 && srcEnd === this.length) { - if (!copy) { - // slice, but full concat if multiple buffers - return this._bufs.length === 1 - ? this._bufs[0] - : Buffer.concat(this._bufs, this.length) - } - - // copy, need to copy individual buffers - for (let i = 0; i < this._bufs.length; i++) { - this._bufs[i].copy(dst, bufoff) - bufoff += this._bufs[i].length - } - - return dst - } - - // easy, cheap case where it's a subset of one of the buffers - if (bytes <= this._bufs[off[0]].length - start) { - return copy - ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) - : this._bufs[off[0]].slice(start, start + bytes) - } - - if (!copy) { - // a slice, we need something to copy in to - dst = Buffer.allocUnsafe(len) - } - - for (let i = off[0]; i < this._bufs.length; i++) { - const l = this._bufs[i].length - start - - if (bytes > l) { - this._bufs[i].copy(dst, bufoff, start) - bufoff += l - } else { - this._bufs[i].copy(dst, bufoff, start, start + bytes) - bufoff += l - break - } - - bytes -= l - - if (start) { - start = 0 - } - } - - // safeguard so that we don't return uninitialized memory - if (dst.length > bufoff) return dst.slice(0, bufoff) - - return dst -} - -BufferList.prototype.shallowSlice = function shallowSlice (start, end) { - start = start || 0 - end = typeof end !== 'number' ? this.length : end - - if (start < 0) { - start += this.length - } - - if (end < 0) { - end += this.length - } - - if (start === end) { - return this._new() - } - - const startOffset = this._offset(start) - const endOffset = this._offset(end) - const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) - - if (endOffset[1] === 0) { - buffers.pop() - } else { - buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]) - } - - if (startOffset[1] !== 0) { - buffers[0] = buffers[0].slice(startOffset[1]) - } - - return this._new(buffers) -} - -BufferList.prototype.toString = function toString (encoding, start, end) { - return this.slice(start, end).toString(encoding) -} - -BufferList.prototype.consume = function consume (bytes) { - // first, normalize the argument, in accordance with how Buffer does it - bytes = Math.trunc(bytes) - // do nothing if not a positive number - if (Number.isNaN(bytes) || bytes <= 0) return this - - while (this._bufs.length) { - if (bytes >= this._bufs[0].length) { - bytes -= this._bufs[0].length - this.length -= this._bufs[0].length - this._bufs.shift() - } else { - this._bufs[0] = this._bufs[0].slice(bytes) - this.length -= bytes - break - } - } - - return this -} - -BufferList.prototype.duplicate = function duplicate () { - const copy = this._new() - - for (let i = 0; i < this._bufs.length; i++) { - copy.append(this._bufs[i]) - } - - return copy -} - -BufferList.prototype.append = function append (buf) { - if (buf == null) { - return this - } - - if (buf.buffer) { - // append a view of the underlying ArrayBuffer - this._appendBuffer(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)) - } else if (Array.isArray(buf)) { - for (let i = 0; i < buf.length; i++) { - this.append(buf[i]) - } - } else if (this._isBufferList(buf)) { - // unwrap argument into individual BufferLists - for (let i = 0; i < buf._bufs.length; i++) { - this.append(buf._bufs[i]) - } - } else { - // coerce number arguments to strings, since Buffer(number) does - // uninitialized memory allocation - if (typeof buf === 'number') { - buf = buf.toString() - } - - this._appendBuffer(Buffer.from(buf)) - } - - return this -} - -BufferList.prototype._appendBuffer = function appendBuffer (buf) { - this._bufs.push(buf) - this.length += buf.length -} - -BufferList.prototype.indexOf = function (search, offset, encoding) { - if (encoding === undefined && typeof offset === 'string') { - encoding = offset - offset = undefined - } - - if (typeof search === 'function' || Array.isArray(search)) { - throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.') - } else if (typeof search === 'number') { - search = Buffer.from([search]) - } else if (typeof search === 'string') { - search = Buffer.from(search, encoding) - } else if (this._isBufferList(search)) { - search = search.slice() - } else if (Array.isArray(search.buffer)) { - search = Buffer.from(search.buffer, search.byteOffset, search.byteLength) - } else if (!Buffer.isBuffer(search)) { - search = Buffer.from(search) - } - - offset = Number(offset || 0) - - if (isNaN(offset)) { - offset = 0 - } - - if (offset < 0) { - offset = this.length + offset - } - - if (offset < 0) { - offset = 0 - } - - if (search.length === 0) { - return offset > this.length ? this.length : offset - } - - const blOffset = this._offset(offset) - let blIndex = blOffset[0] // index of which internal buffer we're working on - let buffOffset = blOffset[1] // offset of the internal buffer we're working on - - // scan over each buffer - for (; blIndex < this._bufs.length; blIndex++) { - const buff = this._bufs[blIndex] - - while (buffOffset < buff.length) { - const availableWindow = buff.length - buffOffset - - if (availableWindow >= search.length) { - const nativeSearchResult = buff.indexOf(search, buffOffset) - - if (nativeSearchResult !== -1) { - return this._reverseOffset([blIndex, nativeSearchResult]) - } - - buffOffset = buff.length - search.length + 1 // end of native search window - } else { - const revOffset = this._reverseOffset([blIndex, buffOffset]) - - if (this._match(revOffset, search)) { - return revOffset - } - - buffOffset++ - } - } - - buffOffset = 0 - } - - return -1 -} - -BufferList.prototype._match = function (offset, search) { - if (this.length - offset < search.length) { - return false - } - - for (let searchOffset = 0; searchOffset < search.length; searchOffset++) { - if (this.get(offset + searchOffset) !== search[searchOffset]) { - return false - } - } - return true -} - -;(function () { - const methods = { - readDoubleBE: 8, - readDoubleLE: 8, - readFloatBE: 4, - readFloatLE: 4, - readInt32BE: 4, - readInt32LE: 4, - readUInt32BE: 4, - readUInt32LE: 4, - readInt16BE: 2, - readInt16LE: 2, - readUInt16BE: 2, - readUInt16LE: 2, - readInt8: 1, - readUInt8: 1, - readIntBE: null, - readIntLE: null, - readUIntBE: null, - readUIntLE: null - } - - for (const m in methods) { - (function (m) { - if (methods[m] === null) { - BufferList.prototype[m] = function (offset, byteLength) { - return this.slice(offset, offset + byteLength)[m](0, byteLength) - } - } else { - BufferList.prototype[m] = function (offset = 0) { - return this.slice(offset, offset + methods[m])[m](0) - } - } - }(m)) - } -}()) - -// Used internally by the class and also as an indicator of this object being -// a `BufferList`. It's not possible to use `instanceof BufferList` in a browser -// environment because there could be multiple different copies of the -// BufferList class and some `BufferList`s might be `BufferList`s. -BufferList.prototype._isBufferList = function _isBufferList (b) { - return b instanceof BufferList || BufferList.isBufferList(b) -} - -BufferList.isBufferList = function isBufferList (b) { - return b != null && b[symbol] -} - -module.exports = BufferList diff --git a/node_modules/bl/LICENSE.md b/node_modules/bl/LICENSE.md deleted file mode 100644 index ecbe516374..0000000000 --- a/node_modules/bl/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -The MIT License (MIT) -===================== - -Copyright (c) 2013-2019 bl contributors ----------------------------------- - -*bl contributors listed at * - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/bl/README.md b/node_modules/bl/README.md deleted file mode 100644 index 9680b1dcb4..0000000000 --- a/node_modules/bl/README.md +++ /dev/null @@ -1,247 +0,0 @@ -# bl *(BufferList)* - -[![Build Status](https://api.travis-ci.com/rvagg/bl.svg?branch=master)](https://travis-ci.com/rvagg/bl/) - -**A Node.js Buffer list collector, reader and streamer thingy.** - -[![NPM](https://nodei.co/npm/bl.svg)](https://nodei.co/npm/bl/) - -**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them! - -The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently. - -```js -const { BufferList } = require('bl') - -const bl = new BufferList() -bl.append(Buffer.from('abcd')) -bl.append(Buffer.from('efg')) -bl.append('hi') // bl will also accept & convert Strings -bl.append(Buffer.from('j')) -bl.append(Buffer.from([ 0x3, 0x4 ])) - -console.log(bl.length) // 12 - -console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij' -console.log(bl.slice(3, 10).toString('ascii')) // 'defghij' -console.log(bl.slice(3, 6).toString('ascii')) // 'def' -console.log(bl.slice(3, 8).toString('ascii')) // 'defgh' -console.log(bl.slice(5, 10).toString('ascii')) // 'fghij' - -console.log(bl.indexOf('def')) // 3 -console.log(bl.indexOf('asdf')) // -1 - -// or just use toString! -console.log(bl.toString()) // 'abcdefghij\u0003\u0004' -console.log(bl.toString('ascii', 3, 8)) // 'defgh' -console.log(bl.toString('ascii', 5, 10)) // 'fghij' - -// other standard Buffer readables -console.log(bl.readUInt16BE(10)) // 0x0304 -console.log(bl.readUInt16LE(10)) // 0x0403 -``` - -Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**: - -```js -const { BufferListStream } = require('bl') -const fs = require('fs') - -fs.createReadStream('README.md') - .pipe(BufferListStream((err, data) => { // note 'new' isn't strictly required - // `data` is a complete Buffer object containing the full data - console.log(data.toString()) - })) -``` - -Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream. - -Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!): - -```js -const hyperquest = require('hyperquest') -const { BufferListStream } = require('bl') - -const url = 'https://raw.github.com/rvagg/bl/master/README.md' - -hyperquest(url).pipe(BufferListStream((err, data) => { - console.log(data.toString()) -})) -``` - -Or, use it as a readable stream to recompose a list of Buffers to an output source: - -```js -const { BufferListStream } = require('bl') -const fs = require('fs') - -var bl = new BufferListStream() -bl.append(Buffer.from('abcd')) -bl.append(Buffer.from('efg')) -bl.append(Buffer.from('hi')) -bl.append(Buffer.from('j')) - -bl.pipe(fs.createWriteStream('gibberish.txt')) -``` - -## API - - * new BufferList([ buf ]) - * BufferList.isBufferList(obj) - * bl.length - * bl.append(buffer) - * bl.get(index) - * bl.indexOf(value[, byteOffset][, encoding]) - * bl.slice([ start[, end ] ]) - * bl.shallowSlice([ start[, end ] ]) - * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) - * bl.duplicate() - * bl.consume(bytes) - * bl.toString([encoding, [ start, [ end ]]]) - * bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() - * new BufferListStream([ callback ]) - --------------------------------------------------------- - -### new BufferList([ Buffer | Buffer array | BufferList | BufferList array | String ]) -No arguments are _required_ for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` objects. - -`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with: - -```js -const { BufferList } = require('bl') -const bl = BufferList() - -// equivalent to: - -const { BufferList } = require('bl') -const bl = new BufferList() -``` - --------------------------------------------------------- - -### BufferList.isBufferList(obj) -Determines if the passed object is a `BufferList`. It will return `true` if the passed object is an instance of `BufferList` **or** `BufferListStream` and `false` otherwise. - -N.B. this won't return `true` for `BufferList` or `BufferListStream` instances created by versions of this library before this static method was added. - --------------------------------------------------------- - -### bl.length -Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list. - --------------------------------------------------------- - -### bl.append(Buffer | Buffer array | BufferList | BufferList array | String) -`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained. - --------------------------------------------------------- - -### bl.get(index) -`get()` will return the byte at the specified index. - --------------------------------------------------------- - -### bl.indexOf(value[, byteOffset][, encoding]) -`get()` will return the byte at the specified index. -`indexOf()` method returns the first index at which a given element can be found in the BufferList, or -1 if it is not present. - --------------------------------------------------------- - -### bl.slice([ start, [ end ] ]) -`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively. - -If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer. - --------------------------------------------------------- - -### bl.shallowSlice([ start, [ end ] ]) -`shallowSlice()` returns a new `BufferList` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively. - -No copies will be performed. All buffers in the result share memory with the original list. - --------------------------------------------------------- - -### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) -`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively. - --------------------------------------------------------- - -### bl.duplicate() -`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example: - -```js -var bl = new BufferListStream() - -bl.append('hello') -bl.append(' world') -bl.append('\n') - -bl.duplicate().pipe(process.stdout, { end: false }) - -console.log(bl.toString()) -``` - --------------------------------------------------------- - -### bl.consume(bytes) -`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data. - --------------------------------------------------------- - -### bl.toString([encoding, [ start, [ end ]]]) -`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information. - --------------------------------------------------------- - -### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() - -All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently. - -See the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work. - --------------------------------------------------------- - -### new BufferListStream([ callback | Buffer | Buffer array | BufferList | BufferList array | String ]) -**BufferListStream** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **BufferListStream** instance. - -The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream. - -Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object. - -`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with: - -```js -const { BufferListStream } = require('bl') -const bl = BufferListStream() - -// equivalent to: - -const { BufferListStream } = require('bl') -const bl = new BufferListStream() -``` - -N.B. For backwards compatibility reasons, `BufferListStream` is the **default** export when you `require('bl')`: - -```js -const { BufferListStream } = require('bl') -// equivalent to: -const BufferListStream = require('bl') -``` - --------------------------------------------------------- - -## Contributors - -**bl** is brought to you by the following hackers: - - * [Rod Vagg](https://github.com/rvagg) - * [Matteo Collina](https://github.com/mcollina) - * [Jarett Cruger](https://github.com/jcrugzz) - - -## License & copyright - -Copyright (c) 2013-2019 bl contributors (listed above). - -bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/node_modules/bl/bl.js b/node_modules/bl/bl.js deleted file mode 100644 index 40228f8799..0000000000 --- a/node_modules/bl/bl.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict' - -const DuplexStream = require('readable-stream').Duplex -const inherits = require('inherits') -const BufferList = require('./BufferList') - -function BufferListStream (callback) { - if (!(this instanceof BufferListStream)) { - return new BufferListStream(callback) - } - - if (typeof callback === 'function') { - this._callback = callback - - const piper = function piper (err) { - if (this._callback) { - this._callback(err) - this._callback = null - } - }.bind(this) - - this.on('pipe', function onPipe (src) { - src.on('error', piper) - }) - this.on('unpipe', function onUnpipe (src) { - src.removeListener('error', piper) - }) - - callback = null - } - - BufferList._init.call(this, callback) - DuplexStream.call(this) -} - -inherits(BufferListStream, DuplexStream) -Object.assign(BufferListStream.prototype, BufferList.prototype) - -BufferListStream.prototype._new = function _new (callback) { - return new BufferListStream(callback) -} - -BufferListStream.prototype._write = function _write (buf, encoding, callback) { - this._appendBuffer(buf) - - if (typeof callback === 'function') { - callback() - } -} - -BufferListStream.prototype._read = function _read (size) { - if (!this.length) { - return this.push(null) - } - - size = Math.min(size, this.length) - this.push(this.slice(0, size)) - this.consume(size) -} - -BufferListStream.prototype.end = function end (chunk) { - DuplexStream.prototype.end.call(this, chunk) - - if (this._callback) { - this._callback(null, this.slice()) - this._callback = null - } -} - -BufferListStream.prototype._destroy = function _destroy (err, cb) { - this._bufs.length = 0 - this.length = 0 - cb(err) -} - -BufferListStream.prototype._isBufferList = function _isBufferList (b) { - return b instanceof BufferListStream || b instanceof BufferList || BufferListStream.isBufferList(b) -} - -BufferListStream.isBufferList = BufferList.isBufferList - -module.exports = BufferListStream -module.exports.BufferListStream = BufferListStream -module.exports.BufferList = BufferList diff --git a/node_modules/bl/node_modules/inherits/LICENSE b/node_modules/bl/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013d67..0000000000 --- a/node_modules/bl/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - diff --git a/node_modules/bl/node_modules/inherits/README.md b/node_modules/bl/node_modules/inherits/README.md deleted file mode 100644 index b1c5665855..0000000000 --- a/node_modules/bl/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Browser-friendly inheritance fully compatible with standard node.js -[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). - -This package exports standard `inherits` from node.js `util` module in -node environment, but also provides alternative browser-friendly -implementation through [browser -field](https://gist.github.com/shtylman/4339901). Alternative -implementation is a literal copy of standard one located in standalone -module to avoid requiring of `util`. It also has a shim for old -browsers with no `Object.create` support. - -While keeping you sure you are using standard `inherits` -implementation in node.js environment, it allows bundlers such as -[browserify](https://github.com/substack/node-browserify) to not -include full `util` package to your client code if all you need is -just `inherits` function. It worth, because browser shim for `util` -package is large and `inherits` is often the single function you need -from it. - -It's recommended to use this package instead of -`require('util').inherits` for any code that has chances to be used -not only in node.js but in browser too. - -## usage - -```js -var inherits = require('inherits'); -// then use exactly as the standard one -``` - -## note on version ~1.0 - -Version ~1.0 had completely different motivation and is not compatible -neither with 2.0 nor with standard node.js `inherits`. - -If you are using version ~1.0 and planning to switch to ~2.0, be -careful: - -* new version uses `super_` instead of `super` for referencing - superclass -* new version overwrites current prototype while old one preserves any - existing fields on it diff --git a/node_modules/bl/node_modules/inherits/inherits.js b/node_modules/bl/node_modules/inherits/inherits.js deleted file mode 100644 index f71f2d9329..0000000000 --- a/node_modules/bl/node_modules/inherits/inherits.js +++ /dev/null @@ -1,9 +0,0 @@ -try { - var util = require('util'); - /* istanbul ignore next */ - if (typeof util.inherits !== 'function') throw ''; - module.exports = util.inherits; -} catch (e) { - /* istanbul ignore next */ - module.exports = require('./inherits_browser.js'); -} diff --git a/node_modules/bl/node_modules/inherits/inherits_browser.js b/node_modules/bl/node_modules/inherits/inherits_browser.js deleted file mode 100644 index 86bbb3dc29..0000000000 --- a/node_modules/bl/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,27 +0,0 @@ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }) - } - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } - } -} diff --git a/node_modules/bl/node_modules/inherits/package.json b/node_modules/bl/node_modules/inherits/package.json deleted file mode 100644 index bdf08a61aa..0000000000 --- a/node_modules/bl/node_modules/inherits/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "inherits", - "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "version": "2.0.4", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented", - "inherits", - "browser", - "browserify" - ], - "main": "./inherits.js", - "browser": "./inherits_browser.js", - "repository": "git://github.com/isaacs/inherits", - "license": "ISC", - "scripts": { - "test": "tap" - }, - "devDependencies": { - "tap": "^14.2.4" - }, - "files": [ - "inherits.js", - "inherits_browser.js" - ] -} \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/CONTRIBUTING.md b/node_modules/bl/node_modules/readable-stream/CONTRIBUTING.md deleted file mode 100644 index f478d58dca..0000000000 --- a/node_modules/bl/node_modules/readable-stream/CONTRIBUTING.md +++ /dev/null @@ -1,38 +0,0 @@ -# Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -* (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -* (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -* (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -* (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. - -## Moderation Policy - -The [Node.js Moderation Policy] applies to this WG. - -## Code of Conduct - -The [Node.js Code of Conduct][] applies to this WG. - -[Node.js Code of Conduct]: -https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md -[Node.js Moderation Policy]: -https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/node_modules/bl/node_modules/readable-stream/GOVERNANCE.md b/node_modules/bl/node_modules/readable-stream/GOVERNANCE.md deleted file mode 100644 index 16ffb93f24..0000000000 --- a/node_modules/bl/node_modules/readable-stream/GOVERNANCE.md +++ /dev/null @@ -1,136 +0,0 @@ -### Streams Working Group - -The Node.js Streams is jointly governed by a Working Group -(WG) -that is responsible for high-level guidance of the project. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project -[README.md](./README.md#current-project-team-members). - -### Collaborators - -The readable-stream GitHub repository is -maintained by the WG and additional Collaborators who are added by the -WG on an ongoing basis. - -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the WG and their addition as -Collaborators is discussed during the WG meeting. - -_Note:_ If you make a significant contribution and are not considered -for commit-access log an issue or contact a WG member directly and it -will be brought up in the next WG meeting. - -Modifications of the contents of the readable-stream repository are -made on -a collaborative basis. Anybody with a GitHub account may propose a -modification via pull request and it will be considered by the project -Collaborators. All pull requests must be reviewed and accepted by a -Collaborator with sufficient expertise who is able to take full -responsibility for the change. In the case of pull requests proposed -by an existing Collaborator, an additional Collaborator is required -for sign-off. Consensus should be sought if additional Collaborators -participate and there is disagreement around a particular -modification. See _Consensus Seeking Process_ below for further detail -on the consensus model used for governance. - -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -WG for discussion by assigning the ***WG-agenda*** tag to a pull -request or issue. The WG should serve as the final arbiter where -required. - -For the current list of Collaborators, see the project -[README.md](./README.md#members). - -### WG Membership - -WG seats are not time-limited. There is no fixed size of the WG. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for WG -membership beyond these rules. - -The WG may add additional members to the WG by unanimous consensus. - -A WG member may be removed from the WG by voluntary resignation, or by -unanimous consensus of all other WG members. - -Changes to WG membership should be posted in the agenda, and may be -suggested as any other agenda item (see "WG Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -WG is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a WG member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the WG members may be affiliated with the same -employer. If removal or resignation of a WG member, or a change of -employment by a WG member, creates a situation where more than 1/3 of -the WG membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more WG -members affiliated with the over-represented employer(s). - -### WG Meetings - -The WG meets occasionally on a Google Hangout On Air. A designated moderator -approved by the WG runs the meeting. Each meeting should be -published to YouTube. - -Items are added to the WG agenda that are considered contentious or -are modifications of governance, contribution policy, WG membership, -or release process. - -The intention of the agenda is not to approve or review all patches; -that should happen continuously on GitHub and be handled by the larger -group of Collaborators. - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -WG member or the moderator can add the item to the agenda by adding -the ***WG-agenda*** tag to the issue. - -Prior to each WG meeting the moderator will share the Agenda with -members of the WG. WG members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the WG -cannot veto or remove items. - -The WG may invite persons or representatives from certain projects to -participate in a non-voting capacity. - -The moderator is responsible for summarizing the discussion of each -agenda item and sends it as a pull request after the meeting. - -### Consensus Seeking Process - -The WG follows a -[Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision-making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a WG member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the WG -or else the discussion will continue. Simple majority wins. - -Note that changes to WG membership require a majority consensus. See -"WG Membership" above. diff --git a/node_modules/bl/node_modules/readable-stream/LICENSE b/node_modules/bl/node_modules/readable-stream/LICENSE deleted file mode 100644 index 2873b3b2e5..0000000000 --- a/node_modules/bl/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/node_modules/bl/node_modules/readable-stream/README.md b/node_modules/bl/node_modules/readable-stream/README.md deleted file mode 100644 index 6f035ab16f..0000000000 --- a/node_modules/bl/node_modules/readable-stream/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# readable-stream - -***Node.js core streams for userland*** [![Build Status](https://travis-ci.com/nodejs/readable-stream.svg?branch=master)](https://travis-ci.com/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readabe-stream.svg)](https://saucelabs.com/u/readabe-stream) - -```bash -npm install --save readable-stream -``` - -This package is a mirror of the streams implementations in Node.js. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v10.19.0/docs/api/stream.html). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -## Version 3.x.x - -v3.x.x of `readable-stream` is a cut from Node 10. This version supports Node 6, 8, and 10, as well as evergreen browsers, IE 11 and latest Safari. The breaking changes introduced by v3 are composed by the combined breaking changes in [Node v9](https://nodejs.org/en/blog/release/v9.0.0/) and [Node v10](https://nodejs.org/en/blog/release/v10.0.0/), as follows: - -1. Error codes: https://github.com/nodejs/node/pull/13310, - https://github.com/nodejs/node/pull/13291, - https://github.com/nodejs/node/pull/16589, - https://github.com/nodejs/node/pull/15042, - https://github.com/nodejs/node/pull/15665, - https://github.com/nodejs/readable-stream/pull/344 -2. 'readable' have precedence over flowing - https://github.com/nodejs/node/pull/18994 -3. make virtual methods errors consistent - https://github.com/nodejs/node/pull/18813 -4. updated streams error handling - https://github.com/nodejs/node/pull/18438 -5. writable.end should return this. - https://github.com/nodejs/node/pull/18780 -6. readable continues to read when push('') - https://github.com/nodejs/node/pull/18211 -7. add custom inspect to BufferList - https://github.com/nodejs/node/pull/17907 -8. always defer 'readable' with nextTick - https://github.com/nodejs/node/pull/17979 - -## Version 2.x.x -v2.x.x of `readable-stream` is a cut of the stream module from Node 8 (there have been no semver-major changes from Node 4 to 8). This version supports all Node.js versions from 0.8, as well as evergreen browsers and IE 10 & 11. - -### Big Thanks - -Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs][sauce] - -# Usage - -You can swap your `require('stream')` with `require('readable-stream')` -without any changes, if you are just using one of the main classes and -functions. - -```js -const { - Readable, - Writable, - Transform, - Duplex, - pipeline, - finished -} = require('readable-stream') -```` - -Note that `require('stream')` will return `Stream`, while -`require('readable-stream')` will return `Readable`. We discourage using -whatever is exported directly, but rather use one of the properties as -shown in the example above. - -# Streams Working Group - -`readable-stream` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - - -## Team Members - -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E -* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> -* **Yoshua Wyuts** ([@yoshuawuyts](https://github.com/yoshuawuyts)) <yoshuawuyts@gmail.com> - -[sauce]: https://saucelabs.com diff --git a/node_modules/bl/node_modules/readable-stream/errors-browser.js b/node_modules/bl/node_modules/readable-stream/errors-browser.js deleted file mode 100644 index fb8e73e189..0000000000 --- a/node_modules/bl/node_modules/readable-stream/errors-browser.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict'; - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } - -var codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; - } - - function getMessage(arg1, arg2, arg3) { - if (typeof message === 'string') { - return message; - } else { - return message(arg1, arg2, arg3); - } - } - - var NodeError = - /*#__PURE__*/ - function (_Base) { - _inheritsLoose(NodeError, _Base); - - function NodeError(arg1, arg2, arg3) { - return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; - } - - return NodeError; - }(Base); - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - codes[code] = NodeError; -} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js - - -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - var len = expected.length; - expected = expected.map(function (i) { - return String(i); - }); - - if (len > 2) { - return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; - } else if (len === 2) { - return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); - } else { - return "of ".concat(thing, " ").concat(expected[0]); - } - } else { - return "of ".concat(thing, " ").concat(String(expected)); - } -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith - - -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith - - -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - - return str.substring(this_len - search.length, this_len) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes - - -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"'; -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - var determiner; - - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - var msg; - - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } else { - var type = includes(name, '.') ? 'property' : 'argument'; - msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } - - msg += ". Received type ".concat(typeof actual); - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented'; -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg; -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); -module.exports.codes = codes; diff --git a/node_modules/bl/node_modules/readable-stream/errors.js b/node_modules/bl/node_modules/readable-stream/errors.js deleted file mode 100644 index 8471526d6e..0000000000 --- a/node_modules/bl/node_modules/readable-stream/errors.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -const codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error - } - - function getMessage (arg1, arg2, arg3) { - if (typeof message === 'string') { - return message - } else { - return message(arg1, arg2, arg3) - } - } - - class NodeError extends Base { - constructor (arg1, arg2, arg3) { - super(getMessage(arg1, arg2, arg3)); - } - } - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - - codes[code] = NodeError; -} - -// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - const len = expected.length; - expected = expected.map((i) => String(i)); - if (len > 2) { - return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + - expected[len - 1]; - } else if (len === 2) { - return `one of ${thing} ${expected[0]} or ${expected[1]}`; - } else { - return `of ${thing} ${expected[0]}`; - } - } else { - return `of ${thing} ${String(expected)}`; - } -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - return str.substring(this_len - search.length, this_len) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"' -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - let determiner; - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - let msg; - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; - } else { - const type = includes(name, '.') ? 'property' : 'argument'; - msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; - } - - msg += `. Received type ${typeof actual}`; - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented' -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); - -module.exports.codes = codes; diff --git a/node_modules/bl/node_modules/readable-stream/experimentalWarning.js b/node_modules/bl/node_modules/readable-stream/experimentalWarning.js deleted file mode 100644 index 78e841495b..0000000000 --- a/node_modules/bl/node_modules/readable-stream/experimentalWarning.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -var experimentalWarnings = new Set(); - -function emitExperimentalWarning(feature) { - if (experimentalWarnings.has(feature)) return; - var msg = feature + ' is an experimental feature. This feature could ' + - 'change at any time'; - experimentalWarnings.add(feature); - process.emitWarning(msg, 'ExperimentalWarning'); -} - -function noop() {} - -module.exports.emitExperimentalWarning = process.emitWarning - ? emitExperimentalWarning - : noop; diff --git a/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index 6752519225..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. -'use strict'; -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - - for (var key in obj) { - keys.push(key); - } - - return keys; -}; -/**/ - - -module.exports = Duplex; - -var Readable = require('./_stream_readable'); - -var Writable = require('./_stream_writable'); - -require('inherits')(Duplex, Readable); - -{ - // Allow the keys array to be GC'ed. - var keys = objectKeys(Writable.prototype); - - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - Readable.call(this, options); - Writable.call(this, options); - this.allowHalfOpen = true; - - if (options) { - if (options.readable === false) this.readable = false; - if (options.writable === false) this.writable = false; - - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once('end', onend); - } - } -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); -Object.defineProperty(Duplex.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -Object.defineProperty(Duplex.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); // the no-half-open enforcer - -function onend() { - // If the writable side ended, then we're ok. - if (this._writableState.ended) return; // no more data can be written. - // But allow more writes to happen in this tick. - - process.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index 32e7414c5a..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -require('inherits')(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index 192d451488..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,1124 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -'use strict'; - -module.exports = Readable; -/**/ - -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; -/**/ - -var EE = require('events').EventEmitter; - -var EElistenerCount = function EElistenerCount(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ - - -var Stream = require('./internal/streams/stream'); -/**/ - - -var Buffer = require('buffer').Buffer; - -var OurUint8Array = global.Uint8Array || function () {}; - -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} - -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} -/**/ - - -var debugUtil = require('util'); - -var debug; - -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function debug() {}; -} -/**/ - - -var BufferList = require('./internal/streams/buffer_list'); - -var destroyImpl = require('./internal/streams/destroy'); - -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; - -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. - - -var StringDecoder; -var createReadableStreamAsyncIterator; -var from; - -require('inherits')(Readable, Stream); - -var errorOrDestroy = destroyImpl.errorOrDestroy; -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream, isDuplex) { - Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - - this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - - this.sync = true; // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.paused = true; // Should close be emitted on destroy. Defaults to true. - - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') - - this.autoDestroy = !!options.autoDestroy; // has it been destroyed - - this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - - this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s - - this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled - - this.readingMore = false; - this.decoder = null; - this.encoding = null; - - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside - // the ReadableState constructor, at least with V8 6.5 - - var isDuplex = this instanceof Duplex; - this._readableState = new ReadableState(options, this, isDuplex); // legacy - - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined) { - return false; - } - - return this._readableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._readableState.destroyed = value; - } -}); -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; - -Readable.prototype._destroy = function (err, cb) { - cb(err); -}; // Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. - - -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; // Unshift should *always* be something directly out of read() - - -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug('readableAddChunk', chunk); - var state = stream._readableState; - - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - - if (er) { - errorOrDestroy(stream, er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; - } else { - state.reading = false; - - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - maybeReadMore(stream, state); - } - } // We can push more data if we are below the highWaterMark. - // Also, if we have no data yet, we can stand some more bytes. - // This is to work around cases where hwm=0, such as the repl. - - - return !state.ended && (state.length < state.highWaterMark || state.length === 0); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; - stream.emit('data', chunk); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream); - } - - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); - } - - return er; -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; // backwards compatibility. - - -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - var decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 - - this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: - - var p = this._readableState.buffer.head; - var content = ''; - - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - - this._readableState.buffer.clear(); - - if (content !== '') this._readableState.buffer.push(content); - this._readableState.length = content.length; - return this; -}; // Don't raise the hwm > 1GB - - -var MAX_HWM = 0x40000000; - -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - - return n; -} // This function is designed to be inlinable, so please take care when making -// changes to the function body. - - -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } // If we're asking for more than the current hwm, then raise the hwm. - - - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; // Don't have enough - - if (!state.ended) { - state.needReadable = true; - return 0; - } - - return state.length; -} // you can override either this method, or the async _read(n) below. - - -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. - - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - // if we need a readable event, then we need to do some reading. - - - var doRead = state.needReadable; - debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some - - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - - - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; // if the length is currently zero, then we *need* a readable event. - - if (state.length === 0) state.needReadable = true; // call internal read method - - this._read(state.highWaterMark); - - state.sync = false; // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; - } else { - state.length -= n; - state.awaitDrain = 0; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. - - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - return ret; -}; - -function onEofChunk(stream, state) { - debug('onEofChunk'); - if (state.ended) return; - - if (state.decoder) { - var chunk = state.decoder.end(); - - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - - state.ended = true; - - if (state.sync) { - // if we are sync, wait until next tick to emit the data. - // Otherwise we risk emitting data in the flow() - // the readable code triggers during a read() call - emitReadable(stream); - } else { - // emit 'readable' now to make sure it gets picked up. - state.needReadable = false; - - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } - } -} // Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. - - -function emitReadable(stream) { - var state = stream._readableState; - debug('emitReadable', state.needReadable, state.emittedReadable); - state.needReadable = false; - - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - process.nextTick(emitReadable_, stream); - } -} - -function emitReadable_(stream) { - var state = stream._readableState; - debug('emitReadable_', state.destroyed, state.length, state.ended); - - if (!state.destroyed && (state.length || state.ended)) { - stream.emit('readable'); - state.emittedReadable = false; - } // The stream needs another readable event if - // 1. It is not flowing, as the flow mechanism will take - // care of it. - // 2. It is not ended. - // 3. It is below the highWaterMark, so we can schedule - // another readable later. - - - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream); -} // at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. - - -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - // Attempt to read more data if we should. - // - // The conditions for reading more data are (one of): - // - Not enough data buffered (state.length < state.highWaterMark). The loop - // is responsible for filling the buffer with enough data if such data - // is available. If highWaterMark is 0 and we are not in the flowing mode - // we should _not_ attempt to buffer any extra data. We'll get more data - // when the stream consumer calls read() instead. - // - No data in the buffer, and the stream is in flowing mode. In this mode - // the loop below is responsible for ensuring read() is called. Failing to - // call read here would abort the flow and there's no other mechanism for - // continuing the flow if the stream consumer has just subscribed to the - // 'data' event. - // - // In addition to the above conditions to keep reading data, the following - // conditions prevent the data from being read: - // - The stream has ended (state.ended). - // - There is already a pending 'read' operation (state.reading). This is a - // case where the the stream has called the implementation defined _read() - // method, but they are processing the call asynchronously and have _not_ - // called push() with new data. In this case we skip performing more - // read()s. The execution ends in this method again after the _read() ends - // up calling push() with more data. - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) // didn't get any data, stop spinning. - break; - } - - state.readingMore = false; -} // abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. - - -Readable.prototype._read = function (n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - - case 1: - state.pipes = [state.pipes, dest]; - break; - - default: - state.pipes.push(dest); - break; - } - - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); - dest.on('unpipe', onunpipe); - - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - - - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - var cleanedUp = false; - - function cleanup() { - debug('cleanup'); // cleanup event handlers once the pipe is broken - - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - cleanedUp = true; // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - src.on('data', ondata); - - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - debug('dest.write', ret); - - if (ret === false) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', state.awaitDrain); - state.awaitDrain++; - } - - src.pause(); - } - } // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - - - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); - } // Make sure our error handler is attached before userland ones. - - - prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. - - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - - dest.once('close', onclose); - - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } // tell the dest that it's being piped to - - - dest.emit('pipe', src); // start the flow if it hasn't been started already. - - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { - hasUnpiped: false - }; // if we're not piping anywhere, then do nothing. - - if (state.pipesCount === 0) return this; // just one destination. most common case. - - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - if (!dest) dest = state.pipes; // got a match. - - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } // slow case. multiple pipe destinations. - - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, { - hasUnpiped: false - }); - } - - return this; - } // try to find the right one. - - - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - dest.emit('unpipe', this, unpipeInfo); - return this; -}; // set up data events if they are asked for -// Ensure readable listeners eventually get something - - -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - var state = this._readableState; - - if (ev === 'data') { - // update readableListening so that resume() may be a no-op - // a few lines down. This is needed to support once('readable'). - state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused - - if (state.flowing !== false) this.resume(); - } else if (ev === 'readable') { - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug('on readable', state.length, state.reading); - - if (state.length) { - emitReadable(this); - } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); - } - } - } - - return res; -}; - -Readable.prototype.addListener = Readable.prototype.on; - -Readable.prototype.removeListener = function (ev, fn) { - var res = Stream.prototype.removeListener.call(this, ev, fn); - - if (ev === 'readable') { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; -}; - -Readable.prototype.removeAllListeners = function (ev) { - var res = Stream.prototype.removeAllListeners.apply(this, arguments); - - if (ev === 'readable' || ev === undefined) { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; -}; - -function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount('readable') > 0; - - if (state.resumeScheduled && !state.paused) { - // flowing needs to be set to true now, otherwise - // the upcoming resume will not flow. - state.flowing = true; // crude way to check if we should resume - } else if (self.listenerCount('data') > 0) { - self.resume(); - } -} - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} // pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. - - -Readable.prototype.resume = function () { - var state = this._readableState; - - if (!state.flowing) { - debug('resume'); // we flow only if there is no one listening - // for readable, but we still have to call - // resume() - - state.flowing = !state.readableListening; - resume(this, state); - } - - state.paused = false; - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - debug('resume', state.reading); - - if (!state.reading) { - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - - if (this._readableState.flowing !== false) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - - this._readableState.paused = true; - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - - while (state.flowing && stream.read() !== null) { - ; - } -} // wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. - - -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - stream.on('end', function () { - debug('wrapped end'); - - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode - - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - - if (!ret) { - paused = true; - stream.pause(); - } - }); // proxy all the other methods. - // important when wrapping filters and duplexes. - - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } // proxy certain important events. - - - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } // when we try to consume some more bytes, simply unpause the - // underlying stream. - - - this._read = function (n) { - debug('wrapped _read', n); - - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -if (typeof Symbol === 'function') { - Readable.prototype[Symbol.asyncIterator] = function () { - if (createReadableStreamAsyncIterator === undefined) { - createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); - } - - return createReadableStreamAsyncIterator(this); - }; -} - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.highWaterMark; - } -}); -Object.defineProperty(Readable.prototype, 'readableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; - } -}); -Object.defineProperty(Readable.prototype, 'readableFlowing', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } -}); // exposed for testing purposes only. - -Readable._fromList = fromList; -Object.defineProperty(Readable.prototype, 'readableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } -}); // Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. - -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = state.buffer.consume(n, state.decoder); - } - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - debug('endReadable', state.endEmitted); - - if (!state.endEmitted) { - state.ended = true; - process.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. - - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the writable side is ready for autoDestroy as well - var wState = stream._writableState; - - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } - } -} - -if (typeof Symbol === 'function') { - Readable.from = function (iterable, opts) { - if (from === undefined) { - from = require('./internal/streams/from'); - } - - return from(Readable, iterable, opts); - }; -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - - return -1; -} \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 41a738c4e9..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. -'use strict'; - -module.exports = Transform; - -var _require$codes = require('../errors').codes, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, - ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; - -var Duplex = require('./_stream_duplex'); - -require('inherits')(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - - if (cb === null) { - return this.emit('error', new ERR_MULTIPLE_CALLBACK()); - } - - ts.writechunk = null; - ts.writecb = null; - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - Duplex.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; // start out asking for a readable event once data is transformed. - - this._readableState.needReadable = true; // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - if (typeof options.flush === 'function') this._flush = options.flush; - } // When the writable side finishes, then flush out anything remaining. - - - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function' && !this._readableState.destroyed) { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; // This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. - - -Transform.prototype._transform = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; // Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. - - -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && !ts.transforming) { - ts.transforming = true; - - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); // TODO(BridgeAR): Write a test for these two error cases - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - - if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); - return stream.push(null); -} \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index a2634d7c24..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,697 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. -'use strict'; - -module.exports = Writable; -/* */ - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} // It seems a linked list but it is not -// there will be only 2 of these for each stream - - -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ - - -var Duplex; -/**/ - -Writable.WritableState = WritableState; -/**/ - -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ - -var Stream = require('./internal/streams/stream'); -/**/ - - -var Buffer = require('buffer').Buffer; - -var OurUint8Array = global.Uint8Array || function () {}; - -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} - -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -var destroyImpl = require('./internal/streams/destroy'); - -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; - -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, - ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; - -var errorOrDestroy = destroyImpl.errorOrDestroy; - -require('inherits')(Writable, Stream); - -function nop() {} - -function WritableState(options, stream, isDuplex) { - Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream, - // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream - // contains buffers or objects. - - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - - this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called - - this.finalCalled = false; // drain event flag. - - this.needDrain = false; // at the start of calling end() - - this.ending = false; // when end() has been called, and returned - - this.ended = false; // when 'finish' is emitted - - this.finished = false; // has it been destroyed - - this.destroyed = false; // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - - this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - - this.length = 0; // a flag to see when we're in the middle of a write. - - this.writing = false; // when true all writes will be buffered until .uncork() call - - this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - - this.sync = true; // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - - this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) - - this.onwrite = function (er) { - onwrite(stream, er); - }; // the callback that the user supplies to write(chunk,encoding,cb) - - - this.writecb = null; // the amount that is being written when _write is called. - - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - - this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - - this.prefinished = false; // True if the error was already emitted and should not be thrown again - - this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. - - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') - - this.autoDestroy = !!options.autoDestroy; // count buffered requests - - this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - - while (current) { - out.push(current); - current = current.next; - } - - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function writableStateBufferGetter() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); // Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. - - -var realHasInstance; - -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function value(object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function realHasInstance(object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - // Checking for a Stream.Duplex instance is faster here instead of inside - // the WritableState constructor, at least with V8 6.5 - - var isDuplex = this instanceof Duplex; - if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); // legacy. - - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - if (typeof options.writev === 'function') this._writev = options.writev; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} // Otherwise people can pipe Writable streams, which is just wrong. - - -Writable.prototype.pipe = function () { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); -}; - -function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb - - errorOrDestroy(stream, er); - process.nextTick(cb, er); -} // Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. - - -function validChunk(stream, state, chunk, cb) { - var er; - - if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== 'string' && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); - } - - if (er) { - errorOrDestroy(stream, er); - process.nextTick(cb, er); - return false; - } - - return true; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - if (typeof cb !== 'function') cb = nop; - if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; -}; - -Writable.prototype.cork = function () { - this._writableState.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -Object.defineProperty(Writable.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); // if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. - -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. - - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - process.nextTick(cb, er); // this can emit finish, and it will always happen - // after error - - process.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); // this can emit finish, but finish must - // always follow error - - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); - onwriteStateUpdate(state); - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state) || stream.destroyed; - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} // Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. - - -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} // if there's something in the buffer waiting, then process it - - -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - - state.pendingcb++; - state.lastBufferedRequest = null; - - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks - - if (state.corked) { - state.corked = 1; - this.uncork(); - } // ignore unnecessary end() calls. - - - if (!state.ending) endWritable(this, state, cb); - return this; -}; - -Object.defineProperty(Writable.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} - -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - - if (err) { - errorOrDestroy(stream, err); - } - - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} - -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function' && !state.destroyed) { - state.pendingcb++; - state.finalCalled = true; - process.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - - if (need) { - prefinish(stream, state); - - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the readable side is ready for autoDestroy as well - var rState = stream._readableState; - - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } - } - } - - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - - if (cb) { - if (state.finished) process.nextTick(cb);else stream.once('finish', cb); - } - - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } // reuse the free corkReq. - - - state.corkedRequestsFree.next = corkReq; -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._writableState === undefined) { - return false; - } - - return this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._writableState.destroyed = value; - } -}); -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; - -Writable.prototype._destroy = function (err, cb) { - cb(err); -}; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/async_iterator.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/async_iterator.js deleted file mode 100644 index 9fb615a2f3..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/async_iterator.js +++ /dev/null @@ -1,207 +0,0 @@ -'use strict'; - -var _Object$setPrototypeO; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var finished = require('./end-of-stream'); - -var kLastResolve = Symbol('lastResolve'); -var kLastReject = Symbol('lastReject'); -var kError = Symbol('error'); -var kEnded = Symbol('ended'); -var kLastPromise = Symbol('lastPromise'); -var kHandlePromise = Symbol('handlePromise'); -var kStream = Symbol('stream'); - -function createIterResult(value, done) { - return { - value: value, - done: done - }; -} - -function readAndResolve(iter) { - var resolve = iter[kLastResolve]; - - if (resolve !== null) { - var data = iter[kStream].read(); // we defer if data is null - // we can be expecting either 'end' or - // 'error' - - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } -} - -function onReadable(iter) { - // we wait for the next tick, because it might - // emit an error with process.nextTick - process.nextTick(readAndResolve, iter); -} - -function wrapForNext(lastPromise, iter) { - return function (resolve, reject) { - lastPromise.then(function () { - if (iter[kEnded]) { - resolve(createIterResult(undefined, true)); - return; - } - - iter[kHandlePromise](resolve, reject); - }, reject); - }; -} - -var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); -var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - - next: function next() { - var _this = this; - - // if we have detected an error in the meanwhile - // reject straight away - var error = this[kError]; - - if (error !== null) { - return Promise.reject(error); - } - - if (this[kEnded]) { - return Promise.resolve(createIterResult(undefined, true)); - } - - if (this[kStream].destroyed) { - // We need to defer via nextTick because if .destroy(err) is - // called, the error will be emitted via nextTick, and - // we cannot guarantee that there is no error lingering around - // waiting to be emitted. - return new Promise(function (resolve, reject) { - process.nextTick(function () { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(undefined, true)); - } - }); - }); - } // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time - - - var lastPromise = this[kLastPromise]; - var promise; - - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - // fast path needed to support multiple this.push() - // without triggering the next() queue - var data = this[kStream].read(); - - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - - promise = new Promise(this[kHandlePromise]); - } - - this[kLastPromise] = promise; - return promise; - } -}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { - return this; -}), _defineProperty(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - - // destroy(err, cb) is a private API - // we can guarantee we have that here, because we control the - // Readable class this is attached to - return new Promise(function (resolve, reject) { - _this2[kStream].destroy(null, function (err) { - if (err) { - reject(err); - return; - } - - resolve(createIterResult(undefined, true)); - }); - }); -}), _Object$setPrototypeO), AsyncIteratorPrototype); - -var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { - var _Object$create; - - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function (err) { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { - var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise - // returned by next() and store the error - - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - - iterator[kError] = err; - return; - } - - var resolve = iterator[kLastResolve]; - - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(undefined, true)); - } - - iterator[kEnded] = true; - }); - stream.on('readable', onReadable.bind(null, iterator)); - return iterator; -}; - -module.exports = createReadableStreamAsyncIterator; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/buffer_list.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/buffer_list.js deleted file mode 100644 index cdea425f19..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/buffer_list.js +++ /dev/null @@ -1,210 +0,0 @@ -'use strict'; - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -var _require = require('buffer'), - Buffer = _require.Buffer; - -var _require2 = require('util'), - inspect = _require2.inspect; - -var custom = inspect && inspect.custom || 'inspect'; - -function copyBuffer(src, target, offset) { - Buffer.prototype.copy.call(src, target, offset); -} - -module.exports = -/*#__PURE__*/ -function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - _createClass(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; - } - }, { - key: "join", - value: function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - - while (p = p.next) { - ret += s + p.data; - } - - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - - return ret; - } // Consumes a specified amount of bytes or characters from the buffered data. - - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - - if (n < this.head.data.length) { - // `slice` is the same for buffers and strings. - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - // First chunk is a perfect match. - ret = this.shift(); - } else { - // Result spans more than one buffer. - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } - - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } // Consumes a specified amount of characters from the buffered data. - - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Consumes a specified amount of bytes from the buffered data. - - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Make sure the linked list only shows the minimal necessary information. - - }, { - key: custom, - value: function value(_, options) { - return inspect(this, _objectSpread({}, options, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); - } - }]); - - return BufferList; -}(); \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js deleted file mode 100644 index 3268a16f3b..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; // undocumented cb() API, needed for core, not for public API - -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); - } - } - - return this; - } // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - - if (this._readableState) { - this._readableState.destroyed = true; - } // if this is a duplex stream mark the writable part as destroyed as well - - - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err); - } else { - process.nextTick(emitCloseNT, _this); - } - } else if (cb) { - process.nextTick(emitCloseNT, _this); - cb(err); - } else { - process.nextTick(emitCloseNT, _this); - } - }); - - return this; -} - -function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); -} - -function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) return; - if (self._readableState && !self._readableState.emitClose) return; - self.emit('close'); -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -function errorOrDestroy(stream, err) { - // We have tests that rely on errors being emitted - // in the same tick, so changing this is semver major. - // For now when you opt-in to autoDestroy we allow - // the error to be emitted nextTick. In a future - // semver major update we should change the default to this. - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy, - errorOrDestroy: errorOrDestroy -}; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/end-of-stream.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/end-of-stream.js deleted file mode 100644 index 831f286d98..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +++ /dev/null @@ -1,104 +0,0 @@ -// Ported from https://github.com/mafintosh/end-of-stream with -// permission from the author, Mathias Buus (@mafintosh). -'use strict'; - -var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; - -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - callback.apply(this, args); - }; -} - -function noop() {} - -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} - -function eos(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; - - var writableEnded = stream._writableState && stream._writableState.finished; - - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; - - var readableEnded = stream._readableState && stream._readableState.endEmitted; - - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; - - var onerror = function onerror(err) { - callback.call(stream, err); - }; - - var onclose = function onclose() { - var err; - - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -} - -module.exports = eos; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from-browser.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from-browser.js deleted file mode 100644 index a4ce56f3c9..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from-browser.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function () { - throw new Error('Readable.from is not available in the browser') -}; diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from.js deleted file mode 100644 index 6c41284416..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } - -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE; - -function from(Readable, iterable, opts) { - var iterator; - - if (iterable && typeof iterable.next === 'function') { - iterator = iterable; - } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); - - var readable = new Readable(_objectSpread({ - objectMode: true - }, opts)); // Reading boolean to protect against _read - // being called before last iteration completion. - - var reading = false; - - readable._read = function () { - if (!reading) { - reading = true; - next(); - } - }; - - function next() { - return _next2.apply(this, arguments); - } - - function _next2() { - _next2 = _asyncToGenerator(function* () { - try { - var _ref = yield iterator.next(), - value = _ref.value, - done = _ref.done; - - if (done) { - readable.push(null); - } else if (readable.push((yield value))) { - next(); - } else { - reading = false; - } - } catch (err) { - readable.destroy(err); - } - }); - return _next2.apply(this, arguments); - } - - return readable; -} - -module.exports = from; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/pipeline.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/pipeline.js deleted file mode 100644 index 6589909889..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/pipeline.js +++ /dev/null @@ -1,97 +0,0 @@ -// Ported from https://github.com/mafintosh/pump with -// permission from the author, Mathias Buus (@mafintosh). -'use strict'; - -var eos; - -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - callback.apply(void 0, arguments); - }; -} - -var _require$codes = require('../../../errors').codes, - ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - -function noop(err) { - // Rethrow the error if it exists to avoid swallowing it - if (err) throw err; -} - -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} - -function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on('close', function () { - closed = true; - }); - if (eos === undefined) eos = require('./end-of-stream'); - eos(stream, { - readable: reading, - writable: writing - }, function (err) { - if (err) return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function (err) { - if (closed) return; - if (destroyed) return; - destroyed = true; // request.destroy just do .end - .abort is what we want - - if (isRequest(stream)) return stream.abort(); - if (typeof stream.destroy === 'function') return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED('pipe')); - }; -} - -function call(fn) { - fn(); -} - -function pipe(from, to) { - return from.pipe(to); -} - -function popCallback(streams) { - if (!streams.length) return noop; - if (typeof streams[streams.length - 1] !== 'function') return noop; - return streams.pop(); -} - -function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; - } - - var callback = popCallback(streams); - if (Array.isArray(streams[0])) streams = streams[0]; - - if (streams.length < 2) { - throw new ERR_MISSING_ARGS('streams'); - } - - var error; - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err; - if (err) destroys.forEach(call); - if (reading) return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe); -} - -module.exports = pipeline; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/state.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/state.js deleted file mode 100644 index 19887eb8a9..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/state.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; - -function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; -} - -function getHighWaterMark(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : 'highWaterMark'; - throw new ERR_INVALID_OPT_VALUE(name, hwm); - } - - return Math.floor(hwm); - } // Default value - - - return state.objectMode ? 16 : 16 * 1024; -} - -module.exports = { - getHighWaterMark: getHighWaterMark -}; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream-browser.js deleted file mode 100644 index 9332a3fdae..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('events').EventEmitter; diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js deleted file mode 100644 index ce2ad5b6ee..0000000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('stream'); diff --git a/node_modules/bl/node_modules/readable-stream/package.json b/node_modules/bl/node_modules/readable-stream/package.json deleted file mode 100644 index 446f70fbc0..0000000000 --- a/node_modules/bl/node_modules/readable-stream/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "readable-stream", - "version": "3.6.0", - "description": "Streams3, a user-land copy of the stream library from Node.js", - "main": "readable.js", - "engines": { - "node": ">= 6" - }, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "devDependencies": { - "@babel/cli": "^7.2.0", - "@babel/core": "^7.2.0", - "@babel/polyfill": "^7.0.0", - "@babel/preset-env": "^7.2.0", - "airtap": "0.0.9", - "assert": "^1.4.0", - "bl": "^2.0.0", - "deep-strict-equal": "^0.2.0", - "events.once": "^2.0.2", - "glob": "^7.1.2", - "gunzip-maybe": "^1.4.1", - "hyperquest": "^2.1.3", - "lolex": "^2.6.0", - "nyc": "^11.0.0", - "pump": "^3.0.0", - "rimraf": "^2.6.2", - "tap": "^12.0.0", - "tape": "^4.9.0", - "tar-fs": "^1.16.2", - "util-promisify": "^2.1.0" - }, - "scripts": { - "test": "tap -J --no-esm test/parallel/*.js test/ours/*.js", - "ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap", - "test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js", - "test-browser-local": "airtap --open --local -- test/browser.js", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "update-browser-errors": "babel -o errors-browser.js errors.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream" - }, - "keywords": [ - "readable", - "stream", - "pipe" - ], - "browser": { - "util": false, - "worker_threads": false, - "./errors": "./errors-browser.js", - "./readable.js": "./readable-browser.js", - "./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "nyc": { - "include": [ - "lib/**.js" - ] - }, - "license": "MIT" -} \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/readable-browser.js b/node_modules/bl/node_modules/readable-stream/readable-browser.js deleted file mode 100644 index adbf60de83..0000000000 --- a/node_modules/bl/node_modules/readable-stream/readable-browser.js +++ /dev/null @@ -1,9 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); -exports.finished = require('./lib/internal/streams/end-of-stream.js'); -exports.pipeline = require('./lib/internal/streams/pipeline.js'); diff --git a/node_modules/bl/node_modules/readable-stream/readable.js b/node_modules/bl/node_modules/readable-stream/readable.js deleted file mode 100644 index 9e0ca120de..0000000000 --- a/node_modules/bl/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,16 +0,0 @@ -var Stream = require('stream'); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream.Readable; - Object.assign(module.exports, Stream); - module.exports.Stream = Stream; -} else { - exports = module.exports = require('./lib/_stream_readable.js'); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require('./lib/_stream_writable.js'); - exports.Duplex = require('./lib/_stream_duplex.js'); - exports.Transform = require('./lib/_stream_transform.js'); - exports.PassThrough = require('./lib/_stream_passthrough.js'); - exports.finished = require('./lib/internal/streams/end-of-stream.js'); - exports.pipeline = require('./lib/internal/streams/pipeline.js'); -} diff --git a/node_modules/bl/package.json b/node_modules/bl/package.json deleted file mode 100644 index f686658bbd..0000000000 --- a/node_modules/bl/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "bl", - "version": "4.1.0", - "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", - "license": "MIT", - "main": "bl.js", - "scripts": { - "lint": "standard *.js test/*.js", - "test": "npm run lint && node test/test.js | faucet" - }, - "repository": { - "type": "git", - "url": "https://github.com/rvagg/bl.git" - }, - "homepage": "https://github.com/rvagg/bl", - "authors": [ - "Rod Vagg (https://github.com/rvagg)", - "Matteo Collina (https://github.com/mcollina)", - "Jarett Cruger (https://github.com/jcrugzz)" - ], - "keywords": [ - "buffer", - "buffers", - "stream", - "awesomesauce" - ], - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - }, - "devDependencies": { - "faucet": "~0.0.1", - "standard": "^14.3.0", - "tape": "^4.11.0" - } -} \ No newline at end of file diff --git a/node_modules/bl/test/convert.js b/node_modules/bl/test/convert.js deleted file mode 100644 index 9f3e23599e..0000000000 --- a/node_modules/bl/test/convert.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict' - -const tape = require('tape') -const { BufferList, BufferListStream } = require('../') -const { Buffer } = require('buffer') - -tape('convert from BufferList to BufferListStream', (t) => { - const data = Buffer.from(`TEST-${Date.now()}`) - const bl = new BufferList(data) - const bls = new BufferListStream(bl) - t.ok(bl.slice().equals(bls.slice())) - t.end() -}) - -tape('convert from BufferListStream to BufferList', (t) => { - const data = Buffer.from(`TEST-${Date.now()}`) - const bls = new BufferListStream(data) - const bl = new BufferList(bls) - t.ok(bl.slice().equals(bls.slice())) - t.end() -}) diff --git a/node_modules/bl/test/indexOf.js b/node_modules/bl/test/indexOf.js deleted file mode 100644 index 62dcb01f3b..0000000000 --- a/node_modules/bl/test/indexOf.js +++ /dev/null @@ -1,492 +0,0 @@ -'use strict' - -const tape = require('tape') -const BufferList = require('../') -const { Buffer } = require('buffer') - -tape('indexOf single byte needle', (t) => { - const bl = new BufferList(['abcdefg', 'abcdefg', '12345']) - - t.equal(bl.indexOf('e'), 4) - t.equal(bl.indexOf('e', 5), 11) - t.equal(bl.indexOf('e', 12), -1) - t.equal(bl.indexOf('5'), 18) - - t.end() -}) - -tape('indexOf multiple byte needle', (t) => { - const bl = new BufferList(['abcdefg', 'abcdefg']) - - t.equal(bl.indexOf('ef'), 4) - t.equal(bl.indexOf('ef', 5), 11) - - t.end() -}) - -tape('indexOf multiple byte needles across buffer boundaries', (t) => { - const bl = new BufferList(['abcdefg', 'abcdefg']) - - t.equal(bl.indexOf('fgabc'), 5) - - t.end() -}) - -tape('indexOf takes a Uint8Array search', (t) => { - const bl = new BufferList(['abcdefg', 'abcdefg']) - const search = new Uint8Array([102, 103, 97, 98, 99]) // fgabc - - t.equal(bl.indexOf(search), 5) - - t.end() -}) - -tape('indexOf takes a buffer list search', (t) => { - const bl = new BufferList(['abcdefg', 'abcdefg']) - const search = new BufferList('fgabc') - - t.equal(bl.indexOf(search), 5) - - t.end() -}) - -tape('indexOf a zero byte needle', (t) => { - const b = new BufferList('abcdef') - const bufEmpty = Buffer.from('') - - t.equal(b.indexOf(''), 0) - t.equal(b.indexOf('', 1), 1) - t.equal(b.indexOf('', b.length + 1), b.length) - t.equal(b.indexOf('', Infinity), b.length) - t.equal(b.indexOf(bufEmpty), 0) - t.equal(b.indexOf(bufEmpty, 1), 1) - t.equal(b.indexOf(bufEmpty, b.length + 1), b.length) - t.equal(b.indexOf(bufEmpty, Infinity), b.length) - - t.end() -}) - -tape('indexOf buffers smaller and larger than the needle', (t) => { - const bl = new BufferList(['abcdefg', 'a', 'bcdefg', 'a', 'bcfgab']) - - t.equal(bl.indexOf('fgabc'), 5) - t.equal(bl.indexOf('fgabc', 6), 12) - t.equal(bl.indexOf('fgabc', 13), -1) - - t.end() -}) - -// only present in node 6+ -;(process.version.substr(1).split('.')[0] >= 6) && tape('indexOf latin1 and binary encoding', (t) => { - const b = new BufferList('abcdef') - - // test latin1 encoding - t.equal( - new BufferList(Buffer.from(b.toString('latin1'), 'latin1')) - .indexOf('d', 0, 'latin1'), - 3 - ) - t.equal( - new BufferList(Buffer.from(b.toString('latin1'), 'latin1')) - .indexOf(Buffer.from('d', 'latin1'), 0, 'latin1'), - 3 - ) - t.equal( - new BufferList(Buffer.from('aa\u00e8aa', 'latin1')) - .indexOf('\u00e8', 'latin1'), - 2 - ) - t.equal( - new BufferList(Buffer.from('\u00e8', 'latin1')) - .indexOf('\u00e8', 'latin1'), - 0 - ) - t.equal( - new BufferList(Buffer.from('\u00e8', 'latin1')) - .indexOf(Buffer.from('\u00e8', 'latin1'), 'latin1'), - 0 - ) - - // test binary encoding - t.equal( - new BufferList(Buffer.from(b.toString('binary'), 'binary')) - .indexOf('d', 0, 'binary'), - 3 - ) - t.equal( - new BufferList(Buffer.from(b.toString('binary'), 'binary')) - .indexOf(Buffer.from('d', 'binary'), 0, 'binary'), - 3 - ) - t.equal( - new BufferList(Buffer.from('aa\u00e8aa', 'binary')) - .indexOf('\u00e8', 'binary'), - 2 - ) - t.equal( - new BufferList(Buffer.from('\u00e8', 'binary')) - .indexOf('\u00e8', 'binary'), - 0 - ) - t.equal( - new BufferList(Buffer.from('\u00e8', 'binary')) - .indexOf(Buffer.from('\u00e8', 'binary'), 'binary'), - 0 - ) - - t.end() -}) - -tape('indexOf the entire nodejs10 buffer test suite', (t) => { - const b = new BufferList('abcdef') - const bufA = Buffer.from('a') - const bufBc = Buffer.from('bc') - const bufF = Buffer.from('f') - const bufZ = Buffer.from('z') - - const stringComparison = 'abcdef' - - t.equal(b.indexOf('a'), 0) - t.equal(b.indexOf('a', 1), -1) - t.equal(b.indexOf('a', -1), -1) - t.equal(b.indexOf('a', -4), -1) - t.equal(b.indexOf('a', -b.length), 0) - t.equal(b.indexOf('a', NaN), 0) - t.equal(b.indexOf('a', -Infinity), 0) - t.equal(b.indexOf('a', Infinity), -1) - t.equal(b.indexOf('bc'), 1) - t.equal(b.indexOf('bc', 2), -1) - t.equal(b.indexOf('bc', -1), -1) - t.equal(b.indexOf('bc', -3), -1) - t.equal(b.indexOf('bc', -5), 1) - t.equal(b.indexOf('bc', NaN), 1) - t.equal(b.indexOf('bc', -Infinity), 1) - t.equal(b.indexOf('bc', Infinity), -1) - t.equal(b.indexOf('f'), b.length - 1) - t.equal(b.indexOf('z'), -1) - - // empty search tests - t.equal(b.indexOf(bufA), 0) - t.equal(b.indexOf(bufA, 1), -1) - t.equal(b.indexOf(bufA, -1), -1) - t.equal(b.indexOf(bufA, -4), -1) - t.equal(b.indexOf(bufA, -b.length), 0) - t.equal(b.indexOf(bufA, NaN), 0) - t.equal(b.indexOf(bufA, -Infinity), 0) - t.equal(b.indexOf(bufA, Infinity), -1) - t.equal(b.indexOf(bufBc), 1) - t.equal(b.indexOf(bufBc, 2), -1) - t.equal(b.indexOf(bufBc, -1), -1) - t.equal(b.indexOf(bufBc, -3), -1) - t.equal(b.indexOf(bufBc, -5), 1) - t.equal(b.indexOf(bufBc, NaN), 1) - t.equal(b.indexOf(bufBc, -Infinity), 1) - t.equal(b.indexOf(bufBc, Infinity), -1) - t.equal(b.indexOf(bufF), b.length - 1) - t.equal(b.indexOf(bufZ), -1) - t.equal(b.indexOf(0x61), 0) - t.equal(b.indexOf(0x61, 1), -1) - t.equal(b.indexOf(0x61, -1), -1) - t.equal(b.indexOf(0x61, -4), -1) - t.equal(b.indexOf(0x61, -b.length), 0) - t.equal(b.indexOf(0x61, NaN), 0) - t.equal(b.indexOf(0x61, -Infinity), 0) - t.equal(b.indexOf(0x61, Infinity), -1) - t.equal(b.indexOf(0x0), -1) - - // test offsets - t.equal(b.indexOf('d', 2), 3) - t.equal(b.indexOf('f', 5), 5) - t.equal(b.indexOf('f', -1), 5) - t.equal(b.indexOf('f', 6), -1) - - t.equal(b.indexOf(Buffer.from('d'), 2), 3) - t.equal(b.indexOf(Buffer.from('f'), 5), 5) - t.equal(b.indexOf(Buffer.from('f'), -1), 5) - t.equal(b.indexOf(Buffer.from('f'), 6), -1) - - t.equal(Buffer.from('ff').indexOf(Buffer.from('f'), 1, 'ucs2'), -1) - - // test invalid and uppercase encoding - t.equal(b.indexOf('b', 'utf8'), 1) - t.equal(b.indexOf('b', 'UTF8'), 1) - t.equal(b.indexOf('62', 'HEX'), 1) - t.throws(() => b.indexOf('bad', 'enc'), TypeError) - - // test hex encoding - t.equal( - Buffer.from(b.toString('hex'), 'hex') - .indexOf('64', 0, 'hex'), - 3 - ) - t.equal( - Buffer.from(b.toString('hex'), 'hex') - .indexOf(Buffer.from('64', 'hex'), 0, 'hex'), - 3 - ) - - // test base64 encoding - t.equal( - Buffer.from(b.toString('base64'), 'base64') - .indexOf('ZA==', 0, 'base64'), - 3 - ) - t.equal( - Buffer.from(b.toString('base64'), 'base64') - .indexOf(Buffer.from('ZA==', 'base64'), 0, 'base64'), - 3 - ) - - // test ascii encoding - t.equal( - Buffer.from(b.toString('ascii'), 'ascii') - .indexOf('d', 0, 'ascii'), - 3 - ) - t.equal( - Buffer.from(b.toString('ascii'), 'ascii') - .indexOf(Buffer.from('d', 'ascii'), 0, 'ascii'), - 3 - ) - - // test optional offset with passed encoding - t.equal(Buffer.from('aaaa0').indexOf('30', 'hex'), 4) - t.equal(Buffer.from('aaaa00a').indexOf('3030', 'hex'), 4) - - { - // test usc2 encoding - const twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2') - - t.equal(8, twoByteString.indexOf('\u0395', 4, 'ucs2')) - t.equal(6, twoByteString.indexOf('\u03a3', -4, 'ucs2')) - t.equal(4, twoByteString.indexOf('\u03a3', -6, 'ucs2')) - t.equal(4, twoByteString.indexOf( - Buffer.from('\u03a3', 'ucs2'), -6, 'ucs2')) - t.equal(-1, twoByteString.indexOf('\u03a3', -2, 'ucs2')) - } - - const mixedByteStringUcs2 = - Buffer.from('\u039a\u0391abc\u03a3\u03a3\u0395', 'ucs2') - - t.equal(6, mixedByteStringUcs2.indexOf('bc', 0, 'ucs2')) - t.equal(10, mixedByteStringUcs2.indexOf('\u03a3', 0, 'ucs2')) - t.equal(-1, mixedByteStringUcs2.indexOf('\u0396', 0, 'ucs2')) - - t.equal( - 6, mixedByteStringUcs2.indexOf(Buffer.from('bc', 'ucs2'), 0, 'ucs2')) - t.equal( - 10, mixedByteStringUcs2.indexOf(Buffer.from('\u03a3', 'ucs2'), 0, 'ucs2')) - t.equal( - -1, mixedByteStringUcs2.indexOf(Buffer.from('\u0396', 'ucs2'), 0, 'ucs2')) - - { - const twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2') - - // Test single char pattern - t.equal(0, twoByteString.indexOf('\u039a', 0, 'ucs2')) - let index = twoByteString.indexOf('\u0391', 0, 'ucs2') - t.equal(2, index, `Alpha - at index ${index}`) - index = twoByteString.indexOf('\u03a3', 0, 'ucs2') - t.equal(4, index, `First Sigma - at index ${index}`) - index = twoByteString.indexOf('\u03a3', 6, 'ucs2') - t.equal(6, index, `Second Sigma - at index ${index}`) - index = twoByteString.indexOf('\u0395', 0, 'ucs2') - t.equal(8, index, `Epsilon - at index ${index}`) - index = twoByteString.indexOf('\u0392', 0, 'ucs2') - t.equal(-1, index, `Not beta - at index ${index}`) - - // Test multi-char pattern - index = twoByteString.indexOf('\u039a\u0391', 0, 'ucs2') - t.equal(0, index, `Lambda Alpha - at index ${index}`) - index = twoByteString.indexOf('\u0391\u03a3', 0, 'ucs2') - t.equal(2, index, `Alpha Sigma - at index ${index}`) - index = twoByteString.indexOf('\u03a3\u03a3', 0, 'ucs2') - t.equal(4, index, `Sigma Sigma - at index ${index}`) - index = twoByteString.indexOf('\u03a3\u0395', 0, 'ucs2') - t.equal(6, index, `Sigma Epsilon - at index ${index}`) - } - - const mixedByteStringUtf8 = Buffer.from('\u039a\u0391abc\u03a3\u03a3\u0395') - - t.equal(5, mixedByteStringUtf8.indexOf('bc')) - t.equal(5, mixedByteStringUtf8.indexOf('bc', 5)) - t.equal(5, mixedByteStringUtf8.indexOf('bc', -8)) - t.equal(7, mixedByteStringUtf8.indexOf('\u03a3')) - t.equal(-1, mixedByteStringUtf8.indexOf('\u0396')) - - // Test complex string indexOf algorithms. Only trigger for long strings. - // Long string that isn't a simple repeat of a shorter string. - let longString = 'A' - for (let i = 66; i < 76; i++) { // from 'B' to 'K' - longString = longString + String.fromCharCode(i) + longString - } - - const longBufferString = Buffer.from(longString) - - // pattern of 15 chars, repeated every 16 chars in long - let pattern = 'ABACABADABACABA' - for (let i = 0; i < longBufferString.length - pattern.length; i += 7) { - const index = longBufferString.indexOf(pattern, i) - t.equal((i + 15) & ~0xf, index, - `Long ABACABA...-string at index ${i}`) - } - - let index = longBufferString.indexOf('AJABACA') - t.equal(510, index, `Long AJABACA, First J - at index ${index}`) - index = longBufferString.indexOf('AJABACA', 511) - t.equal(1534, index, `Long AJABACA, Second J - at index ${index}`) - - pattern = 'JABACABADABACABA' - index = longBufferString.indexOf(pattern) - t.equal(511, index, `Long JABACABA..., First J - at index ${index}`) - index = longBufferString.indexOf(pattern, 512) - t.equal( - 1535, index, `Long JABACABA..., Second J - at index ${index}`) - - // Search for a non-ASCII string in a pure ASCII string. - const asciiString = Buffer.from( - 'somethingnotatallsinisterwhichalsoworks') - t.equal(-1, asciiString.indexOf('\x2061')) - t.equal(3, asciiString.indexOf('eth', 0)) - - // Search in string containing many non-ASCII chars. - const allCodePoints = [] - for (let i = 0; i < 65536; i++) { - allCodePoints[i] = i - } - - const allCharsString = String.fromCharCode.apply(String, allCodePoints) - const allCharsBufferUtf8 = Buffer.from(allCharsString) - const allCharsBufferUcs2 = Buffer.from(allCharsString, 'ucs2') - - // Search for string long enough to trigger complex search with ASCII pattern - // and UC16 subject. - t.equal(-1, allCharsBufferUtf8.indexOf('notfound')) - t.equal(-1, allCharsBufferUcs2.indexOf('notfound')) - - // Needle is longer than haystack, but only because it's encoded as UTF-16 - t.equal(Buffer.from('aaaa').indexOf('a'.repeat(4), 'ucs2'), -1) - - t.equal(Buffer.from('aaaa').indexOf('a'.repeat(4), 'utf8'), 0) - t.equal(Buffer.from('aaaa').indexOf('你好', 'ucs2'), -1) - - // Haystack has odd length, but the needle is UCS2. - t.equal(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1) - - { - // Find substrings in Utf8. - const lengths = [1, 3, 15] // Single char, simple and complex. - const indices = [0x5, 0x60, 0x400, 0x680, 0x7ee, 0xFF02, 0x16610, 0x2f77b] - for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) { - for (let i = 0; i < indices.length; i++) { - const index = indices[i] - let length = lengths[lengthIndex] - - if (index + length > 0x7F) { - length = 2 * length - } - - if (index + length > 0x7FF) { - length = 3 * length - } - - if (index + length > 0xFFFF) { - length = 4 * length - } - - const patternBufferUtf8 = allCharsBufferUtf8.slice(index, index + length) - t.equal(index, allCharsBufferUtf8.indexOf(patternBufferUtf8)) - - const patternStringUtf8 = patternBufferUtf8.toString() - t.equal(index, allCharsBufferUtf8.indexOf(patternStringUtf8)) - } - } - } - - { - // Find substrings in Usc2. - const lengths = [2, 4, 16] // Single char, simple and complex. - const indices = [0x5, 0x65, 0x105, 0x205, 0x285, 0x2005, 0x2085, 0xfff0] - - for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) { - for (let i = 0; i < indices.length; i++) { - const index = indices[i] * 2 - const length = lengths[lengthIndex] - - const patternBufferUcs2 = - allCharsBufferUcs2.slice(index, index + length) - t.equal( - index, allCharsBufferUcs2.indexOf(patternBufferUcs2, 0, 'ucs2')) - - const patternStringUcs2 = patternBufferUcs2.toString('ucs2') - t.equal( - index, allCharsBufferUcs2.indexOf(patternStringUcs2, 0, 'ucs2')) - } - } - } - - [ - () => {}, - {}, - [] - ].forEach((val) => { - t.throws(() => b.indexOf(val), TypeError, `"${JSON.stringify(val)}" should throw`) - }) - - // Test weird offset arguments. - // The following offsets coerce to NaN or 0, searching the whole Buffer - t.equal(b.indexOf('b', undefined), 1) - t.equal(b.indexOf('b', {}), 1) - t.equal(b.indexOf('b', 0), 1) - t.equal(b.indexOf('b', null), 1) - t.equal(b.indexOf('b', []), 1) - - // The following offset coerces to 2, in other words +[2] === 2 - t.equal(b.indexOf('b', [2]), -1) - - // Behavior should match String.indexOf() - t.equal( - b.indexOf('b', undefined), - stringComparison.indexOf('b', undefined)) - t.equal( - b.indexOf('b', {}), - stringComparison.indexOf('b', {})) - t.equal( - b.indexOf('b', 0), - stringComparison.indexOf('b', 0)) - t.equal( - b.indexOf('b', null), - stringComparison.indexOf('b', null)) - t.equal( - b.indexOf('b', []), - stringComparison.indexOf('b', [])) - t.equal( - b.indexOf('b', [2]), - stringComparison.indexOf('b', [2])) - - // test truncation of Number arguments to uint8 - { - const buf = Buffer.from('this is a test') - - t.equal(buf.indexOf(0x6973), 3) - t.equal(buf.indexOf(0x697320), 4) - t.equal(buf.indexOf(0x69732069), 2) - t.equal(buf.indexOf(0x697374657374), 0) - t.equal(buf.indexOf(0x69737374), 0) - t.equal(buf.indexOf(0x69737465), 11) - t.equal(buf.indexOf(0x69737465), 11) - t.equal(buf.indexOf(-140), 0) - t.equal(buf.indexOf(-152), 1) - t.equal(buf.indexOf(0xff), -1) - t.equal(buf.indexOf(0xffff), -1) - } - - // Test that Uint8Array arguments are okay. - { - const needle = new Uint8Array([0x66, 0x6f, 0x6f]) - const haystack = new BufferList(Buffer.from('a foo b foo')) - t.equal(haystack.indexOf(needle), 2) - } - - t.end() -}) diff --git a/node_modules/bl/test/isBufferList.js b/node_modules/bl/test/isBufferList.js deleted file mode 100644 index 9d895d59b3..0000000000 --- a/node_modules/bl/test/isBufferList.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict' - -const tape = require('tape') -const { BufferList, BufferListStream } = require('../') -const { Buffer } = require('buffer') - -tape('isBufferList positives', (t) => { - t.ok(BufferList.isBufferList(new BufferList())) - t.ok(BufferList.isBufferList(new BufferListStream())) - - t.end() -}) - -tape('isBufferList negatives', (t) => { - const types = [ - null, - undefined, - NaN, - true, - false, - {}, - [], - Buffer.alloc(0), - [Buffer.alloc(0)] - ] - - for (const obj of types) { - t.notOk(BufferList.isBufferList(obj)) - } - - t.end() -}) diff --git a/node_modules/bl/test/test.js b/node_modules/bl/test/test.js deleted file mode 100644 index e523d0c3f2..0000000000 --- a/node_modules/bl/test/test.js +++ /dev/null @@ -1,869 +0,0 @@ -'use strict' - -const tape = require('tape') -const crypto = require('crypto') -const fs = require('fs') -const path = require('path') -const BufferList = require('../') -const { Buffer } = require('buffer') - -const encodings = - ('hex utf8 utf-8 ascii binary base64' + - (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ') - -require('./indexOf') -require('./isBufferList') -require('./convert') - -tape('single bytes from single buffer', function (t) { - const bl = new BufferList() - - bl.append(Buffer.from('abcd')) - - t.equal(bl.length, 4) - t.equal(bl.get(-1), undefined) - t.equal(bl.get(0), 97) - t.equal(bl.get(1), 98) - t.equal(bl.get(2), 99) - t.equal(bl.get(3), 100) - t.equal(bl.get(4), undefined) - - t.end() -}) - -tape('single bytes from multiple buffers', function (t) { - const bl = new BufferList() - - bl.append(Buffer.from('abcd')) - bl.append(Buffer.from('efg')) - bl.append(Buffer.from('hi')) - bl.append(Buffer.from('j')) - - t.equal(bl.length, 10) - - t.equal(bl.get(0), 97) - t.equal(bl.get(1), 98) - t.equal(bl.get(2), 99) - t.equal(bl.get(3), 100) - t.equal(bl.get(4), 101) - t.equal(bl.get(5), 102) - t.equal(bl.get(6), 103) - t.equal(bl.get(7), 104) - t.equal(bl.get(8), 105) - t.equal(bl.get(9), 106) - - t.end() -}) - -tape('multi bytes from single buffer', function (t) { - const bl = new BufferList() - - bl.append(Buffer.from('abcd')) - - t.equal(bl.length, 4) - - t.equal(bl.slice(0, 4).toString('ascii'), 'abcd') - t.equal(bl.slice(0, 3).toString('ascii'), 'abc') - t.equal(bl.slice(1, 4).toString('ascii'), 'bcd') - t.equal(bl.slice(-4, -1).toString('ascii'), 'abc') - - t.end() -}) - -tape('multi bytes from single buffer (negative indexes)', function (t) { - const bl = new BufferList() - - bl.append(Buffer.from('buffer')) - - t.equal(bl.length, 6) - - t.equal(bl.slice(-6, -1).toString('ascii'), 'buffe') - t.equal(bl.slice(-6, -2).toString('ascii'), 'buff') - t.equal(bl.slice(-5, -2).toString('ascii'), 'uff') - - t.end() -}) - -tape('multiple bytes from multiple buffers', function (t) { - const bl = new BufferList() - - bl.append(Buffer.from('abcd')) - bl.append(Buffer.from('efg')) - bl.append(Buffer.from('hi')) - bl.append(Buffer.from('j')) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') - t.equal(bl.slice(3, 6).toString('ascii'), 'def') - t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') - t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') - t.equal(bl.slice(-7, -4).toString('ascii'), 'def') - - t.end() -}) - -tape('multiple bytes from multiple buffer lists', function (t) { - const bl = new BufferList() - - bl.append(new BufferList([Buffer.from('abcd'), Buffer.from('efg')])) - bl.append(new BufferList([Buffer.from('hi'), Buffer.from('j')])) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - - t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') - t.equal(bl.slice(3, 6).toString('ascii'), 'def') - t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') - t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') - - t.end() -}) - -// same data as previous test, just using nested constructors -tape('multiple bytes from crazy nested buffer lists', function (t) { - const bl = new BufferList() - - bl.append(new BufferList([ - new BufferList([ - new BufferList(Buffer.from('abc')), - Buffer.from('d'), - new BufferList(Buffer.from('efg')) - ]), - new BufferList([Buffer.from('hi')]), - new BufferList(Buffer.from('j')) - ])) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - - t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') - t.equal(bl.slice(3, 6).toString('ascii'), 'def') - t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') - t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') - - t.end() -}) - -tape('append accepts arrays of Buffers', function (t) { - const bl = new BufferList() - - bl.append(Buffer.from('abc')) - bl.append([Buffer.from('def')]) - bl.append([Buffer.from('ghi'), Buffer.from('jkl')]) - bl.append([Buffer.from('mnop'), Buffer.from('qrstu'), Buffer.from('vwxyz')]) - t.equal(bl.length, 26) - t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') - - t.end() -}) - -tape('append accepts arrays of Uint8Arrays', function (t) { - const bl = new BufferList() - - bl.append(new Uint8Array([97, 98, 99])) - bl.append([Uint8Array.from([100, 101, 102])]) - bl.append([new Uint8Array([103, 104, 105]), new Uint8Array([106, 107, 108])]) - bl.append([new Uint8Array([109, 110, 111, 112]), new Uint8Array([113, 114, 115, 116, 117]), new Uint8Array([118, 119, 120, 121, 122])]) - t.equal(bl.length, 26) - t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') - - t.end() -}) - -tape('append accepts arrays of BufferLists', function (t) { - const bl = new BufferList() - - bl.append(Buffer.from('abc')) - bl.append([new BufferList('def')]) - bl.append(new BufferList([Buffer.from('ghi'), new BufferList('jkl')])) - bl.append([Buffer.from('mnop'), new BufferList([Buffer.from('qrstu'), Buffer.from('vwxyz')])]) - t.equal(bl.length, 26) - t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') - - t.end() -}) - -tape('append chainable', function (t) { - const bl = new BufferList() - - t.ok(bl.append(Buffer.from('abcd')) === bl) - t.ok(bl.append([Buffer.from('abcd')]) === bl) - t.ok(bl.append(new BufferList(Buffer.from('abcd'))) === bl) - t.ok(bl.append([new BufferList(Buffer.from('abcd'))]) === bl) - - t.end() -}) - -tape('append chainable (test results)', function (t) { - const bl = new BufferList('abc') - .append([new BufferList('def')]) - .append(new BufferList([Buffer.from('ghi'), new BufferList('jkl')])) - .append([Buffer.from('mnop'), new BufferList([Buffer.from('qrstu'), Buffer.from('vwxyz')])]) - - t.equal(bl.length, 26) - t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') - - t.end() -}) - -tape('consuming from multiple buffers', function (t) { - const bl = new BufferList() - - bl.append(Buffer.from('abcd')) - bl.append(Buffer.from('efg')) - bl.append(Buffer.from('hi')) - bl.append(Buffer.from('j')) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - - bl.consume(3) - t.equal(bl.length, 7) - t.equal(bl.slice(0, 7).toString('ascii'), 'defghij') - - bl.consume(2) - t.equal(bl.length, 5) - t.equal(bl.slice(0, 5).toString('ascii'), 'fghij') - - bl.consume(1) - t.equal(bl.length, 4) - t.equal(bl.slice(0, 4).toString('ascii'), 'ghij') - - bl.consume(1) - t.equal(bl.length, 3) - t.equal(bl.slice(0, 3).toString('ascii'), 'hij') - - bl.consume(2) - t.equal(bl.length, 1) - t.equal(bl.slice(0, 1).toString('ascii'), 'j') - - t.end() -}) - -tape('complete consumption', function (t) { - const bl = new BufferList() - - bl.append(Buffer.from('a')) - bl.append(Buffer.from('b')) - - bl.consume(2) - - t.equal(bl.length, 0) - t.equal(bl._bufs.length, 0) - - t.end() -}) - -tape('test readUInt8 / readInt8', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(3) - const bl = new BufferList() - - buf1[0] = 0x1 - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt8(), 0x1) - t.equal(bl.readUInt8(2), 0x3) - t.equal(bl.readInt8(2), 0x3) - t.equal(bl.readUInt8(3), 0x4) - t.equal(bl.readInt8(3), 0x4) - t.equal(bl.readUInt8(4), 0x23) - t.equal(bl.readInt8(4), 0x23) - t.equal(bl.readUInt8(5), 0x42) - t.equal(bl.readInt8(5), 0x42) - - t.end() -}) - -tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(3) - const bl = new BufferList() - - buf1[0] = 0x1 - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt16BE(), 0x0100) - t.equal(bl.readUInt16LE(), 0x0001) - t.equal(bl.readUInt16BE(2), 0x0304) - t.equal(bl.readUInt16LE(2), 0x0403) - t.equal(bl.readInt16BE(2), 0x0304) - t.equal(bl.readInt16LE(2), 0x0403) - t.equal(bl.readUInt16BE(3), 0x0423) - t.equal(bl.readUInt16LE(3), 0x2304) - t.equal(bl.readInt16BE(3), 0x0423) - t.equal(bl.readInt16LE(3), 0x2304) - t.equal(bl.readUInt16BE(4), 0x2342) - t.equal(bl.readUInt16LE(4), 0x4223) - t.equal(bl.readInt16BE(4), 0x2342) - t.equal(bl.readInt16LE(4), 0x4223) - - t.end() -}) - -tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(3) - const bl = new BufferList() - - buf1[0] = 0x1 - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt32BE(), 0x01000304) - t.equal(bl.readUInt32LE(), 0x04030001) - t.equal(bl.readUInt32BE(2), 0x03042342) - t.equal(bl.readUInt32LE(2), 0x42230403) - t.equal(bl.readInt32BE(2), 0x03042342) - t.equal(bl.readInt32LE(2), 0x42230403) - - t.end() -}) - -tape('test readUIntLE / readUIntBE / readIntLE / readIntBE', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(3) - const bl = new BufferList() - - buf2[0] = 0x2 - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - buf3[2] = 0x61 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUIntBE(1, 1), 0x02) - t.equal(bl.readUIntBE(1, 2), 0x0203) - t.equal(bl.readUIntBE(1, 3), 0x020304) - t.equal(bl.readUIntBE(1, 4), 0x02030423) - t.equal(bl.readUIntBE(1, 5), 0x0203042342) - t.equal(bl.readUIntBE(1, 6), 0x020304234261) - t.equal(bl.readUIntLE(1, 1), 0x02) - t.equal(bl.readUIntLE(1, 2), 0x0302) - t.equal(bl.readUIntLE(1, 3), 0x040302) - t.equal(bl.readUIntLE(1, 4), 0x23040302) - t.equal(bl.readUIntLE(1, 5), 0x4223040302) - t.equal(bl.readUIntLE(1, 6), 0x614223040302) - t.equal(bl.readIntBE(1, 1), 0x02) - t.equal(bl.readIntBE(1, 2), 0x0203) - t.equal(bl.readIntBE(1, 3), 0x020304) - t.equal(bl.readIntBE(1, 4), 0x02030423) - t.equal(bl.readIntBE(1, 5), 0x0203042342) - t.equal(bl.readIntBE(1, 6), 0x020304234261) - t.equal(bl.readIntLE(1, 1), 0x02) - t.equal(bl.readIntLE(1, 2), 0x0302) - t.equal(bl.readIntLE(1, 3), 0x040302) - t.equal(bl.readIntLE(1, 4), 0x23040302) - t.equal(bl.readIntLE(1, 5), 0x4223040302) - t.equal(bl.readIntLE(1, 6), 0x614223040302) - - t.end() -}) - -tape('test readFloatLE / readFloatBE', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(3) - const bl = new BufferList() - - buf1[0] = 0x01 - buf2[1] = 0x00 - buf2[2] = 0x00 - buf3[0] = 0x80 - buf3[1] = 0x3f - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - const canonical = Buffer.concat([buf1, buf2, buf3]) - t.equal(bl.readFloatLE(), canonical.readFloatLE()) - t.equal(bl.readFloatBE(), canonical.readFloatBE()) - t.equal(bl.readFloatLE(2), canonical.readFloatLE(2)) - t.equal(bl.readFloatBE(2), canonical.readFloatBE(2)) - - t.end() -}) - -tape('test readDoubleLE / readDoubleBE', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(10) - const bl = new BufferList() - - buf1[0] = 0x01 - buf2[1] = 0x55 - buf2[2] = 0x55 - buf3[0] = 0x55 - buf3[1] = 0x55 - buf3[2] = 0x55 - buf3[3] = 0x55 - buf3[4] = 0xd5 - buf3[5] = 0x3f - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - const canonical = Buffer.concat([buf1, buf2, buf3]) - t.equal(bl.readDoubleBE(), canonical.readDoubleBE()) - t.equal(bl.readDoubleLE(), canonical.readDoubleLE()) - t.equal(bl.readDoubleBE(2), canonical.readDoubleBE(2)) - t.equal(bl.readDoubleLE(2), canonical.readDoubleLE(2)) - - t.end() -}) - -tape('test toString', function (t) { - const bl = new BufferList() - - bl.append(Buffer.from('abcd')) - bl.append(Buffer.from('efg')) - bl.append(Buffer.from('hi')) - bl.append(Buffer.from('j')) - - t.equal(bl.toString('ascii', 0, 10), 'abcdefghij') - t.equal(bl.toString('ascii', 3, 10), 'defghij') - t.equal(bl.toString('ascii', 3, 6), 'def') - t.equal(bl.toString('ascii', 3, 8), 'defgh') - t.equal(bl.toString('ascii', 5, 10), 'fghij') - - t.end() -}) - -tape('test toString encoding', function (t) { - const bl = new BufferList() - const b = Buffer.from('abcdefghij\xff\x00') - - bl.append(Buffer.from('abcd')) - bl.append(Buffer.from('efg')) - bl.append(Buffer.from('hi')) - bl.append(Buffer.from('j')) - bl.append(Buffer.from('\xff\x00')) - - encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc), enc) - }) - - t.end() -}) - -tape('uninitialized memory', function (t) { - const secret = crypto.randomBytes(256) - for (let i = 0; i < 1e6; i++) { - const clone = Buffer.from(secret) - const bl = new BufferList() - bl.append(Buffer.from('a')) - bl.consume(-1024) - const buf = bl.slice(1) - if (buf.indexOf(clone) !== -1) { - t.fail(`Match (at ${i})`) - break - } - } - t.end() -}) - -!process.browser && tape('test stream', function (t) { - const random = crypto.randomBytes(65534) - - const bl = new BufferList((err, buf) => { - t.ok(Buffer.isBuffer(buf)) - t.ok(err === null) - t.ok(random.equals(bl.slice())) - t.ok(random.equals(buf.slice())) - - bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat')) - .on('close', function () { - const rndhash = crypto.createHash('md5').update(random).digest('hex') - const md5sum = crypto.createHash('md5') - const s = fs.createReadStream('/tmp/bl_test_rnd_out.dat') - - s.on('data', md5sum.update.bind(md5sum)) - s.on('end', function () { - t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!') - t.end() - }) - }) - }) - - fs.writeFileSync('/tmp/bl_test_rnd.dat', random) - fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl) -}) - -tape('instantiation with Buffer', function (t) { - const buf = crypto.randomBytes(1024) - const buf2 = crypto.randomBytes(1024) - let b = BufferList(buf) - - t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer') - b = BufferList([buf, buf2]) - t.equal(b.slice().toString('hex'), Buffer.concat([buf, buf2]).toString('hex'), 'same buffer') - - t.end() -}) - -tape('test String appendage', function (t) { - const bl = new BufferList() - const b = Buffer.from('abcdefghij\xff\x00') - - bl.append('abcd') - bl.append('efg') - bl.append('hi') - bl.append('j') - bl.append('\xff\x00') - - encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc)) - }) - - t.end() -}) - -tape('test Number appendage', function (t) { - const bl = new BufferList() - const b = Buffer.from('1234567890') - - bl.append(1234) - bl.append(567) - bl.append(89) - bl.append(0) - - encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc)) - }) - - t.end() -}) - -tape('write nothing, should get empty buffer', function (t) { - t.plan(3) - BufferList(function (err, data) { - t.notOk(err, 'no error') - t.ok(Buffer.isBuffer(data), 'got a buffer') - t.equal(0, data.length, 'got a zero-length buffer') - t.end() - }).end() -}) - -tape('unicode string', function (t) { - t.plan(2) - - const inp1 = '\u2600' - const inp2 = '\u2603' - const exp = inp1 + ' and ' + inp2 - const bl = BufferList() - - bl.write(inp1) - bl.write(' and ') - bl.write(inp2) - t.equal(exp, bl.toString()) - t.equal(Buffer.from(exp).toString('hex'), bl.toString('hex')) -}) - -tape('should emit finish', function (t) { - const source = BufferList() - const dest = BufferList() - - source.write('hello') - source.pipe(dest) - - dest.on('finish', function () { - t.equal(dest.toString('utf8'), 'hello') - t.end() - }) -}) - -tape('basic copy', function (t) { - const buf = crypto.randomBytes(1024) - const buf2 = Buffer.alloc(1024) - const b = BufferList(buf) - - b.copy(buf2) - t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') - - t.end() -}) - -tape('copy after many appends', function (t) { - const buf = crypto.randomBytes(512) - const buf2 = Buffer.alloc(1024) - const b = BufferList(buf) - - b.append(buf) - b.copy(buf2) - t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') - - t.end() -}) - -tape('copy at a precise position', function (t) { - const buf = crypto.randomBytes(1004) - const buf2 = Buffer.alloc(1024) - const b = BufferList(buf) - - b.copy(buf2, 20) - t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer') - - t.end() -}) - -tape('copy starting from a precise location', function (t) { - const buf = crypto.randomBytes(10) - const buf2 = Buffer.alloc(5) - const b = BufferList(buf) - - b.copy(buf2, 0, 5) - t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer') - - t.end() -}) - -tape('copy in an interval', function (t) { - const rnd = crypto.randomBytes(10) - const b = BufferList(rnd) // put the random bytes there - const actual = Buffer.alloc(3) - const expected = Buffer.alloc(3) - - rnd.copy(expected, 0, 5, 8) - b.copy(actual, 0, 5, 8) - - t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer') - - t.end() -}) - -tape('copy an interval between two buffers', function (t) { - const buf = crypto.randomBytes(10) - const buf2 = Buffer.alloc(10) - const b = BufferList(buf) - - b.append(buf) - b.copy(buf2, 0, 5, 15) - - t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer') - - t.end() -}) - -tape('shallow slice across buffer boundaries', function (t) { - const bl = new BufferList(['First', 'Second', 'Third']) - - t.equal(bl.shallowSlice(3, 13).toString(), 'stSecondTh') - - t.end() -}) - -tape('shallow slice within single buffer', function (t) { - t.plan(2) - - const bl = new BufferList(['First', 'Second', 'Third']) - - t.equal(bl.shallowSlice(5, 10).toString(), 'Secon') - t.equal(bl.shallowSlice(7, 10).toString(), 'con') - - t.end() -}) - -tape('shallow slice single buffer', function (t) { - t.plan(3) - - const bl = new BufferList(['First', 'Second', 'Third']) - - t.equal(bl.shallowSlice(0, 5).toString(), 'First') - t.equal(bl.shallowSlice(5, 11).toString(), 'Second') - t.equal(bl.shallowSlice(11, 16).toString(), 'Third') -}) - -tape('shallow slice with negative or omitted indices', function (t) { - t.plan(4) - - const bl = new BufferList(['First', 'Second', 'Third']) - - t.equal(bl.shallowSlice().toString(), 'FirstSecondThird') - t.equal(bl.shallowSlice(5).toString(), 'SecondThird') - t.equal(bl.shallowSlice(5, -3).toString(), 'SecondTh') - t.equal(bl.shallowSlice(-8).toString(), 'ondThird') -}) - -tape('shallow slice does not make a copy', function (t) { - t.plan(1) - - const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')] - const bl = (new BufferList(buffers)).shallowSlice(5, -3) - - buffers[1].fill('h') - buffers[2].fill('h') - - t.equal(bl.toString(), 'hhhhhhhh') -}) - -tape('shallow slice with 0 length', function (t) { - t.plan(1) - - const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')] - const bl = (new BufferList(buffers)).shallowSlice(0, 0) - - t.equal(bl.length, 0) -}) - -tape('shallow slice with 0 length from middle', function (t) { - t.plan(1) - - const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')] - const bl = (new BufferList(buffers)).shallowSlice(10, 10) - - t.equal(bl.length, 0) -}) - -tape('duplicate', function (t) { - t.plan(2) - - const bl = new BufferList('abcdefghij\xff\x00') - const dup = bl.duplicate() - - t.equal(bl.prototype, dup.prototype) - t.equal(bl.toString('hex'), dup.toString('hex')) -}) - -tape('destroy no pipe', function (t) { - t.plan(2) - - const bl = new BufferList('alsdkfja;lsdkfja;lsdk') - - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) -}) - -tape('destroy with error', function (t) { - t.plan(3) - - const bl = new BufferList('alsdkfja;lsdkfja;lsdk') - const err = new Error('kaboom') - - bl.destroy(err) - bl.on('error', function (_err) { - t.equal(_err, err) - }) - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) -}) - -!process.browser && tape('destroy with pipe before read end', function (t) { - t.plan(2) - - const bl = new BufferList() - fs.createReadStream(path.join(__dirname, '/test.js')) - .pipe(bl) - - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) -}) - -!process.browser && tape('destroy with pipe before read end with race', function (t) { - t.plan(2) - - const bl = new BufferList() - - fs.createReadStream(path.join(__dirname, '/test.js')) - .pipe(bl) - - setTimeout(function () { - bl.destroy() - setTimeout(function () { - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) - }, 500) - }, 500) -}) - -!process.browser && tape('destroy with pipe after read end', function (t) { - t.plan(2) - - const bl = new BufferList() - - fs.createReadStream(path.join(__dirname, '/test.js')) - .on('end', onEnd) - .pipe(bl) - - function onEnd () { - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) - } -}) - -!process.browser && tape('destroy with pipe while writing to a destination', function (t) { - t.plan(4) - - const bl = new BufferList() - const ds = new BufferList() - - fs.createReadStream(path.join(__dirname, '/test.js')) - .on('end', onEnd) - .pipe(bl) - - function onEnd () { - bl.pipe(ds) - - setTimeout(function () { - bl.destroy() - - t.equals(bl._bufs.length, 0) - t.equals(bl.length, 0) - - ds.destroy() - - t.equals(bl._bufs.length, 0) - t.equals(bl.length, 0) - }, 100) - } -}) - -!process.browser && tape('handle error', function (t) { - t.plan(2) - - fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) { - t.ok(err instanceof Error, 'has error') - t.notOk(data, 'no data') - })) -}) diff --git a/node_modules/boxen/index.d.ts b/node_modules/boxen/index.d.ts deleted file mode 100644 index 69ebd426c3..0000000000 --- a/node_modules/boxen/index.d.ts +++ /dev/null @@ -1,200 +0,0 @@ -import {LiteralUnion} from 'type-fest'; -import {BoxStyle, Boxes} from 'cli-boxes'; - -declare namespace boxen { - /** - Characters used for custom border. - - @example - ``` - // affffb - // e e - // dffffc - - const border: CustomBorderStyle = { - topLeft: 'a', - topRight: 'b', - bottomRight: 'c', - bottomLeft: 'd', - vertical: 'e', - horizontal: 'f' - }; - ``` - */ - interface CustomBorderStyle extends BoxStyle {} - - /** - Spacing used for `padding` and `margin`. - */ - interface Spacing { - readonly top: number; - readonly right: number; - readonly bottom: number; - readonly left: number; - } - - interface Options { - /** - Color of the box border. - */ - readonly borderColor?: LiteralUnion< - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'gray' - | 'grey' - | 'blackBright' - | 'redBright' - | 'greenBright' - | 'yellowBright' - | 'blueBright' - | 'magentaBright' - | 'cyanBright' - | 'whiteBright', - string - >; - - /** - Style of the box border. - - @default 'single' - */ - readonly borderStyle?: keyof Boxes | CustomBorderStyle; - - /** - Reduce opacity of the border. - - @default false - */ - readonly dimBorder?: boolean; - - /** - Space between the text and box border. - - @default 0 - */ - readonly padding?: number | Spacing; - - /** - Space around the box. - - @default 0 - */ - readonly margin?: number | Spacing; - - /** - Float the box on the available terminal screen space. - - @default 'left' - */ - readonly float?: 'left' | 'right' | 'center'; - - /** - Color of the background. - */ - readonly backgroundColor?: LiteralUnion< - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'blackBright' - | 'redBright' - | 'greenBright' - | 'yellowBright' - | 'blueBright' - | 'magentaBright' - | 'cyanBright' - | 'whiteBright', - string - >; - - /** - Align the text in the box based on the widest line. - - @default 'left' - @deprecated Use `textAlignment` instead. - */ - readonly align?: 'left' | 'right' | 'center'; - - /** - Align the text in the box based on the widest line. - - @default 'left' - */ - readonly textAlignment?: 'left' | 'right' | 'center'; - - /** - Display a title at the top of the box. - If needed, the box will horizontally expand to fit the title. - - @example - ``` - console.log(boxen('foo bar', {title: 'example'})); - // ┌ example ┐ - // │foo bar │ - // └─────────┘ - ``` - */ - readonly title?: string; - - /** - Align the title in the top bar. - - @default 'left' - - @example - ``` - console.log(boxen('foo bar foo bar', {title: 'example', titleAlignment: 'center'})); - // ┌─── example ───┐ - // │foo bar foo bar│ - // └───────────────┘ - - console.log(boxen('foo bar foo bar', {title: 'example', titleAlignment: 'right'})); - // ┌────── example ┐ - // │foo bar foo bar│ - // └───────────────┘ - ``` - */ - readonly titleAlignment?: 'left' | 'right' | 'center'; - } -} - -/** -Creates a box in the terminal. - -@param text - The text inside the box. -@returns The box. - -@example -``` -import boxen = require('boxen'); - -console.log(boxen('unicorn', {padding: 1})); -// ┌─────────────┐ -// │ │ -// │ unicorn │ -// │ │ -// └─────────────┘ - -console.log(boxen('unicorn', {padding: 1, margin: 1, borderStyle: 'double'})); -// -// ╔═════════════╗ -// ║ ║ -// ║ unicorn ║ -// ║ ║ -// ╚═════════════╝ -// -``` -*/ -declare const boxen: (text: string, options?: boxen.Options) => string; - -export = boxen; diff --git a/node_modules/boxen/index.js b/node_modules/boxen/index.js deleted file mode 100644 index d6bc693c53..0000000000 --- a/node_modules/boxen/index.js +++ /dev/null @@ -1,279 +0,0 @@ -'use strict'; -const stringWidth = require('string-width'); -const chalk = require('chalk'); -const widestLine = require('widest-line'); -const cliBoxes = require('cli-boxes'); -const camelCase = require('camelcase'); -const ansiAlign = require('ansi-align'); -const wrapAnsi = require('wrap-ansi'); - -const NL = '\n'; -const PAD = ' '; - -const terminalColumns = () => { - const {env, stdout, stderr} = process; - - if (stdout && stdout.columns) { - return stdout.columns; - } - - if (stderr && stderr.columns) { - return stderr.columns; - } - - if (env.COLUMNS) { - return Number.parseInt(env.COLUMNS, 10); - } - - return 80; -}; - -const getObject = detail => { - return typeof detail === 'number' ? { - top: detail, - right: detail * 3, - bottom: detail, - left: detail * 3 - } : { - top: 0, - right: 0, - bottom: 0, - left: 0, - ...detail - }; -}; - -const getBorderChars = borderStyle => { - const sides = [ - 'topLeft', - 'topRight', - 'bottomRight', - 'bottomLeft', - 'vertical', - 'horizontal' - ]; - - let chararacters; - - if (typeof borderStyle === 'string') { - chararacters = cliBoxes[borderStyle]; - - if (!chararacters) { - throw new TypeError(`Invalid border style: ${borderStyle}`); - } - } else { - for (const side of sides) { - if (!borderStyle[side] || typeof borderStyle[side] !== 'string') { - throw new TypeError(`Invalid border style: ${side}`); - } - } - - chararacters = borderStyle; - } - - return chararacters; -}; - -const makeTitle = (text, horizontal, alignement) => { - let title = ''; - - const textWidth = stringWidth(text); - - switch (alignement) { - case 'left': - title = text + horizontal.slice(textWidth); - break; - case 'right': - title = horizontal.slice(textWidth) + text; - break; - default: - horizontal = horizontal.slice(textWidth); - - if (horizontal.length % 2 === 1) { // This is needed in case the length is odd - horizontal = horizontal.slice(Math.floor(horizontal.length / 2)); - title = horizontal.slice(1) + text + horizontal; // We reduce the left part of one character to avoid the bar to go beyond its limit - } else { - horizontal = horizontal.slice(horizontal.length / 2); - title = horizontal + text + horizontal; - } - - break; - } - - return title; -}; - -const makeContentText = (text, padding, columns, align) => { - text = ansiAlign(text, {align}); - let lines = text.split(NL); - const textWidth = widestLine(text); - - const max = columns - padding.left - padding.right; - - if (textWidth > max) { - const newLines = []; - for (const line of lines) { - const createdLines = wrapAnsi(line, max, {hard: true}); - const alignedLines = ansiAlign(createdLines, {align}); - const alignedLinesArray = alignedLines.split('\n'); - const longestLength = Math.max(...alignedLinesArray.map(s => stringWidth(s))); - - for (const alignedLine of alignedLinesArray) { - let paddedLine; - switch (align) { - case 'center': - paddedLine = PAD.repeat((max - longestLength) / 2) + alignedLine; - break; - case 'right': - paddedLine = PAD.repeat(max - longestLength) + alignedLine; - break; - default: - paddedLine = alignedLine; - break; - } - - newLines.push(paddedLine); - } - } - - lines = newLines; - } - - if (align === 'center' && textWidth < max) { - lines = lines.map(line => PAD.repeat((max - textWidth) / 2) + line); - } else if (align === 'right' && textWidth < max) { - lines = lines.map(line => PAD.repeat(max - textWidth) + line); - } - - const paddingLeft = PAD.repeat(padding.left); - const paddingRight = PAD.repeat(padding.right); - - lines = lines.map(line => paddingLeft + line + paddingRight); - - lines = lines.map(line => { - if (columns - stringWidth(line) > 0) { - switch (align) { - case 'center': - return line + PAD.repeat(columns - stringWidth(line)); - case 'right': - return line + PAD.repeat(columns - stringWidth(line)); - default: - return line + PAD.repeat(columns - stringWidth(line)); - } - } - - return line; - }); - - if (padding.top > 0) { - lines = new Array(padding.top).fill(PAD.repeat(columns)).concat(lines); - } - - if (padding.bottom > 0) { - lines = lines.concat(new Array(padding.bottom).fill(PAD.repeat(columns))); - } - - return lines.join(NL); -}; - -const isHex = color => color.match(/^#(?:[0-f]{3}){1,2}$/i); -const isColorValid = color => typeof color === 'string' && ((chalk[color]) || isHex(color)); -const getColorFn = color => isHex(color) ? chalk.hex(color) : chalk[color]; -const getBGColorFn = color => isHex(color) ? chalk.bgHex(color) : chalk[camelCase(['bg', color])]; - -module.exports = (text, options) => { - options = { - padding: 0, - borderStyle: 'single', - dimBorder: false, - textAlignment: 'left', - float: 'left', - titleAlignment: 'left', - ...options - }; - - // This option is deprecated - if (options.align) { - options.textAlignment = options.align; - } - - const BORDERS_WIDTH = 2; - - if (options.borderColor && !isColorValid(options.borderColor)) { - throw new Error(`${options.borderColor} is not a valid borderColor`); - } - - if (options.backgroundColor && !isColorValid(options.backgroundColor)) { - throw new Error(`${options.backgroundColor} is not a valid backgroundColor`); - } - - const chars = getBorderChars(options.borderStyle); - const padding = getObject(options.padding); - const margin = getObject(options.margin); - - const colorizeBorder = border => { - const newBorder = options.borderColor ? getColorFn(options.borderColor)(border) : border; - return options.dimBorder ? chalk.dim(newBorder) : newBorder; - }; - - const colorizeContent = content => options.backgroundColor ? getBGColorFn(options.backgroundColor)(content) : content; - - const columns = terminalColumns(); - - let contentWidth = widestLine(wrapAnsi(text, columns - BORDERS_WIDTH, {hard: true, trim: false})) + padding.left + padding.right; - - // This prevents the title bar to exceed the console's width - let title = options.title && options.title.slice(0, columns - 4 - margin.left - margin.right); - - if (title) { - title = ` ${title} `; - // Make the box larger to fit a larger title - if (stringWidth(title) > contentWidth) { - contentWidth = stringWidth(title); - } - } - - if ((margin.left && margin.right) && contentWidth + BORDERS_WIDTH + margin.left + margin.right > columns) { - // Let's assume we have margins: left = 3, right = 5, in total = 8 - const spaceForMargins = columns - contentWidth - BORDERS_WIDTH; - // Let's assume we have space = 4 - const multiplier = spaceForMargins / (margin.left + margin.right); - // Here: multiplier = 4/8 = 0.5 - margin.left = Math.max(0, Math.floor(margin.left * multiplier)); - margin.right = Math.max(0, Math.floor(margin.right * multiplier)); - // Left: 3 * 0.5 = 1.5 -> 1 - // Right: 6 * 0.5 = 3 - } - - // Prevent content from exceeding the console's width - contentWidth = Math.min(contentWidth, columns - BORDERS_WIDTH - margin.left - margin.right); - - text = makeContentText(text, padding, contentWidth, options.textAlignment); - - let marginLeft = PAD.repeat(margin.left); - - if (options.float === 'center') { - const marginWidth = Math.max((columns - contentWidth - BORDERS_WIDTH) / 2, 0); - marginLeft = PAD.repeat(marginWidth); - } else if (options.float === 'right') { - const marginWidth = Math.max(columns - contentWidth - margin.right - BORDERS_WIDTH, 0); - marginLeft = PAD.repeat(marginWidth); - } - - const horizontal = chars.horizontal.repeat(contentWidth); - const top = colorizeBorder(NL.repeat(margin.top) + marginLeft + chars.topLeft + (title ? makeTitle(title, horizontal, options.titleAlignment) : horizontal) + chars.topRight); - const bottom = colorizeBorder(marginLeft + chars.bottomLeft + horizontal + chars.bottomRight + NL.repeat(margin.bottom)); - const side = colorizeBorder(chars.vertical); - - const LINE_SEPARATOR = (contentWidth + BORDERS_WIDTH + margin.left >= columns) ? '' : NL; - - const lines = text.split(NL); - - const middle = lines.map(line => { - return marginLeft + side + colorizeContent(line) + side; - }).join(LINE_SEPARATOR); - - return top + LINE_SEPARATOR + middle + LINE_SEPARATOR + bottom; -}; - -module.exports._borderStyles = cliBoxes; diff --git a/node_modules/boxen/node_modules/ansi-styles/index.d.ts b/node_modules/boxen/node_modules/ansi-styles/index.d.ts deleted file mode 100644 index 44a907e580..0000000000 --- a/node_modules/boxen/node_modules/ansi-styles/index.d.ts +++ /dev/null @@ -1,345 +0,0 @@ -declare type CSSColor = - | 'aliceblue' - | 'antiquewhite' - | 'aqua' - | 'aquamarine' - | 'azure' - | 'beige' - | 'bisque' - | 'black' - | 'blanchedalmond' - | 'blue' - | 'blueviolet' - | 'brown' - | 'burlywood' - | 'cadetblue' - | 'chartreuse' - | 'chocolate' - | 'coral' - | 'cornflowerblue' - | 'cornsilk' - | 'crimson' - | 'cyan' - | 'darkblue' - | 'darkcyan' - | 'darkgoldenrod' - | 'darkgray' - | 'darkgreen' - | 'darkgrey' - | 'darkkhaki' - | 'darkmagenta' - | 'darkolivegreen' - | 'darkorange' - | 'darkorchid' - | 'darkred' - | 'darksalmon' - | 'darkseagreen' - | 'darkslateblue' - | 'darkslategray' - | 'darkslategrey' - | 'darkturquoise' - | 'darkviolet' - | 'deeppink' - | 'deepskyblue' - | 'dimgray' - | 'dimgrey' - | 'dodgerblue' - | 'firebrick' - | 'floralwhite' - | 'forestgreen' - | 'fuchsia' - | 'gainsboro' - | 'ghostwhite' - | 'gold' - | 'goldenrod' - | 'gray' - | 'green' - | 'greenyellow' - | 'grey' - | 'honeydew' - | 'hotpink' - | 'indianred' - | 'indigo' - | 'ivory' - | 'khaki' - | 'lavender' - | 'lavenderblush' - | 'lawngreen' - | 'lemonchiffon' - | 'lightblue' - | 'lightcoral' - | 'lightcyan' - | 'lightgoldenrodyellow' - | 'lightgray' - | 'lightgreen' - | 'lightgrey' - | 'lightpink' - | 'lightsalmon' - | 'lightseagreen' - | 'lightskyblue' - | 'lightslategray' - | 'lightslategrey' - | 'lightsteelblue' - | 'lightyellow' - | 'lime' - | 'limegreen' - | 'linen' - | 'magenta' - | 'maroon' - | 'mediumaquamarine' - | 'mediumblue' - | 'mediumorchid' - | 'mediumpurple' - | 'mediumseagreen' - | 'mediumslateblue' - | 'mediumspringgreen' - | 'mediumturquoise' - | 'mediumvioletred' - | 'midnightblue' - | 'mintcream' - | 'mistyrose' - | 'moccasin' - | 'navajowhite' - | 'navy' - | 'oldlace' - | 'olive' - | 'olivedrab' - | 'orange' - | 'orangered' - | 'orchid' - | 'palegoldenrod' - | 'palegreen' - | 'paleturquoise' - | 'palevioletred' - | 'papayawhip' - | 'peachpuff' - | 'peru' - | 'pink' - | 'plum' - | 'powderblue' - | 'purple' - | 'rebeccapurple' - | 'red' - | 'rosybrown' - | 'royalblue' - | 'saddlebrown' - | 'salmon' - | 'sandybrown' - | 'seagreen' - | 'seashell' - | 'sienna' - | 'silver' - | 'skyblue' - | 'slateblue' - | 'slategray' - | 'slategrey' - | 'snow' - | 'springgreen' - | 'steelblue' - | 'tan' - | 'teal' - | 'thistle' - | 'tomato' - | 'turquoise' - | 'violet' - | 'wheat' - | 'white' - | 'whitesmoke' - | 'yellow' - | 'yellowgreen'; - -declare namespace ansiStyles { - interface ColorConvert { - /** - The RGB color space. - - @param red - (`0`-`255`) - @param green - (`0`-`255`) - @param blue - (`0`-`255`) - */ - rgb(red: number, green: number, blue: number): string; - - /** - The RGB HEX color space. - - @param hex - A hexadecimal string containing RGB data. - */ - hex(hex: string): string; - - /** - @param keyword - A CSS color name. - */ - keyword(keyword: CSSColor): string; - - /** - The HSL color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param lightness - (`0`-`100`) - */ - hsl(hue: number, saturation: number, lightness: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param value - (`0`-`100`) - */ - hsv(hue: number, saturation: number, value: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param whiteness - (`0`-`100`) - @param blackness - (`0`-`100`) - */ - hwb(hue: number, whiteness: number, blackness: number): string; - - /** - Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. - */ - ansi(ansi: number): string; - - /** - Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(ansi: number): string; - } - - interface CSPair { - /** - The ANSI terminal control sequence for starting this style. - */ - readonly open: string; - - /** - The ANSI terminal control sequence for ending this style. - */ - readonly close: string; - } - - interface ColorBase { - readonly ansi: ColorConvert; - readonly ansi256: ColorConvert; - readonly ansi16m: ColorConvert; - - /** - The ANSI terminal control sequence for ending this color. - */ - readonly close: string; - } - - interface Modifier { - /** - Resets the current color chain. - */ - readonly reset: CSPair; - - /** - Make text bold. - */ - readonly bold: CSPair; - - /** - Emitting only a small amount of light. - */ - readonly dim: CSPair; - - /** - Make text italic. (Not widely supported) - */ - readonly italic: CSPair; - - /** - Make text underline. (Not widely supported) - */ - readonly underline: CSPair; - - /** - Inverse background and foreground colors. - */ - readonly inverse: CSPair; - - /** - Prints the text, but makes it invisible. - */ - readonly hidden: CSPair; - - /** - Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: CSPair; - } - - interface ForegroundColor { - readonly black: CSPair; - readonly red: CSPair; - readonly green: CSPair; - readonly yellow: CSPair; - readonly blue: CSPair; - readonly cyan: CSPair; - readonly magenta: CSPair; - readonly white: CSPair; - - /** - Alias for `blackBright`. - */ - readonly gray: CSPair; - - /** - Alias for `blackBright`. - */ - readonly grey: CSPair; - - readonly blackBright: CSPair; - readonly redBright: CSPair; - readonly greenBright: CSPair; - readonly yellowBright: CSPair; - readonly blueBright: CSPair; - readonly cyanBright: CSPair; - readonly magentaBright: CSPair; - readonly whiteBright: CSPair; - } - - interface BackgroundColor { - readonly bgBlack: CSPair; - readonly bgRed: CSPair; - readonly bgGreen: CSPair; - readonly bgYellow: CSPair; - readonly bgBlue: CSPair; - readonly bgCyan: CSPair; - readonly bgMagenta: CSPair; - readonly bgWhite: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGray: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGrey: CSPair; - - readonly bgBlackBright: CSPair; - readonly bgRedBright: CSPair; - readonly bgGreenBright: CSPair; - readonly bgYellowBright: CSPair; - readonly bgBlueBright: CSPair; - readonly bgCyanBright: CSPair; - readonly bgMagentaBright: CSPair; - readonly bgWhiteBright: CSPair; - } -} - -declare const ansiStyles: { - readonly modifier: ansiStyles.Modifier; - readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; - readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; - readonly codes: ReadonlyMap; -} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; - -export = ansiStyles; diff --git a/node_modules/boxen/node_modules/ansi-styles/index.js b/node_modules/boxen/node_modules/ansi-styles/index.js deleted file mode 100644 index 5d82581a13..0000000000 --- a/node_modules/boxen/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); -}; - -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = require('color-convert'); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } - - return styles; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/node_modules/boxen/node_modules/ansi-styles/license b/node_modules/boxen/node_modules/ansi-styles/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/node_modules/boxen/node_modules/ansi-styles/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/boxen/node_modules/ansi-styles/package.json b/node_modules/boxen/node_modules/ansi-styles/package.json deleted file mode 100644 index ec506b2fd5..0000000000 --- a/node_modules/boxen/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "ansi-styles", - "version": "4.3.0", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": "chalk/ansi-styles", - "funding": "https://github.com/chalk/ansi-styles?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "color-convert": "^2.0.1" - }, - "devDependencies": { - "@types/color-convert": "^1.9.0", - "ava": "^2.3.0", - "svg-term-cli": "^2.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" - } -} \ No newline at end of file diff --git a/node_modules/boxen/node_modules/ansi-styles/readme.md b/node_modules/boxen/node_modules/ansi-styles/readme.md deleted file mode 100644 index 24883de808..0000000000 --- a/node_modules/boxen/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,152 +0,0 @@ -# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) - -> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal - -You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - - - -## Install - -``` -$ npm install ansi-styles -``` - -## Usage - -```js -const style = require('ansi-styles'); - -console.log(`${style.green.open}Hello world!${style.green.close}`); - - -// Color conversion between 16/256/truecolor -// NOTE: If conversion goes to 16 colors or 256 colors, the original color -// may be degraded to fit that color palette. This means terminals -// that do not support 16 million colors will best-match the -// original color. -console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); -console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); -``` - -## API - -Each style has an `open` and `close` property. - -## Styles - -### Modifiers - -- `reset` -- `bold` -- `dim` -- `italic` *(Not widely supported)* -- `underline` -- `inverse` -- `hidden` -- `strikethrough` *(Not widely supported)* - -### Colors - -- `black` -- `red` -- `green` -- `yellow` -- `blue` -- `magenta` -- `cyan` -- `white` -- `blackBright` (alias: `gray`, `grey`) -- `redBright` -- `greenBright` -- `yellowBright` -- `blueBright` -- `magentaBright` -- `cyanBright` -- `whiteBright` - -### Background colors - -- `bgBlack` -- `bgRed` -- `bgGreen` -- `bgYellow` -- `bgBlue` -- `bgMagenta` -- `bgCyan` -- `bgWhite` -- `bgBlackBright` (alias: `bgGray`, `bgGrey`) -- `bgRedBright` -- `bgGreenBright` -- `bgYellowBright` -- `bgBlueBright` -- `bgMagentaBright` -- `bgCyanBright` -- `bgWhiteBright` - -## Advanced usage - -By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. - -- `style.modifier` -- `style.color` -- `style.bgColor` - -###### Example - -```js -console.log(style.color.green.open); -``` - -Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. - -###### Example - -```js -console.log(style.codes.get(36)); -//=> 39 -``` - -## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) - -`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. - -The following color spaces from `color-convert` are supported: - -- `rgb` -- `hex` -- `keyword` -- `hsl` -- `hsv` -- `hwb` -- `ansi` -- `ansi256` - -To use these, call the associated conversion function with the intended output, for example: - -```js -style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code -style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code - -style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code -style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code - -style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code -style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code -``` - -## Related - -- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - -## For enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/boxen/node_modules/chalk/index.d.ts b/node_modules/boxen/node_modules/chalk/index.d.ts deleted file mode 100644 index 9cd88f38be..0000000000 --- a/node_modules/boxen/node_modules/chalk/index.d.ts +++ /dev/null @@ -1,415 +0,0 @@ -/** -Basic foreground colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type ForegroundColor = - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'gray' - | 'grey' - | 'blackBright' - | 'redBright' - | 'greenBright' - | 'yellowBright' - | 'blueBright' - | 'magentaBright' - | 'cyanBright' - | 'whiteBright'; - -/** -Basic background colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type BackgroundColor = - | 'bgBlack' - | 'bgRed' - | 'bgGreen' - | 'bgYellow' - | 'bgBlue' - | 'bgMagenta' - | 'bgCyan' - | 'bgWhite' - | 'bgGray' - | 'bgGrey' - | 'bgBlackBright' - | 'bgRedBright' - | 'bgGreenBright' - | 'bgYellowBright' - | 'bgBlueBright' - | 'bgMagentaBright' - | 'bgCyanBright' - | 'bgWhiteBright'; - -/** -Basic colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type Color = ForegroundColor | BackgroundColor; - -declare type Modifiers = - | 'reset' - | 'bold' - | 'dim' - | 'italic' - | 'underline' - | 'inverse' - | 'hidden' - | 'strikethrough' - | 'visible'; - -declare namespace chalk { - /** - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - type Level = 0 | 1 | 2 | 3; - - interface Options { - /** - Specify the color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level?: Level; - } - - /** - Return a new Chalk instance. - */ - type Instance = new (options?: Options) => Chalk; - - /** - Detect whether the terminal supports color. - */ - interface ColorSupport { - /** - The color level used by Chalk. - */ - level: Level; - - /** - Return whether Chalk supports basic 16 colors. - */ - hasBasic: boolean; - - /** - Return whether Chalk supports ANSI 256 colors. - */ - has256: boolean; - - /** - Return whether Chalk supports Truecolor 16 million colors. - */ - has16m: boolean; - } - - interface ChalkFunction { - /** - Use a template string. - - @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) - - @example - ``` - import chalk = require('chalk'); - - log(chalk` - CPU: {red ${cpu.totalPercent}%} - RAM: {green ${ram.used / ram.total * 100}%} - DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} - `); - ``` - - @example - ``` - import chalk = require('chalk'); - - log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`) - ``` - */ - (text: TemplateStringsArray, ...placeholders: unknown[]): string; - - (...text: unknown[]): string; - } - - interface Chalk extends ChalkFunction { - /** - Return a new Chalk instance. - */ - Instance: Instance; - - /** - The color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level: Level; - - /** - Use HEX value to set text color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.hex('#DEADED'); - ``` - */ - hex(color: string): Chalk; - - /** - Use keyword color value to set text color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.keyword('orange'); - ``` - */ - keyword(color: string): Chalk; - - /** - Use RGB values to set text color. - */ - rgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set text color. - */ - hsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set text color. - */ - hsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set text color. - */ - hwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - */ - ansi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(index: number): Chalk; - - /** - Use HEX value to set background color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgHex('#DEADED'); - ``` - */ - bgHex(color: string): Chalk; - - /** - Use keyword color value to set background color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgKeyword('orange'); - ``` - */ - bgKeyword(color: string): Chalk; - - /** - Use RGB values to set background color. - */ - bgRgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set background color. - */ - bgHsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set background color. - */ - bgHsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set background color. - */ - bgHwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - Use the foreground code, not the background code (for example, not 41, nor 101). - */ - bgAnsi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. - */ - bgAnsi256(index: number): Chalk; - - /** - Modifier: Resets the current color chain. - */ - readonly reset: Chalk; - - /** - Modifier: Make text bold. - */ - readonly bold: Chalk; - - /** - Modifier: Emitting only a small amount of light. - */ - readonly dim: Chalk; - - /** - Modifier: Make text italic. (Not widely supported) - */ - readonly italic: Chalk; - - /** - Modifier: Make text underline. (Not widely supported) - */ - readonly underline: Chalk; - - /** - Modifier: Inverse background and foreground colors. - */ - readonly inverse: Chalk; - - /** - Modifier: Prints the text, but makes it invisible. - */ - readonly hidden: Chalk; - - /** - Modifier: Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: Chalk; - - /** - Modifier: Prints the text only when Chalk has a color support level > 0. - Can be useful for things that are purely cosmetic. - */ - readonly visible: Chalk; - - readonly black: Chalk; - readonly red: Chalk; - readonly green: Chalk; - readonly yellow: Chalk; - readonly blue: Chalk; - readonly magenta: Chalk; - readonly cyan: Chalk; - readonly white: Chalk; - - /* - Alias for `blackBright`. - */ - readonly gray: Chalk; - - /* - Alias for `blackBright`. - */ - readonly grey: Chalk; - - readonly blackBright: Chalk; - readonly redBright: Chalk; - readonly greenBright: Chalk; - readonly yellowBright: Chalk; - readonly blueBright: Chalk; - readonly magentaBright: Chalk; - readonly cyanBright: Chalk; - readonly whiteBright: Chalk; - - readonly bgBlack: Chalk; - readonly bgRed: Chalk; - readonly bgGreen: Chalk; - readonly bgYellow: Chalk; - readonly bgBlue: Chalk; - readonly bgMagenta: Chalk; - readonly bgCyan: Chalk; - readonly bgWhite: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGray: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGrey: Chalk; - - readonly bgBlackBright: Chalk; - readonly bgRedBright: Chalk; - readonly bgGreenBright: Chalk; - readonly bgYellowBright: Chalk; - readonly bgBlueBright: Chalk; - readonly bgMagentaBright: Chalk; - readonly bgCyanBright: Chalk; - readonly bgWhiteBright: Chalk; - } -} - -/** -Main Chalk object that allows to chain styles together. -Call the last one as a method with a string argument. -Order doesn't matter, and later styles take precedent in case of a conflict. -This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. -*/ -declare const chalk: chalk.Chalk & chalk.ChalkFunction & { - supportsColor: chalk.ColorSupport | false; - Level: chalk.Level; - Color: Color; - ForegroundColor: ForegroundColor; - BackgroundColor: BackgroundColor; - Modifiers: Modifiers; - stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false}; -}; - -export = chalk; diff --git a/node_modules/boxen/node_modules/chalk/license b/node_modules/boxen/node_modules/chalk/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/node_modules/boxen/node_modules/chalk/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/boxen/node_modules/chalk/package.json b/node_modules/boxen/node_modules/chalk/package.json deleted file mode 100644 index df5b74e54c..0000000000 --- a/node_modules/boxen/node_modules/chalk/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "chalk", - "version": "4.1.2", - "description": "Terminal string styling done right", - "license": "MIT", - "repository": "chalk/chalk", - "funding": "https://github.com/chalk/chalk?sponsor=1", - "main": "source", - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && nyc ava && tsd", - "bench": "matcha benchmark.js" - }, - "files": [ - "source", - "index.d.ts" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "devDependencies": { - "ava": "^2.4.0", - "coveralls": "^3.0.7", - "execa": "^4.0.0", - "import-fresh": "^3.1.0", - "matcha": "^0.7.0", - "nyc": "^15.0.0", - "resolve-from": "^5.0.0", - "tsd": "^0.7.4", - "xo": "^0.28.2" - }, - "xo": { - "rules": { - "unicorn/prefer-string-slice": "off", - "unicorn/prefer-includes": "off", - "@typescript-eslint/member-ordering": "off", - "no-redeclare": "off", - "unicorn/string-content": "off", - "unicorn/better-regex": "off" - } - } -} \ No newline at end of file diff --git a/node_modules/boxen/node_modules/chalk/readme.md b/node_modules/boxen/node_modules/chalk/readme.md deleted file mode 100644 index a055d21c97..0000000000 --- a/node_modules/boxen/node_modules/chalk/readme.md +++ /dev/null @@ -1,341 +0,0 @@ -

-
-
- Chalk -
-
-
-

- -> Terminal string styling done right - -[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk) - - - -
- ---- - - - ---- - -
- -## Highlights - -- Expressive API -- Highly performant -- Ability to nest styles -- [256/Truecolor color support](#256-and-truecolor-color-support) -- Auto-detects color support -- Doesn't extend `String.prototype` -- Clean and focused -- Actively maintained -- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020 - -## Install - -```console -$ npm install chalk -``` - -## Usage - -```js -const chalk = require('chalk'); - -console.log(chalk.blue('Hello world!')); -``` - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -const chalk = require('chalk'); -const log = console.log; - -// Combine styled and normal strings -log(chalk.blue('Hello') + ' World' + chalk.red('!')); - -// Compose multiple styles using the chainable API -log(chalk.blue.bgRed.bold('Hello world!')); - -// Pass in multiple arguments -log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); - -// Nest styles -log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); - -// Nest styles of the same type even (color, underline, background) -log(chalk.green( - 'I am a green line ' + - chalk.blue.underline.bold('with a blue substring') + - ' that becomes green again!' -)); - -// ES2015 template literal -log(` -CPU: ${chalk.red('90%')} -RAM: ${chalk.green('40%')} -DISK: ${chalk.yellow('70%')} -`); - -// ES2015 tagged template literal -log(chalk` -CPU: {red ${cpu.totalPercent}%} -RAM: {green ${ram.used / ram.total * 100}%} -DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} -`); - -// Use RGB colors in terminal emulators that support it. -log(chalk.keyword('orange')('Yay for orange colored text!')); -log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); -log(chalk.hex('#DEADED').bold('Bold gray!')); -``` - -Easily define your own themes: - -```js -const chalk = require('chalk'); - -const error = chalk.bold.red; -const warning = chalk.keyword('orange'); - -console.log(error('Error!')); -console.log(warning('Warning!')); -``` - -Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): - -```js -const name = 'Sindre'; -console.log(chalk.green('Hello %s'), name); -//=> 'Hello Sindre' -``` - -## API - -### chalk.`