Merge remote-tracking branch 'origin/releases/v3-beta' into 700-actionscache-granular-cache-control

This commit is contained in:
Sankalp Kotewar 2022-12-12 14:18:23 +00:00 committed by GitHub
commit b275c83bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 2330 additions and 2321 deletions

View File

@ -46,3 +46,6 @@
### 3.1.0-beta.2 ### 3.1.0-beta.2
- Added support for fallback to gzip to restore old caches on windows. - Added support for fallback to gzip to restore old caches on windows.
### 3.1.0-beta.3
- Bug fixes for bsdtar fallback if gnutar not available and gzip fallback if cache saved using old cache action on windows.

95
dist/restore/index.js vendored
View File

@ -3432,6 +3432,7 @@ function getCacheEntry(keys, paths, options) {
const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`; const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`;
const response = yield requestUtils_1.retryTypedResponse('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); const response = yield requestUtils_1.retryTypedResponse('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); }));
if (response.statusCode === 204) { if (response.statusCode === 204) {
// Cache not found
return null; return null;
} }
if (!requestUtils_1.isSuccessStatusCode(response.statusCode)) { if (!requestUtils_1.isSuccessStatusCode(response.statusCode)) {
@ -3440,6 +3441,7 @@ function getCacheEntry(keys, paths, options) {
const cacheResult = response.result; const cacheResult = response.result;
const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation; const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation;
if (!cacheDownloadUrl) { if (!cacheDownloadUrl) {
// Cache achiveLocation not found. This should never happen, and hence bail out.
throw new Error('Cache not found.'); throw new Error('Cache not found.');
} }
core.setSecret(cacheDownloadUrl); core.setSecret(cacheDownloadUrl);
@ -38114,7 +38116,7 @@ const path = __importStar(__webpack_require__(622));
const utils = __importStar(__webpack_require__(15)); const utils = __importStar(__webpack_require__(15));
const constants_1 = __webpack_require__(931); const constants_1 = __webpack_require__(931);
const IS_WINDOWS = process.platform === 'win32'; const IS_WINDOWS = process.platform === 'win32';
// Function also mutates the args array. For non-mutation call with passing an empty array. // Returns tar path and type: BSD or GNU
function getTarPath() { function getTarPath() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
switch (process.platform) { switch (process.platform) {
@ -38146,6 +38148,7 @@ function getTarPath() {
default: default:
break; break;
} }
// Default assumption is GNU tar is present in path
return { return {
path: yield io.which('tar', true), path: yield io.which('tar', true),
type: constants_1.ArchiveToolType.GNU type: constants_1.ArchiveToolType.GNU
@ -38159,6 +38162,7 @@ function getTarArgs(tarPath, compressionMethod, type, archivePath = '') {
const cacheFileName = utils.getCacheFileName(compressionMethod); const cacheFileName = utils.getCacheFileName(compressionMethod);
const tarFile = 'cache.tar'; const tarFile = 'cache.tar';
const workingDirectory = getWorkingDirectory(); const workingDirectory = getWorkingDirectory();
// Speficic args for BSD tar on windows for workaround
const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&
compressionMethod !== constants_1.CompressionMethod.Gzip && compressionMethod !== constants_1.CompressionMethod.Gzip &&
IS_WINDOWS; IS_WINDOWS;
@ -38196,8 +38200,10 @@ function getTarArgs(tarPath, compressionMethod, type, archivePath = '') {
return args; return args;
}); });
} }
function getArgs(compressionMethod, type, archivePath = '') { // Returns commands to run tar and compression program
function getCommands(compressionMethod, type, archivePath = '') {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let args;
const tarPath = yield getTarPath(); const tarPath = yield getTarPath();
const tarArgs = yield getTarArgs(tarPath, compressionMethod, type, archivePath); const tarArgs = yield getTarArgs(tarPath, compressionMethod, type, archivePath);
const compressionArgs = type !== 'create' const compressionArgs = type !== 'create'
@ -38207,11 +38213,15 @@ function getArgs(compressionMethod, type, archivePath = '') {
compressionMethod !== constants_1.CompressionMethod.Gzip && compressionMethod !== constants_1.CompressionMethod.Gzip &&
IS_WINDOWS; IS_WINDOWS;
if (BSD_TAR_ZSTD && type !== 'create') { if (BSD_TAR_ZSTD && type !== 'create') {
return [...compressionArgs, ...tarArgs].join(' '); args = [[...compressionArgs].join(' '), [...tarArgs].join(' ')];
} }
else { else {
return [...tarArgs, ...compressionArgs].join(' '); args = [[...tarArgs].join(' '), [...compressionArgs].join(' ')];
} }
if (BSD_TAR_ZSTD) {
return args;
}
return [args.join(' ')];
}); });
} }
function getWorkingDirectory() { function getWorkingDirectory() {
@ -38234,8 +38244,7 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
? [ ? [
'zstd -d --long=30 -o', 'zstd -d --long=30 -o',
constants_1.TarFilename, constants_1.TarFilename,
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
'&&'
] ]
: [ : [
'--use-compress-program', '--use-compress-program',
@ -38246,8 +38255,7 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
? [ ? [
'zstd -d -o', 'zstd -d -o',
constants_1.TarFilename, constants_1.TarFilename,
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
'&&'
] ]
: ['--use-compress-program', IS_WINDOWS ? '"zstd -d"' : 'unzstd']; : ['--use-compress-program', IS_WINDOWS ? '"zstd -d"' : 'unzstd'];
default: default:
@ -38255,6 +38263,7 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
} }
}); });
} }
// Used for creating the archive
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores. // -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
// zstdmt is equivalent to 'zstd -T0' // zstdmt is equivalent to 'zstd -T0'
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit. // --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
@ -38270,7 +38279,6 @@ function getCompressionProgram(tarPath, compressionMethod) {
case constants_1.CompressionMethod.Zstd: case constants_1.CompressionMethod.Zstd:
return BSD_TAR_ZSTD return BSD_TAR_ZSTD
? [ ? [
'&&',
'zstd -T0 --long=30 -o', 'zstd -T0 --long=30 -o',
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
constants_1.TarFilename constants_1.TarFilename
@ -38282,7 +38290,6 @@ function getCompressionProgram(tarPath, compressionMethod) {
case constants_1.CompressionMethod.ZstdWithoutLong: case constants_1.CompressionMethod.ZstdWithoutLong:
return BSD_TAR_ZSTD return BSD_TAR_ZSTD
? [ ? [
'&&',
'zstd -T0 -o', 'zstd -T0 -o',
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
constants_1.TarFilename constants_1.TarFilename
@ -38293,44 +38300,45 @@ function getCompressionProgram(tarPath, compressionMethod) {
} }
}); });
} }
function listTar(archivePath, compressionMethod) { // Executes all commands as separate processes
function execCommands(commands, cwd) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const args = yield getArgs(compressionMethod, 'list', archivePath); for (const command of commands) {
try { try {
yield exec_1.exec(args); yield exec_1.exec(command, undefined, { cwd });
} }
catch (error) { catch (error) {
throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`); throw new Error(`${command.split(' ')[0]} failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
}
} }
}); });
} }
// List the contents of a tar
function listTar(archivePath, compressionMethod) {
return __awaiter(this, void 0, void 0, function* () {
const commands = yield getCommands(compressionMethod, 'list', archivePath);
yield execCommands(commands);
});
}
exports.listTar = listTar; exports.listTar = listTar;
// Extract a tar
function extractTar(archivePath, compressionMethod) { function extractTar(archivePath, compressionMethod) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
// Create directory to extract tar into // Create directory to extract tar into
const workingDirectory = getWorkingDirectory(); const workingDirectory = getWorkingDirectory();
yield io.mkdirP(workingDirectory); yield io.mkdirP(workingDirectory);
const args = yield getArgs(compressionMethod, 'extract', archivePath); const commands = yield getCommands(compressionMethod, 'extract', archivePath);
try { yield execCommands(commands);
yield exec_1.exec(args);
}
catch (error) {
throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
}
}); });
} }
exports.extractTar = extractTar; exports.extractTar = extractTar;
// Create a tar
function createTar(archiveFolder, sourceDirectories, compressionMethod) { function createTar(archiveFolder, sourceDirectories, compressionMethod) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
// Write source directories to manifest.txt to avoid command length limits // Write source directories to manifest.txt to avoid command length limits
fs_1.writeFileSync(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\n')); fs_1.writeFileSync(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\n'));
const args = yield getArgs(compressionMethod, 'create'); const commands = yield getCommands(compressionMethod, 'create');
try { yield execCommands(commands, archiveFolder);
yield exec_1.exec(args, undefined, { cwd: archiveFolder });
}
catch (error) {
throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
}
}); });
} }
exports.createTar = createTar; exports.createTar = createTar;
@ -47204,15 +47212,12 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
let compressionMethod = yield utils.getCompressionMethod(); let compressionMethod = yield utils.getCompressionMethod();
let archivePath = ''; let archivePath = '';
try { try {
try { // path are needed to compute version
// path are needed to compute version cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, {
cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { compressionMethod
compressionMethod });
}); if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
} // This is to support the old cache entry created by gzip on windows.
catch (error) {
// This is to support the old cache entry created
// by the old version of the cache action on windows.
if (process.platform === 'win32' && if (process.platform === 'win32' &&
compressionMethod !== constants_1.CompressionMethod.Gzip) { compressionMethod !== constants_1.CompressionMethod.Gzip) {
compressionMethod = constants_1.CompressionMethod.Gzip; compressionMethod = constants_1.CompressionMethod.Gzip;
@ -47220,17 +47225,15 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
compressionMethod compressionMethod
}); });
if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
throw error; return undefined;
} }
core.debug("Couldn't find cache entry with zstd compression, falling back to gzip compression.");
} }
else { else {
throw error; // Cache not found
return undefined;
} }
} }
if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
// Cache not found
return undefined;
}
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
core.debug(`Archive Path: ${archivePath}`); core.debug(`Archive Path: ${archivePath}`);
// Download the cache from the cache entry // Download the cache from the cache entry

4525
dist/save/index.js vendored
View File

@ -3432,6 +3432,7 @@ function getCacheEntry(keys, paths, options) {
const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`; const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`;
const response = yield requestUtils_1.retryTypedResponse('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); const response = yield requestUtils_1.retryTypedResponse('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); }));
if (response.statusCode === 204) { if (response.statusCode === 204) {
// Cache not found
return null; return null;
} }
if (!requestUtils_1.isSuccessStatusCode(response.statusCode)) { if (!requestUtils_1.isSuccessStatusCode(response.statusCode)) {
@ -3440,6 +3441,7 @@ function getCacheEntry(keys, paths, options) {
const cacheResult = response.result; const cacheResult = response.result;
const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation; const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation;
if (!cacheDownloadUrl) { if (!cacheDownloadUrl) {
// Cache achiveLocation not found. This should never happen, and hence bail out.
throw new Error('Cache not found.'); throw new Error('Cache not found.');
} }
core.setSecret(cacheDownloadUrl); core.setSecret(cacheDownloadUrl);
@ -38109,7 +38111,7 @@ const path = __importStar(__webpack_require__(622));
const utils = __importStar(__webpack_require__(15)); const utils = __importStar(__webpack_require__(15));
const constants_1 = __webpack_require__(931); const constants_1 = __webpack_require__(931);
const IS_WINDOWS = process.platform === 'win32'; const IS_WINDOWS = process.platform === 'win32';
// Function also mutates the args array. For non-mutation call with passing an empty array. // Returns tar path and type: BSD or GNU
function getTarPath() { function getTarPath() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
switch (process.platform) { switch (process.platform) {
@ -38141,6 +38143,7 @@ function getTarPath() {
default: default:
break; break;
} }
// Default assumption is GNU tar is present in path
return { return {
path: yield io.which('tar', true), path: yield io.which('tar', true),
type: constants_1.ArchiveToolType.GNU type: constants_1.ArchiveToolType.GNU
@ -38154,6 +38157,7 @@ function getTarArgs(tarPath, compressionMethod, type, archivePath = '') {
const cacheFileName = utils.getCacheFileName(compressionMethod); const cacheFileName = utils.getCacheFileName(compressionMethod);
const tarFile = 'cache.tar'; const tarFile = 'cache.tar';
const workingDirectory = getWorkingDirectory(); const workingDirectory = getWorkingDirectory();
// Speficic args for BSD tar on windows for workaround
const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&
compressionMethod !== constants_1.CompressionMethod.Gzip && compressionMethod !== constants_1.CompressionMethod.Gzip &&
IS_WINDOWS; IS_WINDOWS;
@ -38191,8 +38195,10 @@ function getTarArgs(tarPath, compressionMethod, type, archivePath = '') {
return args; return args;
}); });
} }
function getArgs(compressionMethod, type, archivePath = '') { // Returns commands to run tar and compression program
function getCommands(compressionMethod, type, archivePath = '') {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let args;
const tarPath = yield getTarPath(); const tarPath = yield getTarPath();
const tarArgs = yield getTarArgs(tarPath, compressionMethod, type, archivePath); const tarArgs = yield getTarArgs(tarPath, compressionMethod, type, archivePath);
const compressionArgs = type !== 'create' const compressionArgs = type !== 'create'
@ -38202,11 +38208,15 @@ function getArgs(compressionMethod, type, archivePath = '') {
compressionMethod !== constants_1.CompressionMethod.Gzip && compressionMethod !== constants_1.CompressionMethod.Gzip &&
IS_WINDOWS; IS_WINDOWS;
if (BSD_TAR_ZSTD && type !== 'create') { if (BSD_TAR_ZSTD && type !== 'create') {
return [...compressionArgs, ...tarArgs].join(' '); args = [[...compressionArgs].join(' '), [...tarArgs].join(' ')];
} }
else { else {
return [...tarArgs, ...compressionArgs].join(' '); args = [[...tarArgs].join(' '), [...compressionArgs].join(' ')];
} }
if (BSD_TAR_ZSTD) {
return args;
}
return [args.join(' ')];
}); });
} }
function getWorkingDirectory() { function getWorkingDirectory() {
@ -38229,8 +38239,7 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
? [ ? [
'zstd -d --long=30 -o', 'zstd -d --long=30 -o',
constants_1.TarFilename, constants_1.TarFilename,
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
'&&'
] ]
: [ : [
'--use-compress-program', '--use-compress-program',
@ -38241,8 +38250,7 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
? [ ? [
'zstd -d -o', 'zstd -d -o',
constants_1.TarFilename, constants_1.TarFilename,
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
'&&'
] ]
: ['--use-compress-program', IS_WINDOWS ? '"zstd -d"' : 'unzstd']; : ['--use-compress-program', IS_WINDOWS ? '"zstd -d"' : 'unzstd'];
default: default:
@ -38250,6 +38258,7 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
} }
}); });
} }
// Used for creating the archive
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores. // -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
// zstdmt is equivalent to 'zstd -T0' // zstdmt is equivalent to 'zstd -T0'
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit. // --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
@ -38265,7 +38274,6 @@ function getCompressionProgram(tarPath, compressionMethod) {
case constants_1.CompressionMethod.Zstd: case constants_1.CompressionMethod.Zstd:
return BSD_TAR_ZSTD return BSD_TAR_ZSTD
? [ ? [
'&&',
'zstd -T0 --long=30 -o', 'zstd -T0 --long=30 -o',
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
constants_1.TarFilename constants_1.TarFilename
@ -38277,7 +38285,6 @@ function getCompressionProgram(tarPath, compressionMethod) {
case constants_1.CompressionMethod.ZstdWithoutLong: case constants_1.CompressionMethod.ZstdWithoutLong:
return BSD_TAR_ZSTD return BSD_TAR_ZSTD
? [ ? [
'&&',
'zstd -T0 -o', 'zstd -T0 -o',
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
constants_1.TarFilename constants_1.TarFilename
@ -38288,44 +38295,45 @@ function getCompressionProgram(tarPath, compressionMethod) {
} }
}); });
} }
function listTar(archivePath, compressionMethod) { // Executes all commands as separate processes
function execCommands(commands, cwd) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const args = yield getArgs(compressionMethod, 'list', archivePath); for (const command of commands) {
try { try {
yield exec_1.exec(args); yield exec_1.exec(command, undefined, { cwd });
} }
catch (error) { catch (error) {
throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`); throw new Error(`${command.split(' ')[0]} failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
}
} }
}); });
} }
// List the contents of a tar
function listTar(archivePath, compressionMethod) {
return __awaiter(this, void 0, void 0, function* () {
const commands = yield getCommands(compressionMethod, 'list', archivePath);
yield execCommands(commands);
});
}
exports.listTar = listTar; exports.listTar = listTar;
// Extract a tar
function extractTar(archivePath, compressionMethod) { function extractTar(archivePath, compressionMethod) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
// Create directory to extract tar into // Create directory to extract tar into
const workingDirectory = getWorkingDirectory(); const workingDirectory = getWorkingDirectory();
yield io.mkdirP(workingDirectory); yield io.mkdirP(workingDirectory);
const args = yield getArgs(compressionMethod, 'extract', archivePath); const commands = yield getCommands(compressionMethod, 'extract', archivePath);
try { yield execCommands(commands);
yield exec_1.exec(args);
}
catch (error) {
throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
}
}); });
} }
exports.extractTar = extractTar; exports.extractTar = extractTar;
// Create a tar
function createTar(archiveFolder, sourceDirectories, compressionMethod) { function createTar(archiveFolder, sourceDirectories, compressionMethod) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
// Write source directories to manifest.txt to avoid command length limits // Write source directories to manifest.txt to avoid command length limits
fs_1.writeFileSync(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\n')); fs_1.writeFileSync(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\n'));
const args = yield getArgs(compressionMethod, 'create'); const commands = yield getCommands(compressionMethod, 'create');
try { yield execCommands(commands, archiveFolder);
yield exec_1.exec(args, undefined, { cwd: archiveFolder });
}
catch (error) {
throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
}
}); });
} }
exports.createTar = createTar; exports.createTar = createTar;
@ -43423,312 +43431,312 @@ Object.defineProperty(exports, "__esModule", { value: true });
/* 608 */ /* 608 */
/***/ (function(module) { /***/ (function(module) {
/*! ***************************************************************************** /*! *****************************************************************************
Copyright (c) Microsoft Corporation. Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted. purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 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 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE. PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */ ***************************************************************************** */
/* global global, define, System, Reflect, Promise */ /* global global, define, System, Reflect, Promise */
var __extends; var __extends;
var __assign; var __assign;
var __rest; var __rest;
var __decorate; var __decorate;
var __param; var __param;
var __metadata; var __metadata;
var __awaiter; var __awaiter;
var __generator; var __generator;
var __exportStar; var __exportStar;
var __values; var __values;
var __read; var __read;
var __spread; var __spread;
var __spreadArrays; var __spreadArrays;
var __spreadArray; var __spreadArray;
var __await; var __await;
var __asyncGenerator; var __asyncGenerator;
var __asyncDelegator; var __asyncDelegator;
var __asyncValues; var __asyncValues;
var __makeTemplateObject; var __makeTemplateObject;
var __importStar; var __importStar;
var __importDefault; var __importDefault;
var __classPrivateFieldGet; var __classPrivateFieldGet;
var __classPrivateFieldSet; var __classPrivateFieldSet;
var __createBinding; var __createBinding;
(function (factory) { (function (factory) {
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
} }
else if ( true && typeof module.exports === "object") { else if ( true && typeof module.exports === "object") {
factory(createExporter(root, createExporter(module.exports))); factory(createExporter(root, createExporter(module.exports)));
} }
else { else {
factory(createExporter(root)); factory(createExporter(root));
} }
function createExporter(exports, previous) { function createExporter(exports, previous) {
if (exports !== root) { if (exports !== root) {
if (typeof Object.create === "function") { if (typeof Object.create === "function") {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
} }
else { else {
exports.__esModule = true; exports.__esModule = true;
} }
} }
return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
} }
}) })
(function (exporter) { (function (exporter) {
var extendStatics = Object.setPrototypeOf || var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
__extends = function (d, b) { __extends = function (d, b) {
if (typeof b !== "function" && b !== null) if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b); extendStatics(d, b);
function __() { this.constructor = d; } function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}; };
__assign = Object.assign || function (t) { __assign = Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) { for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i]; s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
} }
return t; return t;
}; };
__rest = function (s, e) { __rest = function (s, e) {
var t = {}; var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p]; t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]]; t[p[i]] = s[p[i]];
} }
return t; return t;
}; };
__decorate = function (decorators, target, key, desc) { __decorate = function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r; return c > 3 && r && Object.defineProperty(target, key, r), r;
}; };
__param = function (paramIndex, decorator) { __param = function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); } return function (target, key) { decorator(target, key, paramIndex); }
}; };
__metadata = function (metadataKey, metadataValue) { __metadata = function (metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}; };
__awaiter = function (thisArg, _arguments, P, generator) { __awaiter = function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
__generator = function (thisArg, body) { __generator = function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; } function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) { function step(op) {
if (f) throw new TypeError("Generator is already executing."); if (f) throw new TypeError("Generator is already executing.");
while (_) try { while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value]; if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) { switch (op[0]) {
case 0: case 1: t = op; break; case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false }; case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue; case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue; case 7: op = _.ops.pop(); _.trys.pop(); continue;
default: default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop(); if (t[2]) _.ops.pop();
_.trys.pop(); continue; _.trys.pop(); continue;
} }
op = body.call(thisArg, _); op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
} }
}; };
__exportStar = function(m, o) { __exportStar = function(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}; };
__createBinding = Object.create ? (function(o, m, k, k2) { __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
}); });
__values = function (o) { __values = function (o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o); if (m) return m.call(o);
if (o && typeof o.length === "number") return { if (o && typeof o.length === "number") return {
next: function () { next: function () {
if (o && i >= o.length) o = void 0; if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o }; return { value: o && o[i++], done: !o };
} }
}; };
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}; };
__read = function (o, n) { __read = function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator]; var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o; if (!m) return o;
var i = m.call(o), r, ar = [], e; var i = m.call(o), r, ar = [], e;
try { try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
} }
catch (error) { e = { error: error }; } catch (error) { e = { error: error }; }
finally { finally {
try { try {
if (r && !r.done && (m = i["return"])) m.call(i); if (r && !r.done && (m = i["return"])) m.call(i);
} }
finally { if (e) throw e.error; } finally { if (e) throw e.error; }
} }
return ar; return ar;
}; };
/** @deprecated */ /** @deprecated */
__spread = function () { __spread = function () {
for (var ar = [], i = 0; i < arguments.length; i++) for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i])); ar = ar.concat(__read(arguments[i]));
return ar; return ar;
}; };
/** @deprecated */ /** @deprecated */
__spreadArrays = function () { __spreadArrays = function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j]; r[k] = a[j];
return r; return r;
}; };
__spreadArray = function (to, from, pack) { __spreadArray = function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) { if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i); if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i]; ar[i] = from[i];
} }
} }
return to.concat(ar || Array.prototype.slice.call(from)); return to.concat(ar || Array.prototype.slice.call(from));
}; };
__await = function (v) { __await = function (v) {
return this instanceof __await ? (this.v = v, this) : new __await(v); return this instanceof __await ? (this.v = v, this) : new __await(v);
}; };
__asyncGenerator = function (thisArg, _arguments, generator) { __asyncGenerator = function (thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = []; var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); } function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); } function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}; };
__asyncDelegator = function (o) { __asyncDelegator = function (o) {
var i, p; var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}; };
__asyncValues = function (o) { __asyncValues = function (o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i; var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}; };
__makeTemplateObject = function (cooked, raw) { __makeTemplateObject = function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked; return cooked;
}; };
var __setModuleDefault = Object.create ? (function(o, v) { var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}; };
__importStar = function (mod) { __importStar = function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
__importDefault = function (mod) { __importDefault = function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
__classPrivateFieldGet = function (receiver, state, kind, f) { __classPrivateFieldGet = function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}; };
__classPrivateFieldSet = function (receiver, state, value, kind, f) { __classPrivateFieldSet = function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}; };
exporter("__extends", __extends); exporter("__extends", __extends);
exporter("__assign", __assign); exporter("__assign", __assign);
exporter("__rest", __rest); exporter("__rest", __rest);
exporter("__decorate", __decorate); exporter("__decorate", __decorate);
exporter("__param", __param); exporter("__param", __param);
exporter("__metadata", __metadata); exporter("__metadata", __metadata);
exporter("__awaiter", __awaiter); exporter("__awaiter", __awaiter);
exporter("__generator", __generator); exporter("__generator", __generator);
exporter("__exportStar", __exportStar); exporter("__exportStar", __exportStar);
exporter("__createBinding", __createBinding); exporter("__createBinding", __createBinding);
exporter("__values", __values); exporter("__values", __values);
exporter("__read", __read); exporter("__read", __read);
exporter("__spread", __spread); exporter("__spread", __spread);
exporter("__spreadArrays", __spreadArrays); exporter("__spreadArrays", __spreadArrays);
exporter("__spreadArray", __spreadArray); exporter("__spreadArray", __spreadArray);
exporter("__await", __await); exporter("__await", __await);
exporter("__asyncGenerator", __asyncGenerator); exporter("__asyncGenerator", __asyncGenerator);
exporter("__asyncDelegator", __asyncDelegator); exporter("__asyncDelegator", __asyncDelegator);
exporter("__asyncValues", __asyncValues); exporter("__asyncValues", __asyncValues);
exporter("__makeTemplateObject", __makeTemplateObject); exporter("__makeTemplateObject", __makeTemplateObject);
exporter("__importStar", __importStar); exporter("__importStar", __importStar);
exporter("__importDefault", __importDefault); exporter("__importDefault", __importDefault);
exporter("__classPrivateFieldGet", __classPrivateFieldGet); exporter("__classPrivateFieldGet", __classPrivateFieldGet);
exporter("__classPrivateFieldSet", __classPrivateFieldSet); exporter("__classPrivateFieldSet", __classPrivateFieldSet);
}); });
/***/ }), /***/ }),
@ -46584,312 +46592,312 @@ var SpanKind;
/* 671 */ /* 671 */
/***/ (function(module) { /***/ (function(module) {
/*! ***************************************************************************** /*! *****************************************************************************
Copyright (c) Microsoft Corporation. Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted. purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 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 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE. PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */ ***************************************************************************** */
/* global global, define, System, Reflect, Promise */ /* global global, define, System, Reflect, Promise */
var __extends; var __extends;
var __assign; var __assign;
var __rest; var __rest;
var __decorate; var __decorate;
var __param; var __param;
var __metadata; var __metadata;
var __awaiter; var __awaiter;
var __generator; var __generator;
var __exportStar; var __exportStar;
var __values; var __values;
var __read; var __read;
var __spread; var __spread;
var __spreadArrays; var __spreadArrays;
var __spreadArray; var __spreadArray;
var __await; var __await;
var __asyncGenerator; var __asyncGenerator;
var __asyncDelegator; var __asyncDelegator;
var __asyncValues; var __asyncValues;
var __makeTemplateObject; var __makeTemplateObject;
var __importStar; var __importStar;
var __importDefault; var __importDefault;
var __classPrivateFieldGet; var __classPrivateFieldGet;
var __classPrivateFieldSet; var __classPrivateFieldSet;
var __createBinding; var __createBinding;
(function (factory) { (function (factory) {
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
} }
else if ( true && typeof module.exports === "object") { else if ( true && typeof module.exports === "object") {
factory(createExporter(root, createExporter(module.exports))); factory(createExporter(root, createExporter(module.exports)));
} }
else { else {
factory(createExporter(root)); factory(createExporter(root));
} }
function createExporter(exports, previous) { function createExporter(exports, previous) {
if (exports !== root) { if (exports !== root) {
if (typeof Object.create === "function") { if (typeof Object.create === "function") {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
} }
else { else {
exports.__esModule = true; exports.__esModule = true;
} }
} }
return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
} }
}) })
(function (exporter) { (function (exporter) {
var extendStatics = Object.setPrototypeOf || var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
__extends = function (d, b) { __extends = function (d, b) {
if (typeof b !== "function" && b !== null) if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b); extendStatics(d, b);
function __() { this.constructor = d; } function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}; };
__assign = Object.assign || function (t) { __assign = Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) { for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i]; s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
} }
return t; return t;
}; };
__rest = function (s, e) { __rest = function (s, e) {
var t = {}; var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p]; t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]]; t[p[i]] = s[p[i]];
} }
return t; return t;
}; };
__decorate = function (decorators, target, key, desc) { __decorate = function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r; return c > 3 && r && Object.defineProperty(target, key, r), r;
}; };
__param = function (paramIndex, decorator) { __param = function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); } return function (target, key) { decorator(target, key, paramIndex); }
}; };
__metadata = function (metadataKey, metadataValue) { __metadata = function (metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}; };
__awaiter = function (thisArg, _arguments, P, generator) { __awaiter = function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
__generator = function (thisArg, body) { __generator = function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; } function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) { function step(op) {
if (f) throw new TypeError("Generator is already executing."); if (f) throw new TypeError("Generator is already executing.");
while (_) try { while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value]; if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) { switch (op[0]) {
case 0: case 1: t = op; break; case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false }; case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue; case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue; case 7: op = _.ops.pop(); _.trys.pop(); continue;
default: default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop(); if (t[2]) _.ops.pop();
_.trys.pop(); continue; _.trys.pop(); continue;
} }
op = body.call(thisArg, _); op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
} }
}; };
__exportStar = function(m, o) { __exportStar = function(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}; };
__createBinding = Object.create ? (function(o, m, k, k2) { __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
}); });
__values = function (o) { __values = function (o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o); if (m) return m.call(o);
if (o && typeof o.length === "number") return { if (o && typeof o.length === "number") return {
next: function () { next: function () {
if (o && i >= o.length) o = void 0; if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o }; return { value: o && o[i++], done: !o };
} }
}; };
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}; };
__read = function (o, n) { __read = function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator]; var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o; if (!m) return o;
var i = m.call(o), r, ar = [], e; var i = m.call(o), r, ar = [], e;
try { try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
} }
catch (error) { e = { error: error }; } catch (error) { e = { error: error }; }
finally { finally {
try { try {
if (r && !r.done && (m = i["return"])) m.call(i); if (r && !r.done && (m = i["return"])) m.call(i);
} }
finally { if (e) throw e.error; } finally { if (e) throw e.error; }
} }
return ar; return ar;
}; };
/** @deprecated */ /** @deprecated */
__spread = function () { __spread = function () {
for (var ar = [], i = 0; i < arguments.length; i++) for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i])); ar = ar.concat(__read(arguments[i]));
return ar; return ar;
}; };
/** @deprecated */ /** @deprecated */
__spreadArrays = function () { __spreadArrays = function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j]; r[k] = a[j];
return r; return r;
}; };
__spreadArray = function (to, from, pack) { __spreadArray = function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) { if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i); if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i]; ar[i] = from[i];
} }
} }
return to.concat(ar || Array.prototype.slice.call(from)); return to.concat(ar || Array.prototype.slice.call(from));
}; };
__await = function (v) { __await = function (v) {
return this instanceof __await ? (this.v = v, this) : new __await(v); return this instanceof __await ? (this.v = v, this) : new __await(v);
}; };
__asyncGenerator = function (thisArg, _arguments, generator) { __asyncGenerator = function (thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = []; var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); } function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); } function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}; };
__asyncDelegator = function (o) { __asyncDelegator = function (o) {
var i, p; var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}; };
__asyncValues = function (o) { __asyncValues = function (o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i; var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}; };
__makeTemplateObject = function (cooked, raw) { __makeTemplateObject = function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked; return cooked;
}; };
var __setModuleDefault = Object.create ? (function(o, v) { var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}; };
__importStar = function (mod) { __importStar = function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
__importDefault = function (mod) { __importDefault = function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
__classPrivateFieldGet = function (receiver, state, kind, f) { __classPrivateFieldGet = function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}; };
__classPrivateFieldSet = function (receiver, state, value, kind, f) { __classPrivateFieldSet = function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}; };
exporter("__extends", __extends); exporter("__extends", __extends);
exporter("__assign", __assign); exporter("__assign", __assign);
exporter("__rest", __rest); exporter("__rest", __rest);
exporter("__decorate", __decorate); exporter("__decorate", __decorate);
exporter("__param", __param); exporter("__param", __param);
exporter("__metadata", __metadata); exporter("__metadata", __metadata);
exporter("__awaiter", __awaiter); exporter("__awaiter", __awaiter);
exporter("__generator", __generator); exporter("__generator", __generator);
exporter("__exportStar", __exportStar); exporter("__exportStar", __exportStar);
exporter("__createBinding", __createBinding); exporter("__createBinding", __createBinding);
exporter("__values", __values); exporter("__values", __values);
exporter("__read", __read); exporter("__read", __read);
exporter("__spread", __spread); exporter("__spread", __spread);
exporter("__spreadArrays", __spreadArrays); exporter("__spreadArrays", __spreadArrays);
exporter("__spreadArray", __spreadArray); exporter("__spreadArray", __spreadArray);
exporter("__await", __await); exporter("__await", __await);
exporter("__asyncGenerator", __asyncGenerator); exporter("__asyncGenerator", __asyncGenerator);
exporter("__asyncDelegator", __asyncDelegator); exporter("__asyncDelegator", __asyncDelegator);
exporter("__asyncValues", __asyncValues); exporter("__asyncValues", __asyncValues);
exporter("__makeTemplateObject", __makeTemplateObject); exporter("__makeTemplateObject", __makeTemplateObject);
exporter("__importStar", __importStar); exporter("__importStar", __importStar);
exporter("__importDefault", __importDefault); exporter("__importDefault", __importDefault);
exporter("__classPrivateFieldGet", __classPrivateFieldGet); exporter("__classPrivateFieldGet", __classPrivateFieldGet);
exporter("__classPrivateFieldSet", __classPrivateFieldSet); exporter("__classPrivateFieldSet", __classPrivateFieldSet);
}); });
/***/ }), /***/ }),
@ -47317,15 +47325,12 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
let compressionMethod = yield utils.getCompressionMethod(); let compressionMethod = yield utils.getCompressionMethod();
let archivePath = ''; let archivePath = '';
try { try {
try { // path are needed to compute version
// path are needed to compute version cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, {
cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { compressionMethod
compressionMethod });
}); if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
} // This is to support the old cache entry created by gzip on windows.
catch (error) {
// This is to support the old cache entry created
// by the old version of the cache action on windows.
if (process.platform === 'win32' && if (process.platform === 'win32' &&
compressionMethod !== constants_1.CompressionMethod.Gzip) { compressionMethod !== constants_1.CompressionMethod.Gzip) {
compressionMethod = constants_1.CompressionMethod.Gzip; compressionMethod = constants_1.CompressionMethod.Gzip;
@ -47333,17 +47338,15 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
compressionMethod compressionMethod
}); });
if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
throw error; return undefined;
} }
core.debug("Couldn't find cache entry with zstd compression, falling back to gzip compression.");
} }
else { else {
throw error; // Cache not found
return undefined;
} }
} }
if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
// Cache not found
return undefined;
}
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
core.debug(`Archive Path: ${archivePath}`); core.debug(`Archive Path: ${archivePath}`);
// Download the cache from the cache entry // Download the cache from the cache entry
@ -50614,312 +50617,312 @@ exports.default = _default;
/* 865 */ /* 865 */
/***/ (function(module) { /***/ (function(module) {
/*! ***************************************************************************** /*! *****************************************************************************
Copyright (c) Microsoft Corporation. Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted. purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 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 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE. PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */ ***************************************************************************** */
/* global global, define, System, Reflect, Promise */ /* global global, define, System, Reflect, Promise */
var __extends; var __extends;
var __assign; var __assign;
var __rest; var __rest;
var __decorate; var __decorate;
var __param; var __param;
var __metadata; var __metadata;
var __awaiter; var __awaiter;
var __generator; var __generator;
var __exportStar; var __exportStar;
var __values; var __values;
var __read; var __read;
var __spread; var __spread;
var __spreadArrays; var __spreadArrays;
var __spreadArray; var __spreadArray;
var __await; var __await;
var __asyncGenerator; var __asyncGenerator;
var __asyncDelegator; var __asyncDelegator;
var __asyncValues; var __asyncValues;
var __makeTemplateObject; var __makeTemplateObject;
var __importStar; var __importStar;
var __importDefault; var __importDefault;
var __classPrivateFieldGet; var __classPrivateFieldGet;
var __classPrivateFieldSet; var __classPrivateFieldSet;
var __createBinding; var __createBinding;
(function (factory) { (function (factory) {
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
} }
else if ( true && typeof module.exports === "object") { else if ( true && typeof module.exports === "object") {
factory(createExporter(root, createExporter(module.exports))); factory(createExporter(root, createExporter(module.exports)));
} }
else { else {
factory(createExporter(root)); factory(createExporter(root));
} }
function createExporter(exports, previous) { function createExporter(exports, previous) {
if (exports !== root) { if (exports !== root) {
if (typeof Object.create === "function") { if (typeof Object.create === "function") {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
} }
else { else {
exports.__esModule = true; exports.__esModule = true;
} }
} }
return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
} }
}) })
(function (exporter) { (function (exporter) {
var extendStatics = Object.setPrototypeOf || var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
__extends = function (d, b) { __extends = function (d, b) {
if (typeof b !== "function" && b !== null) if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b); extendStatics(d, b);
function __() { this.constructor = d; } function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}; };
__assign = Object.assign || function (t) { __assign = Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) { for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i]; s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
} }
return t; return t;
}; };
__rest = function (s, e) { __rest = function (s, e) {
var t = {}; var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p]; t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]]; t[p[i]] = s[p[i]];
} }
return t; return t;
}; };
__decorate = function (decorators, target, key, desc) { __decorate = function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r; return c > 3 && r && Object.defineProperty(target, key, r), r;
}; };
__param = function (paramIndex, decorator) { __param = function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); } return function (target, key) { decorator(target, key, paramIndex); }
}; };
__metadata = function (metadataKey, metadataValue) { __metadata = function (metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}; };
__awaiter = function (thisArg, _arguments, P, generator) { __awaiter = function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
__generator = function (thisArg, body) { __generator = function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; } function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) { function step(op) {
if (f) throw new TypeError("Generator is already executing."); if (f) throw new TypeError("Generator is already executing.");
while (_) try { while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value]; if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) { switch (op[0]) {
case 0: case 1: t = op; break; case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false }; case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue; case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue; case 7: op = _.ops.pop(); _.trys.pop(); continue;
default: default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop(); if (t[2]) _.ops.pop();
_.trys.pop(); continue; _.trys.pop(); continue;
} }
op = body.call(thisArg, _); op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
} }
}; };
__exportStar = function(m, o) { __exportStar = function(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}; };
__createBinding = Object.create ? (function(o, m, k, k2) { __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
}); });
__values = function (o) { __values = function (o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o); if (m) return m.call(o);
if (o && typeof o.length === "number") return { if (o && typeof o.length === "number") return {
next: function () { next: function () {
if (o && i >= o.length) o = void 0; if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o }; return { value: o && o[i++], done: !o };
} }
}; };
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}; };
__read = function (o, n) { __read = function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator]; var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o; if (!m) return o;
var i = m.call(o), r, ar = [], e; var i = m.call(o), r, ar = [], e;
try { try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
} }
catch (error) { e = { error: error }; } catch (error) { e = { error: error }; }
finally { finally {
try { try {
if (r && !r.done && (m = i["return"])) m.call(i); if (r && !r.done && (m = i["return"])) m.call(i);
} }
finally { if (e) throw e.error; } finally { if (e) throw e.error; }
} }
return ar; return ar;
}; };
/** @deprecated */ /** @deprecated */
__spread = function () { __spread = function () {
for (var ar = [], i = 0; i < arguments.length; i++) for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i])); ar = ar.concat(__read(arguments[i]));
return ar; return ar;
}; };
/** @deprecated */ /** @deprecated */
__spreadArrays = function () { __spreadArrays = function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j]; r[k] = a[j];
return r; return r;
}; };
__spreadArray = function (to, from, pack) { __spreadArray = function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) { if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i); if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i]; ar[i] = from[i];
} }
} }
return to.concat(ar || Array.prototype.slice.call(from)); return to.concat(ar || Array.prototype.slice.call(from));
}; };
__await = function (v) { __await = function (v) {
return this instanceof __await ? (this.v = v, this) : new __await(v); return this instanceof __await ? (this.v = v, this) : new __await(v);
}; };
__asyncGenerator = function (thisArg, _arguments, generator) { __asyncGenerator = function (thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = []; var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); } function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); } function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}; };
__asyncDelegator = function (o) { __asyncDelegator = function (o) {
var i, p; var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}; };
__asyncValues = function (o) { __asyncValues = function (o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i; var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}; };
__makeTemplateObject = function (cooked, raw) { __makeTemplateObject = function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked; return cooked;
}; };
var __setModuleDefault = Object.create ? (function(o, v) { var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}; };
__importStar = function (mod) { __importStar = function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
__importDefault = function (mod) { __importDefault = function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
__classPrivateFieldGet = function (receiver, state, kind, f) { __classPrivateFieldGet = function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}; };
__classPrivateFieldSet = function (receiver, state, value, kind, f) { __classPrivateFieldSet = function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}; };
exporter("__extends", __extends); exporter("__extends", __extends);
exporter("__assign", __assign); exporter("__assign", __assign);
exporter("__rest", __rest); exporter("__rest", __rest);
exporter("__decorate", __decorate); exporter("__decorate", __decorate);
exporter("__param", __param); exporter("__param", __param);
exporter("__metadata", __metadata); exporter("__metadata", __metadata);
exporter("__awaiter", __awaiter); exporter("__awaiter", __awaiter);
exporter("__generator", __generator); exporter("__generator", __generator);
exporter("__exportStar", __exportStar); exporter("__exportStar", __exportStar);
exporter("__createBinding", __createBinding); exporter("__createBinding", __createBinding);
exporter("__values", __values); exporter("__values", __values);
exporter("__read", __read); exporter("__read", __read);
exporter("__spread", __spread); exporter("__spread", __spread);
exporter("__spreadArrays", __spreadArrays); exporter("__spreadArrays", __spreadArrays);
exporter("__spreadArray", __spreadArray); exporter("__spreadArray", __spreadArray);
exporter("__await", __await); exporter("__await", __await);
exporter("__asyncGenerator", __asyncGenerator); exporter("__asyncGenerator", __asyncGenerator);
exporter("__asyncDelegator", __asyncDelegator); exporter("__asyncDelegator", __asyncDelegator);
exporter("__asyncValues", __asyncValues); exporter("__asyncValues", __asyncValues);
exporter("__makeTemplateObject", __makeTemplateObject); exporter("__makeTemplateObject", __makeTemplateObject);
exporter("__importStar", __importStar); exporter("__importStar", __importStar);
exporter("__importDefault", __importDefault); exporter("__importDefault", __importDefault);
exporter("__classPrivateFieldGet", __classPrivateFieldGet); exporter("__classPrivateFieldGet", __classPrivateFieldGet);
exporter("__classPrivateFieldSet", __classPrivateFieldSet); exporter("__classPrivateFieldSet", __classPrivateFieldSet);
}); });
/***/ }), /***/ }),
@ -53403,1303 +53406,1303 @@ var SpanStatusCode;
/***/ (function(module, __unusedexports, __webpack_require__) { /***/ (function(module, __unusedexports, __webpack_require__) {
"use strict"; "use strict";
const punycode = __webpack_require__(815); const punycode = __webpack_require__(815);
const tr46 = __webpack_require__(976); const tr46 = __webpack_require__(976);
const specialSchemes = { const specialSchemes = {
ftp: 21, ftp: 21,
file: null, file: null,
gopher: 70, gopher: 70,
http: 80, http: 80,
https: 443, https: 443,
ws: 80, ws: 80,
wss: 443 wss: 443
}; };
const failure = Symbol("failure"); const failure = Symbol("failure");
function countSymbols(str) { function countSymbols(str) {
return punycode.ucs2.decode(str).length; return punycode.ucs2.decode(str).length;
} }
function at(input, idx) { function at(input, idx) {
const c = input[idx]; const c = input[idx];
return isNaN(c) ? undefined : String.fromCodePoint(c); return isNaN(c) ? undefined : String.fromCodePoint(c);
} }
function isASCIIDigit(c) { function isASCIIDigit(c) {
return c >= 0x30 && c <= 0x39; return c >= 0x30 && c <= 0x39;
} }
function isASCIIAlpha(c) { function isASCIIAlpha(c) {
return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);
} }
function isASCIIAlphanumeric(c) { function isASCIIAlphanumeric(c) {
return isASCIIAlpha(c) || isASCIIDigit(c); return isASCIIAlpha(c) || isASCIIDigit(c);
} }
function isASCIIHex(c) { function isASCIIHex(c) {
return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);
} }
function isSingleDot(buffer) { function isSingleDot(buffer) {
return buffer === "." || buffer.toLowerCase() === "%2e"; return buffer === "." || buffer.toLowerCase() === "%2e";
} }
function isDoubleDot(buffer) { function isDoubleDot(buffer) {
buffer = buffer.toLowerCase(); buffer = buffer.toLowerCase();
return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e";
} }
function isWindowsDriveLetterCodePoints(cp1, cp2) { function isWindowsDriveLetterCodePoints(cp1, cp2) {
return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124);
} }
function isWindowsDriveLetterString(string) { function isWindowsDriveLetterString(string) {
return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|");
} }
function isNormalizedWindowsDriveLetterString(string) { function isNormalizedWindowsDriveLetterString(string) {
return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":";
} }
function containsForbiddenHostCodePoint(string) { function containsForbiddenHostCodePoint(string) {
return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1;
} }
function containsForbiddenHostCodePointExcludingPercent(string) { function containsForbiddenHostCodePointExcludingPercent(string) {
return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1;
} }
function isSpecialScheme(scheme) { function isSpecialScheme(scheme) {
return specialSchemes[scheme] !== undefined; return specialSchemes[scheme] !== undefined;
} }
function isSpecial(url) { function isSpecial(url) {
return isSpecialScheme(url.scheme); return isSpecialScheme(url.scheme);
} }
function defaultPort(scheme) { function defaultPort(scheme) {
return specialSchemes[scheme]; return specialSchemes[scheme];
} }
function percentEncode(c) { function percentEncode(c) {
let hex = c.toString(16).toUpperCase(); let hex = c.toString(16).toUpperCase();
if (hex.length === 1) { if (hex.length === 1) {
hex = "0" + hex; hex = "0" + hex;
} }
return "%" + hex; return "%" + hex;
} }
function utf8PercentEncode(c) { function utf8PercentEncode(c) {
const buf = new Buffer(c); const buf = new Buffer(c);
let str = ""; let str = "";
for (let i = 0; i < buf.length; ++i) { for (let i = 0; i < buf.length; ++i) {
str += percentEncode(buf[i]); str += percentEncode(buf[i]);
} }
return str; return str;
} }
function utf8PercentDecode(str) { function utf8PercentDecode(str) {
const input = new Buffer(str); const input = new Buffer(str);
const output = []; const output = [];
for (let i = 0; i < input.length; ++i) { for (let i = 0; i < input.length; ++i) {
if (input[i] !== 37) { if (input[i] !== 37) {
output.push(input[i]); output.push(input[i]);
} else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) { } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {
output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16)); output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));
i += 2; i += 2;
} else { } else {
output.push(input[i]); output.push(input[i]);
} }
} }
return new Buffer(output).toString(); return new Buffer(output).toString();
} }
function isC0ControlPercentEncode(c) { function isC0ControlPercentEncode(c) {
return c <= 0x1F || c > 0x7E; return c <= 0x1F || c > 0x7E;
} }
const extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); const extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);
function isPathPercentEncode(c) { function isPathPercentEncode(c) {
return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c); return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c);
} }
const extraUserinfoPercentEncodeSet = const extraUserinfoPercentEncodeSet =
new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);
function isUserinfoPercentEncode(c) { function isUserinfoPercentEncode(c) {
return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);
} }
function percentEncodeChar(c, encodeSetPredicate) { function percentEncodeChar(c, encodeSetPredicate) {
const cStr = String.fromCodePoint(c); const cStr = String.fromCodePoint(c);
if (encodeSetPredicate(c)) { if (encodeSetPredicate(c)) {
return utf8PercentEncode(cStr); return utf8PercentEncode(cStr);
} }
return cStr; return cStr;
} }
function parseIPv4Number(input) { function parseIPv4Number(input) {
let R = 10; let R = 10;
if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") {
input = input.substring(2); input = input.substring(2);
R = 16; R = 16;
} else if (input.length >= 2 && input.charAt(0) === "0") { } else if (input.length >= 2 && input.charAt(0) === "0") {
input = input.substring(1); input = input.substring(1);
R = 8; R = 8;
} }
if (input === "") { if (input === "") {
return 0; return 0;
} }
const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/); const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/);
if (regex.test(input)) { if (regex.test(input)) {
return failure; return failure;
} }
return parseInt(input, R); return parseInt(input, R);
} }
function parseIPv4(input) { function parseIPv4(input) {
const parts = input.split("."); const parts = input.split(".");
if (parts[parts.length - 1] === "") { if (parts[parts.length - 1] === "") {
if (parts.length > 1) { if (parts.length > 1) {
parts.pop(); parts.pop();
} }
} }
if (parts.length > 4) { if (parts.length > 4) {
return input; return input;
} }
const numbers = []; const numbers = [];
for (const part of parts) { for (const part of parts) {
if (part === "") { if (part === "") {
return input; return input;
} }
const n = parseIPv4Number(part); const n = parseIPv4Number(part);
if (n === failure) { if (n === failure) {
return input; return input;
} }
numbers.push(n); numbers.push(n);
} }
for (let i = 0; i < numbers.length - 1; ++i) { for (let i = 0; i < numbers.length - 1; ++i) {
if (numbers[i] > 255) { if (numbers[i] > 255) {
return failure; return failure;
} }
} }
if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {
return failure; return failure;
} }
let ipv4 = numbers.pop(); let ipv4 = numbers.pop();
let counter = 0; let counter = 0;
for (const n of numbers) { for (const n of numbers) {
ipv4 += n * Math.pow(256, 3 - counter); ipv4 += n * Math.pow(256, 3 - counter);
++counter; ++counter;
} }
return ipv4; return ipv4;
} }
function serializeIPv4(address) { function serializeIPv4(address) {
let output = ""; let output = "";
let n = address; let n = address;
for (let i = 1; i <= 4; ++i) { for (let i = 1; i <= 4; ++i) {
output = String(n % 256) + output; output = String(n % 256) + output;
if (i !== 4) { if (i !== 4) {
output = "." + output; output = "." + output;
} }
n = Math.floor(n / 256); n = Math.floor(n / 256);
} }
return output; return output;
} }
function parseIPv6(input) { function parseIPv6(input) {
const address = [0, 0, 0, 0, 0, 0, 0, 0]; const address = [0, 0, 0, 0, 0, 0, 0, 0];
let pieceIndex = 0; let pieceIndex = 0;
let compress = null; let compress = null;
let pointer = 0; let pointer = 0;
input = punycode.ucs2.decode(input); input = punycode.ucs2.decode(input);
if (input[pointer] === 58) { if (input[pointer] === 58) {
if (input[pointer + 1] !== 58) { if (input[pointer + 1] !== 58) {
return failure; return failure;
} }
pointer += 2; pointer += 2;
++pieceIndex; ++pieceIndex;
compress = pieceIndex; compress = pieceIndex;
} }
while (pointer < input.length) { while (pointer < input.length) {
if (pieceIndex === 8) { if (pieceIndex === 8) {
return failure; return failure;
} }
if (input[pointer] === 58) { if (input[pointer] === 58) {
if (compress !== null) { if (compress !== null) {
return failure; return failure;
} }
++pointer; ++pointer;
++pieceIndex; ++pieceIndex;
compress = pieceIndex; compress = pieceIndex;
continue; continue;
} }
let value = 0; let value = 0;
let length = 0; let length = 0;
while (length < 4 && isASCIIHex(input[pointer])) { while (length < 4 && isASCIIHex(input[pointer])) {
value = value * 0x10 + parseInt(at(input, pointer), 16); value = value * 0x10 + parseInt(at(input, pointer), 16);
++pointer; ++pointer;
++length; ++length;
} }
if (input[pointer] === 46) { if (input[pointer] === 46) {
if (length === 0) { if (length === 0) {
return failure; return failure;
} }
pointer -= length; pointer -= length;
if (pieceIndex > 6) { if (pieceIndex > 6) {
return failure; return failure;
} }
let numbersSeen = 0; let numbersSeen = 0;
while (input[pointer] !== undefined) { while (input[pointer] !== undefined) {
let ipv4Piece = null; let ipv4Piece = null;
if (numbersSeen > 0) { if (numbersSeen > 0) {
if (input[pointer] === 46 && numbersSeen < 4) { if (input[pointer] === 46 && numbersSeen < 4) {
++pointer; ++pointer;
} else { } else {
return failure; return failure;
} }
} }
if (!isASCIIDigit(input[pointer])) { if (!isASCIIDigit(input[pointer])) {
return failure; return failure;
} }
while (isASCIIDigit(input[pointer])) { while (isASCIIDigit(input[pointer])) {
const number = parseInt(at(input, pointer)); const number = parseInt(at(input, pointer));
if (ipv4Piece === null) { if (ipv4Piece === null) {
ipv4Piece = number; ipv4Piece = number;
} else if (ipv4Piece === 0) { } else if (ipv4Piece === 0) {
return failure; return failure;
} else { } else {
ipv4Piece = ipv4Piece * 10 + number; ipv4Piece = ipv4Piece * 10 + number;
} }
if (ipv4Piece > 255) { if (ipv4Piece > 255) {
return failure; return failure;
} }
++pointer; ++pointer;
} }
address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;
++numbersSeen; ++numbersSeen;
if (numbersSeen === 2 || numbersSeen === 4) { if (numbersSeen === 2 || numbersSeen === 4) {
++pieceIndex; ++pieceIndex;
} }
} }
if (numbersSeen !== 4) { if (numbersSeen !== 4) {
return failure; return failure;
} }
break; break;
} else if (input[pointer] === 58) { } else if (input[pointer] === 58) {
++pointer; ++pointer;
if (input[pointer] === undefined) { if (input[pointer] === undefined) {
return failure; return failure;
} }
} else if (input[pointer] !== undefined) { } else if (input[pointer] !== undefined) {
return failure; return failure;
} }
address[pieceIndex] = value; address[pieceIndex] = value;
++pieceIndex; ++pieceIndex;
} }
if (compress !== null) { if (compress !== null) {
let swaps = pieceIndex - compress; let swaps = pieceIndex - compress;
pieceIndex = 7; pieceIndex = 7;
while (pieceIndex !== 0 && swaps > 0) { while (pieceIndex !== 0 && swaps > 0) {
const temp = address[compress + swaps - 1]; const temp = address[compress + swaps - 1];
address[compress + swaps - 1] = address[pieceIndex]; address[compress + swaps - 1] = address[pieceIndex];
address[pieceIndex] = temp; address[pieceIndex] = temp;
--pieceIndex; --pieceIndex;
--swaps; --swaps;
} }
} else if (compress === null && pieceIndex !== 8) { } else if (compress === null && pieceIndex !== 8) {
return failure; return failure;
} }
return address; return address;
} }
function serializeIPv6(address) { function serializeIPv6(address) {
let output = ""; let output = "";
const seqResult = findLongestZeroSequence(address); const seqResult = findLongestZeroSequence(address);
const compress = seqResult.idx; const compress = seqResult.idx;
let ignore0 = false; let ignore0 = false;
for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {
if (ignore0 && address[pieceIndex] === 0) { if (ignore0 && address[pieceIndex] === 0) {
continue; continue;
} else if (ignore0) { } else if (ignore0) {
ignore0 = false; ignore0 = false;
} }
if (compress === pieceIndex) { if (compress === pieceIndex) {
const separator = pieceIndex === 0 ? "::" : ":"; const separator = pieceIndex === 0 ? "::" : ":";
output += separator; output += separator;
ignore0 = true; ignore0 = true;
continue; continue;
} }
output += address[pieceIndex].toString(16); output += address[pieceIndex].toString(16);
if (pieceIndex !== 7) { if (pieceIndex !== 7) {
output += ":"; output += ":";
} }
} }
return output; return output;
} }
function parseHost(input, isSpecialArg) { function parseHost(input, isSpecialArg) {
if (input[0] === "[") { if (input[0] === "[") {
if (input[input.length - 1] !== "]") { if (input[input.length - 1] !== "]") {
return failure; return failure;
} }
return parseIPv6(input.substring(1, input.length - 1)); return parseIPv6(input.substring(1, input.length - 1));
} }
if (!isSpecialArg) { if (!isSpecialArg) {
return parseOpaqueHost(input); return parseOpaqueHost(input);
} }
const domain = utf8PercentDecode(input); const domain = utf8PercentDecode(input);
const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);
if (asciiDomain === null) { if (asciiDomain === null) {
return failure; return failure;
} }
if (containsForbiddenHostCodePoint(asciiDomain)) { if (containsForbiddenHostCodePoint(asciiDomain)) {
return failure; return failure;
} }
const ipv4Host = parseIPv4(asciiDomain); const ipv4Host = parseIPv4(asciiDomain);
if (typeof ipv4Host === "number" || ipv4Host === failure) { if (typeof ipv4Host === "number" || ipv4Host === failure) {
return ipv4Host; return ipv4Host;
} }
return asciiDomain; return asciiDomain;
} }
function parseOpaqueHost(input) { function parseOpaqueHost(input) {
if (containsForbiddenHostCodePointExcludingPercent(input)) { if (containsForbiddenHostCodePointExcludingPercent(input)) {
return failure; return failure;
} }
let output = ""; let output = "";
const decoded = punycode.ucs2.decode(input); const decoded = punycode.ucs2.decode(input);
for (let i = 0; i < decoded.length; ++i) { for (let i = 0; i < decoded.length; ++i) {
output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);
} }
return output; return output;
} }
function findLongestZeroSequence(arr) { function findLongestZeroSequence(arr) {
let maxIdx = null; let maxIdx = null;
let maxLen = 1; // only find elements > 1 let maxLen = 1; // only find elements > 1
let currStart = null; let currStart = null;
let currLen = 0; let currLen = 0;
for (let i = 0; i < arr.length; ++i) { for (let i = 0; i < arr.length; ++i) {
if (arr[i] !== 0) { if (arr[i] !== 0) {
if (currLen > maxLen) { if (currLen > maxLen) {
maxIdx = currStart; maxIdx = currStart;
maxLen = currLen; maxLen = currLen;
} }
currStart = null; currStart = null;
currLen = 0; currLen = 0;
} else { } else {
if (currStart === null) { if (currStart === null) {
currStart = i; currStart = i;
} }
++currLen; ++currLen;
} }
} }
// if trailing zeros // if trailing zeros
if (currLen > maxLen) { if (currLen > maxLen) {
maxIdx = currStart; maxIdx = currStart;
maxLen = currLen; maxLen = currLen;
} }
return { return {
idx: maxIdx, idx: maxIdx,
len: maxLen len: maxLen
}; };
} }
function serializeHost(host) { function serializeHost(host) {
if (typeof host === "number") { if (typeof host === "number") {
return serializeIPv4(host); return serializeIPv4(host);
} }
// IPv6 serializer // IPv6 serializer
if (host instanceof Array) { if (host instanceof Array) {
return "[" + serializeIPv6(host) + "]"; return "[" + serializeIPv6(host) + "]";
} }
return host; return host;
} }
function trimControlChars(url) { function trimControlChars(url) {
return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, "");
} }
function trimTabAndNewline(url) { function trimTabAndNewline(url) {
return url.replace(/\u0009|\u000A|\u000D/g, ""); return url.replace(/\u0009|\u000A|\u000D/g, "");
} }
function shortenPath(url) { function shortenPath(url) {
const path = url.path; const path = url.path;
if (path.length === 0) { if (path.length === 0) {
return; return;
} }
if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {
return; return;
} }
path.pop(); path.pop();
} }
function includesCredentials(url) { function includesCredentials(url) {
return url.username !== "" || url.password !== ""; return url.username !== "" || url.password !== "";
} }
function cannotHaveAUsernamePasswordPort(url) { function cannotHaveAUsernamePasswordPort(url) {
return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file"; return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file";
} }
function isNormalizedWindowsDriveLetter(string) { function isNormalizedWindowsDriveLetter(string) {
return /^[A-Za-z]:$/.test(string); return /^[A-Za-z]:$/.test(string);
} }
function URLStateMachine(input, base, encodingOverride, url, stateOverride) { function URLStateMachine(input, base, encodingOverride, url, stateOverride) {
this.pointer = 0; this.pointer = 0;
this.input = input; this.input = input;
this.base = base || null; this.base = base || null;
this.encodingOverride = encodingOverride || "utf-8"; this.encodingOverride = encodingOverride || "utf-8";
this.stateOverride = stateOverride; this.stateOverride = stateOverride;
this.url = url; this.url = url;
this.failure = false; this.failure = false;
this.parseError = false; this.parseError = false;
if (!this.url) { if (!this.url) {
this.url = { this.url = {
scheme: "", scheme: "",
username: "", username: "",
password: "", password: "",
host: null, host: null,
port: null, port: null,
path: [], path: [],
query: null, query: null,
fragment: null, fragment: null,
cannotBeABaseURL: false cannotBeABaseURL: false
}; };
const res = trimControlChars(this.input); const res = trimControlChars(this.input);
if (res !== this.input) { if (res !== this.input) {
this.parseError = true; this.parseError = true;
} }
this.input = res; this.input = res;
} }
const res = trimTabAndNewline(this.input); const res = trimTabAndNewline(this.input);
if (res !== this.input) { if (res !== this.input) {
this.parseError = true; this.parseError = true;
} }
this.input = res; this.input = res;
this.state = stateOverride || "scheme start"; this.state = stateOverride || "scheme start";
this.buffer = ""; this.buffer = "";
this.atFlag = false; this.atFlag = false;
this.arrFlag = false; this.arrFlag = false;
this.passwordTokenSeenFlag = false; this.passwordTokenSeenFlag = false;
this.input = punycode.ucs2.decode(this.input); this.input = punycode.ucs2.decode(this.input);
for (; this.pointer <= this.input.length; ++this.pointer) { for (; this.pointer <= this.input.length; ++this.pointer) {
const c = this.input[this.pointer]; const c = this.input[this.pointer];
const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); const cStr = isNaN(c) ? undefined : String.fromCodePoint(c);
// exec state machine // exec state machine
const ret = this["parse " + this.state](c, cStr); const ret = this["parse " + this.state](c, cStr);
if (!ret) { if (!ret) {
break; // terminate algorithm break; // terminate algorithm
} else if (ret === failure) { } else if (ret === failure) {
this.failure = true; this.failure = true;
break; break;
} }
} }
} }
URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) {
if (isASCIIAlpha(c)) { if (isASCIIAlpha(c)) {
this.buffer += cStr.toLowerCase(); this.buffer += cStr.toLowerCase();
this.state = "scheme"; this.state = "scheme";
} else if (!this.stateOverride) { } else if (!this.stateOverride) {
this.state = "no scheme"; this.state = "no scheme";
--this.pointer; --this.pointer;
} else { } else {
this.parseError = true; this.parseError = true;
return failure; return failure;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) {
if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) {
this.buffer += cStr.toLowerCase(); this.buffer += cStr.toLowerCase();
} else if (c === 58) { } else if (c === 58) {
if (this.stateOverride) { if (this.stateOverride) {
if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {
return false; return false;
} }
if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {
return false; return false;
} }
if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") {
return false; return false;
} }
if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) {
return false; return false;
} }
} }
this.url.scheme = this.buffer; this.url.scheme = this.buffer;
this.buffer = ""; this.buffer = "";
if (this.stateOverride) { if (this.stateOverride) {
return false; return false;
} }
if (this.url.scheme === "file") { if (this.url.scheme === "file") {
if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {
this.parseError = true; this.parseError = true;
} }
this.state = "file"; this.state = "file";
} else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {
this.state = "special relative or authority"; this.state = "special relative or authority";
} else if (isSpecial(this.url)) { } else if (isSpecial(this.url)) {
this.state = "special authority slashes"; this.state = "special authority slashes";
} else if (this.input[this.pointer + 1] === 47) { } else if (this.input[this.pointer + 1] === 47) {
this.state = "path or authority"; this.state = "path or authority";
++this.pointer; ++this.pointer;
} else { } else {
this.url.cannotBeABaseURL = true; this.url.cannotBeABaseURL = true;
this.url.path.push(""); this.url.path.push("");
this.state = "cannot-be-a-base-URL path"; this.state = "cannot-be-a-base-URL path";
} }
} else if (!this.stateOverride) { } else if (!this.stateOverride) {
this.buffer = ""; this.buffer = "";
this.state = "no scheme"; this.state = "no scheme";
this.pointer = -1; this.pointer = -1;
} else { } else {
this.parseError = true; this.parseError = true;
return failure; return failure;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) {
if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) { if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) {
return failure; return failure;
} else if (this.base.cannotBeABaseURL && c === 35) { } else if (this.base.cannotBeABaseURL && c === 35) {
this.url.scheme = this.base.scheme; this.url.scheme = this.base.scheme;
this.url.path = this.base.path.slice(); this.url.path = this.base.path.slice();
this.url.query = this.base.query; this.url.query = this.base.query;
this.url.fragment = ""; this.url.fragment = "";
this.url.cannotBeABaseURL = true; this.url.cannotBeABaseURL = true;
this.state = "fragment"; this.state = "fragment";
} else if (this.base.scheme === "file") { } else if (this.base.scheme === "file") {
this.state = "file"; this.state = "file";
--this.pointer; --this.pointer;
} else { } else {
this.state = "relative"; this.state = "relative";
--this.pointer; --this.pointer;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) {
if (c === 47 && this.input[this.pointer + 1] === 47) { if (c === 47 && this.input[this.pointer + 1] === 47) {
this.state = "special authority ignore slashes"; this.state = "special authority ignore slashes";
++this.pointer; ++this.pointer;
} else { } else {
this.parseError = true; this.parseError = true;
this.state = "relative"; this.state = "relative";
--this.pointer; --this.pointer;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) {
if (c === 47) { if (c === 47) {
this.state = "authority"; this.state = "authority";
} else { } else {
this.state = "path"; this.state = "path";
--this.pointer; --this.pointer;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse relative"] = function parseRelative(c) { URLStateMachine.prototype["parse relative"] = function parseRelative(c) {
this.url.scheme = this.base.scheme; this.url.scheme = this.base.scheme;
if (isNaN(c)) { if (isNaN(c)) {
this.url.username = this.base.username; this.url.username = this.base.username;
this.url.password = this.base.password; this.url.password = this.base.password;
this.url.host = this.base.host; this.url.host = this.base.host;
this.url.port = this.base.port; this.url.port = this.base.port;
this.url.path = this.base.path.slice(); this.url.path = this.base.path.slice();
this.url.query = this.base.query; this.url.query = this.base.query;
} else if (c === 47) { } else if (c === 47) {
this.state = "relative slash"; this.state = "relative slash";
} else if (c === 63) { } else if (c === 63) {
this.url.username = this.base.username; this.url.username = this.base.username;
this.url.password = this.base.password; this.url.password = this.base.password;
this.url.host = this.base.host; this.url.host = this.base.host;
this.url.port = this.base.port; this.url.port = this.base.port;
this.url.path = this.base.path.slice(); this.url.path = this.base.path.slice();
this.url.query = ""; this.url.query = "";
this.state = "query"; this.state = "query";
} else if (c === 35) { } else if (c === 35) {
this.url.username = this.base.username; this.url.username = this.base.username;
this.url.password = this.base.password; this.url.password = this.base.password;
this.url.host = this.base.host; this.url.host = this.base.host;
this.url.port = this.base.port; this.url.port = this.base.port;
this.url.path = this.base.path.slice(); this.url.path = this.base.path.slice();
this.url.query = this.base.query; this.url.query = this.base.query;
this.url.fragment = ""; this.url.fragment = "";
this.state = "fragment"; this.state = "fragment";
} else if (isSpecial(this.url) && c === 92) { } else if (isSpecial(this.url) && c === 92) {
this.parseError = true; this.parseError = true;
this.state = "relative slash"; this.state = "relative slash";
} else { } else {
this.url.username = this.base.username; this.url.username = this.base.username;
this.url.password = this.base.password; this.url.password = this.base.password;
this.url.host = this.base.host; this.url.host = this.base.host;
this.url.port = this.base.port; this.url.port = this.base.port;
this.url.path = this.base.path.slice(0, this.base.path.length - 1); this.url.path = this.base.path.slice(0, this.base.path.length - 1);
this.state = "path"; this.state = "path";
--this.pointer; --this.pointer;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) {
if (isSpecial(this.url) && (c === 47 || c === 92)) { if (isSpecial(this.url) && (c === 47 || c === 92)) {
if (c === 92) { if (c === 92) {
this.parseError = true; this.parseError = true;
} }
this.state = "special authority ignore slashes"; this.state = "special authority ignore slashes";
} else if (c === 47) { } else if (c === 47) {
this.state = "authority"; this.state = "authority";
} else { } else {
this.url.username = this.base.username; this.url.username = this.base.username;
this.url.password = this.base.password; this.url.password = this.base.password;
this.url.host = this.base.host; this.url.host = this.base.host;
this.url.port = this.base.port; this.url.port = this.base.port;
this.state = "path"; this.state = "path";
--this.pointer; --this.pointer;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) {
if (c === 47 && this.input[this.pointer + 1] === 47) { if (c === 47 && this.input[this.pointer + 1] === 47) {
this.state = "special authority ignore slashes"; this.state = "special authority ignore slashes";
++this.pointer; ++this.pointer;
} else { } else {
this.parseError = true; this.parseError = true;
this.state = "special authority ignore slashes"; this.state = "special authority ignore slashes";
--this.pointer; --this.pointer;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) {
if (c !== 47 && c !== 92) { if (c !== 47 && c !== 92) {
this.state = "authority"; this.state = "authority";
--this.pointer; --this.pointer;
} else { } else {
this.parseError = true; this.parseError = true;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) {
if (c === 64) { if (c === 64) {
this.parseError = true; this.parseError = true;
if (this.atFlag) { if (this.atFlag) {
this.buffer = "%40" + this.buffer; this.buffer = "%40" + this.buffer;
} }
this.atFlag = true; this.atFlag = true;
// careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars
const len = countSymbols(this.buffer); const len = countSymbols(this.buffer);
for (let pointer = 0; pointer < len; ++pointer) { for (let pointer = 0; pointer < len; ++pointer) {
const codePoint = this.buffer.codePointAt(pointer); const codePoint = this.buffer.codePointAt(pointer);
if (codePoint === 58 && !this.passwordTokenSeenFlag) { if (codePoint === 58 && !this.passwordTokenSeenFlag) {
this.passwordTokenSeenFlag = true; this.passwordTokenSeenFlag = true;
continue; continue;
} }
const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);
if (this.passwordTokenSeenFlag) { if (this.passwordTokenSeenFlag) {
this.url.password += encodedCodePoints; this.url.password += encodedCodePoints;
} else { } else {
this.url.username += encodedCodePoints; this.url.username += encodedCodePoints;
} }
} }
this.buffer = ""; this.buffer = "";
} else if (isNaN(c) || c === 47 || c === 63 || c === 35 || } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||
(isSpecial(this.url) && c === 92)) { (isSpecial(this.url) && c === 92)) {
if (this.atFlag && this.buffer === "") { if (this.atFlag && this.buffer === "") {
this.parseError = true; this.parseError = true;
return failure; return failure;
} }
this.pointer -= countSymbols(this.buffer) + 1; this.pointer -= countSymbols(this.buffer) + 1;
this.buffer = ""; this.buffer = "";
this.state = "host"; this.state = "host";
} else { } else {
this.buffer += cStr; this.buffer += cStr;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse hostname"] =
URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) {
if (this.stateOverride && this.url.scheme === "file") { if (this.stateOverride && this.url.scheme === "file") {
--this.pointer; --this.pointer;
this.state = "file host"; this.state = "file host";
} else if (c === 58 && !this.arrFlag) { } else if (c === 58 && !this.arrFlag) {
if (this.buffer === "") { if (this.buffer === "") {
this.parseError = true; this.parseError = true;
return failure; return failure;
} }
const host = parseHost(this.buffer, isSpecial(this.url)); const host = parseHost(this.buffer, isSpecial(this.url));
if (host === failure) { if (host === failure) {
return failure; return failure;
} }
this.url.host = host; this.url.host = host;
this.buffer = ""; this.buffer = "";
this.state = "port"; this.state = "port";
if (this.stateOverride === "hostname") { if (this.stateOverride === "hostname") {
return false; return false;
} }
} else if (isNaN(c) || c === 47 || c === 63 || c === 35 || } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||
(isSpecial(this.url) && c === 92)) { (isSpecial(this.url) && c === 92)) {
--this.pointer; --this.pointer;
if (isSpecial(this.url) && this.buffer === "") { if (isSpecial(this.url) && this.buffer === "") {
this.parseError = true; this.parseError = true;
return failure; return failure;
} else if (this.stateOverride && this.buffer === "" && } else if (this.stateOverride && this.buffer === "" &&
(includesCredentials(this.url) || this.url.port !== null)) { (includesCredentials(this.url) || this.url.port !== null)) {
this.parseError = true; this.parseError = true;
return false; return false;
} }
const host = parseHost(this.buffer, isSpecial(this.url)); const host = parseHost(this.buffer, isSpecial(this.url));
if (host === failure) { if (host === failure) {
return failure; return failure;
} }
this.url.host = host; this.url.host = host;
this.buffer = ""; this.buffer = "";
this.state = "path start"; this.state = "path start";
if (this.stateOverride) { if (this.stateOverride) {
return false; return false;
} }
} else { } else {
if (c === 91) { if (c === 91) {
this.arrFlag = true; this.arrFlag = true;
} else if (c === 93) { } else if (c === 93) {
this.arrFlag = false; this.arrFlag = false;
} }
this.buffer += cStr; this.buffer += cStr;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) {
if (isASCIIDigit(c)) { if (isASCIIDigit(c)) {
this.buffer += cStr; this.buffer += cStr;
} else if (isNaN(c) || c === 47 || c === 63 || c === 35 || } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||
(isSpecial(this.url) && c === 92) || (isSpecial(this.url) && c === 92) ||
this.stateOverride) { this.stateOverride) {
if (this.buffer !== "") { if (this.buffer !== "") {
const port = parseInt(this.buffer); const port = parseInt(this.buffer);
if (port > Math.pow(2, 16) - 1) { if (port > Math.pow(2, 16) - 1) {
this.parseError = true; this.parseError = true;
return failure; return failure;
} }
this.url.port = port === defaultPort(this.url.scheme) ? null : port; this.url.port = port === defaultPort(this.url.scheme) ? null : port;
this.buffer = ""; this.buffer = "";
} }
if (this.stateOverride) { if (this.stateOverride) {
return false; return false;
} }
this.state = "path start"; this.state = "path start";
--this.pointer; --this.pointer;
} else { } else {
this.parseError = true; this.parseError = true;
return failure; return failure;
} }
return true; return true;
}; };
const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]);
URLStateMachine.prototype["parse file"] = function parseFile(c) { URLStateMachine.prototype["parse file"] = function parseFile(c) {
this.url.scheme = "file"; this.url.scheme = "file";
if (c === 47 || c === 92) { if (c === 47 || c === 92) {
if (c === 92) { if (c === 92) {
this.parseError = true; this.parseError = true;
} }
this.state = "file slash"; this.state = "file slash";
} else if (this.base !== null && this.base.scheme === "file") { } else if (this.base !== null && this.base.scheme === "file") {
if (isNaN(c)) { if (isNaN(c)) {
this.url.host = this.base.host; this.url.host = this.base.host;
this.url.path = this.base.path.slice(); this.url.path = this.base.path.slice();
this.url.query = this.base.query; this.url.query = this.base.query;
} else if (c === 63) { } else if (c === 63) {
this.url.host = this.base.host; this.url.host = this.base.host;
this.url.path = this.base.path.slice(); this.url.path = this.base.path.slice();
this.url.query = ""; this.url.query = "";
this.state = "query"; this.state = "query";
} else if (c === 35) { } else if (c === 35) {
this.url.host = this.base.host; this.url.host = this.base.host;
this.url.path = this.base.path.slice(); this.url.path = this.base.path.slice();
this.url.query = this.base.query; this.url.query = this.base.query;
this.url.fragment = ""; this.url.fragment = "";
this.state = "fragment"; this.state = "fragment";
} else { } else {
if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points
!isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) ||
(this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points
!fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) { !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) {
this.url.host = this.base.host; this.url.host = this.base.host;
this.url.path = this.base.path.slice(); this.url.path = this.base.path.slice();
shortenPath(this.url); shortenPath(this.url);
} else { } else {
this.parseError = true; this.parseError = true;
} }
this.state = "path"; this.state = "path";
--this.pointer; --this.pointer;
} }
} else { } else {
this.state = "path"; this.state = "path";
--this.pointer; --this.pointer;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) {
if (c === 47 || c === 92) { if (c === 47 || c === 92) {
if (c === 92) { if (c === 92) {
this.parseError = true; this.parseError = true;
} }
this.state = "file host"; this.state = "file host";
} else { } else {
if (this.base !== null && this.base.scheme === "file") { if (this.base !== null && this.base.scheme === "file") {
if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {
this.url.path.push(this.base.path[0]); this.url.path.push(this.base.path[0]);
} else { } else {
this.url.host = this.base.host; this.url.host = this.base.host;
} }
} }
this.state = "path"; this.state = "path";
--this.pointer; --this.pointer;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) {
if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) {
--this.pointer; --this.pointer;
if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {
this.parseError = true; this.parseError = true;
this.state = "path"; this.state = "path";
} else if (this.buffer === "") { } else if (this.buffer === "") {
this.url.host = ""; this.url.host = "";
if (this.stateOverride) { if (this.stateOverride) {
return false; return false;
} }
this.state = "path start"; this.state = "path start";
} else { } else {
let host = parseHost(this.buffer, isSpecial(this.url)); let host = parseHost(this.buffer, isSpecial(this.url));
if (host === failure) { if (host === failure) {
return failure; return failure;
} }
if (host === "localhost") { if (host === "localhost") {
host = ""; host = "";
} }
this.url.host = host; this.url.host = host;
if (this.stateOverride) { if (this.stateOverride) {
return false; return false;
} }
this.buffer = ""; this.buffer = "";
this.state = "path start"; this.state = "path start";
} }
} else { } else {
this.buffer += cStr; this.buffer += cStr;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { URLStateMachine.prototype["parse path start"] = function parsePathStart(c) {
if (isSpecial(this.url)) { if (isSpecial(this.url)) {
if (c === 92) { if (c === 92) {
this.parseError = true; this.parseError = true;
} }
this.state = "path"; this.state = "path";
if (c !== 47 && c !== 92) { if (c !== 47 && c !== 92) {
--this.pointer; --this.pointer;
} }
} else if (!this.stateOverride && c === 63) { } else if (!this.stateOverride && c === 63) {
this.url.query = ""; this.url.query = "";
this.state = "query"; this.state = "query";
} else if (!this.stateOverride && c === 35) { } else if (!this.stateOverride && c === 35) {
this.url.fragment = ""; this.url.fragment = "";
this.state = "fragment"; this.state = "fragment";
} else if (c !== undefined) { } else if (c !== undefined) {
this.state = "path"; this.state = "path";
if (c !== 47) { if (c !== 47) {
--this.pointer; --this.pointer;
} }
} }
return true; return true;
}; };
URLStateMachine.prototype["parse path"] = function parsePath(c) { URLStateMachine.prototype["parse path"] = function parsePath(c) {
if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) || if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) ||
(!this.stateOverride && (c === 63 || c === 35))) { (!this.stateOverride && (c === 63 || c === 35))) {
if (isSpecial(this.url) && c === 92) { if (isSpecial(this.url) && c === 92) {
this.parseError = true; this.parseError = true;
} }
if (isDoubleDot(this.buffer)) { if (isDoubleDot(this.buffer)) {
shortenPath(this.url); shortenPath(this.url);
if (c !== 47 && !(isSpecial(this.url) && c === 92)) { if (c !== 47 && !(isSpecial(this.url) && c === 92)) {
this.url.path.push(""); this.url.path.push("");
} }
} else if (isSingleDot(this.buffer) && c !== 47 && } else if (isSingleDot(this.buffer) && c !== 47 &&
!(isSpecial(this.url) && c === 92)) { !(isSpecial(this.url) && c === 92)) {
this.url.path.push(""); this.url.path.push("");
} else if (!isSingleDot(this.buffer)) { } else if (!isSingleDot(this.buffer)) {
if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {
if (this.url.host !== "" && this.url.host !== null) { if (this.url.host !== "" && this.url.host !== null) {
this.parseError = true; this.parseError = true;
this.url.host = ""; this.url.host = "";
} }
this.buffer = this.buffer[0] + ":"; this.buffer = this.buffer[0] + ":";
} }
this.url.path.push(this.buffer); this.url.path.push(this.buffer);
} }
this.buffer = ""; this.buffer = "";
if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) { if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) {
while (this.url.path.length > 1 && this.url.path[0] === "") { while (this.url.path.length > 1 && this.url.path[0] === "") {
this.parseError = true; this.parseError = true;
this.url.path.shift(); this.url.path.shift();
} }
} }
if (c === 63) { if (c === 63) {
this.url.query = ""; this.url.query = "";
this.state = "query"; this.state = "query";
} }
if (c === 35) { if (c === 35) {
this.url.fragment = ""; this.url.fragment = "";
this.state = "fragment"; this.state = "fragment";
} }
} else { } else {
// TODO: If c is not a URL code point and not "%", parse error. // TODO: If c is not a URL code point and not "%", parse error.
if (c === 37 && if (c === 37 &&
(!isASCIIHex(this.input[this.pointer + 1]) || (!isASCIIHex(this.input[this.pointer + 1]) ||
!isASCIIHex(this.input[this.pointer + 2]))) { !isASCIIHex(this.input[this.pointer + 2]))) {
this.parseError = true; this.parseError = true;
} }
this.buffer += percentEncodeChar(c, isPathPercentEncode); this.buffer += percentEncodeChar(c, isPathPercentEncode);
} }
return true; return true;
}; };
URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) { URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) {
if (c === 63) { if (c === 63) {
this.url.query = ""; this.url.query = "";
this.state = "query"; this.state = "query";
} else if (c === 35) { } else if (c === 35) {
this.url.fragment = ""; this.url.fragment = "";
this.state = "fragment"; this.state = "fragment";
} else { } else {
// TODO: Add: not a URL code point // TODO: Add: not a URL code point
if (!isNaN(c) && c !== 37) { if (!isNaN(c) && c !== 37) {
this.parseError = true; this.parseError = true;
} }
if (c === 37 && if (c === 37 &&
(!isASCIIHex(this.input[this.pointer + 1]) || (!isASCIIHex(this.input[this.pointer + 1]) ||
!isASCIIHex(this.input[this.pointer + 2]))) { !isASCIIHex(this.input[this.pointer + 2]))) {
this.parseError = true; this.parseError = true;
} }
if (!isNaN(c)) { if (!isNaN(c)) {
this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode);
} }
} }
return true; return true;
}; };
URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) {
if (isNaN(c) || (!this.stateOverride && c === 35)) { if (isNaN(c) || (!this.stateOverride && c === 35)) {
if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") {
this.encodingOverride = "utf-8"; this.encodingOverride = "utf-8";
} }
const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead
for (let i = 0; i < buffer.length; ++i) { for (let i = 0; i < buffer.length; ++i) {
if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 || if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 ||
buffer[i] === 0x3C || buffer[i] === 0x3E) { buffer[i] === 0x3C || buffer[i] === 0x3E) {
this.url.query += percentEncode(buffer[i]); this.url.query += percentEncode(buffer[i]);
} else { } else {
this.url.query += String.fromCodePoint(buffer[i]); this.url.query += String.fromCodePoint(buffer[i]);
} }
} }
this.buffer = ""; this.buffer = "";
if (c === 35) { if (c === 35) {
this.url.fragment = ""; this.url.fragment = "";
this.state = "fragment"; this.state = "fragment";
} }
} else { } else {
// TODO: If c is not a URL code point and not "%", parse error. // TODO: If c is not a URL code point and not "%", parse error.
if (c === 37 && if (c === 37 &&
(!isASCIIHex(this.input[this.pointer + 1]) || (!isASCIIHex(this.input[this.pointer + 1]) ||
!isASCIIHex(this.input[this.pointer + 2]))) { !isASCIIHex(this.input[this.pointer + 2]))) {
this.parseError = true; this.parseError = true;
} }
this.buffer += cStr; this.buffer += cStr;
} }
return true; return true;
}; };
URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { URLStateMachine.prototype["parse fragment"] = function parseFragment(c) {
if (isNaN(c)) { // do nothing if (isNaN(c)) { // do nothing
} else if (c === 0x0) { } else if (c === 0x0) {
this.parseError = true; this.parseError = true;
} else { } else {
// TODO: If c is not a URL code point and not "%", parse error. // TODO: If c is not a URL code point and not "%", parse error.
if (c === 37 && if (c === 37 &&
(!isASCIIHex(this.input[this.pointer + 1]) || (!isASCIIHex(this.input[this.pointer + 1]) ||
!isASCIIHex(this.input[this.pointer + 2]))) { !isASCIIHex(this.input[this.pointer + 2]))) {
this.parseError = true; this.parseError = true;
} }
this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode); this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode);
} }
return true; return true;
}; };
function serializeURL(url, excludeFragment) { function serializeURL(url, excludeFragment) {
let output = url.scheme + ":"; let output = url.scheme + ":";
if (url.host !== null) { if (url.host !== null) {
output += "//"; output += "//";
if (url.username !== "" || url.password !== "") { if (url.username !== "" || url.password !== "") {
output += url.username; output += url.username;
if (url.password !== "") { if (url.password !== "") {
output += ":" + url.password; output += ":" + url.password;
} }
output += "@"; output += "@";
} }
output += serializeHost(url.host); output += serializeHost(url.host);
if (url.port !== null) { if (url.port !== null) {
output += ":" + url.port; output += ":" + url.port;
} }
} else if (url.host === null && url.scheme === "file") { } else if (url.host === null && url.scheme === "file") {
output += "//"; output += "//";
} }
if (url.cannotBeABaseURL) { if (url.cannotBeABaseURL) {
output += url.path[0]; output += url.path[0];
} else { } else {
for (const string of url.path) { for (const string of url.path) {
output += "/" + string; output += "/" + string;
} }
} }
if (url.query !== null) { if (url.query !== null) {
output += "?" + url.query; output += "?" + url.query;
} }
if (!excludeFragment && url.fragment !== null) { if (!excludeFragment && url.fragment !== null) {
output += "#" + url.fragment; output += "#" + url.fragment;
} }
return output; return output;
} }
function serializeOrigin(tuple) { function serializeOrigin(tuple) {
let result = tuple.scheme + "://"; let result = tuple.scheme + "://";
result += serializeHost(tuple.host); result += serializeHost(tuple.host);
if (tuple.port !== null) { if (tuple.port !== null) {
result += ":" + tuple.port; result += ":" + tuple.port;
} }
return result; return result;
} }
module.exports.serializeURL = serializeURL; module.exports.serializeURL = serializeURL;
module.exports.serializeURLOrigin = function (url) { module.exports.serializeURLOrigin = function (url) {
// https://url.spec.whatwg.org/#concept-url-origin // https://url.spec.whatwg.org/#concept-url-origin
switch (url.scheme) { switch (url.scheme) {
case "blob": case "blob":
try { try {
return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0])); return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));
} catch (e) { } catch (e) {
// serializing an opaque origin returns "null" // serializing an opaque origin returns "null"
return "null"; return "null";
} }
case "ftp": case "ftp":
case "gopher": case "gopher":
case "http": case "http":
case "https": case "https":
case "ws": case "ws":
case "wss": case "wss":
return serializeOrigin({ return serializeOrigin({
scheme: url.scheme, scheme: url.scheme,
host: url.host, host: url.host,
port: url.port port: url.port
}); });
case "file": case "file":
// spec says "exercise to the reader", chrome says "file://" // spec says "exercise to the reader", chrome says "file://"
return "file://"; return "file://";
default: default:
// serializing an opaque origin returns "null" // serializing an opaque origin returns "null"
return "null"; return "null";
} }
}; };
module.exports.basicURLParse = function (input, options) { module.exports.basicURLParse = function (input, options) {
if (options === undefined) { if (options === undefined) {
options = {}; options = {};
} }
const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);
if (usm.failure) { if (usm.failure) {
return "failure"; return "failure";
} }
return usm.url; return usm.url;
}; };
module.exports.setTheUsername = function (url, username) { module.exports.setTheUsername = function (url, username) {
url.username = ""; url.username = "";
const decoded = punycode.ucs2.decode(username); const decoded = punycode.ucs2.decode(username);
for (let i = 0; i < decoded.length; ++i) { for (let i = 0; i < decoded.length; ++i) {
url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
} }
}; };
module.exports.setThePassword = function (url, password) { module.exports.setThePassword = function (url, password) {
url.password = ""; url.password = "";
const decoded = punycode.ucs2.decode(password); const decoded = punycode.ucs2.decode(password);
for (let i = 0; i < decoded.length; ++i) { for (let i = 0; i < decoded.length; ++i) {
url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
} }
}; };
module.exports.serializeHost = serializeHost; module.exports.serializeHost = serializeHost;
module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;
module.exports.serializeInteger = function (integer) { module.exports.serializeInteger = function (integer) {
return String(integer); return String(integer);
}; };
module.exports.parseURL = function (input, options) { module.exports.parseURL = function (input, options) {
if (options === undefined) { if (options === undefined) {
options = {}; options = {};
} }
// We don't handle blobs, so this just delegates: // We don't handle blobs, so this just delegates:
return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });
}; };
/***/ }), /***/ }),

View File

@ -317,7 +317,7 @@ After [deprecation](https://github.blog/changelog/2022-10-11-github-actions-depr
### Bash shell ### Bash shell
```yaml ```yaml
- name: Get npm cache directory - name: Get npm cache directory
id: npm-cache id: npm-cache-dir
shell: bash shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
``` ```
@ -325,7 +325,7 @@ After [deprecation](https://github.blog/changelog/2022-10-11-github-actions-depr
### PWSH shell ### PWSH shell
```yaml ```yaml
- name: Get npm cache directory - name: Get npm cache directory
id: npm-cache id: npm-cache-dir
shell: pwsh shell: pwsh
run: echo "dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT} run: echo "dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT}
``` ```

18
package-lock.json generated
View File

@ -1,15 +1,15 @@
{ {
"name": "cache", "name": "cache",
"version": "3.1.0-beta.2", "version": "3.1.0-beta.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cache", "name": "cache",
"version": "3.1.0-beta.2", "version": "3.1.0-beta.3",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "3.1.0-beta.2", "@actions/cache": "3.1.0-beta.3",
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2" "@actions/io": "^1.1.2"
@ -36,9 +36,9 @@
} }
}, },
"node_modules/@actions/cache": { "node_modules/@actions/cache": {
"version": "3.1.0-beta.2", "version": "3.1.0-beta.3",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.0-beta.2.tgz", "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.0-beta.3.tgz",
"integrity": "sha512-xt9NLWPCh5WU9Z5ITeGpT5Nza/57wMXeLsGuNVcRCIVpPuNTf3Puj82vjZZQw4rGqiCCs+n4+hnkTcE9BKw2sw==", "integrity": "sha512-71S1vd0WKLbC2lAe04pCYqTLBjSa8gURtiqnVBCYAt8QVBjOfwa2D3ESf2m8K2xjUxman/Yimdp7CPJDyFnxZg==",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",
@ -9722,9 +9722,9 @@
}, },
"dependencies": { "dependencies": {
"@actions/cache": { "@actions/cache": {
"version": "3.1.0-beta.2", "version": "3.1.0-beta.3",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.0-beta.2.tgz", "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.0-beta.3.tgz",
"integrity": "sha512-xt9NLWPCh5WU9Z5ITeGpT5Nza/57wMXeLsGuNVcRCIVpPuNTf3Puj82vjZZQw4rGqiCCs+n4+hnkTcE9BKw2sw==", "integrity": "sha512-71S1vd0WKLbC2lAe04pCYqTLBjSa8gURtiqnVBCYAt8QVBjOfwa2D3ESf2m8K2xjUxman/Yimdp7CPJDyFnxZg==",
"requires": { "requires": {
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "cache", "name": "cache",
"version": "3.1.0-beta.2", "version": "3.1.0-beta.3",
"private": true, "private": true,
"description": "Cache dependencies and build outputs", "description": "Cache dependencies and build outputs",
"main": "dist/restore/index.js", "main": "dist/restore/index.js",
@ -23,7 +23,7 @@
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "3.1.0-beta.2", "@actions/cache": "3.1.0-beta.3",
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2" "@actions/io": "^1.1.2"

View File

@ -14,7 +14,7 @@ A cache today is immutable and cannot be updated. But some use cases require the
restore-keys: | restore-keys: |
primes-${{ runner.os }} primes-${{ runner.os }}
``` ```
Please note that this will create a new cache on every run and hence will consume the cache [quota](#cache-limits). Please note that this will create a new cache on every run and hence will consume the cache [quota](./README.md#cache-limits).
## Use cache across feature branches ## Use cache across feature branches
Reusing cache across feature branches is not allowed today to provide cache [isolation](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache). However if both feature branches are from the default branch, a good way to achieve this is to ensure that the default branch has a cache. This cache will then be consumable by both feature branches. Reusing cache across feature branches is not allowed today to provide cache [isolation](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache). However if both feature branches are from the default branch, a good way to achieve this is to ensure that the default branch has a cache. This cache will then be consumable by both feature branches.