mirror of
https://github.com/actions/checkout.git
synced 2026-06-14 16:28:39 +07:00
38918 lines
1.3 MiB
38918 lines
1.3 MiB
module.exports =
|
||
/******/ (function(modules, runtime) { // webpackBootstrap
|
||
/******/ "use strict";
|
||
/******/ // The module cache
|
||
/******/ var installedModules = {};
|
||
/******/
|
||
/******/ // The require function
|
||
/******/ function __webpack_require__(moduleId) {
|
||
/******/
|
||
/******/ // Check if module is in cache
|
||
/******/ if(installedModules[moduleId]) {
|
||
/******/ return installedModules[moduleId].exports;
|
||
/******/ }
|
||
/******/ // Create a new module (and put it into the cache)
|
||
/******/ var module = installedModules[moduleId] = {
|
||
/******/ i: moduleId,
|
||
/******/ l: false,
|
||
/******/ exports: {}
|
||
/******/ };
|
||
/******/
|
||
/******/ // Execute the module function
|
||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
/******/
|
||
/******/ // Flag the module as loaded
|
||
/******/ module.l = true;
|
||
/******/
|
||
/******/ // Return the exports of the module
|
||
/******/ return module.exports;
|
||
/******/ }
|
||
/******/
|
||
/******/
|
||
/******/ __webpack_require__.ab = __dirname + "/";
|
||
/******/
|
||
/******/ // the startup function
|
||
/******/ function startup() {
|
||
/******/ // Load entry module and return exports
|
||
/******/ return __webpack_require__(198);
|
||
/******/ };
|
||
/******/
|
||
/******/ // run startup
|
||
/******/ return startup();
|
||
/******/ })
|
||
/************************************************************************/
|
||
/******/ ({
|
||
|
||
/***/ 0:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
const { requestLog } = __webpack_require__(916);
|
||
const {
|
||
restEndpointMethods
|
||
} = __webpack_require__(842);
|
||
|
||
const Core = __webpack_require__(529);
|
||
|
||
const CORE_PLUGINS = [
|
||
__webpack_require__(190),
|
||
__webpack_require__(19), // deprecated: remove in v17
|
||
requestLog,
|
||
__webpack_require__(148),
|
||
restEndpointMethods,
|
||
__webpack_require__(430),
|
||
|
||
__webpack_require__(850) // deprecated: remove in v17
|
||
];
|
||
|
||
const OctokitRest = Core.plugin(CORE_PLUGINS);
|
||
|
||
function DeprecatedOctokit(options) {
|
||
const warn =
|
||
options && options.log && options.log.warn
|
||
? options.log.warn
|
||
: console.warn;
|
||
warn(
|
||
'[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead'
|
||
);
|
||
return new OctokitRest(options);
|
||
}
|
||
|
||
const Octokit = Object.assign(DeprecatedOctokit, {
|
||
Octokit: OctokitRest
|
||
});
|
||
|
||
Object.keys(OctokitRest).forEach(key => {
|
||
/* istanbul ignore else */
|
||
if (OctokitRest.hasOwnProperty(key)) {
|
||
Octokit[key] = OctokitRest[key];
|
||
}
|
||
});
|
||
|
||
module.exports = Octokit;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 1:
|
||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||
}) : (function(o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
o[k2] = m[k];
|
||
}));
|
||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||
}) : function(o, v) {
|
||
o["default"] = v;
|
||
});
|
||
var __importStar = (this && this.__importStar) || function (mod) {
|
||
if (mod && mod.__esModule) return mod;
|
||
var result = {};
|
||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||
__setModuleDefault(result, mod);
|
||
return result;
|
||
};
|
||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
return new (P || (P = Promise))(function (resolve, reject) {
|
||
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 step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
});
|
||
};
|
||
Object.defineProperty(exports, "__esModule", { value: true });
|
||
exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
|
||
const assert_1 = __webpack_require__(357);
|
||
const childProcess = __importStar(__webpack_require__(129));
|
||
const path = __importStar(__webpack_require__(622));
|
||
const util_1 = __webpack_require__(669);
|
||
const ioUtil = __importStar(__webpack_require__(672));
|
||
const exec = util_1.promisify(childProcess.exec);
|
||
const execFile = util_1.promisify(childProcess.execFile);
|
||
/**
|
||
* Copies a file or folder.
|
||
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
|
||
*
|
||
* @param source source path
|
||
* @param dest destination path
|
||
* @param options optional. See CopyOptions.
|
||
*/
|
||
function cp(source, dest, options = {}) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const { force, recursive, copySourceDirectory } = readCopyOptions(options);
|
||
const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
|
||
// Dest is an existing file, but not forcing
|
||
if (destStat && destStat.isFile() && !force) {
|
||
return;
|
||
}
|
||
// If dest is an existing directory, should copy inside.
|
||
const newDest = destStat && destStat.isDirectory() && copySourceDirectory
|
||
? path.join(dest, path.basename(source))
|
||
: dest;
|
||
if (!(yield ioUtil.exists(source))) {
|
||
throw new Error(`no such file or directory: ${source}`);
|
||
}
|
||
const sourceStat = yield ioUtil.stat(source);
|
||
if (sourceStat.isDirectory()) {
|
||
if (!recursive) {
|
||
throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
|
||
}
|
||
else {
|
||
yield cpDirRecursive(source, newDest, 0, force);
|
||
}
|
||
}
|
||
else {
|
||
if (path.relative(source, newDest) === '') {
|
||
// a file cannot be copied to itself
|
||
throw new Error(`'${newDest}' and '${source}' are the same file`);
|
||
}
|
||
yield copyFile(source, newDest, force);
|
||
}
|
||
});
|
||
}
|
||
exports.cp = cp;
|
||
/**
|
||
* Moves a path.
|
||
*
|
||
* @param source source path
|
||
* @param dest destination path
|
||
* @param options optional. See MoveOptions.
|
||
*/
|
||
function mv(source, dest, options = {}) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (yield ioUtil.exists(dest)) {
|
||
let destExists = true;
|
||
if (yield ioUtil.isDirectory(dest)) {
|
||
// If dest is directory copy src into dest
|
||
dest = path.join(dest, path.basename(source));
|
||
destExists = yield ioUtil.exists(dest);
|
||
}
|
||
if (destExists) {
|
||
if (options.force == null || options.force) {
|
||
yield rmRF(dest);
|
||
}
|
||
else {
|
||
throw new Error('Destination already exists');
|
||
}
|
||
}
|
||
}
|
||
yield mkdirP(path.dirname(dest));
|
||
yield ioUtil.rename(source, dest);
|
||
});
|
||
}
|
||
exports.mv = mv;
|
||
/**
|
||
* Remove a path recursively with force
|
||
*
|
||
* @param inputPath path to remove
|
||
*/
|
||
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 (await ioUtil.isDirectory(inputPath, true)) {
|
||
// await execFile(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
|
||
// env: {inputPath}
|
||
// })
|
||
// } else {
|
||
yield execFile(`${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 = await 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 {
|
||
// await ioUtil.unlink(inputPath)
|
||
// }
|
||
}
|
||
});
|
||
}
|
||
exports.rmRF = rmRF;
|
||
/**
|
||
* Make a directory. Creates the full path with folders in between
|
||
* Will throw if it fails
|
||
*
|
||
* @param fsPath path to create
|
||
* @returns Promise<void>
|
||
*/
|
||
function mkdirP(fsPath) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
assert_1.ok(fsPath, 'a path argument must be provided');
|
||
yield ioUtil.mkdir(fsPath, { recursive: true });
|
||
});
|
||
}
|
||
exports.mkdirP = mkdirP;
|
||
/**
|
||
* Returns path of a tool had the tool actually been invoked. Resolves via paths.
|
||
* If you check and the tool does not exist, it will throw.
|
||
*
|
||
* @param tool name of the tool
|
||
* @param check whether to check if tool exists
|
||
* @returns Promise<string> path to tool
|
||
*/
|
||
function which(tool, check) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (!tool) {
|
||
throw new Error("parameter 'tool' is required");
|
||
}
|
||
// recursive when check=true
|
||
if (check) {
|
||
const result = yield which(tool, false);
|
||
if (!result) {
|
||
if (ioUtil.IS_WINDOWS) {
|
||
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
|
||
}
|
||
else {
|
||
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
|
||
}
|
||
}
|
||
return result;
|
||
}
|
||
const matches = yield findInPath(tool);
|
||
if (matches && matches.length > 0) {
|
||
return matches[0];
|
||
}
|
||
return '';
|
||
});
|
||
}
|
||
exports.which = which;
|
||
/**
|
||
* Returns a list of all occurrences of the given tool on the system path.
|
||
*
|
||
* @returns Promise<string[]> the paths of the tool
|
||
*/
|
||
function findInPath(tool) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (!tool) {
|
||
throw new Error("parameter 'tool' is required");
|
||
}
|
||
// build the list of extensions to try
|
||
const extensions = [];
|
||
if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
|
||
for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
|
||
if (extension) {
|
||
extensions.push(extension);
|
||
}
|
||
}
|
||
}
|
||
// if it's rooted, return it if exists. otherwise return empty.
|
||
if (ioUtil.isRooted(tool)) {
|
||
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
|
||
if (filePath) {
|
||
return [filePath];
|
||
}
|
||
return [];
|
||
}
|
||
// if any path separators, return empty
|
||
if (tool.includes(path.sep)) {
|
||
return [];
|
||
}
|
||
// build the list of directories
|
||
//
|
||
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
|
||
// it feels like we should not do this. Checking the current directory seems like more of a use
|
||
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
|
||
// across platforms.
|
||
const directories = [];
|
||
if (process.env.PATH) {
|
||
for (const p of process.env.PATH.split(path.delimiter)) {
|
||
if (p) {
|
||
directories.push(p);
|
||
}
|
||
}
|
||
}
|
||
// find all matches
|
||
const matches = [];
|
||
for (const directory of directories) {
|
||
const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
|
||
if (filePath) {
|
||
matches.push(filePath);
|
||
}
|
||
}
|
||
return matches;
|
||
});
|
||
}
|
||
exports.findInPath = findInPath;
|
||
function readCopyOptions(options) {
|
||
const force = options.force == null ? true : options.force;
|
||
const recursive = Boolean(options.recursive);
|
||
const copySourceDirectory = options.copySourceDirectory == null
|
||
? true
|
||
: Boolean(options.copySourceDirectory);
|
||
return { force, recursive, copySourceDirectory };
|
||
}
|
||
function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
// Ensure there is not a run away recursive copy
|
||
if (currentDepth >= 255)
|
||
return;
|
||
currentDepth++;
|
||
yield mkdirP(destDir);
|
||
const files = yield ioUtil.readdir(sourceDir);
|
||
for (const fileName of files) {
|
||
const srcFile = `${sourceDir}/${fileName}`;
|
||
const destFile = `${destDir}/${fileName}`;
|
||
const srcFileStat = yield ioUtil.lstat(srcFile);
|
||
if (srcFileStat.isDirectory()) {
|
||
// Recurse
|
||
yield cpDirRecursive(srcFile, destFile, currentDepth, force);
|
||
}
|
||
else {
|
||
yield copyFile(srcFile, destFile, force);
|
||
}
|
||
}
|
||
// Change the mode for the newly created directory
|
||
yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
|
||
});
|
||
}
|
||
// Buffered file copy
|
||
function copyFile(srcFile, destFile, force) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
|
||
// unlink/re-link it
|
||
try {
|
||
yield ioUtil.lstat(destFile);
|
||
yield ioUtil.unlink(destFile);
|
||
}
|
||
catch (e) {
|
||
// Try to override file permission
|
||
if (e.code === 'EPERM') {
|
||
yield ioUtil.chmod(destFile, '0666');
|
||
yield ioUtil.unlink(destFile);
|
||
}
|
||
// other errors = it doesn't exist, no work to do
|
||
}
|
||
// Copy over symlink
|
||
const symlinkFull = yield ioUtil.readlink(srcFile);
|
||
yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
|
||
}
|
||
else if (!(yield ioUtil.exists(destFile)) || force) {
|
||
yield ioUtil.copyFile(srcFile, destFile);
|
||
}
|
||
});
|
||
}
|
||
//# sourceMappingURL=io.js.map
|
||
|
||
/***/ }),
|
||
|
||
/***/ 2:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
const os = __webpack_require__(87);
|
||
const macosRelease = __webpack_require__(118);
|
||
const winRelease = __webpack_require__(49);
|
||
|
||
const osName = (platform, release) => {
|
||
if (!platform && release) {
|
||
throw new Error('You can\'t specify a `release` without specifying `platform`');
|
||
}
|
||
|
||
platform = platform || os.platform();
|
||
|
||
let id;
|
||
|
||
if (platform === 'darwin') {
|
||
if (!release && os.platform() === 'darwin') {
|
||
release = os.release();
|
||
}
|
||
|
||
const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
|
||
id = release ? macosRelease(release).name : '';
|
||
return prefix + (id ? ' ' + id : '');
|
||
}
|
||
|
||
if (platform === 'linux') {
|
||
if (!release && os.platform() === 'linux') {
|
||
release = os.release();
|
||
}
|
||
|
||
id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
|
||
return 'Linux' + (id ? ' ' + id : '');
|
||
}
|
||
|
||
if (platform === 'win32') {
|
||
if (!release && os.platform() === 'win32') {
|
||
release = os.release();
|
||
}
|
||
|
||
id = release ? winRelease(release) : '';
|
||
return 'Windows' + (id ? ' ' + id : '');
|
||
}
|
||
|
||
return platform;
|
||
};
|
||
|
||
module.exports = osName;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 3:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
var once = __webpack_require__(969);
|
||
|
||
var noop = function() {};
|
||
|
||
var isRequest = function(stream) {
|
||
return stream.setHeader && typeof stream.abort === 'function';
|
||
};
|
||
|
||
var isChildProcess = function(stream) {
|
||
return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
|
||
};
|
||
|
||
var eos = function(stream, opts, callback) {
|
||
if (typeof opts === 'function') return eos(stream, null, opts);
|
||
if (!opts) opts = {};
|
||
|
||
callback = once(callback || noop);
|
||
|
||
var ws = stream._writableState;
|
||
var rs = stream._readableState;
|
||
var readable = opts.readable || (opts.readable !== false && stream.readable);
|
||
var writable = opts.writable || (opts.writable !== false && stream.writable);
|
||
var cancelled = false;
|
||
|
||
var onlegacyfinish = function() {
|
||
if (!stream.writable) onfinish();
|
||
};
|
||
|
||
var onfinish = function() {
|
||
writable = false;
|
||
if (!readable) callback.call(stream);
|
||
};
|
||
|
||
var onend = function() {
|
||
readable = false;
|
||
if (!writable) callback.call(stream);
|
||
};
|
||
|
||
var onexit = function(exitCode) {
|
||
callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
|
||
};
|
||
|
||
var onerror = function(err) {
|
||
callback.call(stream, err);
|
||
};
|
||
|
||
var onclose = function() {
|
||
process.nextTick(onclosenexttick);
|
||
};
|
||
|
||
var onclosenexttick = function() {
|
||
if (cancelled) return;
|
||
if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
|
||
if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
|
||
};
|
||
|
||
var onrequest = function() {
|
||
stream.req.on('finish', onfinish);
|
||
};
|
||
|
||
if (isRequest(stream)) {
|
||
stream.on('complete', onfinish);
|
||
stream.on('abort', onclose);
|
||
if (stream.req) onrequest();
|
||
else stream.on('request', onrequest);
|
||
} else if (writable && !ws) { // legacy streams
|
||
stream.on('end', onlegacyfinish);
|
||
stream.on('close', onlegacyfinish);
|
||
}
|
||
|
||
if (isChildProcess(stream)) stream.on('exit', onexit);
|
||
|
||
stream.on('end', onend);
|
||
stream.on('finish', onfinish);
|
||
if (opts.error !== false) stream.on('error', onerror);
|
||
stream.on('close', onclose);
|
||
|
||
return function() {
|
||
cancelled = true;
|
||
stream.removeListener('complete', onfinish);
|
||
stream.removeListener('abort', onclose);
|
||
stream.removeListener('request', onrequest);
|
||
if (stream.req) stream.req.removeListener('finish', onfinish);
|
||
stream.removeListener('end', onlegacyfinish);
|
||
stream.removeListener('close', onlegacyfinish);
|
||
stream.removeListener('finish', onfinish);
|
||
stream.removeListener('exit', onexit);
|
||
stream.removeListener('end', onend);
|
||
stream.removeListener('error', onerror);
|
||
stream.removeListener('close', onclose);
|
||
};
|
||
};
|
||
|
||
module.exports = eos;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 4:
|
||
/***/ (function(__unusedmodule, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.default = void 0;
|
||
var _default = '00000000-0000-0000-0000-000000000000';
|
||
exports.default = _default;
|
||
|
||
/***/ }),
|
||
|
||
/***/ 9:
|
||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
return new (P || (P = Promise))(function (resolve, reject) {
|
||
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 step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
});
|
||
};
|
||
Object.defineProperty(exports, "__esModule", { value: true });
|
||
const os = __webpack_require__(87);
|
||
const events = __webpack_require__(614);
|
||
const child = __webpack_require__(129);
|
||
/* eslint-disable @typescript-eslint/unbound-method */
|
||
const IS_WINDOWS = process.platform === 'win32';
|
||
/*
|
||
* Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
|
||
*/
|
||
class ToolRunner extends events.EventEmitter {
|
||
constructor(toolPath, args, options) {
|
||
super();
|
||
if (!toolPath) {
|
||
throw new Error("Parameter 'toolPath' cannot be null or empty.");
|
||
}
|
||
this.toolPath = toolPath;
|
||
this.args = args || [];
|
||
this.options = options || {};
|
||
}
|
||
_debug(message) {
|
||
if (this.options.listeners && this.options.listeners.debug) {
|
||
this.options.listeners.debug(message);
|
||
}
|
||
}
|
||
_getCommandString(options, noPrefix) {
|
||
const toolPath = this._getSpawnFileName();
|
||
const args = this._getSpawnArgs(options);
|
||
let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
|
||
if (IS_WINDOWS) {
|
||
// Windows + cmd file
|
||
if (this._isCmdFile()) {
|
||
cmd += toolPath;
|
||
for (const a of args) {
|
||
cmd += ` ${a}`;
|
||
}
|
||
}
|
||
// Windows + verbatim
|
||
else if (options.windowsVerbatimArguments) {
|
||
cmd += `"${toolPath}"`;
|
||
for (const a of args) {
|
||
cmd += ` ${a}`;
|
||
}
|
||
}
|
||
// Windows (regular)
|
||
else {
|
||
cmd += this._windowsQuoteCmdArg(toolPath);
|
||
for (const a of args) {
|
||
cmd += ` ${this._windowsQuoteCmdArg(a)}`;
|
||
}
|
||
}
|
||
}
|
||
else {
|
||
// OSX/Linux - this can likely be improved with some form of quoting.
|
||
// creating processes on Unix is fundamentally different than Windows.
|
||
// on Unix, execvp() takes an arg array.
|
||
cmd += toolPath;
|
||
for (const a of args) {
|
||
cmd += ` ${a}`;
|
||
}
|
||
}
|
||
return cmd;
|
||
}
|
||
_processLineBuffer(data, strBuffer, onLine) {
|
||
try {
|
||
let s = strBuffer + data.toString();
|
||
let n = s.indexOf(os.EOL);
|
||
while (n > -1) {
|
||
const line = s.substring(0, n);
|
||
onLine(line);
|
||
// the rest of the string ...
|
||
s = s.substring(n + os.EOL.length);
|
||
n = s.indexOf(os.EOL);
|
||
}
|
||
strBuffer = s;
|
||
}
|
||
catch (err) {
|
||
// streaming lines to console is best effort. Don't fail a build.
|
||
this._debug(`error processing line. Failed with error ${err}`);
|
||
}
|
||
}
|
||
_getSpawnFileName() {
|
||
if (IS_WINDOWS) {
|
||
if (this._isCmdFile()) {
|
||
return process.env['COMSPEC'] || 'cmd.exe';
|
||
}
|
||
}
|
||
return this.toolPath;
|
||
}
|
||
_getSpawnArgs(options) {
|
||
if (IS_WINDOWS) {
|
||
if (this._isCmdFile()) {
|
||
let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
|
||
for (const a of this.args) {
|
||
argline += ' ';
|
||
argline += options.windowsVerbatimArguments
|
||
? a
|
||
: this._windowsQuoteCmdArg(a);
|
||
}
|
||
argline += '"';
|
||
return [argline];
|
||
}
|
||
}
|
||
return this.args;
|
||
}
|
||
_endsWith(str, end) {
|
||
return str.endsWith(end);
|
||
}
|
||
_isCmdFile() {
|
||
const upperToolPath = this.toolPath.toUpperCase();
|
||
return (this._endsWith(upperToolPath, '.CMD') ||
|
||
this._endsWith(upperToolPath, '.BAT'));
|
||
}
|
||
_windowsQuoteCmdArg(arg) {
|
||
// for .exe, apply the normal quoting rules that libuv applies
|
||
if (!this._isCmdFile()) {
|
||
return this._uvQuoteCmdArg(arg);
|
||
}
|
||
// otherwise apply quoting rules specific to the cmd.exe command line parser.
|
||
// the libuv rules are generic and are not designed specifically for cmd.exe
|
||
// command line parser.
|
||
//
|
||
// for a detailed description of the cmd.exe command line parser, refer to
|
||
// http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
|
||
// need quotes for empty arg
|
||
if (!arg) {
|
||
return '""';
|
||
}
|
||
// determine whether the arg needs to be quoted
|
||
const cmdSpecialChars = [
|
||
' ',
|
||
'\t',
|
||
'&',
|
||
'(',
|
||
')',
|
||
'[',
|
||
']',
|
||
'{',
|
||
'}',
|
||
'^',
|
||
'=',
|
||
';',
|
||
'!',
|
||
"'",
|
||
'+',
|
||
',',
|
||
'`',
|
||
'~',
|
||
'|',
|
||
'<',
|
||
'>',
|
||
'"'
|
||
];
|
||
let needsQuotes = false;
|
||
for (const char of arg) {
|
||
if (cmdSpecialChars.some(x => x === char)) {
|
||
needsQuotes = true;
|
||
break;
|
||
}
|
||
}
|
||
// short-circuit if quotes not needed
|
||
if (!needsQuotes) {
|
||
return arg;
|
||
}
|
||
// the following quoting rules are very similar to the rules that by libuv applies.
|
||
//
|
||
// 1) wrap the string in quotes
|
||
//
|
||
// 2) double-up quotes - i.e. " => ""
|
||
//
|
||
// this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
|
||
// doesn't work well with a cmd.exe command line.
|
||
//
|
||
// note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
|
||
// for example, the command line:
|
||
// foo.exe "myarg:""my val"""
|
||
// is parsed by a .NET console app into an arg array:
|
||
// [ "myarg:\"my val\"" ]
|
||
// which is the same end result when applying libuv quoting rules. although the actual
|
||
// command line from libuv quoting rules would look like:
|
||
// foo.exe "myarg:\"my val\""
|
||
//
|
||
// 3) double-up slashes that precede a quote,
|
||
// e.g. hello \world => "hello \world"
|
||
// hello\"world => "hello\\""world"
|
||
// hello\\"world => "hello\\\\""world"
|
||
// hello world\ => "hello world\\"
|
||
//
|
||
// technically this is not required for a cmd.exe command line, or the batch argument parser.
|
||
// the reasons for including this as a .cmd quoting rule are:
|
||
//
|
||
// a) this is optimized for the scenario where the argument is passed from the .cmd file to an
|
||
// external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
|
||
//
|
||
// b) it's what we've been doing previously (by deferring to node default behavior) and we
|
||
// haven't heard any complaints about that aspect.
|
||
//
|
||
// note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
|
||
// escaped when used on the command line directly - even though within a .cmd file % can be escaped
|
||
// by using %%.
|
||
//
|
||
// the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
|
||
// the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
|
||
//
|
||
// one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
|
||
// often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
|
||
// variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
|
||
// to an external program.
|
||
//
|
||
// an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
|
||
// % can be escaped within a .cmd file.
|
||
let reverse = '"';
|
||
let quoteHit = true;
|
||
for (let i = arg.length; i > 0; i--) {
|
||
// walk the string in reverse
|
||
reverse += arg[i - 1];
|
||
if (quoteHit && arg[i - 1] === '\\') {
|
||
reverse += '\\'; // double the slash
|
||
}
|
||
else if (arg[i - 1] === '"') {
|
||
quoteHit = true;
|
||
reverse += '"'; // double the quote
|
||
}
|
||
else {
|
||
quoteHit = false;
|
||
}
|
||
}
|
||
reverse += '"';
|
||
return reverse
|
||
.split('')
|
||
.reverse()
|
||
.join('');
|
||
}
|
||
_uvQuoteCmdArg(arg) {
|
||
// Tool runner wraps child_process.spawn() and needs to apply the same quoting as
|
||
// Node in certain cases where the undocumented spawn option windowsVerbatimArguments
|
||
// is used.
|
||
//
|
||
// Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
|
||
// see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
|
||
// pasting copyright notice from Node within this function:
|
||
//
|
||
// Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
||
//
|
||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
// of this software and associated documentation files (the "Software"), to
|
||
// deal in the Software without restriction, including without limitation the
|
||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||
// sell copies of the Software, and to permit persons to whom the Software is
|
||
// furnished to do so, subject to the following conditions:
|
||
//
|
||
// The above copyright notice and this permission notice shall be included in
|
||
// all copies or substantial portions of the Software.
|
||
//
|
||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||
// IN THE SOFTWARE.
|
||
if (!arg) {
|
||
// Need double quotation for empty argument
|
||
return '""';
|
||
}
|
||
if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
|
||
// No quotation needed
|
||
return arg;
|
||
}
|
||
if (!arg.includes('"') && !arg.includes('\\')) {
|
||
// No embedded double quotes or backslashes, so I can just wrap
|
||
// quote marks around the whole thing.
|
||
return `"${arg}"`;
|
||
}
|
||
// Expected input/output:
|
||
// input : hello"world
|
||
// output: "hello\"world"
|
||
// input : hello""world
|
||
// output: "hello\"\"world"
|
||
// input : hello\world
|
||
// output: hello\world
|
||
// input : hello\\world
|
||
// output: hello\\world
|
||
// input : hello\"world
|
||
// output: "hello\\\"world"
|
||
// input : hello\\"world
|
||
// output: "hello\\\\\"world"
|
||
// input : hello world\
|
||
// output: "hello world\\" - note the comment in libuv actually reads "hello world\"
|
||
// but it appears the comment is wrong, it should be "hello world\\"
|
||
let reverse = '"';
|
||
let quoteHit = true;
|
||
for (let i = arg.length; i > 0; i--) {
|
||
// walk the string in reverse
|
||
reverse += arg[i - 1];
|
||
if (quoteHit && arg[i - 1] === '\\') {
|
||
reverse += '\\';
|
||
}
|
||
else if (arg[i - 1] === '"') {
|
||
quoteHit = true;
|
||
reverse += '\\';
|
||
}
|
||
else {
|
||
quoteHit = false;
|
||
}
|
||
}
|
||
reverse += '"';
|
||
return reverse
|
||
.split('')
|
||
.reverse()
|
||
.join('');
|
||
}
|
||
_cloneExecOptions(options) {
|
||
options = options || {};
|
||
const result = {
|
||
cwd: options.cwd || process.cwd(),
|
||
env: options.env || process.env,
|
||
silent: options.silent || false,
|
||
windowsVerbatimArguments: options.windowsVerbatimArguments || false,
|
||
failOnStdErr: options.failOnStdErr || false,
|
||
ignoreReturnCode: options.ignoreReturnCode || false,
|
||
delay: options.delay || 10000
|
||
};
|
||
result.outStream = options.outStream || process.stdout;
|
||
result.errStream = options.errStream || process.stderr;
|
||
return result;
|
||
}
|
||
_getSpawnOptions(options, toolPath) {
|
||
options = options || {};
|
||
const result = {};
|
||
result.cwd = options.cwd;
|
||
result.env = options.env;
|
||
result['windowsVerbatimArguments'] =
|
||
options.windowsVerbatimArguments || this._isCmdFile();
|
||
if (options.windowsVerbatimArguments) {
|
||
result.argv0 = `"${toolPath}"`;
|
||
}
|
||
return result;
|
||
}
|
||
/**
|
||
* Exec a tool.
|
||
* Output will be streamed to the live console.
|
||
* Returns promise with return code
|
||
*
|
||
* @param tool path to tool to exec
|
||
* @param options optional exec options. See ExecOptions
|
||
* @returns number
|
||
*/
|
||
exec() {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
return new Promise((resolve, reject) => {
|
||
this._debug(`exec tool: ${this.toolPath}`);
|
||
this._debug('arguments:');
|
||
for (const arg of this.args) {
|
||
this._debug(` ${arg}`);
|
||
}
|
||
const optionsNonNull = this._cloneExecOptions(this.options);
|
||
if (!optionsNonNull.silent && optionsNonNull.outStream) {
|
||
optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
|
||
}
|
||
const state = new ExecState(optionsNonNull, this.toolPath);
|
||
state.on('debug', (message) => {
|
||
this._debug(message);
|
||
});
|
||
const fileName = this._getSpawnFileName();
|
||
const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
|
||
const stdbuffer = '';
|
||
if (cp.stdout) {
|
||
cp.stdout.on('data', (data) => {
|
||
if (this.options.listeners && this.options.listeners.stdout) {
|
||
this.options.listeners.stdout(data);
|
||
}
|
||
if (!optionsNonNull.silent && optionsNonNull.outStream) {
|
||
optionsNonNull.outStream.write(data);
|
||
}
|
||
this._processLineBuffer(data, stdbuffer, (line) => {
|
||
if (this.options.listeners && this.options.listeners.stdline) {
|
||
this.options.listeners.stdline(line);
|
||
}
|
||
});
|
||
});
|
||
}
|
||
const errbuffer = '';
|
||
if (cp.stderr) {
|
||
cp.stderr.on('data', (data) => {
|
||
state.processStderr = true;
|
||
if (this.options.listeners && this.options.listeners.stderr) {
|
||
this.options.listeners.stderr(data);
|
||
}
|
||
if (!optionsNonNull.silent &&
|
||
optionsNonNull.errStream &&
|
||
optionsNonNull.outStream) {
|
||
const s = optionsNonNull.failOnStdErr
|
||
? optionsNonNull.errStream
|
||
: optionsNonNull.outStream;
|
||
s.write(data);
|
||
}
|
||
this._processLineBuffer(data, errbuffer, (line) => {
|
||
if (this.options.listeners && this.options.listeners.errline) {
|
||
this.options.listeners.errline(line);
|
||
}
|
||
});
|
||
});
|
||
}
|
||
cp.on('error', (err) => {
|
||
state.processError = err.message;
|
||
state.processExited = true;
|
||
state.processClosed = true;
|
||
state.CheckComplete();
|
||
});
|
||
cp.on('exit', (code) => {
|
||
state.processExitCode = code;
|
||
state.processExited = true;
|
||
this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
|
||
state.CheckComplete();
|
||
});
|
||
cp.on('close', (code) => {
|
||
state.processExitCode = code;
|
||
state.processExited = true;
|
||
state.processClosed = true;
|
||
this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
|
||
state.CheckComplete();
|
||
});
|
||
state.on('done', (error, exitCode) => {
|
||
if (stdbuffer.length > 0) {
|
||
this.emit('stdline', stdbuffer);
|
||
}
|
||
if (errbuffer.length > 0) {
|
||
this.emit('errline', errbuffer);
|
||
}
|
||
cp.removeAllListeners();
|
||
if (error) {
|
||
reject(error);
|
||
}
|
||
else {
|
||
resolve(exitCode);
|
||
}
|
||
});
|
||
});
|
||
});
|
||
}
|
||
}
|
||
exports.ToolRunner = ToolRunner;
|
||
/**
|
||
* Convert an arg string to an array of args. Handles escaping
|
||
*
|
||
* @param argString string of arguments
|
||
* @returns string[] array of arguments
|
||
*/
|
||
function argStringToArray(argString) {
|
||
const args = [];
|
||
let inQuotes = false;
|
||
let escaped = false;
|
||
let arg = '';
|
||
function append(c) {
|
||
// we only escape double quotes.
|
||
if (escaped && c !== '"') {
|
||
arg += '\\';
|
||
}
|
||
arg += c;
|
||
escaped = false;
|
||
}
|
||
for (let i = 0; i < argString.length; i++) {
|
||
const c = argString.charAt(i);
|
||
if (c === '"') {
|
||
if (!escaped) {
|
||
inQuotes = !inQuotes;
|
||
}
|
||
else {
|
||
append(c);
|
||
}
|
||
continue;
|
||
}
|
||
if (c === '\\' && escaped) {
|
||
append(c);
|
||
continue;
|
||
}
|
||
if (c === '\\' && inQuotes) {
|
||
escaped = true;
|
||
continue;
|
||
}
|
||
if (c === ' ' && !inQuotes) {
|
||
if (arg.length > 0) {
|
||
args.push(arg);
|
||
arg = '';
|
||
}
|
||
continue;
|
||
}
|
||
append(c);
|
||
}
|
||
if (arg.length > 0) {
|
||
args.push(arg.trim());
|
||
}
|
||
return args;
|
||
}
|
||
exports.argStringToArray = argStringToArray;
|
||
class ExecState extends events.EventEmitter {
|
||
constructor(options, toolPath) {
|
||
super();
|
||
this.processClosed = false; // tracks whether the process has exited and stdio is closed
|
||
this.processError = '';
|
||
this.processExitCode = 0;
|
||
this.processExited = false; // tracks whether the process has exited
|
||
this.processStderr = false; // tracks whether stderr was written to
|
||
this.delay = 10000; // 10 seconds
|
||
this.done = false;
|
||
this.timeout = null;
|
||
if (!toolPath) {
|
||
throw new Error('toolPath must not be empty');
|
||
}
|
||
this.options = options;
|
||
this.toolPath = toolPath;
|
||
if (options.delay) {
|
||
this.delay = options.delay;
|
||
}
|
||
}
|
||
CheckComplete() {
|
||
if (this.done) {
|
||
return;
|
||
}
|
||
if (this.processClosed) {
|
||
this._setResult();
|
||
}
|
||
else if (this.processExited) {
|
||
this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
|
||
}
|
||
}
|
||
_debug(message) {
|
||
this.emit('debug', message);
|
||
}
|
||
_setResult() {
|
||
// determine whether there is an error
|
||
let error;
|
||
if (this.processExited) {
|
||
if (this.processError) {
|
||
error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
|
||
}
|
||
else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
|
||
error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
|
||
}
|
||
else if (this.processStderr && this.options.failOnStdErr) {
|
||
error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
|
||
}
|
||
}
|
||
// clear the timeout
|
||
if (this.timeout) {
|
||
clearTimeout(this.timeout);
|
||
this.timeout = null;
|
||
}
|
||
this.done = true;
|
||
this.emit('done', error, this.processExitCode);
|
||
}
|
||
static HandleTimeout(state) {
|
||
if (state.done) {
|
||
return;
|
||
}
|
||
if (!state.processClosed && state.processExited) {
|
||
const message = `The STDIO streams did not close within ${state.delay /
|
||
1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
|
||
state._debug(message);
|
||
}
|
||
state._setResult();
|
||
}
|
||
}
|
||
//# sourceMappingURL=toolrunner.js.map
|
||
|
||
/***/ }),
|
||
|
||
/***/ 11:
|
||
/***/ (function(module) {
|
||
|
||
// Returns a wrapper function that returns a wrapped callback
|
||
// The wrapper function should do some stuff, and return a
|
||
// presumably different callback function.
|
||
// This makes sure that own properties are retained, so that
|
||
// decorations and such are not lost along the way.
|
||
module.exports = wrappy
|
||
function wrappy (fn, cb) {
|
||
if (fn && cb) return wrappy(fn)(cb)
|
||
|
||
if (typeof fn !== 'function')
|
||
throw new TypeError('need wrapper function')
|
||
|
||
Object.keys(fn).forEach(function (k) {
|
||
wrapper[k] = fn[k]
|
||
})
|
||
|
||
return wrapper
|
||
|
||
function wrapper() {
|
||
var args = new Array(arguments.length)
|
||
for (var i = 0; i < args.length; i++) {
|
||
args[i] = arguments[i]
|
||
}
|
||
var ret = fn.apply(this, args)
|
||
var cb = args[args.length-1]
|
||
if (typeof ret === 'function' && ret !== cb) {
|
||
Object.keys(cb).forEach(function (k) {
|
||
ret[k] = cb[k]
|
||
})
|
||
}
|
||
return ret
|
||
}
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 13:
|
||
/***/ (function(module) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var replace = String.prototype.replace;
|
||
var percentTwenties = /%20/g;
|
||
|
||
var Format = {
|
||
RFC1738: 'RFC1738',
|
||
RFC3986: 'RFC3986'
|
||
};
|
||
|
||
module.exports = {
|
||
'default': Format.RFC3986,
|
||
formatters: {
|
||
RFC1738: function (value) {
|
||
return replace.call(value, percentTwenties, '+');
|
||
},
|
||
RFC3986: function (value) {
|
||
return String(value);
|
||
}
|
||
},
|
||
RFC1738: Format.RFC1738,
|
||
RFC3986: Format.RFC3986
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 16:
|
||
/***/ (function(module) {
|
||
|
||
module.exports = require("tls");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 18:
|
||
/***/ (function() {
|
||
|
||
eval("require")("encoding");
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 19:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
module.exports = authenticationPlugin;
|
||
|
||
const { Deprecation } = __webpack_require__(692);
|
||
const once = __webpack_require__(969);
|
||
|
||
const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
|
||
|
||
const authenticate = __webpack_require__(674);
|
||
const beforeRequest = __webpack_require__(471);
|
||
const requestError = __webpack_require__(349);
|
||
|
||
function authenticationPlugin(octokit, options) {
|
||
if (options.auth) {
|
||
octokit.authenticate = () => {
|
||
deprecateAuthenticate(
|
||
octokit.log,
|
||
new Deprecation(
|
||
'[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
|
||
)
|
||
);
|
||
};
|
||
return;
|
||
}
|
||
const state = {
|
||
octokit,
|
||
auth: false
|
||
};
|
||
octokit.authenticate = authenticate.bind(null, state);
|
||
octokit.hook.before("request", beforeRequest.bind(null, state));
|
||
octokit.hook.error("request", requestError.bind(null, state));
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 20:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
const cp = __webpack_require__(129);
|
||
const parse = __webpack_require__(568);
|
||
const enoent = __webpack_require__(881);
|
||
|
||
function spawn(command, args, options) {
|
||
// Parse the arguments
|
||
const parsed = parse(command, args, options);
|
||
|
||
// Spawn the child process
|
||
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
||
|
||
// Hook into child process "exit" event to emit an error if the command
|
||
// does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
|
||
enoent.hookChildProcess(spawned, parsed);
|
||
|
||
return spawned;
|
||
}
|
||
|
||
function spawnSync(command, args, options) {
|
||
// Parse the arguments
|
||
const parsed = parse(command, args, options);
|
||
|
||
// Spawn the child process
|
||
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
||
|
||
// Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
|
||
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
||
|
||
return result;
|
||
}
|
||
|
||
module.exports = spawn;
|
||
module.exports.spawn = spawn;
|
||
module.exports.sync = spawnSync;
|
||
|
||
module.exports._parse = parse;
|
||
module.exports._enoent = enoent;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 25:
|
||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
Object.defineProperty(exports, "v1", {
|
||
enumerable: true,
|
||
get: function () {
|
||
return _v.default;
|
||
}
|
||
});
|
||
Object.defineProperty(exports, "v3", {
|
||
enumerable: true,
|
||
get: function () {
|
||
return _v2.default;
|
||
}
|
||
});
|
||
Object.defineProperty(exports, "v4", {
|
||
enumerable: true,
|
||
get: function () {
|
||
return _v3.default;
|
||
}
|
||
});
|
||
Object.defineProperty(exports, "v5", {
|
||
enumerable: true,
|
||
get: function () {
|
||
return _v4.default;
|
||
}
|
||
});
|
||
Object.defineProperty(exports, "NIL", {
|
||
enumerable: true,
|
||
get: function () {
|
||
return _nil.default;
|
||
}
|
||
});
|
||
Object.defineProperty(exports, "version", {
|
||
enumerable: true,
|
||
get: function () {
|
||
return _version.default;
|
||
}
|
||
});
|
||
Object.defineProperty(exports, "validate", {
|
||
enumerable: true,
|
||
get: function () {
|
||
return _validate.default;
|
||
}
|
||
});
|
||
Object.defineProperty(exports, "stringify", {
|
||
enumerable: true,
|
||
get: function () {
|
||
return _stringify.default;
|
||
}
|
||
});
|
||
Object.defineProperty(exports, "parse", {
|
||
enumerable: true,
|
||
get: function () {
|
||
return _parse.default;
|
||
}
|
||
});
|
||
|
||
var _v = _interopRequireDefault(__webpack_require__(810));
|
||
|
||
var _v2 = _interopRequireDefault(__webpack_require__(572));
|
||
|
||
var _v3 = _interopRequireDefault(__webpack_require__(293));
|
||
|
||
var _v4 = _interopRequireDefault(__webpack_require__(638));
|
||
|
||
var _nil = _interopRequireDefault(__webpack_require__(4));
|
||
|
||
var _version = _interopRequireDefault(__webpack_require__(135));
|
||
|
||
var _validate = _interopRequireDefault(__webpack_require__(634));
|
||
|
||
var _stringify = _interopRequireDefault(__webpack_require__(960));
|
||
|
||
var _parse = _interopRequireDefault(__webpack_require__(204));
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
/***/ }),
|
||
|
||
/***/ 26:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
var hasMap = typeof Map === 'function' && Map.prototype;
|
||
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
||
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
|
||
var mapForEach = hasMap && Map.prototype.forEach;
|
||
var hasSet = typeof Set === 'function' && Set.prototype;
|
||
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
|
||
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
|
||
var setForEach = hasSet && Set.prototype.forEach;
|
||
var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
|
||
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
||
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
|
||
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
||
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
|
||
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
||
var booleanValueOf = Boolean.prototype.valueOf;
|
||
var objectToString = Object.prototype.toString;
|
||
var functionToString = Function.prototype.toString;
|
||
var match = String.prototype.match;
|
||
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
||
var gOPS = Object.getOwnPropertySymbols;
|
||
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
|
||
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
|
||
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
||
|
||
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
|
||
[].__proto__ === Array.prototype // eslint-disable-line no-proto
|
||
? function (O) {
|
||
return O.__proto__; // eslint-disable-line no-proto
|
||
}
|
||
: null
|
||
);
|
||
|
||
var inspectCustom = __webpack_require__(330).custom;
|
||
var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
|
||
var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null;
|
||
|
||
module.exports = function inspect_(obj, options, depth, seen) {
|
||
var opts = options || {};
|
||
|
||
if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
|
||
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
||
}
|
||
if (
|
||
has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
|
||
? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
|
||
: opts.maxStringLength !== null
|
||
)
|
||
) {
|
||
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
||
}
|
||
var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
|
||
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
|
||
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
|
||
}
|
||
|
||
if (
|
||
has(opts, 'indent')
|
||
&& opts.indent !== null
|
||
&& opts.indent !== '\t'
|
||
&& !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
|
||
) {
|
||
throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');
|
||
}
|
||
|
||
if (typeof obj === 'undefined') {
|
||
return 'undefined';
|
||
}
|
||
if (obj === null) {
|
||
return 'null';
|
||
}
|
||
if (typeof obj === 'boolean') {
|
||
return obj ? 'true' : 'false';
|
||
}
|
||
|
||
if (typeof obj === 'string') {
|
||
return inspectString(obj, opts);
|
||
}
|
||
if (typeof obj === 'number') {
|
||
if (obj === 0) {
|
||
return Infinity / obj > 0 ? '0' : '-0';
|
||
}
|
||
return String(obj);
|
||
}
|
||
if (typeof obj === 'bigint') {
|
||
return String(obj) + 'n';
|
||
}
|
||
|
||
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
|
||
if (typeof depth === 'undefined') { depth = 0; }
|
||
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
|
||
return isArray(obj) ? '[Array]' : '[Object]';
|
||
}
|
||
|
||
var indent = getIndent(opts, depth);
|
||
|
||
if (typeof seen === 'undefined') {
|
||
seen = [];
|
||
} else if (indexOf(seen, obj) >= 0) {
|
||
return '[Circular]';
|
||
}
|
||
|
||
function inspect(value, from, noIndent) {
|
||
if (from) {
|
||
seen = seen.slice();
|
||
seen.push(from);
|
||
}
|
||
if (noIndent) {
|
||
var newOpts = {
|
||
depth: opts.depth
|
||
};
|
||
if (has(opts, 'quoteStyle')) {
|
||
newOpts.quoteStyle = opts.quoteStyle;
|
||
}
|
||
return inspect_(value, newOpts, depth + 1, seen);
|
||
}
|
||
return inspect_(value, opts, depth + 1, seen);
|
||
}
|
||
|
||
if (typeof obj === 'function') {
|
||
var name = nameOf(obj);
|
||
var keys = arrObjKeys(obj, inspect);
|
||
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : '');
|
||
}
|
||
if (isSymbol(obj)) {
|
||
var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
|
||
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
|
||
}
|
||
if (isElement(obj)) {
|
||
var s = '<' + String(obj.nodeName).toLowerCase();
|
||
var attrs = obj.attributes || [];
|
||
for (var i = 0; i < attrs.length; i++) {
|
||
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
|
||
}
|
||
s += '>';
|
||
if (obj.childNodes && obj.childNodes.length) { s += '...'; }
|
||
s += '</' + String(obj.nodeName).toLowerCase() + '>';
|
||
return s;
|
||
}
|
||
if (isArray(obj)) {
|
||
if (obj.length === 0) { return '[]'; }
|
||
var xs = arrObjKeys(obj, inspect);
|
||
if (indent && !singleLineValues(xs)) {
|
||
return '[' + indentedJoin(xs, indent) + ']';
|
||
}
|
||
return '[ ' + xs.join(', ') + ' ]';
|
||
}
|
||
if (isError(obj)) {
|
||
var parts = arrObjKeys(obj, inspect);
|
||
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
||
return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }';
|
||
}
|
||
if (typeof obj === 'object' && customInspect) {
|
||
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
|
||
return obj[inspectSymbol]();
|
||
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
||
return obj.inspect();
|
||
}
|
||
}
|
||
if (isMap(obj)) {
|
||
var mapParts = [];
|
||
mapForEach.call(obj, function (value, key) {
|
||
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
|
||
});
|
||
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
|
||
}
|
||
if (isSet(obj)) {
|
||
var setParts = [];
|
||
setForEach.call(obj, function (value) {
|
||
setParts.push(inspect(value, obj));
|
||
});
|
||
return collectionOf('Set', setSize.call(obj), setParts, indent);
|
||
}
|
||
if (isWeakMap(obj)) {
|
||
return weakCollectionOf('WeakMap');
|
||
}
|
||
if (isWeakSet(obj)) {
|
||
return weakCollectionOf('WeakSet');
|
||
}
|
||
if (isWeakRef(obj)) {
|
||
return weakCollectionOf('WeakRef');
|
||
}
|
||
if (isNumber(obj)) {
|
||
return markBoxed(inspect(Number(obj)));
|
||
}
|
||
if (isBigInt(obj)) {
|
||
return markBoxed(inspect(bigIntValueOf.call(obj)));
|
||
}
|
||
if (isBoolean(obj)) {
|
||
return markBoxed(booleanValueOf.call(obj));
|
||
}
|
||
if (isString(obj)) {
|
||
return markBoxed(inspect(String(obj)));
|
||
}
|
||
if (!isDate(obj) && !isRegExp(obj)) {
|
||
var ys = arrObjKeys(obj, inspect);
|
||
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
||
var protoTag = obj instanceof Object ? '' : 'null prototype';
|
||
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : '';
|
||
var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
|
||
var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : '');
|
||
if (ys.length === 0) { return tag + '{}'; }
|
||
if (indent) {
|
||
return tag + '{' + indentedJoin(ys, indent) + '}';
|
||
}
|
||
return tag + '{ ' + ys.join(', ') + ' }';
|
||
}
|
||
return String(obj);
|
||
};
|
||
|
||
function wrapQuotes(s, defaultStyle, opts) {
|
||
var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
|
||
return quoteChar + s + quoteChar;
|
||
}
|
||
|
||
function quote(s) {
|
||
return String(s).replace(/"/g, '"');
|
||
}
|
||
|
||
function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||
function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||
function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||
function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||
function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||
function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||
|
||
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
||
function isSymbol(obj) {
|
||
if (hasShammedSymbols) {
|
||
return obj && typeof obj === 'object' && obj instanceof Symbol;
|
||
}
|
||
if (typeof obj === 'symbol') {
|
||
return true;
|
||
}
|
||
if (!obj || typeof obj !== 'object' || !symToString) {
|
||
return false;
|
||
}
|
||
try {
|
||
symToString.call(obj);
|
||
return true;
|
||
} catch (e) {}
|
||
return false;
|
||
}
|
||
|
||
function isBigInt(obj) {
|
||
if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
|
||
return false;
|
||
}
|
||
try {
|
||
bigIntValueOf.call(obj);
|
||
return true;
|
||
} catch (e) {}
|
||
return false;
|
||
}
|
||
|
||
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
|
||
function has(obj, key) {
|
||
return hasOwn.call(obj, key);
|
||
}
|
||
|
||
function toStr(obj) {
|
||
return objectToString.call(obj);
|
||
}
|
||
|
||
function nameOf(f) {
|
||
if (f.name) { return f.name; }
|
||
var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
||
if (m) { return m[1]; }
|
||
return null;
|
||
}
|
||
|
||
function indexOf(xs, x) {
|
||
if (xs.indexOf) { return xs.indexOf(x); }
|
||
for (var i = 0, l = xs.length; i < l; i++) {
|
||
if (xs[i] === x) { return i; }
|
||
}
|
||
return -1;
|
||
}
|
||
|
||
function isMap(x) {
|
||
if (!mapSize || !x || typeof x !== 'object') {
|
||
return false;
|
||
}
|
||
try {
|
||
mapSize.call(x);
|
||
try {
|
||
setSize.call(x);
|
||
} catch (s) {
|
||
return true;
|
||
}
|
||
return x instanceof Map; // core-js workaround, pre-v2.5.0
|
||
} catch (e) {}
|
||
return false;
|
||
}
|
||
|
||
function isWeakMap(x) {
|
||
if (!weakMapHas || !x || typeof x !== 'object') {
|
||
return false;
|
||
}
|
||
try {
|
||
weakMapHas.call(x, weakMapHas);
|
||
try {
|
||
weakSetHas.call(x, weakSetHas);
|
||
} catch (s) {
|
||
return true;
|
||
}
|
||
return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
|
||
} catch (e) {}
|
||
return false;
|
||
}
|
||
|
||
function isWeakRef(x) {
|
||
if (!weakRefDeref || !x || typeof x !== 'object') {
|
||
return false;
|
||
}
|
||
try {
|
||
weakRefDeref.call(x);
|
||
return true;
|
||
} catch (e) {}
|
||
return false;
|
||
}
|
||
|
||
function isSet(x) {
|
||
if (!setSize || !x || typeof x !== 'object') {
|
||
return false;
|
||
}
|
||
try {
|
||
setSize.call(x);
|
||
try {
|
||
mapSize.call(x);
|
||
} catch (m) {
|
||
return true;
|
||
}
|
||
return x instanceof Set; // core-js workaround, pre-v2.5.0
|
||
} catch (e) {}
|
||
return false;
|
||
}
|
||
|
||
function isWeakSet(x) {
|
||
if (!weakSetHas || !x || typeof x !== 'object') {
|
||
return false;
|
||
}
|
||
try {
|
||
weakSetHas.call(x, weakSetHas);
|
||
try {
|
||
weakMapHas.call(x, weakMapHas);
|
||
} catch (s) {
|
||
return true;
|
||
}
|
||
return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
|
||
} catch (e) {}
|
||
return false;
|
||
}
|
||
|
||
function isElement(x) {
|
||
if (!x || typeof x !== 'object') { return false; }
|
||
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
|
||
return true;
|
||
}
|
||
return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
|
||
}
|
||
|
||
function inspectString(str, opts) {
|
||
if (str.length > opts.maxStringLength) {
|
||
var remaining = str.length - opts.maxStringLength;
|
||
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
|
||
return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer;
|
||
}
|
||
// eslint-disable-next-line no-control-regex
|
||
var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte);
|
||
return wrapQuotes(s, 'single', opts);
|
||
}
|
||
|
||
function lowbyte(c) {
|
||
var n = c.charCodeAt(0);
|
||
var x = {
|
||
8: 'b',
|
||
9: 't',
|
||
10: 'n',
|
||
12: 'f',
|
||
13: 'r'
|
||
}[n];
|
||
if (x) { return '\\' + x; }
|
||
return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase();
|
||
}
|
||
|
||
function markBoxed(str) {
|
||
return 'Object(' + str + ')';
|
||
}
|
||
|
||
function weakCollectionOf(type) {
|
||
return type + ' { ? }';
|
||
}
|
||
|
||
function collectionOf(type, size, entries, indent) {
|
||
var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', ');
|
||
return type + ' (' + size + ') {' + joinedEntries + '}';
|
||
}
|
||
|
||
function singleLineValues(xs) {
|
||
for (var i = 0; i < xs.length; i++) {
|
||
if (indexOf(xs[i], '\n') >= 0) {
|
||
return false;
|
||
}
|
||
}
|
||
return true;
|
||
}
|
||
|
||
function getIndent(opts, depth) {
|
||
var baseIndent;
|
||
if (opts.indent === '\t') {
|
||
baseIndent = '\t';
|
||
} else if (typeof opts.indent === 'number' && opts.indent > 0) {
|
||
baseIndent = Array(opts.indent + 1).join(' ');
|
||
} else {
|
||
return null;
|
||
}
|
||
return {
|
||
base: baseIndent,
|
||
prev: Array(depth + 1).join(baseIndent)
|
||
};
|
||
}
|
||
|
||
function indentedJoin(xs, indent) {
|
||
if (xs.length === 0) { return ''; }
|
||
var lineJoiner = '\n' + indent.prev + indent.base;
|
||
return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev;
|
||
}
|
||
|
||
function arrObjKeys(obj, inspect) {
|
||
var isArr = isArray(obj);
|
||
var xs = [];
|
||
if (isArr) {
|
||
xs.length = obj.length;
|
||
for (var i = 0; i < obj.length; i++) {
|
||
xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
|
||
}
|
||
}
|
||
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
|
||
var symMap;
|
||
if (hasShammedSymbols) {
|
||
symMap = {};
|
||
for (var k = 0; k < syms.length; k++) {
|
||
symMap['$' + syms[k]] = syms[k];
|
||
}
|
||
}
|
||
|
||
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
||
if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
||
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
||
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
|
||
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
||
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
||
} else if ((/[^\w$]/).test(key)) {
|
||
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
|
||
} else {
|
||
xs.push(key + ': ' + inspect(obj[key], obj));
|
||
}
|
||
}
|
||
if (typeof gOPS === 'function') {
|
||
for (var j = 0; j < syms.length; j++) {
|
||
if (isEnumerable.call(obj, syms[j])) {
|
||
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
|
||
}
|
||
}
|
||
}
|
||
return xs;
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 30:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
module.exports = getLastPage
|
||
|
||
const getPage = __webpack_require__(265)
|
||
|
||
function getLastPage (octokit, link, headers) {
|
||
return getPage(octokit, link, 'last', headers)
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 39:
|
||
/***/ (function(module) {
|
||
|
||
"use strict";
|
||
|
||
module.exports = opts => {
|
||
opts = opts || {};
|
||
|
||
const env = opts.env || process.env;
|
||
const platform = opts.platform || process.platform;
|
||
|
||
if (platform !== 'win32') {
|
||
return 'PATH';
|
||
}
|
||
|
||
return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 47:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
module.exports = factory;
|
||
|
||
const Octokit = __webpack_require__(402);
|
||
const registerPlugin = __webpack_require__(855);
|
||
|
||
function factory(plugins) {
|
||
const Api = Octokit.bind(null, plugins || []);
|
||
Api.plugin = registerPlugin.bind(null, plugins || []);
|
||
return Api;
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 49:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
const os = __webpack_require__(87);
|
||
const execa = __webpack_require__(955);
|
||
|
||
// Reference: https://www.gaijin.at/en/lstwinver.php
|
||
const names = new Map([
|
||
['10.0', '10'],
|
||
['6.3', '8.1'],
|
||
['6.2', '8'],
|
||
['6.1', '7'],
|
||
['6.0', 'Vista'],
|
||
['5.2', 'Server 2003'],
|
||
['5.1', 'XP'],
|
||
['5.0', '2000'],
|
||
['4.9', 'ME'],
|
||
['4.1', '98'],
|
||
['4.0', '95']
|
||
]);
|
||
|
||
const windowsRelease = release => {
|
||
const version = /\d+\.\d/.exec(release || os.release());
|
||
|
||
if (release && !version) {
|
||
throw new Error('`release` argument doesn\'t match `n.n`');
|
||
}
|
||
|
||
const ver = (version || [])[0];
|
||
|
||
// Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime.
|
||
// If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
|
||
// then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
|
||
// If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead.
|
||
// If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name.
|
||
if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
|
||
let stdout;
|
||
try {
|
||
stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
|
||
} catch (_) {
|
||
stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
|
||
}
|
||
|
||
const year = (stdout.match(/2008|2012|2016|2019/) || [])[0];
|
||
|
||
if (year) {
|
||
return `Server ${year}`;
|
||
}
|
||
}
|
||
|
||
return names.get(ver);
|
||
};
|
||
|
||
module.exports = windowsRelease;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 68:
|
||
/***/ (function(__unusedmodule, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, '__esModule', { value: true });
|
||
|
||
async function auth(token) {
|
||
const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
|
||
return {
|
||
type: "token",
|
||
token: token,
|
||
tokenType
|
||
};
|
||
}
|
||
|
||
/**
|
||
* Prefix token for usage in the Authorization header
|
||
*
|
||
* @param token OAuth token or JSON Web Token
|
||
*/
|
||
function withAuthorizationPrefix(token) {
|
||
if (token.split(/\./).length === 3) {
|
||
return `bearer ${token}`;
|
||
}
|
||
|
||
return `token ${token}`;
|
||
}
|
||
|
||
async function hook(token, request, route, parameters) {
|
||
const endpoint = request.endpoint.merge(route, parameters);
|
||
endpoint.headers.authorization = withAuthorizationPrefix(token);
|
||
return request(endpoint);
|
||
}
|
||
|
||
const createTokenAuth = function createTokenAuth(token) {
|
||
if (!token) {
|
||
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
|
||
}
|
||
|
||
if (typeof token !== "string") {
|
||
throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
|
||
}
|
||
|
||
token = token.replace(/^(token|bearer) +/i, "");
|
||
return Object.assign(auth.bind(null, token), {
|
||
hook: hook.bind(null, token)
|
||
});
|
||
};
|
||
|
||
exports.createTokenAuth = createTokenAuth;
|
||
//# sourceMappingURL=index.js.map
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 70:
|
||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
exports.URL = __webpack_require__(782).interface;
|
||
exports.serializeURL = __webpack_require__(936).serializeURL;
|
||
exports.serializeURLOrigin = __webpack_require__(936).serializeURLOrigin;
|
||
exports.basicURLParse = __webpack_require__(936).basicURLParse;
|
||
exports.setTheUsername = __webpack_require__(936).setTheUsername;
|
||
exports.setThePassword = __webpack_require__(936).setThePassword;
|
||
exports.serializeHost = __webpack_require__(936).serializeHost;
|
||
exports.serializeInteger = __webpack_require__(936).serializeInteger;
|
||
exports.parseURL = __webpack_require__(936).parseURL;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 81:
|
||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||
}) : (function(o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
o[k2] = m[k];
|
||
}));
|
||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||
}) : function(o, v) {
|
||
o["default"] = v;
|
||
});
|
||
var __importStar = (this && this.__importStar) || function (mod) {
|
||
if (mod && mod.__esModule) return mod;
|
||
var result = {};
|
||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||
__setModuleDefault(result, mod);
|
||
return result;
|
||
};
|
||
Object.defineProperty(exports, "__esModule", { value: true });
|
||
exports.isGhes = exports.getServerApiUrl = exports.getServerUrl = exports.getFetchUrl = void 0;
|
||
const assert = __importStar(__webpack_require__(357));
|
||
const url_1 = __webpack_require__(835);
|
||
function getFetchUrl(settings) {
|
||
assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
|
||
assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
|
||
const serviceUrl = getServerUrl(settings.githubServerUrl);
|
||
const encodedOwner = encodeURIComponent(settings.repositoryOwner);
|
||
const encodedName = encodeURIComponent(settings.repositoryName);
|
||
if (settings.sshKey) {
|
||
return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
|
||
}
|
||
// "origin" is SCHEME://HOSTNAME[:PORT]
|
||
return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
|
||
}
|
||
exports.getFetchUrl = getFetchUrl;
|
||
function getServerUrl(url) {
|
||
let urlValue = url && url.trim().length > 0
|
||
? url
|
||
: process.env['GITHUB_SERVER_URL'] || 'https://github.com';
|
||
return new url_1.URL(urlValue);
|
||
}
|
||
exports.getServerUrl = getServerUrl;
|
||
function getServerApiUrl(url) {
|
||
let apiUrl = 'https://api.github.com';
|
||
if (isGhes(url)) {
|
||
const serverUrl = getServerUrl(url);
|
||
apiUrl = new url_1.URL(`${serverUrl.origin}/api/v3`).toString();
|
||
}
|
||
return apiUrl;
|
||
}
|
||
exports.getServerApiUrl = getServerApiUrl;
|
||
function isGhes(url) {
|
||
const ghUrl = getServerUrl(url);
|
||
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
|
||
}
|
||
exports.isGhes = isGhes;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 82:
|
||
/***/ (function(__unusedmodule, exports) {
|
||
|
||
"use strict";
|
||
|
||
// We use any as a valid input type
|
||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||
Object.defineProperty(exports, "__esModule", { value: true });
|
||
exports.toCommandProperties = exports.toCommandValue = void 0;
|
||
/**
|
||
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
||
* @param input input to sanitize into a string
|
||
*/
|
||
function toCommandValue(input) {
|
||
if (input === null || input === undefined) {
|
||
return '';
|
||
}
|
||
else if (typeof input === 'string' || input instanceof String) {
|
||
return input;
|
||
}
|
||
return JSON.stringify(input);
|
||
}
|
||
exports.toCommandValue = toCommandValue;
|
||
/**
|
||
*
|
||
* @param annotationProperties
|
||
* @returns The command properties to send with the actual annotation command
|
||
* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
|
||
*/
|
||
function toCommandProperties(annotationProperties) {
|
||
if (!Object.keys(annotationProperties).length) {
|
||
return {};
|
||
}
|
||
return {
|
||
title: annotationProperties.title,
|
||
file: annotationProperties.file,
|
||
line: annotationProperties.startLine,
|
||
endLine: annotationProperties.endLine,
|
||
col: annotationProperties.startColumn,
|
||
endColumn: annotationProperties.endColumn
|
||
};
|
||
}
|
||
exports.toCommandProperties = toCommandProperties;
|
||
//# sourceMappingURL=utils.js.map
|
||
|
||
/***/ }),
|
||
|
||
/***/ 87:
|
||
/***/ (function(module) {
|
||
|
||
module.exports = require("os");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 95:
|
||
/***/ (function(__unusedmodule, exports) {
|
||
|
||
"use strict";
|
||
|
||
Object.defineProperty(exports, "__esModule", { value: true });
|
||
exports.checkBypass = exports.getProxyUrl = void 0;
|
||
function getProxyUrl(reqUrl) {
|
||
const usingSsl = reqUrl.protocol === 'https:';
|
||
if (checkBypass(reqUrl)) {
|
||
return undefined;
|
||
}
|
||
const proxyVar = (() => {
|
||
if (usingSsl) {
|
||
return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
|
||
}
|
||
else {
|
||
return process.env['http_proxy'] || process.env['HTTP_PROXY'];
|
||
}
|
||
})();
|
||
if (proxyVar) {
|
||
return new URL(proxyVar);
|
||
}
|
||
else {
|
||
return undefined;
|
||
}
|
||
}
|
||
exports.getProxyUrl = getProxyUrl;
|
||
function checkBypass(reqUrl) {
|
||
if (!reqUrl.hostname) {
|
||
return false;
|
||
}
|
||
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
|
||
if (!noProxy) {
|
||
return false;
|
||
}
|
||
// Determine the request port
|
||
let reqPort;
|
||
if (reqUrl.port) {
|
||
reqPort = Number(reqUrl.port);
|
||
}
|
||
else if (reqUrl.protocol === 'http:') {
|
||
reqPort = 80;
|
||
}
|
||
else if (reqUrl.protocol === 'https:') {
|
||
reqPort = 443;
|
||
}
|
||
// Format the request hostname and hostname with port
|
||
const upperReqHosts = [reqUrl.hostname.toUpperCase()];
|
||
if (typeof reqPort === 'number') {
|
||
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
|
||
}
|
||
// Compare request host against noproxy
|
||
for (const upperNoProxyItem of noProxy
|
||
.split(',')
|
||
.map(x => x.trim().toUpperCase())
|
||
.filter(x => x)) {
|
||
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
|
||
return true;
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
exports.checkBypass = checkBypass;
|
||
//# sourceMappingURL=proxy.js.map
|
||
|
||
/***/ }),
|
||
|
||
/***/ 102:
|
||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
// For internal use, subject to change.
|
||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||
}) : (function(o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
o[k2] = m[k];
|
||
}));
|
||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||
}) : function(o, v) {
|
||
o["default"] = v;
|
||
});
|
||
var __importStar = (this && this.__importStar) || function (mod) {
|
||
if (mod && mod.__esModule) return mod;
|
||
var result = {};
|
||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||
__setModuleDefault(result, mod);
|
||
return result;
|
||
};
|
||
Object.defineProperty(exports, "__esModule", { value: true });
|
||
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
|
||
// We use any as a valid input type
|
||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||
const fs = __importStar(__webpack_require__(747));
|
||
const os = __importStar(__webpack_require__(87));
|
||
const uuid_1 = __webpack_require__(25);
|
||
const utils_1 = __webpack_require__(82);
|
||
function issueFileCommand(command, message) {
|
||
const filePath = process.env[`GITHUB_${command}`];
|
||
if (!filePath) {
|
||
throw new Error(`Unable to find environment variable for file command ${command}`);
|
||
}
|
||
if (!fs.existsSync(filePath)) {
|
||
throw new Error(`Missing file at path: ${filePath}`);
|
||
}
|
||
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
|
||
encoding: 'utf8'
|
||
});
|
||
}
|
||
exports.issueFileCommand = issueFileCommand;
|
||
function prepareKeyValueMessage(key, value) {
|
||
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
|
||
const convertedValue = utils_1.toCommandValue(value);
|
||
// These should realistically never happen, but just in case someone finds a
|
||
// way to exploit uuid generation let's not allow keys or values that contain
|
||
// the delimiter.
|
||
if (key.includes(delimiter)) {
|
||
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
|
||
}
|
||
if (convertedValue.includes(delimiter)) {
|
||
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
|
||
}
|
||
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
|
||
}
|
||
exports.prepareKeyValueMessage = prepareKeyValueMessage;
|
||
//# sourceMappingURL=file-command.js.map
|
||
|
||
/***/ }),
|
||
|
||
/***/ 118:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
const os = __webpack_require__(87);
|
||
|
||
const nameMap = new Map([
|
||
[19, 'Catalina'],
|
||
[18, 'Mojave'],
|
||
[17, 'High Sierra'],
|
||
[16, 'Sierra'],
|
||
[15, 'El Capitan'],
|
||
[14, 'Yosemite'],
|
||
[13, 'Mavericks'],
|
||
[12, 'Mountain Lion'],
|
||
[11, 'Lion'],
|
||
[10, 'Snow Leopard'],
|
||
[9, 'Leopard'],
|
||
[8, 'Tiger'],
|
||
[7, 'Panther'],
|
||
[6, 'Jaguar'],
|
||
[5, 'Puma']
|
||
]);
|
||
|
||
const macosRelease = release => {
|
||
release = Number((release || os.release()).split('.')[0]);
|
||
return {
|
||
name: nameMap.get(release),
|
||
version: '10.' + (release - 4)
|
||
};
|
||
};
|
||
|
||
module.exports = macosRelease;
|
||
// TODO: remove this in the next major version
|
||
module.exports.default = macosRelease;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 126:
|
||
/***/ (function(module) {
|
||
|
||
/**
|
||
* lodash (Custom Build) <https://lodash.com/>
|
||
* Build: `lodash modularize exports="npm" -o ./`
|
||
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/
|
||
|
||
/** Used as the size to enable large array optimizations. */
|
||
var LARGE_ARRAY_SIZE = 200;
|
||
|
||
/** Used to stand-in for `undefined` hash values. */
|
||
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
||
|
||
/** Used as references for various `Number` constants. */
|
||
var INFINITY = 1 / 0;
|
||
|
||
/** `Object#toString` result references. */
|
||
var funcTag = '[object Function]',
|
||
genTag = '[object GeneratorFunction]';
|
||
|
||
/**
|
||
* Used to match `RegExp`
|
||
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
||
*/
|
||
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
||
|
||
/** Used to detect host constructors (Safari). */
|
||
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
||
|
||
/** Detect free variable `global` from Node.js. */
|
||
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
||
|
||
/** Detect free variable `self`. */
|
||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
||
|
||
/** Used as a reference to the global object. */
|
||
var root = freeGlobal || freeSelf || Function('return this')();
|
||
|
||
/**
|
||
* A specialized version of `_.includes` for arrays without support for
|
||
* specifying an index to search from.
|
||
*
|
||
* @private
|
||
* @param {Array} [array] The array to inspect.
|
||
* @param {*} target The value to search for.
|
||
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
||
*/
|
||
function arrayIncludes(array, value) {
|
||
var length = array ? array.length : 0;
|
||
return !!length && baseIndexOf(array, value, 0) > -1;
|
||
}
|
||
|
||
/**
|
||
* This function is like `arrayIncludes` except that it accepts a comparator.
|
||
*
|
||
* @private
|
||
* @param {Array} [array] The array to inspect.
|
||
* @param {*} target The value to search for.
|
||
* @param {Function} comparator The comparator invoked per element.
|
||
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
||
*/
|
||
function arrayIncludesWith(array, value, comparator) {
|
||
var index = -1,
|
||
length = array ? array.length : 0;
|
||
|
||
while (++index < length) {
|
||
if (comparator(value, array[index])) {
|
||
return true;
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
|
||
/**
|
||
* The base implementation of `_.findIndex` and `_.findLastIndex` without
|
||
* support for iteratee shorthands.
|
||
*
|
||
* @private
|
||
* @param {Array} array The array to inspect.
|
||
* @param {Function} predicate The function invoked per iteration.
|
||
* @param {number} fromIndex The index to search from.
|
||
* @param {boolean} [fromRight] Specify iterating from right to left.
|
||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||
*/
|
||
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
||
var length = array.length,
|
||
index = fromIndex + (fromRight ? 1 : -1);
|
||
|
||
while ((fromRight ? index-- : ++index < length)) {
|
||
if (predicate(array[index], index, array)) {
|
||
return index;
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
|
||
/**
|
||
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
||
*
|
||
* @private
|
||
* @param {Array} array The array to inspect.
|
||
* @param {*} value The value to search for.
|
||
* @param {number} fromIndex The index to search from.
|
||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||
*/
|
||
function baseIndexOf(array, value, fromIndex) {
|
||
if (value !== value) {
|
||
return baseFindIndex(array, baseIsNaN, fromIndex);
|
||
}
|
||
var index = fromIndex - 1,
|
||
length = array.length;
|
||
|
||
while (++index < length) {
|
||
if (array[index] === value) {
|
||
return index;
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
|
||
/**
|
||
* The base implementation of `_.isNaN` without support for number objects.
|
||
*
|
||
* @private
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
|
||
*/
|
||
function baseIsNaN(value) {
|
||
return value !== value;
|
||
}
|
||
|
||
/**
|
||
* Checks if a cache value for `key` exists.
|
||
*
|
||
* @private
|
||
* @param {Object} cache The cache to query.
|
||
* @param {string} key The key of the entry to check.
|
||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||
*/
|
||
function cacheHas(cache, key) {
|
||
return cache.has(key);
|
||
}
|
||
|
||
/**
|
||
* Gets the value at `key` of `object`.
|
||
*
|
||
* @private
|
||
* @param {Object} [object] The object to query.
|
||
* @param {string} key The key of the property to get.
|
||
* @returns {*} Returns the property value.
|
||
*/
|
||
function getValue(object, key) {
|
||
return object == null ? undefined : object[key];
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is a host object in IE < 9.
|
||
*
|
||
* @private
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
||
*/
|
||
function isHostObject(value) {
|
||
// Many host objects are `Object` objects that can coerce to strings
|
||
// despite having improperly defined `toString` methods.
|
||
var result = false;
|
||
if (value != null && typeof value.toString != 'function') {
|
||
try {
|
||
result = !!(value + '');
|
||
} catch (e) {}
|
||
}
|
||
return result;
|
||
}
|
||
|
||
/**
|
||
* Converts `set` to an array of its values.
|
||
*
|
||
* @private
|
||
* @param {Object} set The set to convert.
|
||
* @returns {Array} Returns the values.
|
||
*/
|
||
function setToArray(set) {
|
||
var index = -1,
|
||
result = Array(set.size);
|
||
|
||
set.forEach(function(value) {
|
||
result[++index] = value;
|
||
});
|
||
return result;
|
||
}
|
||
|
||
/** Used for built-in method references. */
|
||
var arrayProto = Array.prototype,
|
||
funcProto = Function.prototype,
|
||
objectProto = Object.prototype;
|
||
|
||
/** Used to detect overreaching core-js shims. */
|
||
var coreJsData = root['__core-js_shared__'];
|
||
|
||
/** Used to detect methods masquerading as native. */
|
||
var maskSrcKey = (function() {
|
||
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
||
return uid ? ('Symbol(src)_1.' + uid) : '';
|
||
}());
|
||
|
||
/** Used to resolve the decompiled source of functions. */
|
||
var funcToString = funcProto.toString;
|
||
|
||
/** Used to check objects for own properties. */
|
||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||
|
||
/**
|
||
* Used to resolve the
|
||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||
* of values.
|
||
*/
|
||
var objectToString = objectProto.toString;
|
||
|
||
/** Used to detect if a method is native. */
|
||
var reIsNative = RegExp('^' +
|
||
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
||
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
||
);
|
||
|
||
/** Built-in value references. */
|
||
var splice = arrayProto.splice;
|
||
|
||
/* Built-in method references that are verified to be native. */
|
||
var Map = getNative(root, 'Map'),
|
||
Set = getNative(root, 'Set'),
|
||
nativeCreate = getNative(Object, 'create');
|
||
|
||
/**
|
||
* Creates a hash object.
|
||
*
|
||
* @private
|
||
* @constructor
|
||
* @param {Array} [entries] The key-value pairs to cache.
|
||
*/
|
||
function Hash(entries) {
|
||
var index = -1,
|
||
length = entries ? entries.length : 0;
|
||
|
||
this.clear();
|
||
while (++index < length) {
|
||
var entry = entries[index];
|
||
this.set(entry[0], entry[1]);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Removes all key-value entries from the hash.
|
||
*
|
||
* @private
|
||
* @name clear
|
||
* @memberOf Hash
|
||
*/
|
||
function hashClear() {
|
||
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
||
}
|
||
|
||
/**
|
||
* Removes `key` and its value from the hash.
|
||
*
|
||
* @private
|
||
* @name delete
|
||
* @memberOf Hash
|
||
* @param {Object} hash The hash to modify.
|
||
* @param {string} key The key of the value to remove.
|
||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||
*/
|
||
function hashDelete(key) {
|
||
return this.has(key) && delete this.__data__[key];
|
||
}
|
||
|
||
/**
|
||
* Gets the hash value for `key`.
|
||
*
|
||
* @private
|
||
* @name get
|
||
* @memberOf Hash
|
||
* @param {string} key The key of the value to get.
|
||
* @returns {*} Returns the entry value.
|
||
*/
|
||
function hashGet(key) {
|
||
var data = this.__data__;
|
||
if (nativeCreate) {
|
||
var result = data[key];
|
||
return result === HASH_UNDEFINED ? undefined : result;
|
||
}
|
||
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
||
}
|
||
|
||
/**
|
||
* Checks if a hash value for `key` exists.
|
||
*
|
||
* @private
|
||
* @name has
|
||
* @memberOf Hash
|
||
* @param {string} key The key of the entry to check.
|
||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||
*/
|
||
function hashHas(key) {
|
||
var data = this.__data__;
|
||
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
||
}
|
||
|
||
/**
|
||
* Sets the hash `key` to `value`.
|
||
*
|
||
* @private
|
||
* @name set
|
||
* @memberOf Hash
|
||
* @param {string} key The key of the value to set.
|
||
* @param {*} value The value to set.
|
||
* @returns {Object} Returns the hash instance.
|
||
*/
|
||
function hashSet(key, value) {
|
||
var data = this.__data__;
|
||
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
||
return this;
|
||
}
|
||
|
||
// Add methods to `Hash`.
|
||
Hash.prototype.clear = hashClear;
|
||
Hash.prototype['delete'] = hashDelete;
|
||
Hash.prototype.get = hashGet;
|
||
Hash.prototype.has = hashHas;
|
||
Hash.prototype.set = hashSet;
|
||
|
||
/**
|
||
* Creates an list cache object.
|
||
*
|
||
* @private
|
||
* @constructor
|
||
* @param {Array} [entries] The key-value pairs to cache.
|
||
*/
|
||
function ListCache(entries) {
|
||
var index = -1,
|
||
length = entries ? entries.length : 0;
|
||
|
||
this.clear();
|
||
while (++index < length) {
|
||
var entry = entries[index];
|
||
this.set(entry[0], entry[1]);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Removes all key-value entries from the list cache.
|
||
*
|
||
* @private
|
||
* @name clear
|
||
* @memberOf ListCache
|
||
*/
|
||
function listCacheClear() {
|
||
this.__data__ = [];
|
||
}
|
||
|
||
/**
|
||
* Removes `key` and its value from the list cache.
|
||
*
|
||
* @private
|
||
* @name delete
|
||
* @memberOf ListCache
|
||
* @param {string} key The key of the value to remove.
|
||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||
*/
|
||
function listCacheDelete(key) {
|
||
var data = this.__data__,
|
||
index = assocIndexOf(data, key);
|
||
|
||
if (index < 0) {
|
||
return false;
|
||
}
|
||
var lastIndex = data.length - 1;
|
||
if (index == lastIndex) {
|
||
data.pop();
|
||
} else {
|
||
splice.call(data, index, 1);
|
||
}
|
||
return true;
|
||
}
|
||
|
||
/**
|
||
* Gets the list cache value for `key`.
|
||
*
|
||
* @private
|
||
* @name get
|
||
* @memberOf ListCache
|
||
* @param {string} key The key of the value to get.
|
||
* @returns {*} Returns the entry value.
|
||
*/
|
||
function listCacheGet(key) {
|
||
var data = this.__data__,
|
||
index = assocIndexOf(data, key);
|
||
|
||
return index < 0 ? undefined : data[index][1];
|
||
}
|
||
|
||
/**
|
||
* Checks if a list cache value for `key` exists.
|
||
*
|
||
* @private
|
||
* @name has
|
||
* @memberOf ListCache
|
||
* @param {string} key The key of the entry to check.
|
||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||
*/
|
||
function listCacheHas(key) {
|
||
return assocIndexOf(this.__data__, key) > -1;
|
||
}
|
||
|
||
/**
|
||
* Sets the list cache `key` to `value`.
|
||
*
|
||
* @private
|
||
* @name set
|
||
* @memberOf ListCache
|
||
* @param {string} key The key of the value to set.
|
||
* @param {*} value The value to set.
|
||
* @returns {Object} Returns the list cache instance.
|
||
*/
|
||
function listCacheSet(key, value) {
|
||
var data = this.__data__,
|
||
index = assocIndexOf(data, key);
|
||
|
||
if (index < 0) {
|
||
data.push([key, value]);
|
||
} else {
|
||
data[index][1] = value;
|
||
}
|
||
return this;
|
||
}
|
||
|
||
// Add methods to `ListCache`.
|
||
ListCache.prototype.clear = listCacheClear;
|
||
ListCache.prototype['delete'] = listCacheDelete;
|
||
ListCache.prototype.get = listCacheGet;
|
||
ListCache.prototype.has = listCacheHas;
|
||
ListCache.prototype.set = listCacheSet;
|
||
|
||
/**
|
||
* Creates a map cache object to store key-value pairs.
|
||
*
|
||
* @private
|
||
* @constructor
|
||
* @param {Array} [entries] The key-value pairs to cache.
|
||
*/
|
||
function MapCache(entries) {
|
||
var index = -1,
|
||
length = entries ? entries.length : 0;
|
||
|
||
this.clear();
|
||
while (++index < length) {
|
||
var entry = entries[index];
|
||
this.set(entry[0], entry[1]);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Removes all key-value entries from the map.
|
||
*
|
||
* @private
|
||
* @name clear
|
||
* @memberOf MapCache
|
||
*/
|
||
function mapCacheClear() {
|
||
this.__data__ = {
|
||
'hash': new Hash,
|
||
'map': new (Map || ListCache),
|
||
'string': new Hash
|
||
};
|
||
}
|
||
|
||
/**
|
||
* Removes `key` and its value from the map.
|
||
*
|
||
* @private
|
||
* @name delete
|
||
* @memberOf MapCache
|
||
* @param {string} key The key of the value to remove.
|
||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||
*/
|
||
function mapCacheDelete(key) {
|
||
return getMapData(this, key)['delete'](key);
|
||
}
|
||
|
||
/**
|
||
* Gets the map value for `key`.
|
||
*
|
||
* @private
|
||
* @name get
|
||
* @memberOf MapCache
|
||
* @param {string} key The key of the value to get.
|
||
* @returns {*} Returns the entry value.
|
||
*/
|
||
function mapCacheGet(key) {
|
||
return getMapData(this, key).get(key);
|
||
}
|
||
|
||
/**
|
||
* Checks if a map value for `key` exists.
|
||
*
|
||
* @private
|
||
* @name has
|
||
* @memberOf MapCache
|
||
* @param {string} key The key of the entry to check.
|
||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||
*/
|
||
function mapCacheHas(key) {
|
||
return getMapData(this, key).has(key);
|
||
}
|
||
|
||
/**
|
||
* Sets the map `key` to `value`.
|
||
*
|
||
* @private
|
||
* @name set
|
||
* @memberOf MapCache
|
||
* @param {string} key The key of the value to set.
|
||
* @param {*} value The value to set.
|
||
* @returns {Object} Returns the map cache instance.
|
||
*/
|
||
function mapCacheSet(key, value) {
|
||
getMapData(this, key).set(key, value);
|
||
return this;
|
||
}
|
||
|
||
// Add methods to `MapCache`.
|
||
MapCache.prototype.clear = mapCacheClear;
|
||
MapCache.prototype['delete'] = mapCacheDelete;
|
||
MapCache.prototype.get = mapCacheGet;
|
||
MapCache.prototype.has = mapCacheHas;
|
||
MapCache.prototype.set = mapCacheSet;
|
||
|
||
/**
|
||
*
|
||
* Creates an array cache object to store unique values.
|
||
*
|
||
* @private
|
||
* @constructor
|
||
* @param {Array} [values] The values to cache.
|
||
*/
|
||
function SetCache(values) {
|
||
var index = -1,
|
||
length = values ? values.length : 0;
|
||
|
||
this.__data__ = new MapCache;
|
||
while (++index < length) {
|
||
this.add(values[index]);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Adds `value` to the array cache.
|
||
*
|
||
* @private
|
||
* @name add
|
||
* @memberOf SetCache
|
||
* @alias push
|
||
* @param {*} value The value to cache.
|
||
* @returns {Object} Returns the cache instance.
|
||
*/
|
||
function setCacheAdd(value) {
|
||
this.__data__.set(value, HASH_UNDEFINED);
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is in the array cache.
|
||
*
|
||
* @private
|
||
* @name has
|
||
* @memberOf SetCache
|
||
* @param {*} value The value to search for.
|
||
* @returns {number} Returns `true` if `value` is found, else `false`.
|
||
*/
|
||
function setCacheHas(value) {
|
||
return this.__data__.has(value);
|
||
}
|
||
|
||
// Add methods to `SetCache`.
|
||
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
||
SetCache.prototype.has = setCacheHas;
|
||
|
||
/**
|
||
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
||
*
|
||
* @private
|
||
* @param {Array} array The array to inspect.
|
||
* @param {*} key The key to search for.
|
||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||
*/
|
||
function assocIndexOf(array, key) {
|
||
var length = array.length;
|
||
while (length--) {
|
||
if (eq(array[length][0], key)) {
|
||
return length;
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
|
||
/**
|
||
* The base implementation of `_.isNative` without bad shim checks.
|
||
*
|
||
* @private
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is a native function,
|
||
* else `false`.
|
||
*/
|
||
function baseIsNative(value) {
|
||
if (!isObject(value) || isMasked(value)) {
|
||
return false;
|
||
}
|
||
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
|
||
return pattern.test(toSource(value));
|
||
}
|
||
|
||
/**
|
||
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
|
||
*
|
||
* @private
|
||
* @param {Array} array The array to inspect.
|
||
* @param {Function} [iteratee] The iteratee invoked per element.
|
||
* @param {Function} [comparator] The comparator invoked per element.
|
||
* @returns {Array} Returns the new duplicate free array.
|
||
*/
|
||
function baseUniq(array, iteratee, comparator) {
|
||
var index = -1,
|
||
includes = arrayIncludes,
|
||
length = array.length,
|
||
isCommon = true,
|
||
result = [],
|
||
seen = result;
|
||
|
||
if (comparator) {
|
||
isCommon = false;
|
||
includes = arrayIncludesWith;
|
||
}
|
||
else if (length >= LARGE_ARRAY_SIZE) {
|
||
var set = iteratee ? null : createSet(array);
|
||
if (set) {
|
||
return setToArray(set);
|
||
}
|
||
isCommon = false;
|
||
includes = cacheHas;
|
||
seen = new SetCache;
|
||
}
|
||
else {
|
||
seen = iteratee ? [] : result;
|
||
}
|
||
outer:
|
||
while (++index < length) {
|
||
var value = array[index],
|
||
computed = iteratee ? iteratee(value) : value;
|
||
|
||
value = (comparator || value !== 0) ? value : 0;
|
||
if (isCommon && computed === computed) {
|
||
var seenIndex = seen.length;
|
||
while (seenIndex--) {
|
||
if (seen[seenIndex] === computed) {
|
||
continue outer;
|
||
}
|
||
}
|
||
if (iteratee) {
|
||
seen.push(computed);
|
||
}
|
||
result.push(value);
|
||
}
|
||
else if (!includes(seen, computed, comparator)) {
|
||
if (seen !== result) {
|
||
seen.push(computed);
|
||
}
|
||
result.push(value);
|
||
}
|
||
}
|
||
return result;
|
||
}
|
||
|
||
/**
|
||
* Creates a set object of `values`.
|
||
*
|
||
* @private
|
||
* @param {Array} values The values to add to the set.
|
||
* @returns {Object} Returns the new set.
|
||
*/
|
||
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
|
||
return new Set(values);
|
||
};
|
||
|
||
/**
|
||
* Gets the data for `map`.
|
||
*
|
||
* @private
|
||
* @param {Object} map The map to query.
|
||
* @param {string} key The reference key.
|
||
* @returns {*} Returns the map data.
|
||
*/
|
||
function getMapData(map, key) {
|
||
var data = map.__data__;
|
||
return isKeyable(key)
|
||
? data[typeof key == 'string' ? 'string' : 'hash']
|
||
: data.map;
|
||
}
|
||
|
||
/**
|
||
* Gets the native function at `key` of `object`.
|
||
*
|
||
* @private
|
||
* @param {Object} object The object to query.
|
||
* @param {string} key The key of the method to get.
|
||
* @returns {*} Returns the function if it's native, else `undefined`.
|
||
*/
|
||
function getNative(object, key) {
|
||
var value = getValue(object, key);
|
||
return baseIsNative(value) ? value : undefined;
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is suitable for use as unique object key.
|
||
*
|
||
* @private
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
||
*/
|
||
function isKeyable(value) {
|
||
var type = typeof value;
|
||
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
||
? (value !== '__proto__')
|
||
: (value === null);
|
||
}
|
||
|
||
/**
|
||
* Checks if `func` has its source masked.
|
||
*
|
||
* @private
|
||
* @param {Function} func The function to check.
|
||
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
||
*/
|
||
function isMasked(func) {
|
||
return !!maskSrcKey && (maskSrcKey in func);
|
||
}
|
||
|
||
/**
|
||
* Converts `func` to its source code.
|
||
*
|
||
* @private
|
||
* @param {Function} func The function to process.
|
||
* @returns {string} Returns the source code.
|
||
*/
|
||
function toSource(func) {
|
||
if (func != null) {
|
||
try {
|
||
return funcToString.call(func);
|
||
} catch (e) {}
|
||
try {
|
||
return (func + '');
|
||
} catch (e) {}
|
||
}
|
||
return '';
|
||
}
|
||
|
||
/**
|
||
* Creates a duplicate-free version of an array, using
|
||
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
||
* for equality comparisons, in which only the first occurrence of each
|
||
* element is kept.
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 0.1.0
|
||
* @category Array
|
||
* @param {Array} array The array to inspect.
|
||
* @returns {Array} Returns the new duplicate free array.
|
||
* @example
|
||
*
|
||
* _.uniq([2, 1, 2]);
|
||
* // => [2, 1]
|
||
*/
|
||
function uniq(array) {
|
||
return (array && array.length)
|
||
? baseUniq(array)
|
||
: [];
|
||
}
|
||
|
||
/**
|
||
* Performs a
|
||
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
||
* comparison between two values to determine if they are equivalent.
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 4.0.0
|
||
* @category Lang
|
||
* @param {*} value The value to compare.
|
||
* @param {*} other The other value to compare.
|
||
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
||
* @example
|
||
*
|
||
* var object = { 'a': 1 };
|
||
* var other = { 'a': 1 };
|
||
*
|
||
* _.eq(object, object);
|
||
* // => true
|
||
*
|
||
* _.eq(object, other);
|
||
* // => false
|
||
*
|
||
* _.eq('a', 'a');
|
||
* // => true
|
||
*
|
||
* _.eq('a', Object('a'));
|
||
* // => false
|
||
*
|
||
* _.eq(NaN, NaN);
|
||
* // => true
|
||
*/
|
||
function eq(value, other) {
|
||
return value === other || (value !== value && other !== other);
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is classified as a `Function` object.
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 0.1.0
|
||
* @category Lang
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
||
* @example
|
||
*
|
||
* _.isFunction(_);
|
||
* // => true
|
||
*
|
||
* _.isFunction(/abc/);
|
||
* // => false
|
||
*/
|
||
function isFunction(value) {
|
||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
||
var tag = isObject(value) ? objectToString.call(value) : '';
|
||
return tag == funcTag || tag == genTag;
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is the
|
||
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
||
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 0.1.0
|
||
* @category Lang
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
||
* @example
|
||
*
|
||
* _.isObject({});
|
||
* // => true
|
||
*
|
||
* _.isObject([1, 2, 3]);
|
||
* // => true
|
||
*
|
||
* _.isObject(_.noop);
|
||
* // => true
|
||
*
|
||
* _.isObject(null);
|
||
* // => false
|
||
*/
|
||
function isObject(value) {
|
||
var type = typeof value;
|
||
return !!value && (type == 'object' || type == 'function');
|
||
}
|
||
|
||
/**
|
||
* This method returns `undefined`.
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 2.3.0
|
||
* @category Util
|
||
* @example
|
||
*
|
||
* _.times(2, _.noop);
|
||
* // => [undefined, undefined]
|
||
*/
|
||
function noop() {
|
||
// No operation performed.
|
||
}
|
||
|
||
module.exports = uniq;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 129:
|
||
/***/ (function(module) {
|
||
|
||
module.exports = require("child_process");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 135:
|
||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.default = void 0;
|
||
|
||
var _validate = _interopRequireDefault(__webpack_require__(634));
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
function version(uuid) {
|
||
if (!(0, _validate.default)(uuid)) {
|
||
throw TypeError('Invalid UUID');
|
||
}
|
||
|
||
return parseInt(uuid.substr(14, 1), 16);
|
||
}
|
||
|
||
var _default = version;
|
||
exports.default = _default;
|
||
|
||
/***/ }),
|
||
|
||
/***/ 136:
|
||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.default = _default;
|
||
exports.URL = exports.DNS = void 0;
|
||
|
||
var _stringify = _interopRequireDefault(__webpack_require__(960));
|
||
|
||
var _parse = _interopRequireDefault(__webpack_require__(204));
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
function stringToBytes(str) {
|
||
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
||
|
||
const bytes = [];
|
||
|
||
for (let i = 0; i < str.length; ++i) {
|
||
bytes.push(str.charCodeAt(i));
|
||
}
|
||
|
||
return bytes;
|
||
}
|
||
|
||
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
||
exports.DNS = DNS;
|
||
const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
||
exports.URL = URL;
|
||
|
||
function _default(name, version, hashfunc) {
|
||
function generateUUID(value, namespace, buf, offset) {
|
||
if (typeof value === 'string') {
|
||
value = stringToBytes(value);
|
||
}
|
||
|
||
if (typeof namespace === 'string') {
|
||
namespace = (0, _parse.default)(namespace);
|
||
}
|
||
|
||
if (namespace.length !== 16) {
|
||
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
||
} // Compute hash of namespace and value, Per 4.3
|
||
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
||
// hashfunc([...namespace, ... value])`
|
||
|
||
|
||
let bytes = new Uint8Array(16 + value.length);
|
||
bytes.set(namespace);
|
||
bytes.set(value, namespace.length);
|
||
bytes = hashfunc(bytes);
|
||
bytes[6] = bytes[6] & 0x0f | version;
|
||
bytes[8] = bytes[8] & 0x3f | 0x80;
|
||
|
||
if (buf) {
|
||
offset = offset || 0;
|
||
|
||
for (let i = 0; i < 16; ++i) {
|
||
buf[offset + i] = bytes[i];
|
||
}
|
||
|
||
return buf;
|
||
}
|
||
|
||
return (0, _stringify.default)(bytes);
|
||
} // Function#name is not settable on some platforms (#270)
|
||
|
||
|
||
try {
|
||
generateUUID.name = name; // eslint-disable-next-line no-empty
|
||
} catch (err) {} // For CommonJS default export support
|
||
|
||
|
||
generateUUID.DNS = DNS;
|
||
generateUUID.URL = URL;
|
||
return generateUUID;
|
||
}
|
||
|
||
/***/ }),
|
||
|
||
/***/ 139:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
// Unique ID creation requires a high quality random # generator. In node.js
|
||
// this is pretty straight-forward - we use the crypto API.
|
||
|
||
var crypto = __webpack_require__(417);
|
||
|
||
module.exports = function nodeRNG() {
|
||
return crypto.randomBytes(16);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 141:
|
||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var net = __webpack_require__(631);
|
||
var tls = __webpack_require__(16);
|
||
var http = __webpack_require__(605);
|
||
var https = __webpack_require__(211);
|
||
var events = __webpack_require__(614);
|
||
var assert = __webpack_require__(357);
|
||
var util = __webpack_require__(669);
|
||
|
||
|
||
exports.httpOverHttp = httpOverHttp;
|
||
exports.httpsOverHttp = httpsOverHttp;
|
||
exports.httpOverHttps = httpOverHttps;
|
||
exports.httpsOverHttps = httpsOverHttps;
|
||
|
||
|
||
function httpOverHttp(options) {
|
||
var agent = new TunnelingAgent(options);
|
||
agent.request = http.request;
|
||
return agent;
|
||
}
|
||
|
||
function httpsOverHttp(options) {
|
||
var agent = new TunnelingAgent(options);
|
||
agent.request = http.request;
|
||
agent.createSocket = createSecureSocket;
|
||
agent.defaultPort = 443;
|
||
return agent;
|
||
}
|
||
|
||
function httpOverHttps(options) {
|
||
var agent = new TunnelingAgent(options);
|
||
agent.request = https.request;
|
||
return agent;
|
||
}
|
||
|
||
function httpsOverHttps(options) {
|
||
var agent = new TunnelingAgent(options);
|
||
agent.request = https.request;
|
||
agent.createSocket = createSecureSocket;
|
||
agent.defaultPort = 443;
|
||
return agent;
|
||
}
|
||
|
||
|
||
function TunnelingAgent(options) {
|
||
var self = this;
|
||
self.options = options || {};
|
||
self.proxyOptions = self.options.proxy || {};
|
||
self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
|
||
self.requests = [];
|
||
self.sockets = [];
|
||
|
||
self.on('free', function onFree(socket, host, port, localAddress) {
|
||
var options = toOptions(host, port, localAddress);
|
||
for (var i = 0, len = self.requests.length; i < len; ++i) {
|
||
var pending = self.requests[i];
|
||
if (pending.host === options.host && pending.port === options.port) {
|
||
// Detect the request to connect same origin server,
|
||
// reuse the connection.
|
||
self.requests.splice(i, 1);
|
||
pending.request.onSocket(socket);
|
||
return;
|
||
}
|
||
}
|
||
socket.destroy();
|
||
self.removeSocket(socket);
|
||
});
|
||
}
|
||
util.inherits(TunnelingAgent, events.EventEmitter);
|
||
|
||
TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
|
||
var self = this;
|
||
var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
|
||
|
||
if (self.sockets.length >= this.maxSockets) {
|
||
// We are over limit so we'll add it to the queue.
|
||
self.requests.push(options);
|
||
return;
|
||
}
|
||
|
||
// If we are under maxSockets create a new one.
|
||
self.createSocket(options, function(socket) {
|
||
socket.on('free', onFree);
|
||
socket.on('close', onCloseOrRemove);
|
||
socket.on('agentRemove', onCloseOrRemove);
|
||
req.onSocket(socket);
|
||
|
||
function onFree() {
|
||
self.emit('free', socket, options);
|
||
}
|
||
|
||
function onCloseOrRemove(err) {
|
||
self.removeSocket(socket);
|
||
socket.removeListener('free', onFree);
|
||
socket.removeListener('close', onCloseOrRemove);
|
||
socket.removeListener('agentRemove', onCloseOrRemove);
|
||
}
|
||
});
|
||
};
|
||
|
||
TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
|
||
var self = this;
|
||
var placeholder = {};
|
||
self.sockets.push(placeholder);
|
||
|
||
var connectOptions = mergeOptions({}, self.proxyOptions, {
|
||
method: 'CONNECT',
|
||
path: options.host + ':' + options.port,
|
||
agent: false,
|
||
headers: {
|
||
host: options.host + ':' + options.port
|
||
}
|
||
});
|
||
if (options.localAddress) {
|
||
connectOptions.localAddress = options.localAddress;
|
||
}
|
||
if (connectOptions.proxyAuth) {
|
||
connectOptions.headers = connectOptions.headers || {};
|
||
connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
|
||
new Buffer(connectOptions.proxyAuth).toString('base64');
|
||
}
|
||
|
||
debug('making CONNECT request');
|
||
var connectReq = self.request(connectOptions);
|
||
connectReq.useChunkedEncodingByDefault = false; // for v0.6
|
||
connectReq.once('response', onResponse); // for v0.6
|
||
connectReq.once('upgrade', onUpgrade); // for v0.6
|
||
connectReq.once('connect', onConnect); // for v0.7 or later
|
||
connectReq.once('error', onError);
|
||
connectReq.end();
|
||
|
||
function onResponse(res) {
|
||
// Very hacky. This is necessary to avoid http-parser leaks.
|
||
res.upgrade = true;
|
||
}
|
||
|
||
function onUpgrade(res, socket, head) {
|
||
// Hacky.
|
||
process.nextTick(function() {
|
||
onConnect(res, socket, head);
|
||
});
|
||
}
|
||
|
||
function onConnect(res, socket, head) {
|
||
connectReq.removeAllListeners();
|
||
socket.removeAllListeners();
|
||
|
||
if (res.statusCode !== 200) {
|
||
debug('tunneling socket could not be established, statusCode=%d',
|
||
res.statusCode);
|
||
socket.destroy();
|
||
var error = new Error('tunneling socket could not be established, ' +
|
||
'statusCode=' + res.statusCode);
|
||
error.code = 'ECONNRESET';
|
||
options.request.emit('error', error);
|
||
self.removeSocket(placeholder);
|
||
return;
|
||
}
|
||
if (head.length > 0) {
|
||
debug('got illegal response body from proxy');
|
||
socket.destroy();
|
||
var error = new Error('got illegal response body from proxy');
|
||
error.code = 'ECONNRESET';
|
||
options.request.emit('error', error);
|
||
self.removeSocket(placeholder);
|
||
return;
|
||
}
|
||
debug('tunneling connection has established');
|
||
self.sockets[self.sockets.indexOf(placeholder)] = socket;
|
||
return cb(socket);
|
||
}
|
||
|
||
function onError(cause) {
|
||
connectReq.removeAllListeners();
|
||
|
||
debug('tunneling socket could not be established, cause=%s\n',
|
||
cause.message, cause.stack);
|
||
var error = new Error('tunneling socket could not be established, ' +
|
||
'cause=' + cause.message);
|
||
error.code = 'ECONNRESET';
|
||
options.request.emit('error', error);
|
||
self.removeSocket(placeholder);
|
||
}
|
||
};
|
||
|
||
TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
|
||
var pos = this.sockets.indexOf(socket)
|
||
if (pos === -1) {
|
||
return;
|
||
}
|
||
this.sockets.splice(pos, 1);
|
||
|
||
var pending = this.requests.shift();
|
||
if (pending) {
|
||
// If we have pending requests and a socket gets closed a new one
|
||
// needs to be created to take over in the pool for the one that closed.
|
||
this.createSocket(pending, function(socket) {
|
||
pending.request.onSocket(socket);
|
||
});
|
||
}
|
||
};
|
||
|
||
function createSecureSocket(options, cb) {
|
||
var self = this;
|
||
TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
|
||
var hostHeader = options.request.getHeader('host');
|
||
var tlsOptions = mergeOptions({}, self.options, {
|
||
socket: socket,
|
||
servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
|
||
});
|
||
|
||
// 0 is dummy port for v0.6
|
||
var secureSocket = tls.connect(0, tlsOptions);
|
||
self.sockets[self.sockets.indexOf(socket)] = secureSocket;
|
||
cb(secureSocket);
|
||
});
|
||
}
|
||
|
||
|
||
function toOptions(host, port, localAddress) {
|
||
if (typeof host === 'string') { // since v0.10
|
||
return {
|
||
host: host,
|
||
port: port,
|
||
localAddress: localAddress
|
||
};
|
||
}
|
||
return host; // for v0.11 or later
|
||
}
|
||
|
||
function mergeOptions(target) {
|
||
for (var i = 1, len = arguments.length; i < len; ++i) {
|
||
var overrides = arguments[i];
|
||
if (typeof overrides === 'object') {
|
||
var keys = Object.keys(overrides);
|
||
for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
|
||
var k = keys[j];
|
||
if (overrides[k] !== undefined) {
|
||
target[k] = overrides[k];
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return target;
|
||
}
|
||
|
||
|
||
var debug;
|
||
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
|
||
debug = function() {
|
||
var args = Array.prototype.slice.call(arguments);
|
||
if (typeof args[0] === 'string') {
|
||
args[0] = 'TUNNEL: ' + args[0];
|
||
} else {
|
||
args.unshift('TUNNEL:');
|
||
}
|
||
console.error.apply(console, args);
|
||
}
|
||
} else {
|
||
debug = function() {};
|
||
}
|
||
exports.debug = debug; // for test
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 143:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
module.exports = withAuthorizationPrefix;
|
||
|
||
const atob = __webpack_require__(368);
|
||
|
||
const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
|
||
|
||
function withAuthorizationPrefix(authorization) {
|
||
if (/^(basic|bearer|token) /i.test(authorization)) {
|
||
return authorization;
|
||
}
|
||
|
||
try {
|
||
if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
|
||
return `basic ${authorization}`;
|
||
}
|
||
} catch (error) {}
|
||
|
||
if (authorization.split(/\./).length === 3) {
|
||
return `bearer ${authorization}`;
|
||
}
|
||
|
||
return `token ${authorization}`;
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 145:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
const pump = __webpack_require__(453);
|
||
const bufferStream = __webpack_require__(966);
|
||
|
||
class MaxBufferError extends Error {
|
||
constructor() {
|
||
super('maxBuffer exceeded');
|
||
this.name = 'MaxBufferError';
|
||
}
|
||
}
|
||
|
||
function getStream(inputStream, options) {
|
||
if (!inputStream) {
|
||
return Promise.reject(new Error('Expected a stream'));
|
||
}
|
||
|
||
options = Object.assign({maxBuffer: Infinity}, options);
|
||
|
||
const {maxBuffer} = options;
|
||
|
||
let stream;
|
||
return new Promise((resolve, reject) => {
|
||
const rejectPromise = error => {
|
||
if (error) { // A null check
|
||
error.bufferedData = stream.getBufferedValue();
|
||
}
|
||
reject(error);
|
||
};
|
||
|
||
stream = pump(inputStream, bufferStream(options), error => {
|
||
if (error) {
|
||
rejectPromise(error);
|
||
return;
|
||
}
|
||
|
||
resolve();
|
||
});
|
||
|
||
stream.on('data', () => {
|
||
if (stream.getBufferedLength() > maxBuffer) {
|
||
rejectPromise(new MaxBufferError());
|
||
}
|
||
});
|
||
}).then(() => stream.getBufferedValue());
|
||
}
|
||
|
||
module.exports = getStream;
|
||
module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
|
||
module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
|
||
module.exports.MaxBufferError = MaxBufferError;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 148:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
module.exports = paginatePlugin;
|
||
|
||
const { paginateRest } = __webpack_require__(299);
|
||
|
||
function paginatePlugin(octokit) {
|
||
Object.assign(octokit, paginateRest(octokit));
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 149:
|
||
/***/ (function(module) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var conversions = {};
|
||
module.exports = conversions;
|
||
|
||
function sign(x) {
|
||
return x < 0 ? -1 : 1;
|
||
}
|
||
|
||
function evenRound(x) {
|
||
// Round x to the nearest integer, choosing the even integer if it lies halfway between two.
|
||
if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)
|
||
return Math.floor(x);
|
||
} else {
|
||
return Math.round(x);
|
||
}
|
||
}
|
||
|
||
function createNumberConversion(bitLength, typeOpts) {
|
||
if (!typeOpts.unsigned) {
|
||
--bitLength;
|
||
}
|
||
const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);
|
||
const upperBound = Math.pow(2, bitLength) - 1;
|
||
|
||
const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);
|
||
const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);
|
||
|
||
return function(V, opts) {
|
||
if (!opts) opts = {};
|
||
|
||
let x = +V;
|
||
|
||
if (opts.enforceRange) {
|
||
if (!Number.isFinite(x)) {
|
||
throw new TypeError("Argument is not a finite number");
|
||
}
|
||
|
||
x = sign(x) * Math.floor(Math.abs(x));
|
||
if (x < lowerBound || x > upperBound) {
|
||
throw new TypeError("Argument is not in byte range");
|
||
}
|
||
|
||
return x;
|
||
}
|
||
|
||
if (!isNaN(x) && opts.clamp) {
|
||
x = evenRound(x);
|
||
|
||
if (x < lowerBound) x = lowerBound;
|
||
if (x > upperBound) x = upperBound;
|
||
return x;
|
||
}
|
||
|
||
if (!Number.isFinite(x) || x === 0) {
|
||
return 0;
|
||
}
|
||
|
||
x = sign(x) * Math.floor(Math.abs(x));
|
||
x = x % moduloVal;
|
||
|
||
if (!typeOpts.unsigned && x >= moduloBound) {
|
||
return x - moduloVal;
|
||
} else if (typeOpts.unsigned) {
|
||
if (x < 0) {
|
||
x += moduloVal;
|
||
} else if (x === -0) { // don't return negative zero
|
||
return 0;
|
||
}
|
||
}
|
||
|
||
return x;
|
||
}
|
||
}
|
||
|
||
conversions["void"] = function () {
|
||
return undefined;
|
||
};
|
||
|
||
conversions["boolean"] = function (val) {
|
||
return !!val;
|
||
};
|
||
|
||
conversions["byte"] = createNumberConversion(8, { unsigned: false });
|
||
conversions["octet"] = createNumberConversion(8, { unsigned: true });
|
||
|
||
conversions["short"] = createNumberConversion(16, { unsigned: false });
|
||
conversions["unsigned short"] = createNumberConversion(16, { unsigned: true });
|
||
|
||
conversions["long"] = createNumberConversion(32, { unsigned: false });
|
||
conversions["unsigned long"] = createNumberConversion(32, { unsigned: true });
|
||
|
||
conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });
|
||
conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });
|
||
|
||
conversions["double"] = function (V) {
|
||
const x = +V;
|
||
|
||
if (!Number.isFinite(x)) {
|
||
throw new TypeError("Argument is not a finite floating-point value");
|
||
}
|
||
|
||
return x;
|
||
};
|
||
|
||
conversions["unrestricted double"] = function (V) {
|
||
const x = +V;
|
||
|
||
if (isNaN(x)) {
|
||
throw new TypeError("Argument is NaN");
|
||
}
|
||
|
||
return x;
|
||
};
|
||
|
||
// not quite valid, but good enough for JS
|
||
conversions["float"] = conversions["double"];
|
||
conversions["unrestricted float"] = conversions["unrestricted double"];
|
||
|
||
conversions["DOMString"] = function (V, opts) {
|
||
if (!opts) opts = {};
|
||
|
||
if (opts.treatNullAsEmptyString && V === null) {
|
||
return "";
|
||
}
|
||
|
||
return String(V);
|
||
};
|
||
|
||
conversions["ByteString"] = function (V, opts) {
|
||
const x = String(V);
|
||
let c = undefined;
|
||
for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {
|
||
if (c > 255) {
|
||
throw new TypeError("Argument is not a valid bytestring");
|
||
}
|
||
}
|
||
|
||
return x;
|
||
};
|
||
|
||
conversions["USVString"] = function (V) {
|
||
const S = String(V);
|
||
const n = S.length;
|
||
const U = [];
|
||
for (let i = 0; i < n; ++i) {
|
||
const c = S.charCodeAt(i);
|
||
if (c < 0xD800 || c > 0xDFFF) {
|
||
U.push(String.fromCodePoint(c));
|
||
} else if (0xDC00 <= c && c <= 0xDFFF) {
|
||
U.push(String.fromCodePoint(0xFFFD));
|
||
} else {
|
||
if (i === n - 1) {
|
||
U.push(String.fromCodePoint(0xFFFD));
|
||
} else {
|
||
const d = S.charCodeAt(i + 1);
|
||
if (0xDC00 <= d && d <= 0xDFFF) {
|
||
const a = c & 0x3FF;
|
||
const b = d & 0x3FF;
|
||
U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));
|
||
++i;
|
||
} else {
|
||
U.push(String.fromCodePoint(0xFFFD));
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
return U.join('');
|
||
};
|
||
|
||
conversions["Date"] = function (V, opts) {
|
||
if (!(V instanceof Date)) {
|
||
throw new TypeError("Argument is not a Date object");
|
||
}
|
||
if (isNaN(V)) {
|
||
return undefined;
|
||
}
|
||
|
||
return V;
|
||
};
|
||
|
||
conversions["RegExp"] = function (V, opts) {
|
||
if (!(V instanceof RegExp)) {
|
||
V = new RegExp(V);
|
||
}
|
||
|
||
return V;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 153:
|
||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||
}) : (function(o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
o[k2] = m[k];
|
||
}));
|
||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||
}) : function(o, v) {
|
||
o["default"] = v;
|
||
});
|
||
var __importStar = (this && this.__importStar) || function (mod) {
|
||
if (mod && mod.__esModule) return mod;
|
||
var result = {};
|
||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||
__setModuleDefault(result, mod);
|
||
return result;
|
||
};
|
||
Object.defineProperty(exports, "__esModule", { value: true });
|
||
exports.setSafeDirectory = exports.setSshKnownHostsPath = exports.setSshKeyPath = exports.setRepositoryPath = exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
|
||
const core = __importStar(__webpack_require__(470));
|
||
/**
|
||
* Indicates whether the POST action is running
|
||
*/
|
||
exports.IsPost = !!core.getState('isPost');
|
||
/**
|
||
* The repository path for the POST action. The value is empty during the MAIN action.
|
||
*/
|
||
exports.RepositoryPath = core.getState('repositoryPath');
|
||
/**
|
||
* The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
|
||
*/
|
||
exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
|
||
/**
|
||
* The SSH key path for the POST action. The value is empty during the MAIN action.
|
||
*/
|
||
exports.SshKeyPath = core.getState('sshKeyPath');
|
||
/**
|
||
* The SSH known hosts path for the POST action. The value is empty during the MAIN action.
|
||
*/
|
||
exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
|
||
/**
|
||
* Save the repository path so the POST action can retrieve the value.
|
||
*/
|
||
function setRepositoryPath(repositoryPath) {
|
||
core.saveState('repositoryPath', repositoryPath);
|
||
}
|
||
exports.setRepositoryPath = setRepositoryPath;
|
||
/**
|
||
* Save the SSH key path so the POST action can retrieve the value.
|
||
*/
|
||
function setSshKeyPath(sshKeyPath) {
|
||
core.saveState('sshKeyPath', sshKeyPath);
|
||
}
|
||
exports.setSshKeyPath = setSshKeyPath;
|
||
/**
|
||
* Save the SSH known hosts path so the POST action can retrieve the value.
|
||
*/
|
||
function setSshKnownHostsPath(sshKnownHostsPath) {
|
||
core.saveState('sshKnownHostsPath', sshKnownHostsPath);
|
||
}
|
||
exports.setSshKnownHostsPath = setSshKnownHostsPath;
|
||
/**
|
||
* Save the sef-safe-directory input so the POST action can retrieve the value.
|
||
*/
|
||
function setSafeDirectory() {
|
||
core.saveState('setSafeDirectory', 'true');
|
||
}
|
||
exports.setSafeDirectory = setSafeDirectory;
|
||
// Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
|
||
// This is necessary since we don't have a separate entry point.
|
||
if (!exports.IsPost) {
|
||
core.saveState('isPost', 'true');
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 168:
|
||
/***/ (function(module) {
|
||
|
||
"use strict";
|
||
|
||
const alias = ['stdin', 'stdout', 'stderr'];
|
||
|
||
const hasAlias = opts => alias.some(x => Boolean(opts[x]));
|
||
|
||
module.exports = opts => {
|
||
if (!opts) {
|
||
return null;
|
||
}
|
||
|
||
if (opts.stdio && hasAlias(opts)) {
|
||
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
|
||
}
|
||
|
||
if (typeof opts.stdio === 'string') {
|
||
return opts.stdio;
|
||
}
|
||
|
||
const stdio = opts.stdio || [];
|
||
|
||
if (!Array.isArray(stdio)) {
|
||
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
||
}
|
||
|
||
const result = [];
|
||
const len = Math.max(stdio.length, alias.length);
|
||
|
||
for (let i = 0; i < len; i++) {
|
||
let value = null;
|
||
|
||
if (stdio[i] !== undefined) {
|
||
value = stdio[i];
|
||
} else if (opts[alias[i]] !== undefined) {
|
||
value = opts[alias[i]];
|
||
}
|
||
|
||
result[i] = value;
|
||
}
|
||
|
||
return result;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 174:
|
||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var bind = __webpack_require__(739);
|
||
|
||
module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 179:
|
||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var net = __webpack_require__(631);
|
||
var tls = __webpack_require__(16);
|
||
var http = __webpack_require__(605);
|
||
var https = __webpack_require__(211);
|
||
var events = __webpack_require__(614);
|
||
var assert = __webpack_require__(357);
|
||
var util = __webpack_require__(669);
|
||
|
||
|
||
exports.httpOverHttp = httpOverHttp;
|
||
exports.httpsOverHttp = httpsOverHttp;
|
||
exports.httpOverHttps = httpOverHttps;
|
||
exports.httpsOverHttps = httpsOverHttps;
|
||
|
||
|
||
function httpOverHttp(options) {
|
||
var agent = new TunnelingAgent(options);
|
||
agent.request = http.request;
|
||
return agent;
|
||
}
|
||
|
||
function httpsOverHttp(options) {
|
||
var agent = new TunnelingAgent(options);
|
||
agent.request = http.request;
|
||
agent.createSocket = createSecureSocket;
|
||
agent.defaultPort = 443;
|
||
return agent;
|
||
}
|
||
|
||
function httpOverHttps(options) {
|
||
var agent = new TunnelingAgent(options);
|
||
agent.request = https.request;
|
||
return agent;
|
||
}
|
||
|
||
function httpsOverHttps(options) {
|
||
var agent = new TunnelingAgent(options);
|
||
agent.request = https.request;
|
||
agent.createSocket = createSecureSocket;
|
||
agent.defaultPort = 443;
|
||
return agent;
|
||
}
|
||
|
||
|
||
function TunnelingAgent(options) {
|
||
var self = this;
|
||
self.options = options || {};
|
||
self.proxyOptions = self.options.proxy || {};
|
||
self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
|
||
self.requests = [];
|
||
self.sockets = [];
|
||
|
||
self.on('free', function onFree(socket, host, port, localAddress) {
|
||
var options = toOptions(host, port, localAddress);
|
||
for (var i = 0, len = self.requests.length; i < len; ++i) {
|
||
var pending = self.requests[i];
|
||
if (pending.host === options.host && pending.port === options.port) {
|
||
// Detect the request to connect same origin server,
|
||
// reuse the connection.
|
||
self.requests.splice(i, 1);
|
||
pending.request.onSocket(socket);
|
||
return;
|
||
}
|
||
}
|
||
socket.destroy();
|
||
self.removeSocket(socket);
|
||
});
|
||
}
|
||
util.inherits(TunnelingAgent, events.EventEmitter);
|
||
|
||
TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
|
||
var self = this;
|
||
var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
|
||
|
||
if (self.sockets.length >= this.maxSockets) {
|
||
// We are over limit so we'll add it to the queue.
|
||
self.requests.push(options);
|
||
return;
|
||
}
|
||
| < |