Skip to content

Commit 751ffc4

Browse files
committed
update dependencies
1 parent bbcd910 commit 751ffc4

File tree

3 files changed

+712
-697
lines changed

3 files changed

+712
-697
lines changed

dist/index.js

+35-56
Original file line numberDiff line numberDiff line change
@@ -3449,6 +3449,10 @@ function checkBypass(reqUrl) {
34493449
if (!reqUrl.hostname) {
34503450
return false;
34513451
}
3452+
const reqHost = reqUrl.hostname;
3453+
if (isLoopbackAddress(reqHost)) {
3454+
return true;
3455+
}
34523456
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
34533457
if (!noProxy) {
34543458
return false;
@@ -3474,13 +3478,24 @@ function checkBypass(reqUrl) {
34743478
.split(',')
34753479
.map(x => x.trim().toUpperCase())
34763480
.filter(x => x)) {
3477-
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
3481+
if (upperNoProxyItem === '*' ||
3482+
upperReqHosts.some(x => x === upperNoProxyItem ||
3483+
x.endsWith(`.${upperNoProxyItem}`) ||
3484+
(upperNoProxyItem.startsWith('.') &&
3485+
x.endsWith(`${upperNoProxyItem}`)))) {
34783486
return true;
34793487
}
34803488
}
34813489
return false;
34823490
}
34833491
exports.checkBypass = checkBypass;
3492+
function isLoopbackAddress(host) {
3493+
const hostLower = host.toLowerCase();
3494+
return (hostLower === 'localhost' ||
3495+
hostLower.startsWith('127.') ||
3496+
hostLower.startsWith('[::1]') ||
3497+
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
3498+
}
34843499
//# sourceMappingURL=proxy.js.map
34853500

34863501
/***/ }),
@@ -3520,11 +3535,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
35203535
};
35213536
var _a;
35223537
Object.defineProperty(exports, "__esModule", ({ value: true }));
3523-
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;
3538+
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;
35243539
const fs = __importStar(__nccwpck_require__(7147));
35253540
const path = __importStar(__nccwpck_require__(1017));
3526-
_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;
3541+
_a = fs.promises
3542+
// export const {open} = 'fs'
3543+
, 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;
3544+
// export const {open} = 'fs'
35273545
exports.IS_WINDOWS = process.platform === 'win32';
3546+
// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
3547+
exports.UV_FS_O_EXLOCK = 0x10000000;
3548+
exports.READONLY = fs.constants.O_RDONLY;
35283549
function exists(fsPath) {
35293550
return __awaiter(this, void 0, void 0, function* () {
35303551
try {
@@ -3705,12 +3726,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
37053726
Object.defineProperty(exports, "__esModule", ({ value: true }));
37063727
exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
37073728
const assert_1 = __nccwpck_require__(9491);
3708-
const childProcess = __importStar(__nccwpck_require__(2081));
37093729
const path = __importStar(__nccwpck_require__(1017));
3710-
const util_1 = __nccwpck_require__(3837);
37113730
const ioUtil = __importStar(__nccwpck_require__(1962));
3712-
const exec = util_1.promisify(childProcess.exec);
3713-
const execFile = util_1.promisify(childProcess.execFile);
37143731
/**
37153732
* Copies a file or folder.
37163733
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
@@ -3791,61 +3808,23 @@ exports.mv = mv;
37913808
function rmRF(inputPath) {
37923809
return __awaiter(this, void 0, void 0, function* () {
37933810
if (ioUtil.IS_WINDOWS) {
3794-
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
3795-
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
37963811
// Check for invalid characters
37973812
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
37983813
if (/[*"<>|]/.test(inputPath)) {
37993814
throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
38003815
}
3801-
try {
3802-
const cmdPath = ioUtil.getCmdPath();
3803-
if (yield ioUtil.isDirectory(inputPath, true)) {
3804-
yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
3805-
env: { inputPath }
3806-
});
3807-
}
3808-
else {
3809-
yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
3810-
env: { inputPath }
3811-
});
3812-
}
3813-
}
3814-
catch (err) {
3815-
// if you try to delete a file that doesn't exist, desired result is achieved
3816-
// other errors are valid
3817-
if (err.code !== 'ENOENT')
3818-
throw err;
3819-
}
3820-
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
3821-
try {
3822-
yield ioUtil.unlink(inputPath);
3823-
}
3824-
catch (err) {
3825-
// if you try to delete a file that doesn't exist, desired result is achieved
3826-
// other errors are valid
3827-
if (err.code !== 'ENOENT')
3828-
throw err;
3829-
}
38303816
}
3831-
else {
3832-
let isDir = false;
3833-
try {
3834-
isDir = yield ioUtil.isDirectory(inputPath);
3835-
}
3836-
catch (err) {
3837-
// if you try to delete a file that doesn't exist, desired result is achieved
3838-
// other errors are valid
3839-
if (err.code !== 'ENOENT')
3840-
throw err;
3841-
return;
3842-
}
3843-
if (isDir) {
3844-
yield execFile(`rm`, [`-rf`, `${inputPath}`]);
3845-
}
3846-
else {
3847-
yield ioUtil.unlink(inputPath);
3848-
}
3817+
try {
3818+
// note if path does not exist, error is silent
3819+
yield ioUtil.rm(inputPath, {
3820+
force: true,
3821+
maxRetries: 3,
3822+
recursive: true,
3823+
retryDelay: 300
3824+
});
3825+
}
3826+
catch (err) {
3827+
throw new Error(`File was unable to be removed ${err}`);
38493828
}
38503829
});
38513830
}

0 commit comments

Comments
 (0)