Skip to content

Commit ee8e7c2

Browse files
committed
update packages
1 parent c20ab55 commit ee8e7c2

File tree

3 files changed

+2850
-2045
lines changed

3 files changed

+2850
-2045
lines changed

dist/index.js

Lines changed: 56 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,10 +2571,6 @@ function checkBypass(reqUrl) {
25712571
if (!reqUrl.hostname) {
25722572
return false;
25732573
}
2574-
const reqHost = reqUrl.hostname;
2575-
if (isLoopbackAddress(reqHost)) {
2576-
return true;
2577-
}
25782574
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
25792575
if (!noProxy) {
25802576
return false;
@@ -2600,24 +2596,13 @@ function checkBypass(reqUrl) {
26002596
.split(',')
26012597
.map(x => x.trim().toUpperCase())
26022598
.filter(x => x)) {
2603-
if (upperNoProxyItem === '*' ||
2604-
upperReqHosts.some(x => x === upperNoProxyItem ||
2605-
x.endsWith(`.${upperNoProxyItem}`) ||
2606-
(upperNoProxyItem.startsWith('.') &&
2607-
x.endsWith(`${upperNoProxyItem}`)))) {
2599+
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
26082600
return true;
26092601
}
26102602
}
26112603
return false;
26122604
}
26132605
exports.checkBypass = checkBypass;
2614-
function isLoopbackAddress(host) {
2615-
const hostLower = host.toLowerCase();
2616-
return (hostLower === 'localhost' ||
2617-
hostLower.startsWith('127.') ||
2618-
hostLower.startsWith('[::1]') ||
2619-
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
2620-
}
26212606
//# sourceMappingURL=proxy.js.map
26222607

26232608
/***/ }),
@@ -2657,17 +2642,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
26572642
};
26582643
var _a;
26592644
Object.defineProperty(exports, "__esModule", ({ value: true }));
2660-
exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
2645+
exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
26612646
const fs = __importStar(__nccwpck_require__(147));
26622647
const path = __importStar(__nccwpck_require__(17));
2663-
_a = fs.promises
2664-
// export const {open} = 'fs'
2665-
, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
2666-
// export const {open} = 'fs'
2648+
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
26672649
exports.IS_WINDOWS = process.platform === 'win32';
2668-
// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
2669-
exports.UV_FS_O_EXLOCK = 0x10000000;
2670-
exports.READONLY = fs.constants.O_RDONLY;
26712650
function exists(fsPath) {
26722651
return __awaiter(this, void 0, void 0, function* () {
26732652
try {
@@ -2848,8 +2827,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
28482827
Object.defineProperty(exports, "__esModule", ({ value: true }));
28492828
exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
28502829
const assert_1 = __nccwpck_require__(491);
2830+
const childProcess = __importStar(__nccwpck_require__(81));
28512831
const path = __importStar(__nccwpck_require__(17));
2832+
const util_1 = __nccwpck_require__(837);
28522833
const ioUtil = __importStar(__nccwpck_require__(962));
2834+
const exec = util_1.promisify(childProcess.exec);
2835+
const execFile = util_1.promisify(childProcess.execFile);
28532836
/**
28542837
* Copies a file or folder.
28552838
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
@@ -2930,23 +2913,61 @@ exports.mv = mv;
29302913
function rmRF(inputPath) {
29312914
return __awaiter(this, void 0, void 0, function* () {
29322915
if (ioUtil.IS_WINDOWS) {
2916+
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
2917+
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
29332918
// Check for invalid characters
29342919
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
29352920
if (/[*"<>|]/.test(inputPath)) {
29362921
throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
29372922
}
2923+
try {
2924+
const cmdPath = ioUtil.getCmdPath();
2925+
if (yield ioUtil.isDirectory(inputPath, true)) {
2926+
yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
2927+
env: { inputPath }
2928+
});
2929+
}
2930+
else {
2931+
yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
2932+
env: { inputPath }
2933+
});
2934+
}
2935+
}
2936+
catch (err) {
2937+
// if you try to delete a file that doesn't exist, desired result is achieved
2938+
// other errors are valid
2939+
if (err.code !== 'ENOENT')
2940+
throw err;
2941+
}
2942+
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
2943+
try {
2944+
yield ioUtil.unlink(inputPath);
2945+
}
2946+
catch (err) {
2947+
// if you try to delete a file that doesn't exist, desired result is achieved
2948+
// other errors are valid
2949+
if (err.code !== 'ENOENT')
2950+
throw err;
2951+
}
29382952
}
2939-
try {
2940-
// note if path does not exist, error is silent
2941-
yield ioUtil.rm(inputPath, {
2942-
force: true,
2943-
maxRetries: 3,
2944-
recursive: true,
2945-
retryDelay: 300
2946-
});
2947-
}
2948-
catch (err) {
2949-
throw new Error(`File was unable to be removed ${err}`);
2953+
else {
2954+
let isDir = false;
2955+
try {
2956+
isDir = yield ioUtil.isDirectory(inputPath);
2957+
}
2958+
catch (err) {
2959+
// if you try to delete a file that doesn't exist, desired result is achieved
2960+
// other errors are valid
2961+
if (err.code !== 'ENOENT')
2962+
throw err;
2963+
return;
2964+
}
2965+
if (isDir) {
2966+
yield execFile(`rm`, [`-rf`, `${inputPath}`]);
2967+
}
2968+
else {
2969+
yield ioUtil.unlink(inputPath);
2970+
}
29502971
}
29512972
});
29522973
}

0 commit comments

Comments
 (0)