From 008b0062c6ac3303f93f63484e6b6cac388de017 Mon Sep 17 00:00:00 2001 From: Esben Sparre Andreasen Date: Mon, 10 Aug 2020 08:58:19 +0200 Subject: [PATCH 1/5] add ExtraOptions type for codeql commands --- src/codeql.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/codeql.ts b/src/codeql.ts index 0e081a80f..7ab4692d9 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -14,6 +14,27 @@ import * as api from './api-client'; import * as defaults from './defaults.json'; // Referenced from codeql-action-sync-tool! import * as util from './util'; +type Options = (string|number|boolean)[]; + +/** + * Extra command line options for the codeql commands. + */ +interface ExtraOptions { + '*'?: Options; + database?: { + '*'?: Options, + init?: Options, + 'trace-command'?: Options, + analyze?: Options, + finalize?: Options + }; + resolve?: { + '*'?: Options, + extractor?: Options, + queries?: Options + }; +} + export interface CodeQL { /** * Get the directory where the CodeQL executable is located. From c2b7b7f97734fa04a28b0b0581a25f7effce9255 Mon Sep 17 00:00:00 2001 From: Esben Sparre Andreasen Date: Thu, 6 Aug 2020 09:30:16 +0200 Subject: [PATCH 2/5] add getExtraOptions utility --- src/util.test.ts | 34 ++++++++++++++++++++++++++++++++++ src/util.ts | 20 ++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/src/util.test.ts b/src/util.test.ts index 844c749a4..e31c96557 100644 --- a/src/util.test.ts +++ b/src/util.test.ts @@ -116,3 +116,37 @@ test('prepareEnvironment() when a local run', t => { process.env.CODEQL_LOCAL_RUN = origLocalRun; }); + +test('getExtraOptionsEnvParam() succeeds on valid JSON with invalid options (for now)', t => { + const origExtraOptions = process.env.CODEQL_ACTION_EXTRA_OPTIONS; + + const options = {foo: 42}; + + process.env.CODEQL_ACTION_EXTRA_OPTIONS = JSON.stringify(options); + + t.deepEqual(util.getExtraOptionsEnvParam(), options); + + process.env.CODEQL_ACTION_EXTRA_OPTIONS = origExtraOptions; +}); + + +test('getExtraOptionsEnvParam() succeeds on valid options', t => { + const origExtraOptions = process.env.CODEQL_ACTION_EXTRA_OPTIONS; + + const options = { database: { init: ["--debug"] } }; + process.env.CODEQL_ACTION_EXTRA_OPTIONS = + JSON.stringify(options); + + t.deepEqual(util.getExtraOptionsEnvParam(), options); + + process.env.CODEQL_ACTION_EXTRA_OPTIONS = origExtraOptions; +}); + +test('getExtraOptionsEnvParam() fails on invalid JSON', t => { + const origExtraOptions = process.env.CODEQL_ACTION_EXTRA_OPTIONS; + + process.env.CODEQL_ACTION_EXTRA_OPTIONS = "{{invalid-json}}"; + t.throws(util.getExtraOptionsEnvParam); + + process.env.CODEQL_ACTION_EXTRA_OPTIONS = origExtraOptions; +}); diff --git a/src/util.ts b/src/util.ts index fa92c7f4f..741dc8d63 100644 --- a/src/util.ts +++ b/src/util.ts @@ -39,6 +39,26 @@ export function getRequiredEnvParam(paramName: string): string { return value; } +/** + * Get the extra options for the codeql commands. + */ +export function getExtraOptionsEnvParam(): object { + const varName = 'CODEQL_ACTION_EXTRA_OPTIONS'; + const raw = process.env[varName]; + if (raw === undefined || raw.length === 0) { + return {}; + } + try { + return JSON.parse(raw); + } catch (e) { + throw new Error( + varName + + ' environment variable is set, but does not contain valid JSON: ' + + e.message + ); + } +} + export function isLocalRun(): boolean { return !!process.env.CODEQL_LOCAL_RUN && process.env.CODEQL_LOCAL_RUN !== 'false' From 288f49eee552ea1740c4b81b35d5cdf6a4e6178d Mon Sep 17 00:00:00 2001 From: Esben Sparre Andreasen Date: Mon, 10 Aug 2020 09:12:36 +0200 Subject: [PATCH 3/5] use ExtraOptions in codeql commands --- src/codeql.test.ts | 32 ++++++++++++++++++++++ src/codeql.ts | 68 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 98 insertions(+), 2 deletions(-) diff --git a/src/codeql.test.ts b/src/codeql.test.ts index 2d665b5a3..0db008fb2 100644 --- a/src/codeql.test.ts +++ b/src/codeql.test.ts @@ -63,3 +63,35 @@ test('parse codeql bundle url version', t => { } } }); + +test('getExtraOptions works for explicit paths', t => { + t.deepEqual(codeql.getExtraOptions({}, ['foo'], []), []); + + t.deepEqual(codeql.getExtraOptions({foo: [42]}, ['foo'], []), ['42']); + + t.deepEqual(codeql.getExtraOptions({foo: {bar: [42]}}, ['foo', 'bar'], []), ['42']); +}); + +test('getExtraOptions works for wildcards', t => { + t.deepEqual(codeql.getExtraOptions({'*': [42]}, ['foo'], []), ['42']); +}); + +test('getExtraOptions works for wildcards and explicit paths', t => { + let o1 = {'*': [42], foo: [87]}; + t.deepEqual(codeql.getExtraOptions(o1, ['foo'], []), ['42', '87']); + + let o2 = {'*': [42], foo: [87]}; + t.deepEqual(codeql.getExtraOptions(o2, ['foo', 'bar'], []), ['42']); + + let o3 = {'*': [42], foo: { '*': [87], bar: [99]}}; + let p = ['foo', 'bar']; + t.deepEqual(codeql.getExtraOptions(o3, p, []), ['42', '87', '99']); +}); + +test('getExtraOptions throws for bad content', t => { + t.throws(() => codeql.getExtraOptions({'*': 42}, ['foo'], [])); + + t.throws(() => codeql.getExtraOptions({foo: 87}, ['foo'], [])); + + t.throws(() => codeql.getExtraOptions({'*': [42], foo: { '*': 87, bar: [99]}}, ['foo', 'bar'], [])); +}); diff --git a/src/codeql.ts b/src/codeql.ts index 7ab4692d9..e05f524bf 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -307,6 +307,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { 'trace-command', databasePath, ...compilerSpecArg, + ...getExtraOptionsFromEnv(['database', 'trace-command']), process.execPath, path.resolve(__dirname, 'tracer-env.js'), envFile @@ -320,6 +321,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { databasePath, '--language=' + language, '--source-root=' + sourceRoot, + ...getExtraOptionsFromEnv(['database', 'init']), ]); }, runAutobuild: async function(language: string) { @@ -345,7 +347,8 @@ function getCodeQLForCmd(cmd: string): CodeQL { 'resolve', 'extractor', '--format=json', - '--language=' + language + '--language=' + language, + ...getExtraOptionsFromEnv(['resolve', 'extractor']), ], { silent: true, @@ -363,6 +366,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { await exec.exec(cmd, [ 'database', 'trace-command', + ...getExtraOptionsFromEnv(['database', 'trace-command']), databasePath, '--', traceCommand @@ -372,6 +376,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { await exec.exec(cmd, [ 'database', 'finalize', + ...getExtraOptionsFromEnv(['database', 'finalize']), databasePath ]); }, @@ -380,7 +385,8 @@ function getCodeQLForCmd(cmd: string): CodeQL { 'resolve', 'queries', ...queries, - '--format=bylanguage' + '--format=bylanguage', + ...getExtraOptionsFromEnv(['resolve', 'queries']) ]; if (extraSearchPath !== undefined) { codeqlArgs.push('--search-path', extraSearchPath); @@ -406,6 +412,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { '--format=sarif-latest', '--output=' + sarifFile, '--no-sarif-add-snippets', + ...getExtraOptionsFromEnv(['database', 'analyze']), querySuite ]); } @@ -419,3 +426,60 @@ export function isTracedLanguage(language: string): boolean { export function isScannedLanguage(language: string): boolean { return !isTracedLanguage(language); } + +/** + * Gets the options for `path` of `options` as an array of extra option strings. + */ +function getExtraOptionsFromEnv(path: string[]) { + let options: ExtraOptions = util.getExtraOptionsEnvParam(); + return getExtraOptions(options, path, []); +} + +/** + * Gets the options for `path` of `options` as an array of extra option strings. + * + * - the special terminal step name '*' in `options` matches all path steps + * - throws an exception if this conversion is impossible. + */ +export /* exported for testing */ function getExtraOptions( + options: any, + path: string[], + pathInfo: string[]): string[] { + /** + * Gets `options` as an array of extra option strings. + * + * - throws an exception mentioning `pathInfo` if this conversion is impossible. + */ + function asExtraOptions(options: any, pathInfo: string[]): string[] { + if (options === undefined) { + return []; + } + if (!Array.isArray(options)) { + const msg = + 'The extra options for `' + + pathInfo.join('.') + + '` (`' + + JSON.stringify(options) + + '`) are not in an array.'; + throw new Error(msg); + } + return options.map(o => { + const t = typeof o; + if (t !== 'string' && t !== 'number' && t !== 'boolean') { + const msg = + 'The extra option for `' + + pathInfo.join('.') + + '` (`' + + JSON.stringify(o) + + '`) is not a primitive value.'; + throw new Error(msg); + } + return o + ''; + }); + } + let all = asExtraOptions(options?.['*'], pathInfo.concat('*')); + let specific = path.length === 0 ? + asExtraOptions(options, pathInfo) : + getExtraOptions(options?.[path[0]], path?.slice(1), pathInfo.concat(path[0])); + return all.concat(specific); +} From fd94b16cf5b5709c3cdbc4e12774eb1caa4c0717 Mon Sep 17 00:00:00 2001 From: Esben Sparre Andreasen Date: Mon, 10 Aug 2020 18:42:13 +0200 Subject: [PATCH 4/5] use template strings instead of concatenations --- src/codeql.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/codeql.ts b/src/codeql.ts index e05f524bf..9a74227a5 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -456,22 +456,14 @@ export /* exported for testing */ function getExtraOptions( } if (!Array.isArray(options)) { const msg = - 'The extra options for `' + - pathInfo.join('.') + - '` (`' + - JSON.stringify(options) + - '`) are not in an array.'; + `The extra options for '${pathInfo.join('.')}' ('${JSON.stringify(options)}') are not in an array.`; throw new Error(msg); } return options.map(o => { const t = typeof o; if (t !== 'string' && t !== 'number' && t !== 'boolean') { const msg = - 'The extra option for `' + - pathInfo.join('.') + - '` (`' + - JSON.stringify(o) + - '`) is not a primitive value.'; + `The extra option for '${pathInfo.join('.')}' ('${JSON.stringify(o)}') is not a primitive value.`; throw new Error(msg); } return o + ''; From 9597f2e88980d212c6206518f5b6c598e0f0832e Mon Sep 17 00:00:00 2001 From: Esben Sparre Andreasen Date: Mon, 10 Aug 2020 09:25:14 +0200 Subject: [PATCH 5/5] build typescript --- lib/codeql.js | 55 ++++++++++++++++++++++++++++++++++++++++-- lib/codeql.js.map | 2 +- lib/codeql.test.js | 22 +++++++++++++++++ lib/codeql.test.js.map | 2 +- lib/util.js | 19 +++++++++++++++ lib/util.js.map | 2 +- lib/util.test.js | 21 ++++++++++++++++ lib/util.test.js.map | 2 +- 8 files changed, 119 insertions(+), 6 deletions(-) diff --git a/lib/codeql.js b/lib/codeql.js index c0586d9fa..24d017209 100644 --- a/lib/codeql.js +++ b/lib/codeql.js @@ -225,6 +225,7 @@ function getCodeQLForCmd(cmd) { 'trace-command', databasePath, ...compilerSpecArg, + ...getExtraOptionsFromEnv(['database', 'trace-command']), process.execPath, path.resolve(__dirname, 'tracer-env.js'), envFile @@ -238,6 +239,7 @@ function getCodeQLForCmd(cmd) { databasePath, '--language=' + language, '--source-root=' + sourceRoot, + ...getExtraOptionsFromEnv(['database', 'init']), ]); }, runAutobuild: async function (language) { @@ -259,7 +261,8 @@ function getCodeQLForCmd(cmd) { 'resolve', 'extractor', '--format=json', - '--language=' + language + '--language=' + language, + ...getExtraOptionsFromEnv(['resolve', 'extractor']), ], { silent: true, listeners: { @@ -274,6 +277,7 @@ function getCodeQLForCmd(cmd) { await exec.exec(cmd, [ 'database', 'trace-command', + ...getExtraOptionsFromEnv(['database', 'trace-command']), databasePath, '--', traceCommand @@ -283,6 +287,7 @@ function getCodeQLForCmd(cmd) { await exec.exec(cmd, [ 'database', 'finalize', + ...getExtraOptionsFromEnv(['database', 'finalize']), databasePath ]); }, @@ -291,7 +296,8 @@ function getCodeQLForCmd(cmd) { 'resolve', 'queries', ...queries, - '--format=bylanguage' + '--format=bylanguage', + ...getExtraOptionsFromEnv(['resolve', 'queries']) ]; if (extraSearchPath !== undefined) { codeqlArgs.push('--search-path', extraSearchPath); @@ -316,6 +322,7 @@ function getCodeQLForCmd(cmd) { '--format=sarif-latest', '--output=' + sarifFile, '--no-sarif-add-snippets', + ...getExtraOptionsFromEnv(['database', 'analyze']), querySuite ]); } @@ -329,4 +336,48 @@ function isScannedLanguage(language) { return !isTracedLanguage(language); } exports.isScannedLanguage = isScannedLanguage; +/** + * Gets the options for `path` of `options` as an array of extra option strings. + */ +function getExtraOptionsFromEnv(path) { + let options = util.getExtraOptionsEnvParam(); + return getExtraOptions(options, path, []); +} +/** + * Gets the options for `path` of `options` as an array of extra option strings. + * + * - the special terminal step name '*' in `options` matches all path steps + * - throws an exception if this conversion is impossible. + */ +function getExtraOptions(options, path, pathInfo) { + var _a, _b, _c; + /** + * Gets `options` as an array of extra option strings. + * + * - throws an exception mentioning `pathInfo` if this conversion is impossible. + */ + function asExtraOptions(options, pathInfo) { + if (options === undefined) { + return []; + } + if (!Array.isArray(options)) { + const msg = `The extra options for '${pathInfo.join('.')}' ('${JSON.stringify(options)}') are not in an array.`; + throw new Error(msg); + } + return options.map(o => { + const t = typeof o; + if (t !== 'string' && t !== 'number' && t !== 'boolean') { + const msg = `The extra option for '${pathInfo.join('.')}' ('${JSON.stringify(o)}') is not a primitive value.`; + throw new Error(msg); + } + return o + ''; + }); + } + let all = asExtraOptions((_a = options) === null || _a === void 0 ? void 0 : _a['*'], pathInfo.concat('*')); + let specific = path.length === 0 ? + asExtraOptions(options, pathInfo) : + getExtraOptions((_b = options) === null || _b === void 0 ? void 0 : _b[path[0]], (_c = path) === null || _c === void 0 ? void 0 : _c.slice(1), pathInfo.concat(path[0])); + return all.concat(specific); +} +exports.getExtraOptions = getExtraOptions; //# sourceMappingURL=codeql.js.map \ No newline at end of file diff --git a/lib/codeql.js.map b/lib/codeql.js.map index 624d21ed9..3eb54bdc8 100644 --- a/lib/codeql.js.map +++ b/lib/codeql.js.map @@ -1 +1 @@ -{"version":3,"file":"codeql.js","sourceRoot":"","sources":["../src/codeql.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,oDAAsC;AACtC,2DAA6C;AAE7C,+DAAiD;AACjD,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AACnC,iDAA6B;AAE7B,kDAAoC;AACpC,0DAA4C,CAAC,2CAA2C;AACxF,6CAA+B;AAyD/B;;;GAGG;AACH,IAAI,YAAY,GAAuB,SAAS,CAAC;AAEjD;;;GAGG;AACH,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAE9C,MAAM,qBAAqB,GAAG,QAAQ,CAAC,aAAa,CAAC;AAC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js +++ b/lib/codeql.test.js @@ -57,4 +57,26 @@ ava_1.default('parse codeql bundle url version', t => { } } }); +ava_1.default('getExtraOptions works for explicit paths', t => { + t.deepEqual(codeql.getExtraOptions({}, ['foo'], []), []); + t.deepEqual(codeql.getExtraOptions({ foo: [42] }, ['foo'], []), ['42']); + t.deepEqual(codeql.getExtraOptions({ foo: { bar: [42] } }, ['foo', 'bar'], []), ['42']); +}); +ava_1.default('getExtraOptions works for wildcards', t => { + t.deepEqual(codeql.getExtraOptions({ '*': [42] }, ['foo'], []), ['42']); +}); +ava_1.default('getExtraOptions works for wildcards and explicit paths', t => { + let o1 = { '*': [42], foo: [87] }; + t.deepEqual(codeql.getExtraOptions(o1, ['foo'], []), ['42', '87']); + let o2 = { '*': [42], foo: [87] }; + t.deepEqual(codeql.getExtraOptions(o2, ['foo', 'bar'], []), ['42']); + let o3 = { '*': [42], foo: { '*': [87], bar: [99] } }; + let p = ['foo', 'bar']; + t.deepEqual(codeql.getExtraOptions(o3, p, []), ['42', '87', '99']); +}); +ava_1.default('getExtraOptions throws for bad content', t => { + t.throws(() => codeql.getExtraOptions({ '*': 42 }, ['foo'], [])); + t.throws(() => codeql.getExtraOptions({ foo: 87 }, ['foo'], [])); + t.throws(() => codeql.getExtraOptions({ '*': [42], foo: { '*': 87, bar: [99] } }, ['foo', 'bar'], [])); +}); //# sourceMappingURL=codeql.test.js.map \ No newline at end of file diff --git a/lib/codeql.test.js.map b/lib/codeql.test.js.map index 5034ca12d..949d4ce19 100644 --- a/lib/codeql.test.js.map +++ b/lib/codeql.test.js.map @@ -1 +1 @@ -{"version":3,"file":"codeql.test.js","sourceRoot":"","sources":["../src/codeql.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAAiD;AACjD,8CAAuB;AACvB,gDAAwB;AACxB,2CAA6B;AAE7B,iDAAmC;AACnC,mDAA2C;AAC3C,6CAA+B;AAE/B,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,8BAA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,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,EAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAC,EAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACtG,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/util.js b/lib/util.js index 65b049c4a..5215a84fc 100644 --- a/lib/util.js +++ b/lib/util.js @@ -45,6 +45,25 @@ function getRequiredEnvParam(paramName) { return value; } exports.getRequiredEnvParam = getRequiredEnvParam; +/** + * Get the extra options for the codeql commands. + */ +function getExtraOptionsEnvParam() { + const varName = 'CODEQL_ACTION_EXTRA_OPTIONS'; + const raw = process.env[varName]; + if (raw === undefined || raw.length === 0) { + return {}; + } + try { + return JSON.parse(raw); + } + catch (e) { + throw new Error(varName + + ' environment variable is set, but does not contain valid JSON: ' + + e.message); + } +} +exports.getExtraOptionsEnvParam = getExtraOptionsEnvParam; function isLocalRun() { return !!process.env.CODEQL_LOCAL_RUN && process.env.CODEQL_LOCAL_RUN !== 'false' diff --git a/lib/util.js.map b/lib/util.js.map index f17ffb941..2c068ebf0 100644 --- a/lib/util.js.map +++ b/lib/util.js.map @@ -1 +1 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AACtC,oDAAsC;AACtC,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B,kDAAoC;AACpC,gEAAkD;AAElD;;GAEG;AACU,QAAA,qBAAqB,GAAG,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,SAAgB,iBAAiB;IAC/B,OAAO,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,6BAAqB,CAAC;AAChE,CAAC;AAFD,8CAEC;AAED;;GAEG;AACH,SAAgB,YAAY;IAC1B,OAAO,iBA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BD,wCAuBC;AAED;;GAEG;AACH,SAAgB,qBAAqB;IACnC,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC,CAAC;AAC9E,CAAC;AAFD,sDAEC"} \ No newline at end of file diff --git a/lib/util.test.js b/lib/util.test.js index c92cd72a4..b5f4161a2 100644 --- a/lib/util.test.js +++ b/lib/util.test.js @@ -92,4 +92,25 @@ ava_1.default('prepareEnvironment() when a local run', t => { t.deepEqual(process.env.GITHUB_JOB, 'UNKNOWN-JOB'); process.env.CODEQL_LOCAL_RUN = origLocalRun; }); +ava_1.default('getExtraOptionsEnvParam() succeeds on valid JSON with invalid options (for now)', t => { + const origExtraOptions = process.env.CODEQL_ACTION_EXTRA_OPTIONS; + const options = { foo: 42 }; + process.env.CODEQL_ACTION_EXTRA_OPTIONS = JSON.stringify(options); + t.deepEqual(util.getExtraOptionsEnvParam(), options); + process.env.CODEQL_ACTION_EXTRA_OPTIONS = origExtraOptions; +}); +ava_1.default('getExtraOptionsEnvParam() succeeds on valid options', t => { + const origExtraOptions = process.env.CODEQL_ACTION_EXTRA_OPTIONS; + const options = { database: { init: ["--debug"] } }; + process.env.CODEQL_ACTION_EXTRA_OPTIONS = + JSON.stringify(options); + t.deepEqual(util.getExtraOptionsEnvParam(), options); + process.env.CODEQL_ACTION_EXTRA_OPTIONS = origExtraOptions; +}); +ava_1.default('getExtraOptionsEnvParam() fails on invalid JSON', t => { + const origExtraOptions = process.env.CODEQL_ACTION_EXTRA_OPTIONS; + process.env.CODEQL_ACTION_EXTRA_OPTIONS = "{{invalid-json}}"; + t.throws(util.getExtraOptionsEnvParam); + process.env.CODEQL_ACTION_EXTRA_OPTIONS = origExtraOptions; +}); //# sourceMappingURL=util.test.js.map \ No newline at end of file diff --git a/lib/util.test.js.map b/lib/util.test.js.map index df299e559..9f2eb61f9 100644 --- a/lib/util.test.js.map +++ b/lib/util.test.js.map @@ -1 +1 @@ -{"version":3,"file":"util.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