diff --git a/dist/index.mjs b/dist/index.mjs index a4a4b8d..34f9727 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -1,7 +1,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /******/ var __webpack_modules__ = ({ -/***/ 5604: +/***/ 3551: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issue = exports.issueCommand = void 0; const os = __importStar(__nccwpck_require__(2037)); -const utils_1 = __nccwpck_require__(1245); +const utils_1 = __nccwpck_require__(2139); /** * Commands * @@ -99,7 +99,7 @@ function escapeProperty(s) { /***/ }), -/***/ 5127: +/***/ 2606: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -133,12 +133,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(5604); -const file_command_1 = __nccwpck_require__(7352); -const utils_1 = __nccwpck_require__(1245); +const command_1 = __nccwpck_require__(3551); +const file_command_1 = __nccwpck_require__(3682); +const utils_1 = __nccwpck_require__(2139); const os = __importStar(__nccwpck_require__(2037)); const path = __importStar(__nccwpck_require__(1017)); -const oidc_utils_1 = __nccwpck_require__(4457); +const oidc_utils_1 = __nccwpck_require__(7539); /** * The code to exit an action */ @@ -423,17 +423,17 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(9124); +var summary_1 = __nccwpck_require__(2586); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(9124); +var summary_2 = __nccwpck_require__(2586); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports */ -var path_utils_1 = __nccwpck_require__(7169); +var path_utils_1 = __nccwpck_require__(5228); Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); @@ -441,7 +441,7 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct /***/ }), -/***/ 7352: +/***/ 3682: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -471,8 +471,8 @@ exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar(__nccwpck_require__(7147)); const os = __importStar(__nccwpck_require__(2037)); -const uuid_1 = __nccwpck_require__(9267); -const utils_1 = __nccwpck_require__(1245); +const uuid_1 = __nccwpck_require__(5941); +const utils_1 = __nccwpck_require__(2139); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { @@ -505,7 +505,7 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -/***/ 4457: +/***/ 7539: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -520,9 +520,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(6227); -const auth_1 = __nccwpck_require__(5181); -const core_1 = __nccwpck_require__(5127); +const http_client_1 = __nccwpck_require__(4215); +const auth_1 = __nccwpck_require__(885); +const core_1 = __nccwpck_require__(2606); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -588,7 +588,7 @@ exports.OidcClient = OidcClient; /***/ }), -/***/ 7169: +/***/ 5228: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -652,7 +652,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 9124: +/***/ 2586: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -941,7 +941,7 @@ exports.summary = _summary; /***/ }), -/***/ 1245: +/***/ 2139: /***/ ((__unused_webpack_module, exports) => { @@ -987,7 +987,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 2049: +/***/ 69: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -1022,7 +1022,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getExecOutput = exports.exec = void 0; const string_decoder_1 = __nccwpck_require__(1576); -const tr = __importStar(__nccwpck_require__(1469)); +const tr = __importStar(__nccwpck_require__(5029)); /** * Exec a command. * Output will be streamed to the live console. @@ -1096,7 +1096,7 @@ exports.getExecOutput = getExecOutput; /***/ }), -/***/ 1469: +/***/ 5029: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -1134,8 +1134,8 @@ const os = __importStar(__nccwpck_require__(2037)); const events = __importStar(__nccwpck_require__(2361)); const child = __importStar(__nccwpck_require__(2081)); const path = __importStar(__nccwpck_require__(1017)); -const io = __importStar(__nccwpck_require__(2864)); -const ioUtil = __importStar(__nccwpck_require__(1887)); +const io = __importStar(__nccwpck_require__(96)); +const ioUtil = __importStar(__nccwpck_require__(375)); const timers_1 = __nccwpck_require__(9512); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; @@ -1720,7 +1720,7 @@ class ExecState extends events.EventEmitter { /***/ }), -/***/ 5181: +/***/ 885: /***/ (function(__unused_webpack_module, exports) { @@ -1807,7 +1807,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 6227: +/***/ 4215: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -1844,8 +1844,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; const http = __importStar(__nccwpck_require__(3685)); const https = __importStar(__nccwpck_require__(5687)); -const pm = __importStar(__nccwpck_require__(603)); -const tunnel = __importStar(__nccwpck_require__(7265)); +const pm = __importStar(__nccwpck_require__(6695)); +const tunnel = __importStar(__nccwpck_require__(5306)); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -2418,7 +2418,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 603: +/***/ 6695: /***/ ((__unused_webpack_module, exports) => { @@ -2449,6 +2449,10 @@ function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; if (!noProxy) { return false; @@ -2474,18 +2478,29 @@ function checkBypass(reqUrl) { .split(',') .map(x => x.trim().toUpperCase()) .filter(x => x)) { - if (upperReqHosts.some(x => x === upperNoProxyItem)) { + if (upperNoProxyItem === '*' || + upperReqHosts.some(x => x === upperNoProxyItem || + x.endsWith(`.${upperNoProxyItem}`) || + (upperNoProxyItem.startsWith('.') && + x.endsWith(`${upperNoProxyItem}`)))) { return true; } } return false; } exports.checkBypass = checkBypass; +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return (hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]')); +} //# sourceMappingURL=proxy.js.map /***/ }), -/***/ 1887: +/***/ 375: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -2519,11 +2534,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; const fs = __importStar(__nccwpck_require__(7147)); const path = __importStar(__nccwpck_require__(1017)); -_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +_a = fs.promises +// export const {open} = 'fs' +, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +// export const {open} = 'fs' exports.IS_WINDOWS = process.platform === 'win32'; +// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 +exports.UV_FS_O_EXLOCK = 0x10000000; +exports.READONLY = fs.constants.O_RDONLY; function exists(fsPath) { return __awaiter(this, void 0, void 0, function* () { try { @@ -2668,7 +2689,7 @@ exports.getCmdPath = getCmdPath; /***/ }), -/***/ 2864: +/***/ 96: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -2703,12 +2724,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; const assert_1 = __nccwpck_require__(9491); -const childProcess = __importStar(__nccwpck_require__(2081)); const path = __importStar(__nccwpck_require__(1017)); -const util_1 = __nccwpck_require__(3837); -const ioUtil = __importStar(__nccwpck_require__(1887)); -const exec = util_1.promisify(childProcess.exec); -const execFile = util_1.promisify(childProcess.execFile); +const ioUtil = __importStar(__nccwpck_require__(375)); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js @@ -2789,61 +2806,23 @@ exports.mv = mv; function rmRF(inputPath) { return __awaiter(this, void 0, void 0, function* () { if (ioUtil.IS_WINDOWS) { - // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another - // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. // Check for invalid characters // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file if (/[*"<>|]/.test(inputPath)) { throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); } - try { - const cmdPath = ioUtil.getCmdPath(); - if (yield ioUtil.isDirectory(inputPath, true)) { - yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, { - env: { inputPath } - }); - } - else { - yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, { - env: { inputPath } - }); - } - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } - // Shelling out fails to remove a symlink folder with missing source, this unlink catches that - try { - yield ioUtil.unlink(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } } - else { - let isDir = false; - try { - isDir = yield ioUtil.isDirectory(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - return; - } - if (isDir) { - yield execFile(`rm`, [`-rf`, `${inputPath}`]); - } - else { - yield ioUtil.unlink(inputPath); - } + try { + // note if path does not exist, error is silent + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } + catch (err) { + throw new Error(`File was unable to be removed ${err}`); } }); } @@ -3015,7 +2994,7 @@ function copyFile(srcFile, destFile, force) { /***/ }), -/***/ 9024: +/***/ 2033: /***/ (function(module, exports, __nccwpck_require__) { @@ -3049,8 +3028,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0; -const semver = __importStar(__nccwpck_require__(1156)); -const core_1 = __nccwpck_require__(5127); +const semver = __importStar(__nccwpck_require__(537)); +const core_1 = __nccwpck_require__(2606); // needs to be require for core node modules to be mocked /* eslint @typescript-eslint/no-require-imports: 0 */ const os = __nccwpck_require__(2037); @@ -3149,7 +3128,7 @@ exports._readLinuxVersionFile = _readLinuxVersionFile; /***/ }), -/***/ 6429: +/***/ 2182: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -3183,7 +3162,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RetryHelper = void 0; -const core = __importStar(__nccwpck_require__(5127)); +const core = __importStar(__nccwpck_require__(2606)); /** * Internal class for retries */ @@ -3238,7 +3217,7 @@ exports.RetryHelper = RetryHelper; /***/ }), -/***/ 9348: +/***/ 1994: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -3275,20 +3254,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.evaluateVersions = exports.isExplicitVersion = exports.findFromManifest = exports.getManifestFromRepo = exports.findAllVersions = exports.find = exports.cacheFile = exports.cacheDir = exports.extractZip = exports.extractXar = exports.extractTar = exports.extract7z = exports.downloadTool = exports.HTTPError = void 0; -const core = __importStar(__nccwpck_require__(5127)); -const io = __importStar(__nccwpck_require__(2864)); +const core = __importStar(__nccwpck_require__(2606)); +const io = __importStar(__nccwpck_require__(96)); const fs = __importStar(__nccwpck_require__(7147)); -const mm = __importStar(__nccwpck_require__(9024)); +const mm = __importStar(__nccwpck_require__(2033)); const os = __importStar(__nccwpck_require__(2037)); const path = __importStar(__nccwpck_require__(1017)); -const httpm = __importStar(__nccwpck_require__(6227)); -const semver = __importStar(__nccwpck_require__(1156)); +const httpm = __importStar(__nccwpck_require__(4215)); +const semver = __importStar(__nccwpck_require__(537)); const stream = __importStar(__nccwpck_require__(2781)); const util = __importStar(__nccwpck_require__(3837)); const assert_1 = __nccwpck_require__(9491); -const v4_1 = __importDefault(__nccwpck_require__(9872)); -const exec_1 = __nccwpck_require__(2049); -const retry_helper_1 = __nccwpck_require__(6429); +const v4_1 = __importDefault(__nccwpck_require__(6651)); +const exec_1 = __nccwpck_require__(69); +const retry_helper_1 = __nccwpck_require__(2182); class HTTPError extends Error { constructor(httpStatusCode) { super(`Unexpected HTTP response: ${httpStatusCode}`); @@ -3909,7 +3888,7 @@ function _unique(values) { /***/ }), -/***/ 9205: +/***/ 5792: /***/ ((module) => { /** @@ -3942,7 +3921,7 @@ module.exports = bytesToUuid; /***/ }), -/***/ 5975: +/***/ 7553: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Unique ID creation requires a high quality random # generator. In node.js @@ -3957,11 +3936,11 @@ module.exports = function nodeRNG() { /***/ }), -/***/ 9872: +/***/ 6651: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var rng = __nccwpck_require__(5975); -var bytesToUuid = __nccwpck_require__(9205); +var rng = __nccwpck_require__(7553); +var bytesToUuid = __nccwpck_require__(5792); function v4(options, buf, offset) { var i = buf && offset || 0; @@ -3993,7 +3972,7 @@ module.exports = v4; /***/ }), -/***/ 1156: +/***/ 537: /***/ ((module, exports) => { exports = module.exports = SemVer @@ -4024,8 +4003,11 @@ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16 +var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + // The actual regexps go on exports.re var re = exports.re = [] +var safeRe = exports.safeRe = [] var src = exports.src = [] var t = exports.tokens = {} var R = 0 @@ -4034,6 +4016,31 @@ function tok (n) { t[n] = R++ } +var LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +var safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +function makeSafeRe (value) { + for (var i = 0; i < safeRegexReplacements.length; i++) { + var token = safeRegexReplacements[i][0] + var max = safeRegexReplacements[i][1] + value = value + .split(token + '*').join(token + '{0,' + max + '}') + .split(token + '+').join(token + '{1,' + max + '}') + } + return value +} + // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. @@ -4043,14 +4050,14 @@ function tok (n) { tok('NUMERICIDENTIFIER') src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' tok('NUMERICIDENTIFIERLOOSE') -src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' +src[t.NUMERICIDENTIFIERLOOSE] = '\\d+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. tok('NONNUMERICIDENTIFIER') -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' // ## Main Version // Three dot-separated numeric identifiers. @@ -4092,7 +4099,7 @@ src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + // Any combination of digits, letters, or hyphens. tok('BUILDIDENTIFIER') -src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' +src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata @@ -4172,6 +4179,7 @@ src[t.COERCE] = '(^|[^\\d])' + '(?:$|[^\\d])' tok('COERCERTL') re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') +safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g') // Tilde ranges. // Meaning is "reasonably at or greater than" @@ -4181,6 +4189,7 @@ src[t.LONETILDE] = '(?:~>?)' tok('TILDETRIM') src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') +safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g') var tildeTrimReplace = '$1~' tok('TILDE') @@ -4196,6 +4205,7 @@ src[t.LONECARET] = '(?:\\^)' tok('CARETTRIM') src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') +safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g') var caretTrimReplace = '$1^' tok('CARET') @@ -4217,6 +4227,7 @@ src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + // this one has to use the /g flag re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') +safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g') var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` @@ -4245,6 +4256,14 @@ for (var i = 0; i < R; i++) { debug(i, src[i]) if (!re[i]) { re[i] = new RegExp(src[i]) + + // Replace all greedy whitespace to prevent regex dos issues. These regex are + // used internally via the safeRe object since all inputs in this library get + // normalized first to trim and collapse all extra whitespace. The original + // regexes are exported for userland consumption and lower level usage. A + // future breaking change could export the safer regex only with a note that + // all input should have extra whitespace removed. + safeRe[i] = new RegExp(makeSafeRe(src[i])) } } @@ -4269,7 +4288,7 @@ function parse (version, options) { return null } - var r = options.loose ? re[t.LOOSE] : re[t.FULL] + var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL] if (!r.test(version)) { return null } @@ -4324,7 +4343,7 @@ function SemVer (version, options) { this.options = options this.loose = !!options.loose - var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]) if (!m) { throw new TypeError('Invalid Version: ' + version) @@ -4769,6 +4788,7 @@ function Comparator (comp, options) { return new Comparator(comp, options) } + comp = comp.trim().split(/\s+/).join(' ') debug('comparator', comp, options) this.options = options this.loose = !!options.loose @@ -4785,7 +4805,7 @@ function Comparator (comp, options) { var ANY = {} Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] var m = comp.match(r) if (!m) { @@ -4909,9 +4929,16 @@ function Range (range, options) { this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease - // First, split based on boolean or || + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { + .trim() + .split(/\s+/) + .join(' ') + + // First, split based on boolean or || + this.set = this.raw.split('||').map(function (range) { return this.parseRange(range.trim()) }, this).filter(function (c) { // throw out any that are not relevant for whatever reason @@ -4919,7 +4946,7 @@ function Range (range, options) { }) if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) + throw new TypeError('Invalid SemVer Range: ' + this.raw) } this.format() @@ -4938,20 +4965,19 @@ Range.prototype.toString = function () { Range.prototype.parseRange = function (range) { var loose = this.options.loose - range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[t.COMPARATORTRIM]) + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, safeRe[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') @@ -4959,7 +4985,7 @@ Range.prototype.parseRange = function (range) { // At this point, the range is completely trimmed and // ready to be split into comparators. - var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] var set = range.split(' ').map(function (comp) { return parseComparator(comp, this.options) }, this).join(' ').split(/\s+/) @@ -5059,7 +5085,7 @@ function replaceTildes (comp, options) { } function replaceTilde (comp, options) { - var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret @@ -5100,7 +5126,7 @@ function replaceCarets (comp, options) { function replaceCaret (comp, options) { debug('caret', comp, options) - var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret @@ -5159,7 +5185,7 @@ function replaceXRanges (comp, options) { function replaceXRange (comp, options) { comp = comp.trim() - var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) @@ -5234,7 +5260,7 @@ function replaceXRange (comp, options) { function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') + return comp.trim().replace(safeRe[t.STAR], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) @@ -5560,7 +5586,7 @@ function coerce (version, options) { var match = null if (!options.rtl) { - match = version.match(re[t.COERCE]) + match = version.match(safeRe[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. @@ -5571,17 +5597,17 @@ function coerce (version, options) { // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. var next - while ((next = re[t.COERCERTL].exec(version)) && + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 + safeRe[t.COERCERTL].lastIndex = -1 } if (match === null) { @@ -5596,15 +5622,15 @@ function coerce (version, options) { /***/ }), -/***/ 7265: +/***/ 5306: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __nccwpck_require__(2686); +module.exports = __nccwpck_require__(1998); /***/ }), -/***/ 2686: +/***/ 1998: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -5875,7 +5901,7 @@ exports.debug = debug; // for test /***/ }), -/***/ 9267: +/***/ 5941: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -5938,29 +5964,29 @@ Object.defineProperty(exports, "parse", ({ } })); -var _v = _interopRequireDefault(__nccwpck_require__(940)); +var _v = _interopRequireDefault(__nccwpck_require__(7174)); -var _v2 = _interopRequireDefault(__nccwpck_require__(7052)); +var _v2 = _interopRequireDefault(__nccwpck_require__(5714)); -var _v3 = _interopRequireDefault(__nccwpck_require__(1545)); +var _v3 = _interopRequireDefault(__nccwpck_require__(6142)); -var _v4 = _interopRequireDefault(__nccwpck_require__(483)); +var _v4 = _interopRequireDefault(__nccwpck_require__(3946)); -var _nil = _interopRequireDefault(__nccwpck_require__(4418)); +var _nil = _interopRequireDefault(__nccwpck_require__(9687)); -var _version = _interopRequireDefault(__nccwpck_require__(6433)); +var _version = _interopRequireDefault(__nccwpck_require__(4312)); -var _validate = _interopRequireDefault(__nccwpck_require__(659)); +var _validate = _interopRequireDefault(__nccwpck_require__(2644)); -var _stringify = _interopRequireDefault(__nccwpck_require__(4886)); +var _stringify = _interopRequireDefault(__nccwpck_require__(8551)); -var _parse = _interopRequireDefault(__nccwpck_require__(8517)); +var _parse = _interopRequireDefault(__nccwpck_require__(1728)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/***/ 4576: +/***/ 7802: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -5989,7 +6015,7 @@ exports["default"] = _default; /***/ }), -/***/ 4418: +/***/ 9687: /***/ ((__unused_webpack_module, exports) => { @@ -6003,7 +6029,7 @@ exports["default"] = _default; /***/ }), -/***/ 8517: +/***/ 1728: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6013,7 +6039,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(659)); +var _validate = _interopRequireDefault(__nccwpck_require__(2644)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6054,7 +6080,7 @@ exports["default"] = _default; /***/ }), -/***/ 3310: +/***/ 808: /***/ ((__unused_webpack_module, exports) => { @@ -6068,7 +6094,7 @@ exports["default"] = _default; /***/ }), -/***/ 1710: +/***/ 406: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6098,7 +6124,7 @@ function rng() { /***/ }), -/***/ 8315: +/***/ 2683: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6127,7 +6153,7 @@ exports["default"] = _default; /***/ }), -/***/ 4886: +/***/ 8551: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6137,7 +6163,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(659)); +var _validate = _interopRequireDefault(__nccwpck_require__(2644)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6172,7 +6198,7 @@ exports["default"] = _default; /***/ }), -/***/ 940: +/***/ 7174: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6182,9 +6208,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(1710)); +var _rng = _interopRequireDefault(__nccwpck_require__(406)); -var _stringify = _interopRequireDefault(__nccwpck_require__(4886)); +var _stringify = _interopRequireDefault(__nccwpck_require__(8551)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6285,7 +6311,7 @@ exports["default"] = _default; /***/ }), -/***/ 7052: +/***/ 5714: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6295,9 +6321,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(4837)); +var _v = _interopRequireDefault(__nccwpck_require__(1130)); -var _md = _interopRequireDefault(__nccwpck_require__(4576)); +var _md = _interopRequireDefault(__nccwpck_require__(7802)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6307,7 +6333,7 @@ exports["default"] = _default; /***/ }), -/***/ 4837: +/***/ 1130: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6318,9 +6344,9 @@ Object.defineProperty(exports, "__esModule", ({ exports["default"] = _default; exports.URL = exports.DNS = void 0; -var _stringify = _interopRequireDefault(__nccwpck_require__(4886)); +var _stringify = _interopRequireDefault(__nccwpck_require__(8551)); -var _parse = _interopRequireDefault(__nccwpck_require__(8517)); +var _parse = _interopRequireDefault(__nccwpck_require__(1728)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6391,7 +6417,7 @@ function _default(name, version, hashfunc) { /***/ }), -/***/ 1545: +/***/ 6142: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6401,9 +6427,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(1710)); +var _rng = _interopRequireDefault(__nccwpck_require__(406)); -var _stringify = _interopRequireDefault(__nccwpck_require__(4886)); +var _stringify = _interopRequireDefault(__nccwpck_require__(8551)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6434,7 +6460,7 @@ exports["default"] = _default; /***/ }), -/***/ 483: +/***/ 3946: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6444,9 +6470,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(4837)); +var _v = _interopRequireDefault(__nccwpck_require__(1130)); -var _sha = _interopRequireDefault(__nccwpck_require__(8315)); +var _sha = _interopRequireDefault(__nccwpck_require__(2683)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6456,7 +6482,7 @@ exports["default"] = _default; /***/ }), -/***/ 659: +/***/ 2644: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6466,7 +6492,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _regex = _interopRequireDefault(__nccwpck_require__(3310)); +var _regex = _interopRequireDefault(__nccwpck_require__(808)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6479,7 +6505,7 @@ exports["default"] = _default; /***/ }), -/***/ 6433: +/***/ 4312: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6489,7 +6515,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(659)); +var _validate = _interopRequireDefault(__nccwpck_require__(2644)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6625,7 +6651,7 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util"); /***/ }), -/***/ 5324: +/***/ 3247: /***/ ((__webpack_module__, __unused_webpack___webpack_exports__, __nccwpck_require__) => { var _actions_core__WEBPACK_IMPORTED_MODULE_0___namespace_cache; @@ -6635,10 +6661,10 @@ var fs__WEBPACK_IMPORTED_MODULE_4___namespace_cache; var os__WEBPACK_IMPORTED_MODULE_6___namespace_cache; var process__WEBPACK_IMPORTED_MODULE_7___namespace_cache; __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { -/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(5127); -/* harmony import */ var _actions_exec__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(2049); -/* harmony import */ var _actions_http_client__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(6227); -/* harmony import */ var _actions_tool_cache__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(9348); +/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(2606); +/* harmony import */ var _actions_exec__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(69); +/* harmony import */ var _actions_http_client__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(4215); +/* harmony import */ var _actions_tool_cache__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(1994); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(7147); /* harmony import */ var module__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(8188); /* harmony import */ var os__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(2037); @@ -6859,6 +6885,6 @@ __webpack_async_result__(); /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module used 'module' so it can't be inlined -/******/ var __webpack_exports__ = __nccwpck_require__(5324); +/******/ var __webpack_exports__ = __nccwpck_require__(3247); /******/ __webpack_exports__ = await __webpack_exports__; /******/ diff --git a/dist/main.cjs b/dist/main.cjs index 69a8fda..9270ce7 100644 --- a/dist/main.cjs +++ b/dist/main.cjs @@ -1,4 +1,4 @@ -// Generated by dart2js (NullSafetyMode.sound, csp, deferred-serialization, intern-composite-values), the Dart to JavaScript compiler version: 3.2.0-42.0.dev. +// Generated by dart2js (NullSafetyMode.sound, csp, deferred-serialization, intern-composite-values), the Dart to JavaScript compiler version: 3.2.0-92.0.dev. // The code supports the following hooks: // dartPrint(message): // if this function is defined it is called instead of the Dart [print] @@ -682,7 +682,10 @@ trace = exception.$cachedTrace; if (trace != null) return trace; - return exception.$cachedTrace = new A._StackTrace(exception); + trace = new A._StackTrace(exception); + if (typeof exception === "object") + exception.$cachedTrace = trace; + return trace; }, objectHashCode(object) { if (object == null) @@ -5419,7 +5422,7 @@ main$body(args) { var $async$goto = 0, $async$completer = A._makeAsyncAwaitCompleter(type$.dynamic), - $async$returnValue, $async$handler = 2, $async$currentError, sdk, flavor, raw, os, architecture, version, channel, url, toolName, sdkPath, archivePath, extractedFolder, pubCache, error, t1, t2, t3, versionFilePath, exception, $async$exception; + $async$returnValue, $async$handler = 2, $async$currentError, sdk, flavor, raw, os, architecture, version, channel, url, toolName, sdkPath, archivePath, extractedFolder, pubCache, error, t1, t2, t3, t4, versionFilePath, exception, $async$exception; var $async$main = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$currentError = $async$result; @@ -5430,24 +5433,25 @@ case 0: // Function start $async$handler = 4; - t1 = type$.JSObject; - sdk = A._asString(t1._as(globalThis.core).getInput("sdk")); + t1 = self; + t2 = type$.JSObject; + sdk = A._asString(t2._as(t1.core).getInput("sdk")); if (J.get$length$asx(sdk) === 0) sdk = "stable"; - flavor = A._asString(t1._as(globalThis.core).getInput("flavor")); + flavor = A._asString(t2._as(t1.core).getInput("flavor")); if (J.get$length$asx(flavor) === 0) flavor = J.$eq$(sdk, "main") ? "raw" : "release"; else if (!J.$eq$(flavor, "raw") && !J.$eq$(flavor, "release")) { - t1._as(globalThis.core).setFailed("Unrecognized build flavor '" + A.S(flavor) + "'."); + t2._as(t1.core).setFailed("Unrecognized build flavor '" + A.S(flavor) + "'."); // goto return $async$goto = 1; break; } raw = J.$eq$(flavor, "raw"); os = A.getPlatform(); - architecture = A._asString(t1._as(globalThis.core).getInput("architecture")); + architecture = A._asString(t2._as(t1.core).getInput("architecture")); if (J.get$length$asx(architecture) === 0) - architecture = B.JSArray_methods.contains$1(B.List_x64_ia32_arm_arm64, A._asString(t1._as(globalThis.os).arch())) ? A._asString(t1._as(globalThis.os).arch()) : "x64"; + architecture = B.JSArray_methods.contains$1(B.List_x64_ia32_arm_arm64, A._asString(t2._as(t1.os).arch())) ? A._asString(t2._as(t1.os).arch()) : "x64"; version = null; channel = null; $async$goto = J.$eq$(sdk, "stable") || J.$eq$(sdk, "beta") || J.$eq$(sdk, "dev") ? 7 : 9; @@ -5510,7 +5514,7 @@ else if (J.contains$1$asx(sdk, "beta")) channel = "beta"; else if (J.contains$1$asx(sdk, "main")) { - t1._as(globalThis.core).setFailed("Versions cannot be specified for main channel builds."); + t2._as(t1.core).setFailed("Versions cannot be specified for main channel builds."); // goto return $async$goto = 1; break; @@ -5520,61 +5524,61 @@ // join case 8: // join - t1._as(globalThis.core).info("Installing the " + A.S(os) + "-" + A.S(architecture) + " Dart SDK version " + A.S(version) + " from the " + A.S(channel) + " (" + A.S(flavor) + ") channel."); + t2._as(t1.core).info("Installing the " + A.S(os) + "-" + A.S(architecture) + " Dart SDK version " + A.S(version) + " from the " + A.S(channel) + " (" + A.S(flavor) + ") channel."); url = string$.https_ + A.S(channel) + "/" + A.S(flavor) + "/" + A.S(version) + "/sdk/dartsdk-" + A.S(os) + "-" + A.S(architecture) + "-release.zip"; toolName = A.boolConversionCheck(raw) ? "dart_raw" : "dart"; - sdkPath = !A.boolConversionCheck(raw) ? A._asString(t1._as(globalThis.toolCache).find(toolName, version, architecture)) : ""; + sdkPath = !A.boolConversionCheck(raw) ? A._asString(t2._as(t1.toolCache).find(toolName, version, architecture)) : ""; $async$goto = J.get$length$asx(sdkPath) !== 0 ? 21 : 23; break; case 21: // then - t1._as(globalThis.core).info("Using cached sdk from " + A.S(sdkPath) + "."); + t2._as(t1.core).info("Using cached sdk from " + A.S(sdkPath) + "."); // goto join $async$goto = 22; break; case 23: // else - t1._as(globalThis.core).info(A.S(url) + " ..."); - t2 = type$.String; + t2._as(t1.core).info(A.S(url) + " ..."); + t3 = type$.String; $async$goto = 24; - return A._asyncAwait(A.promiseToFuture(t1._as(t1._as(globalThis.toolCache).downloadTool(url)), t2), $async$main); + return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.toolCache).downloadTool(url)), t3), $async$main); case 24: // returning from await. archivePath = $async$result; $async$goto = 25; - return A._asyncAwait(A.promiseToFuture(t1._as(t1._as(globalThis.toolCache).extractZip(archivePath)), t2), $async$main); + return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.toolCache).extractZip(archivePath)), t3), $async$main); case 25: // returning from await. extractedFolder = $async$result; extractedFolder = A.join(extractedFolder, "dart-sdk"); $async$goto = 26; - return A._asyncAwait(A.promiseToFuture(t1._as(t1._as(globalThis.toolCache).cacheDir(extractedFolder, toolName, version, architecture)), t2), $async$main); + return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.toolCache).cacheDir(extractedFolder, toolName, version, architecture)), t3), $async$main); case 26: // returning from await. sdkPath = $async$result; case 22: // join - t2 = t1._as(globalThis.process); - t3 = J.$eq$(os, "windows") ? "USERPROFILE" : "HOME"; - t3 = A._asStringQ(t1._as(t2.env)[t3]); - t3.toString; - pubCache = A.join(t3, ".pub-cache"); - t1._as(globalThis.core).exportVariable("DART_HOME", sdkPath); - t1._as(globalThis.core).addPath(A.join(sdkPath, "bin")); - t1._as(globalThis.core).exportVariable("PUB_CACHE", pubCache); - t1._as(globalThis.core).addPath(A.join(pubCache, "bin")); + t3 = t2._as(t1.process); + t4 = J.$eq$(os, "windows") ? "USERPROFILE" : "HOME"; + t4 = A._asStringQ(t2._as(t3.env)[t4]); + t4.toString; + pubCache = A.join(t4, ".pub-cache"); + t2._as(t1.core).exportVariable("DART_HOME", sdkPath); + t2._as(t1.core).addPath(A.join(sdkPath, "bin")); + t2._as(t1.core).exportVariable("PUB_CACHE", pubCache); + t2._as(t1.core).addPath(A.join(pubCache, "bin")); $async$goto = 27; return A._asyncAwait(A.createPubOIDCToken(), $async$main); case 27: // returning from await. if (A.boolConversionCheck(raw)) { - t2 = t1._as(globalThis.core); + t3 = t2._as(t1.core); versionFilePath = A.join(sdkPath, "version"); - t2.setOutput("dart-version", B.JSString_methods.trim$0(A._asString(t1._as(globalThis.fs).readFileSync(versionFilePath, "utf8")))); + t3.setOutput("dart-version", B.JSString_methods.trim$0(A._asString(t2._as(t1.fs).readFileSync(versionFilePath, "utf8")))); } else - t1._as(globalThis.core).setOutput("dart-version", version); + t2._as(t1.core).setOutput("dart-version", version); $async$goto = 28; - return A._asyncAwait(A.promiseToFuture(t1._as(t1._as(globalThis.exec).exec("dart", A._setArrayType(["--version"], type$.JSArray_String))), type$.dynamic), $async$main); + return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.exec).exec("dart", A._setArrayType(["--version"], type$.JSArray_String))), type$.dynamic), $async$main); case 28: // returning from await. $async$handler = 2; @@ -5586,7 +5590,7 @@ $async$handler = 3; $async$exception = $async$currentError; error = A.unwrapException($async$exception); - t1 = globalThis; + t1 = self; type$.JSObject._as(t1.core).setFailed(A.S(error)); // goto after finally $async$goto = 6; @@ -5610,7 +5614,7 @@ }, getPlatform() { var t1, - _0_0 = A._asString(type$.JSObject._as(globalThis.os).platform()); + _0_0 = A._asString(type$.JSObject._as(self.os).platform()); $label0$0: { if ("win32" === _0_0) { t1 = "windows"; @@ -5628,7 +5632,7 @@ createPubOIDCToken() { var $async$goto = 0, $async$completer = A._makeAsyncAwaitCompleter(type$.void), - $async$returnValue, token, t1, tokenRequestUrl, tokenRequestToken; + $async$returnValue, token, t1, t2, tokenRequestUrl, tokenRequestToken; var $async$createPubOIDCToken = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { if ($async$errorCode === 1) return A._asyncRethrow($async$result, $async$completer); @@ -5636,22 +5640,23 @@ switch ($async$goto) { case 0: // Function start - t1 = type$.JSObject; - tokenRequestUrl = A._asStringQ(t1._as(t1._as(globalThis.process).env).ACTIONS_ID_TOKEN_REQUEST_URL); - tokenRequestToken = A._asStringQ(t1._as(t1._as(globalThis.process).env).ACTIONS_ID_TOKEN_REQUEST_TOKEN); + t1 = self; + t2 = type$.JSObject; + tokenRequestUrl = A._asStringQ(t2._as(t2._as(t1.process).env).ACTIONS_ID_TOKEN_REQUEST_URL); + tokenRequestToken = A._asStringQ(t2._as(t2._as(t1.process).env).ACTIONS_ID_TOKEN_REQUEST_TOKEN); if (tokenRequestUrl == null || tokenRequestToken == null) { // goto return $async$goto = 1; break; } $async$goto = 3; - return A._asyncAwait(A.promiseToFuture(t1._as(t1._as(globalThis.core).getIDToken("https://pub.dev")), type$.String), $async$createPubOIDCToken); + return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.core).getIDToken("https://pub.dev")), type$.String), $async$createPubOIDCToken); case 3: // returning from await. token = $async$result; - t1._as(globalThis.core).exportVariable("PUB_TOKEN", token); + t2._as(t1.core).exportVariable("PUB_TOKEN", token); $async$goto = 4; - return A._asyncAwait(A.promiseToFuture(t1._as(t1._as(globalThis.exec).exec("dart", A._setArrayType(["pub", "token", "add", "https://pub.dev", "--env-var", "PUB_TOKEN"], type$.JSArray_String))), type$.dynamic), $async$createPubOIDCToken); + return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.exec).exec("dart", A._setArrayType(["pub", "token", "add", "https://pub.dev", "--env-var", "PUB_TOKEN"], type$.JSArray_String))), type$.dynamic), $async$createPubOIDCToken); case 4: // returning from await. case 1: @@ -5676,7 +5681,7 @@ $async$temp1 = type$.FutureOr_String; $async$temp2 = t1; $async$goto = 3; - return A._asyncAwait(A.promiseToFuture(t1._as(t1._as(new globalThis.HttpClient("setup-dart", A._setArrayType([], type$.JSArray_Object), type$.nullable_JSObject._as(A.jsify(A.LinkedHashMap_LinkedHashMap$_literal(["allowRedirects", true, "maxRedirects", 3, "allowRetries", true, "maxRetries", 3], type$.String, type$.Object))))).getJson(string$.https_ + channel + "/" + flavor + "/latest/VERSION")), t1), $async$latestPublishedVersion); + return A._asyncAwait(A.promiseToFuture(t1._as(t1._as(new self.HttpClient("setup-dart", A._setArrayType([], type$.JSArray_Object), type$.nullable_JSObject._as(A.jsify(A.LinkedHashMap_LinkedHashMap$_literal(["allowRedirects", true, "maxRedirects", 3, "allowRetries", true, "maxRetries", 3], type$.String, type$.Object))))).getJson(string$.https_ + channel + "/" + flavor + "/latest/VERSION")), t1), $async$latestPublishedVersion); case 3: // returning from await. $async$returnValue = $async$temp1._as($async$temp2._as($async$result.result).version); @@ -5827,6 +5832,10 @@ if (typeof receiver != "object") { if (typeof receiver == "function") return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; return receiver; } if (receiver instanceof A.Object) @@ -5843,6 +5852,10 @@ if (typeof receiver != "object") { if (typeof receiver == "function") return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; return receiver; } if (receiver instanceof A.Object) @@ -5857,6 +5870,10 @@ if (typeof receiver != "object") { if (typeof receiver == "function") return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; return receiver; } if (receiver instanceof A.Object) @@ -5925,6 +5942,10 @@ }, JavaScriptFunction: function JavaScriptFunction() { }, + JavaScriptBigInt: function JavaScriptBigInt() { + }, + JavaScriptSymbol: function JavaScriptSymbol() { + }, JSArray: function JSArray(t0) { this.$ti = t0; }, @@ -6012,6 +6033,22 @@ }, $isFunction: 1 }; + J.JavaScriptBigInt.prototype = { + get$hashCode(receiver) { + return 0; + }, + toString$0(receiver) { + return String(receiver); + } + }; + J.JavaScriptSymbol.prototype = { + get$hashCode(receiver) { + return 0; + }, + toString$0(receiver) { + return String(receiver); + } + }; J.JSArray.prototype = { add$1(receiver, value) { A._arrayInstanceType(receiver)._precomputed1._as(value); @@ -9024,7 +9061,7 @@ _inheritMany = hunkHelpers.inheritMany; _inherit(A.Object, null); _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, J.ArrayIterator, A.Error, A.ListBase, A.Iterable, A.ListIterator, A.MappedIterator, A.WhereIterator, A.WhereTypeIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A.Closure, A.MapBase, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.JSSyntaxRegExp, A._MatchImplementation, A._AllMatchesIterator, A.StringMatch, A._StringAllMatchesIterator, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._AsyncAwaitCompleter, A.AsyncError, A._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A._StreamIterator, A._Zone, A._HashMapKeyIterator, A.Codec, A.Converter, A._Utf8Decoder, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.Null, A._StringStackTrace, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.NullRejectionException, A.Context, A.Style, A.ParsedPath]); - _inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JavaScriptObject, J.JSNumber, J.JSString]); + _inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JavaScriptObject, J.JavaScriptBigInt, J.JavaScriptSymbol, J.JSNumber, J.JSString]); _inheritMany(J.JavaScriptObject, [J.LegacyJavaScriptObject, J.JSArray, A.NativeByteBuffer, A.NativeTypedData]); _inheritMany(J.LegacyJavaScriptObject, [J.PlainJavaScriptObject, J.UnknownJavaScriptObject, J.JavaScriptFunction]); _inherit(J.JSUnmodifiableArray, J.JSArray); diff --git a/dist/sig.txt b/dist/sig.txt index fe3e7be..ce282a6 100644 --- a/dist/sig.txt +++ b/dist/sig.txt @@ -1 +1 @@ -F500C84960FB4A579CD093BAC4BD0E9E +F5AD5D9AC7CB46475A2BB056581E63C4 diff --git a/lib/node/process.dart b/lib/node/process.dart index fc41f9f..e78c3d7 100644 --- a/lib/node/process.dart +++ b/lib/node/process.dart @@ -14,7 +14,7 @@ external Process get process; extension type Process (JSObject obj) { @JS('env') // Map - external JSObject _env; + external JSObject get _env; /// Read the environment variable [variable]. String? env(String variable) => getProperty(_env, variable);