@socketsecurity/lib 5.23.0 → 5.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/archives.js +4 -4
- package/dist/constants/socket.js +1 -1
- package/dist/debug.js +5 -5
- package/dist/dlx/manifest.js +18 -20
- package/dist/errors.js +2 -3
- package/dist/external/@npmcli/package-json/lib/read-package.js +3 -2
- package/dist/external/@npmcli/package-json.js +4125 -165
- package/dist/external/@npmcli/promise-spawn.js +3 -2
- package/dist/external/adm-zip.js +3 -2
- package/dist/external/debug.js +2 -1
- package/dist/external/external-pack.js +4 -3
- package/dist/external/fast-sort.js +2 -1
- package/dist/external/get-east-asian-width.js +3 -2
- package/dist/external/npm-pack.js +6965 -4075
- package/dist/external/p-map.js +6 -5
- package/dist/external/pico-pack.js +24 -23
- package/dist/external/supports-color.js +3 -1
- package/dist/external/tar-fs.js +9 -8
- package/dist/external/which.js +3 -2
- package/dist/external/yargs-parser.js +3 -2
- package/dist/fs.js +5 -4
- package/dist/git.js +3 -3
- package/dist/github.d.ts +3 -3
- package/dist/github.js +3 -3
- package/dist/http-request.d.ts +2 -2
- package/dist/json/edit.js +9 -9
- package/dist/json/parse.d.ts +2 -2
- package/dist/json/parse.js +2 -2
- package/dist/logger.js +5 -6
- package/dist/objects.js +28 -39
- package/dist/packages/edit.js +3 -3
- package/dist/packages/isolation.js +3 -3
- package/dist/primordials.d.ts +337 -0
- package/dist/primordials.js +828 -0
- package/dist/process-lock.js +11 -11
- package/dist/releases/github.js +4 -4
- package/dist/signal-exit.js +4 -4
- package/dist/spawn.d.ts +13 -13
- package/dist/stdio/stderr.d.ts +2 -2
- package/dist/suppress-warnings.js +2 -2
- package/package.json +12 -8
- package/dist/env/socket-cli-shadow.d.ts +0 -77
- package/dist/env/socket-cli-shadow.js +0 -59
package/dist/external/p-map.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const { NumberIsSafeInteger: _p_NumberIsSafeInteger, PromiseCtor: _p_PromiseCtor, TypeErrorCtor: _p_TypeErrorCtor } = require('../primordials.js')
|
|
1
2
|
"use strict";
|
|
2
3
|
/**
|
|
3
4
|
* Bundled from p-map
|
|
@@ -38,14 +39,14 @@ async function pMap(iterable, mapper, {
|
|
|
38
39
|
stopOnError = true,
|
|
39
40
|
signal
|
|
40
41
|
} = {}) {
|
|
41
|
-
return new
|
|
42
|
+
return new _p_PromiseCtor((resolve_, reject_) => {
|
|
42
43
|
if (iterable[Symbol.iterator] === void 0 && iterable[Symbol.asyncIterator] === void 0) {
|
|
43
|
-
throw new
|
|
44
|
+
throw new _p_TypeErrorCtor(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
|
44
45
|
}
|
|
45
46
|
if (typeof mapper !== "function") {
|
|
46
|
-
throw new
|
|
47
|
+
throw new _p_TypeErrorCtor("Mapper function is required");
|
|
47
48
|
}
|
|
48
|
-
if (!(
|
|
49
|
+
if (!(_p_NumberIsSafeInteger(concurrency) && concurrency >= 1 || concurrency === Number.POSITIVE_INFINITY)) {
|
|
49
50
|
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
|
50
51
|
}
|
|
51
52
|
const result = [];
|
|
@@ -158,7 +159,7 @@ function pMapIterable(iterable, mapper, {
|
|
|
158
159
|
backpressure = concurrency
|
|
159
160
|
} = {}) {
|
|
160
161
|
if (iterable[Symbol.iterator] === void 0 && iterable[Symbol.asyncIterator] === void 0) {
|
|
161
|
-
throw new
|
|
162
|
+
throw new _p_TypeErrorCtor(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
|
162
163
|
}
|
|
163
164
|
if (typeof mapper !== "function") {
|
|
164
165
|
throw new TypeError("Mapper function is required");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const { ArrayIsArray: _p_ArrayIsArray, NumberIsSafeInteger: _p_NumberIsSafeInteger, ObjectDefineProperty: _p_ObjectDefineProperty, PromiseCtor: _p_PromiseCtor, StringPrototypeStartsWith: _p_StringPrototypeStartsWith, TypeErrorCtor: _p_TypeErrorCtor } = require('../primordials.js')
|
|
1
2
|
"use strict";
|
|
2
3
|
/**
|
|
3
4
|
* Bundled from pico-pack
|
|
@@ -1792,8 +1793,8 @@ var require_picomatch2 = __commonJS({
|
|
|
1792
1793
|
|
|
1793
1794
|
// node_modules/.pnpm/@sindresorhus+merge-streams@2.3.0/node_modules/@sindresorhus/merge-streams/index.js
|
|
1794
1795
|
function mergeStreams(streams) {
|
|
1795
|
-
if (!
|
|
1796
|
-
throw new
|
|
1796
|
+
if (!_p_ArrayIsArray(streams)) {
|
|
1797
|
+
throw new _p_TypeErrorCtor(`Expected an array, got \`${typeof streams}\`.`);
|
|
1797
1798
|
}
|
|
1798
1799
|
for (const stream of streams) {
|
|
1799
1800
|
validateStream(stream);
|
|
@@ -2052,7 +2053,7 @@ var require_fs = __commonJS({
|
|
|
2052
2053
|
var require_path = __commonJS({
|
|
2053
2054
|
"node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js"(exports2) {
|
|
2054
2055
|
"use strict";
|
|
2055
|
-
|
|
2056
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
2056
2057
|
exports2.convertPosixPathToPattern = exports2.convertWindowsPathToPattern = exports2.convertPathToPattern = exports2.escapePosixPath = exports2.escapeWindowsPath = exports2.escape = exports2.removeLeadingDotSegment = exports2.makeAbsolute = exports2.unixify = void 0;
|
|
2057
2058
|
var os = require("os");
|
|
2058
2059
|
var path6 = require("path");
|
|
@@ -2421,7 +2422,7 @@ var require_to_regex_range = __commonJS({
|
|
|
2421
2422
|
var isNumber = require_is_number();
|
|
2422
2423
|
var toRegexRange = /* @__PURE__ */ __name((min, max, options) => {
|
|
2423
2424
|
if (isNumber(min) === false) {
|
|
2424
|
-
throw new
|
|
2425
|
+
throw new _p_TypeErrorCtor("toRegexRange: expected the first argument to be a number");
|
|
2425
2426
|
}
|
|
2426
2427
|
if (max === void 0 || min === max) {
|
|
2427
2428
|
return String(min);
|
|
@@ -3546,7 +3547,7 @@ var require_micromatch = __commonJS({
|
|
|
3546
3547
|
var require_pattern = __commonJS({
|
|
3547
3548
|
"node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/pattern.js"(exports2) {
|
|
3548
3549
|
"use strict";
|
|
3549
|
-
|
|
3550
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
3550
3551
|
exports2.isAbsolute = exports2.partitionAbsoluteAndRelative = exports2.removeDuplicateSlashes = exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;
|
|
3551
3552
|
var path6 = require("path");
|
|
3552
3553
|
var globParent = require_glob_parent();
|
|
@@ -3908,7 +3909,7 @@ var require_string = __commonJS({
|
|
|
3908
3909
|
var require_utils3 = __commonJS({
|
|
3909
3910
|
"node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/index.js"(exports2) {
|
|
3910
3911
|
"use strict";
|
|
3911
|
-
|
|
3912
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
3912
3913
|
exports2.string = exports2.stream = exports2.pattern = exports2.path = exports2.fs = exports2.errno = exports2.array = void 0;
|
|
3913
3914
|
var array = require_array();
|
|
3914
3915
|
exports2.array = array;
|
|
@@ -3931,7 +3932,7 @@ var require_utils3 = __commonJS({
|
|
|
3931
3932
|
var require_tasks = __commonJS({
|
|
3932
3933
|
"node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/managers/tasks.js"(exports2) {
|
|
3933
3934
|
"use strict";
|
|
3934
|
-
|
|
3935
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
3935
3936
|
exports2.convertPatternGroupToTask = exports2.convertPatternGroupsToTasks = exports2.groupPatternsByBaseDirectory = exports2.getNegativePatternsAsPositive = exports2.getPositivePatterns = exports2.convertPatternsToTasks = exports2.generate = void 0;
|
|
3936
3937
|
var utils = require_utils3();
|
|
3937
3938
|
function generate(input, settings) {
|
|
@@ -4158,7 +4159,7 @@ var require_settings = __commonJS({
|
|
|
4158
4159
|
var require_out = __commonJS({
|
|
4159
4160
|
"node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.js"(exports2) {
|
|
4160
4161
|
"use strict";
|
|
4161
|
-
|
|
4162
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
4162
4163
|
exports2.statSync = exports2.stat = exports2.Settings = void 0;
|
|
4163
4164
|
var async = require_async();
|
|
4164
4165
|
var sync = require_sync();
|
|
@@ -4257,7 +4258,7 @@ var require_run_parallel = __commonJS({
|
|
|
4257
4258
|
var require_constants3 = __commonJS({
|
|
4258
4259
|
"node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js"(exports2) {
|
|
4259
4260
|
"use strict";
|
|
4260
|
-
|
|
4261
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
4261
4262
|
exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
|
|
4262
4263
|
var NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
|
|
4263
4264
|
if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) {
|
|
@@ -4334,7 +4335,7 @@ var require_common = __commonJS({
|
|
|
4334
4335
|
var require_async2 = __commonJS({
|
|
4335
4336
|
"node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports2) {
|
|
4336
4337
|
"use strict";
|
|
4337
|
-
|
|
4338
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
4338
4339
|
exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
|
|
4339
4340
|
var fsStat = require_out();
|
|
4340
4341
|
var rpl = require_run_parallel();
|
|
@@ -4450,7 +4451,7 @@ var require_async2 = __commonJS({
|
|
|
4450
4451
|
var require_sync2 = __commonJS({
|
|
4451
4452
|
"node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports2) {
|
|
4452
4453
|
"use strict";
|
|
4453
|
-
|
|
4454
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
4454
4455
|
exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
|
|
4455
4456
|
var fsStat = require_out();
|
|
4456
4457
|
var constants_1 = require_constants3();
|
|
@@ -4571,7 +4572,7 @@ var require_settings2 = __commonJS({
|
|
|
4571
4572
|
var require_out2 = __commonJS({
|
|
4572
4573
|
"node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.js"(exports2) {
|
|
4573
4574
|
"use strict";
|
|
4574
|
-
|
|
4575
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
4575
4576
|
exports2.Settings = exports2.scandirSync = exports2.scandir = void 0;
|
|
4576
4577
|
var async = require_async2();
|
|
4577
4578
|
var sync = require_sync2();
|
|
@@ -4945,7 +4946,7 @@ var require_queue = __commonJS({
|
|
|
4945
4946
|
var require_common2 = __commonJS({
|
|
4946
4947
|
"node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.js"(exports2) {
|
|
4947
4948
|
"use strict";
|
|
4948
|
-
|
|
4949
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
4949
4950
|
exports2.joinPathSegments = exports2.replacePathSegmentSeparator = exports2.isAppliedFilter = exports2.isFatalError = void 0;
|
|
4950
4951
|
function isFatalError(settings, error) {
|
|
4951
4952
|
if (settings.errorFilter === null) {
|
|
@@ -5319,7 +5320,7 @@ var require_settings3 = __commonJS({
|
|
|
5319
5320
|
var require_out3 = __commonJS({
|
|
5320
5321
|
"node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.js"(exports2) {
|
|
5321
5322
|
"use strict";
|
|
5322
|
-
|
|
5323
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
5323
5324
|
exports2.Settings = exports2.walkStream = exports2.walkSync = exports2.walk = void 0;
|
|
5324
5325
|
var async_1 = require_async4();
|
|
5325
5326
|
var stream_1 = require_stream2();
|
|
@@ -6204,7 +6205,7 @@ var require_out4 = __commonJS({
|
|
|
6204
6205
|
// node_modules/.pnpm/path-type@6.0.0/node_modules/path-type/index.js
|
|
6205
6206
|
async function isType(fsStatType, statsMethodName, filePath) {
|
|
6206
6207
|
if (typeof filePath !== "string") {
|
|
6207
|
-
throw new
|
|
6208
|
+
throw new _p_TypeErrorCtor(`Expected a string, got ${typeof filePath}`);
|
|
6208
6209
|
}
|
|
6209
6210
|
try {
|
|
6210
6211
|
const stats = await import_promises2.default[fsStatType](filePath);
|
|
@@ -6218,7 +6219,7 @@ async function isType(fsStatType, statsMethodName, filePath) {
|
|
|
6218
6219
|
}
|
|
6219
6220
|
function isTypeSync(fsStatType, statsMethodName, filePath) {
|
|
6220
6221
|
if (typeof filePath !== "string") {
|
|
6221
|
-
throw new
|
|
6222
|
+
throw new _p_TypeErrorCtor(`Expected a string, got ${typeof filePath}`);
|
|
6222
6223
|
}
|
|
6223
6224
|
try {
|
|
6224
6225
|
return import_node_fs.default[fsStatType](filePath)[statsMethodName]();
|
|
@@ -6273,7 +6274,7 @@ var init_node = __esm({
|
|
|
6273
6274
|
var require_ignore = __commonJS({
|
|
6274
6275
|
"node_modules/.pnpm/ignore@7.0.5/node_modules/ignore/index.js"(exports2, module2) {
|
|
6275
6276
|
function makeArray(subject) {
|
|
6276
|
-
return
|
|
6277
|
+
return _p_ArrayIsArray(subject) ? subject : [subject];
|
|
6277
6278
|
}
|
|
6278
6279
|
__name(makeArray, "makeArray");
|
|
6279
6280
|
var UNDEFINED = void 0;
|
|
@@ -6738,7 +6739,7 @@ var require_ignore = __commonJS({
|
|
|
6738
6739
|
|
|
6739
6740
|
// node_modules/.pnpm/slash@5.1.0/node_modules/slash/index.js
|
|
6740
6741
|
function slash(path6) {
|
|
6741
|
-
const isExtendedLengthPath = path6
|
|
6742
|
+
const isExtendedLengthPath = _p_StringPrototypeStartsWith(path6, "\\\\?\\");
|
|
6742
6743
|
if (isExtendedLengthPath) {
|
|
6743
6744
|
return path6;
|
|
6744
6745
|
}
|
|
@@ -7091,14 +7092,14 @@ async function pMap(iterable, mapper, {
|
|
|
7091
7092
|
stopOnError = true,
|
|
7092
7093
|
signal
|
|
7093
7094
|
} = {}) {
|
|
7094
|
-
return new
|
|
7095
|
+
return new _p_PromiseCtor((resolve_, reject_) => {
|
|
7095
7096
|
if (iterable[Symbol.iterator] === void 0 && iterable[Symbol.asyncIterator] === void 0) {
|
|
7096
|
-
throw new
|
|
7097
|
+
throw new _p_TypeErrorCtor(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
|
7097
7098
|
}
|
|
7098
7099
|
if (typeof mapper !== "function") {
|
|
7099
|
-
throw new
|
|
7100
|
+
throw new _p_TypeErrorCtor("Mapper function is required");
|
|
7100
7101
|
}
|
|
7101
|
-
if (!(
|
|
7102
|
+
if (!(_p_NumberIsSafeInteger(concurrency) && concurrency >= 1 || concurrency === Number.POSITIVE_INFINITY)) {
|
|
7102
7103
|
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
|
7103
7104
|
}
|
|
7104
7105
|
const result = [];
|
|
@@ -7257,7 +7258,7 @@ function safeCheck(file, cwd) {
|
|
|
7257
7258
|
}
|
|
7258
7259
|
}
|
|
7259
7260
|
function normalizePatterns(patterns) {
|
|
7260
|
-
patterns =
|
|
7261
|
+
patterns = _p_ArrayIsArray(patterns) ? patterns : [patterns];
|
|
7261
7262
|
patterns = patterns.map((pattern) => {
|
|
7262
7263
|
if (import_node_process4.default.platform === "win32" && (0, import_is_glob.default)(pattern) === false) {
|
|
7263
7264
|
return slash(pattern);
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
// Re-export from external-pack bundle for better deduplication.
|
|
4
4
|
const { supportsColor } = require('./external-pack')
|
|
5
|
+
const { ObjectAssign: _p_ObjectAssign } = require('../primordials.js')
|
|
6
|
+
|
|
5
7
|
// supports-color is an ESM module, re-export all properties.
|
|
6
8
|
const exported = supportsColor.default || supportsColor
|
|
7
|
-
|
|
9
|
+
_p_ObjectAssign(module.exports, exported)
|
|
8
10
|
module.exports.default = exported
|
package/dist/external/tar-fs.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const { BufferAlloc: _p_BufferAlloc, BufferAllocUnsafe: _p_BufferAllocUnsafe, BufferAllocUnsafeSlow: _p_BufferAllocUnsafeSlow, BufferIsBuffer: _p_BufferIsBuffer, BufferIsEncoding: _p_BufferIsEncoding, ErrorCtor: _p_ErrorCtor } = require('../primordials.js')
|
|
1
2
|
"use strict";
|
|
2
3
|
/**
|
|
3
4
|
* Bundled from tar-fs
|
|
@@ -26,7 +27,7 @@ var require_fixed_size = __commonJS({
|
|
|
26
27
|
__name(this, "FixedFIFO");
|
|
27
28
|
}
|
|
28
29
|
constructor(hwm) {
|
|
29
|
-
if (!(hwm > 0) || (hwm - 1 & hwm) !== 0) throw new
|
|
30
|
+
if (!(hwm > 0) || (hwm - 1 & hwm) !== 0) throw new _p_ErrorCtor("Max size for a FixedFIFO should be a power of two");
|
|
30
31
|
this.buffer = new Array(hwm);
|
|
31
32
|
this.mask = hwm - 1;
|
|
32
33
|
this.top = 0;
|
|
@@ -115,23 +116,23 @@ var require_fast_fifo = __commonJS({
|
|
|
115
116
|
var require_b4a = __commonJS({
|
|
116
117
|
"node_modules/.pnpm/b4a@1.8.0/node_modules/b4a/index.js"(exports2, module2) {
|
|
117
118
|
function isBuffer(value) {
|
|
118
|
-
return
|
|
119
|
+
return _p_BufferIsBuffer(value) || value instanceof Uint8Array;
|
|
119
120
|
}
|
|
120
121
|
__name(isBuffer, "isBuffer");
|
|
121
122
|
function isEncoding(encoding) {
|
|
122
|
-
return
|
|
123
|
+
return _p_BufferIsEncoding(encoding);
|
|
123
124
|
}
|
|
124
125
|
__name(isEncoding, "isEncoding");
|
|
125
126
|
function alloc(size, fill2, encoding) {
|
|
126
|
-
return
|
|
127
|
+
return _p_BufferAlloc(size, fill2, encoding);
|
|
127
128
|
}
|
|
128
129
|
__name(alloc, "alloc");
|
|
129
130
|
function allocUnsafe(size) {
|
|
130
|
-
return
|
|
131
|
+
return _p_BufferAllocUnsafe(size);
|
|
131
132
|
}
|
|
132
133
|
__name(allocUnsafe, "allocUnsafe");
|
|
133
134
|
function allocUnsafeSlow(size) {
|
|
134
|
-
return
|
|
135
|
+
return _p_BufferAllocUnsafeSlow(size);
|
|
135
136
|
}
|
|
136
137
|
__name(allocUnsafeSlow, "allocUnsafeSlow");
|
|
137
138
|
function byteLength(string, encoding) {
|
|
@@ -551,8 +552,8 @@ var require_text_decoder = __commonJS({
|
|
|
551
552
|
var require_streamx = __commonJS({
|
|
552
553
|
"node_modules/.pnpm/streamx@2.25.0/node_modules/streamx/index.js"(exports2, module2) {
|
|
553
554
|
var { EventEmitter } = require_default();
|
|
554
|
-
var STREAM_DESTROYED = new
|
|
555
|
-
var PREMATURE_CLOSE = new
|
|
555
|
+
var STREAM_DESTROYED = new _p_ErrorCtor("Stream was destroyed");
|
|
556
|
+
var PREMATURE_CLOSE = new _p_ErrorCtor("Premature close");
|
|
556
557
|
var FIFO = require_fast_fifo();
|
|
557
558
|
var TextDecoder = require_text_decoder();
|
|
558
559
|
var qmt = typeof queueMicrotask === "undefined" ? (fn) => global.process.nextTick(fn) : queueMicrotask;
|
package/dist/external/which.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const { ObjectDefineProperty: _p_ObjectDefineProperty } = require('../primordials.js')
|
|
1
2
|
"use strict";
|
|
2
3
|
/**
|
|
3
4
|
* Bundled from which
|
|
@@ -15,7 +16,7 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
15
16
|
var require_posix = __commonJS({
|
|
16
17
|
"node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/posix.js"(exports2) {
|
|
17
18
|
"use strict";
|
|
18
|
-
|
|
19
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
19
20
|
exports2.sync = exports2.isexe = void 0;
|
|
20
21
|
var fs_1 = require("fs");
|
|
21
22
|
var promises_1 = require("fs/promises");
|
|
@@ -68,7 +69,7 @@ var require_posix = __commonJS({
|
|
|
68
69
|
var require_win32 = __commonJS({
|
|
69
70
|
"node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/win32.js"(exports2) {
|
|
70
71
|
"use strict";
|
|
71
|
-
|
|
72
|
+
_p_ObjectDefineProperty(exports2, "__esModule", { value: true });
|
|
72
73
|
exports2.sync = exports2.isexe = void 0;
|
|
73
74
|
var fs_1 = require("fs");
|
|
74
75
|
var promises_1 = require("fs/promises");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const { ArrayIsArray: _p_ArrayIsArray, ObjectCreate: _p_ObjectCreate } = require('../primordials.js')
|
|
1
2
|
"use strict";
|
|
2
3
|
/**
|
|
3
4
|
* Bundled from yargs-parser
|
|
@@ -89,7 +90,7 @@ var init_string_utils = __esm({
|
|
|
89
90
|
|
|
90
91
|
// node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
|
|
91
92
|
function tokenizeArgString(argString) {
|
|
92
|
-
if (
|
|
93
|
+
if (_p_ArrayIsArray(argString)) {
|
|
93
94
|
return argString.map((e) => typeof e !== "string" ? e + "" : e);
|
|
94
95
|
}
|
|
95
96
|
argString = argString.trim();
|
|
@@ -140,7 +141,7 @@ var init_yargs_parser_types = __esm({
|
|
|
140
141
|
// node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/yargs-parser.js
|
|
141
142
|
function combineAliases(aliases) {
|
|
142
143
|
const aliasArrays = [];
|
|
143
|
-
const combined = /* @__PURE__ */
|
|
144
|
+
const combined = /* @__PURE__ */ _p_ObjectCreate(null);
|
|
144
145
|
let change = true;
|
|
145
146
|
Object.keys(aliases).forEach(function(key) {
|
|
146
147
|
aliasArrays.push([].concat(aliases[key], key));
|
package/dist/fs.js
CHANGED
|
@@ -64,6 +64,7 @@ module.exports = __toCommonJS(fs_exports);
|
|
|
64
64
|
var import_node_process = __toESM(require("node:process"));
|
|
65
65
|
var import_arrays = require("./arrays");
|
|
66
66
|
var import_process = require("./constants/process");
|
|
67
|
+
var import_errors = require("./errors");
|
|
67
68
|
var import_globs = require("./globs");
|
|
68
69
|
var import_parse = require("./json/parse");
|
|
69
70
|
var import_objects = require("./objects");
|
|
@@ -608,8 +609,8 @@ function safeDeleteSync(filepath, options) {
|
|
|
608
609
|
onlyFiles: false
|
|
609
610
|
});
|
|
610
611
|
return;
|
|
611
|
-
} catch (
|
|
612
|
-
lastError =
|
|
612
|
+
} catch (e) {
|
|
613
|
+
lastError = e;
|
|
613
614
|
if (attempt < maxRetries) {
|
|
614
615
|
const waitMs = delay;
|
|
615
616
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, waitMs);
|
|
@@ -627,7 +628,7 @@ async function safeMkdir(path, options) {
|
|
|
627
628
|
try {
|
|
628
629
|
await fs.promises.mkdir(path, opts);
|
|
629
630
|
} catch (e) {
|
|
630
|
-
if (
|
|
631
|
+
if (!(0, import_errors.isErrnoException)(e) || e.code !== "EEXIST") {
|
|
631
632
|
throw e;
|
|
632
633
|
}
|
|
633
634
|
}
|
|
@@ -638,7 +639,7 @@ function safeMkdirSync(path, options) {
|
|
|
638
639
|
try {
|
|
639
640
|
fs.mkdirSync(path, opts);
|
|
640
641
|
} catch (e) {
|
|
641
|
-
if (
|
|
642
|
+
if (!(0, import_errors.isErrnoException)(e) || e.code !== "EEXIST") {
|
|
642
643
|
throw e;
|
|
643
644
|
}
|
|
644
645
|
}
|
package/dist/git.js
CHANGED
|
@@ -91,10 +91,10 @@ function getCachedRealpath(pathname) {
|
|
|
91
91
|
let resolved;
|
|
92
92
|
try {
|
|
93
93
|
resolved = fs.realpathSync(pathname);
|
|
94
|
-
} catch (
|
|
95
|
-
const code =
|
|
94
|
+
} catch (e) {
|
|
95
|
+
const code = e.code;
|
|
96
96
|
if (code === "ENOENT" || code === "ENOTDIR") {
|
|
97
|
-
throw
|
|
97
|
+
throw e;
|
|
98
98
|
}
|
|
99
99
|
resolved = pathname;
|
|
100
100
|
}
|
package/dist/github.d.ts
CHANGED
|
@@ -344,9 +344,9 @@ export declare function fetchGhsaDetails(ghsaId: string, options?: GitHubFetchOp
|
|
|
344
344
|
* // Handle rate limit errors
|
|
345
345
|
* try {
|
|
346
346
|
* await fetchGitHub('https://api.github.com/repos/owner/repo')
|
|
347
|
-
* } catch (
|
|
348
|
-
* if (
|
|
349
|
-
* console.error(`Rate limited until ${
|
|
347
|
+
* } catch (e) {
|
|
348
|
+
* if (e.status === 403 && e.resetTime) {
|
|
349
|
+
* console.error(`Rate limited until ${e.resetTime}`)
|
|
350
350
|
* }
|
|
351
351
|
* }
|
|
352
352
|
* ```
|
package/dist/github.js
CHANGED
|
@@ -164,12 +164,12 @@ async function fetchGitHub(url, options) {
|
|
|
164
164
|
}
|
|
165
165
|
try {
|
|
166
166
|
return JSON.parse(response.body.toString("utf8"));
|
|
167
|
-
} catch (
|
|
167
|
+
} catch (e) {
|
|
168
168
|
throw new Error(
|
|
169
|
-
`Failed to parse GitHub API response: ${(0, import_errors.errorMessage)(
|
|
169
|
+
`Failed to parse GitHub API response: ${(0, import_errors.errorMessage)(e)}
|
|
170
170
|
URL: ${url}
|
|
171
171
|
Response may be malformed or incomplete.`,
|
|
172
|
-
{ cause:
|
|
172
|
+
{ cause: e }
|
|
173
173
|
);
|
|
174
174
|
}
|
|
175
175
|
}
|
package/dist/http-request.d.ts
CHANGED
|
@@ -674,8 +674,8 @@ export interface FetchChecksumsOptions {
|
|
|
674
674
|
* ```typescript
|
|
675
675
|
* try {
|
|
676
676
|
* await fetch('https://api.example.com')
|
|
677
|
-
* } catch (
|
|
678
|
-
* console.error(enrichErrorMessage('https://api.example.com', 'GET',
|
|
677
|
+
* } catch (e) {
|
|
678
|
+
* console.error(enrichErrorMessage('https://api.example.com', 'GET', e))
|
|
679
679
|
* }
|
|
680
680
|
* ```
|
|
681
681
|
*/
|
package/dist/json/edit.js
CHANGED
|
@@ -58,11 +58,11 @@ async function readFile(filepath) {
|
|
|
58
58
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
59
59
|
try {
|
|
60
60
|
return await fsPromises.readFile(filepath, "utf8");
|
|
61
|
-
} catch (
|
|
61
|
+
} catch (e) {
|
|
62
62
|
const isLastAttempt = attempt === maxRetries;
|
|
63
|
-
const isEnoent = (0, import_errors.isErrnoException)(
|
|
63
|
+
const isEnoent = (0, import_errors.isErrnoException)(e) && e.code === "ENOENT";
|
|
64
64
|
if (!isEnoent || isLastAttempt) {
|
|
65
|
-
throw
|
|
65
|
+
throw e;
|
|
66
66
|
}
|
|
67
67
|
const delay = import_node_process.default.platform === "win32" ? 50 * (attempt + 1) : 20;
|
|
68
68
|
await (0, import_promises.setTimeout)(delay);
|
|
@@ -91,11 +91,11 @@ async function retryWrite(filepath, content, retries = 3, baseDelay = 10) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
return;
|
|
94
|
-
} catch (
|
|
94
|
+
} catch (e) {
|
|
95
95
|
const isLastAttempt = attempt === retries;
|
|
96
|
-
const isRetriableError = (0, import_errors.isErrnoException)(
|
|
96
|
+
const isRetriableError = (0, import_errors.isErrnoException)(e) && (e.code === "EPERM" || e.code === "EBUSY" || e.code === "ENOENT");
|
|
97
97
|
if (!isRetriableError || isLastAttempt) {
|
|
98
|
-
throw
|
|
98
|
+
throw e;
|
|
99
99
|
}
|
|
100
100
|
const delay = baseDelay * 2 ** attempt;
|
|
101
101
|
await (0, import_promises.setTimeout)(delay);
|
|
@@ -168,11 +168,11 @@ function getEditableJsonClass() {
|
|
|
168
168
|
let parseErr;
|
|
169
169
|
try {
|
|
170
170
|
this._readFileContent = await readFile(this.filename);
|
|
171
|
-
} catch (
|
|
171
|
+
} catch (e) {
|
|
172
172
|
if (!create) {
|
|
173
|
-
throw
|
|
173
|
+
throw e;
|
|
174
174
|
}
|
|
175
|
-
parseErr =
|
|
175
|
+
parseErr = e;
|
|
176
176
|
}
|
|
177
177
|
if (parseErr) {
|
|
178
178
|
throw parseErr;
|
package/dist/json/parse.d.ts
CHANGED
|
@@ -56,8 +56,8 @@ export declare function isJsonPrimitive(value: unknown): value is JsonPrimitive;
|
|
|
56
56
|
* // Enhanced error messages with filepath
|
|
57
57
|
* try {
|
|
58
58
|
* jsonParse('invalid', { filepath: 'config.json' })
|
|
59
|
-
* } catch (
|
|
60
|
-
* console.error(
|
|
59
|
+
* } catch (e) {
|
|
60
|
+
* console.error(e.message)
|
|
61
61
|
* // => "config.json: Unexpected token i in JSON at position 0"
|
|
62
62
|
* }
|
|
63
63
|
*
|
package/dist/json/parse.js
CHANGED
|
@@ -93,8 +93,8 @@ function safeJsonParse(jsonString, schema, options = {}) {
|
|
|
93
93
|
let parsed;
|
|
94
94
|
try {
|
|
95
95
|
parsed = allowPrototype ? JSONParse(jsonString) : JSONParse(jsonString, prototypePollutionReviver);
|
|
96
|
-
} catch (
|
|
97
|
-
throw new Error(`Failed to parse JSON: ${
|
|
96
|
+
} catch (e) {
|
|
97
|
+
throw new Error(`Failed to parse JSON: ${e}`);
|
|
98
98
|
}
|
|
99
99
|
if (schema) {
|
|
100
100
|
const result = (0, import_validate.validateSchema)(schema, parsed);
|
package/dist/logger.js
CHANGED
|
@@ -40,12 +40,11 @@ module.exports = __toCommonJS(logger_exports);
|
|
|
40
40
|
var import_node_process = __toESM(require("node:process"));
|
|
41
41
|
var import_is_unicode_supported = __toESM(require("./external/@socketregistry/is-unicode-supported"));
|
|
42
42
|
var import_yoctocolors_cjs = __toESM(require("./external/yoctocolors-cjs"));
|
|
43
|
+
var import_primordials = require("./primordials");
|
|
43
44
|
var import_strings = require("./strings");
|
|
44
45
|
var import_context = require("./themes/context");
|
|
45
46
|
var import_themes = require("./themes/themes");
|
|
46
47
|
const globalConsole = console;
|
|
47
|
-
const ReflectApply = Reflect.apply;
|
|
48
|
-
const ReflectConstruct = Reflect.construct;
|
|
49
48
|
let _Console;
|
|
50
49
|
let _consoleSymbols;
|
|
51
50
|
let _kGroupIndentationWidthSymbol;
|
|
@@ -226,7 +225,7 @@ class Logger {
|
|
|
226
225
|
const targetStream = stream || (methodName === "log" ? "stdout" : "stderr");
|
|
227
226
|
const indent = this.#getIndent(targetStream);
|
|
228
227
|
const logArgs = hasText ? [(0, import_strings.applyLinePrefix)(text, { prefix: indent }), ...args.slice(1)] : args;
|
|
229
|
-
ReflectApply(
|
|
228
|
+
(0, import_primordials.ReflectApply)(
|
|
230
229
|
con[methodName],
|
|
231
230
|
con,
|
|
232
231
|
logArgs
|
|
@@ -851,7 +850,7 @@ class Logger {
|
|
|
851
850
|
group(...label) {
|
|
852
851
|
const { length } = label;
|
|
853
852
|
if (length) {
|
|
854
|
-
ReflectApply(this.log, this, label);
|
|
853
|
+
(0, import_primordials.ReflectApply)(this.log, this, label);
|
|
855
854
|
}
|
|
856
855
|
this.indent(this[getKGroupIndentationWidthSymbol()]);
|
|
857
856
|
if (length) {
|
|
@@ -880,7 +879,7 @@ class Logger {
|
|
|
880
879
|
// groupCollapsed is an alias of group.
|
|
881
880
|
// https://nodejs.org/api/console.html#consolegroupcollapsed
|
|
882
881
|
groupCollapsed(...label) {
|
|
883
|
-
return ReflectApply(this.group, this, label);
|
|
882
|
+
return (0, import_primordials.ReflectApply)(this.group, this, label);
|
|
884
883
|
}
|
|
885
884
|
/**
|
|
886
885
|
* Ends the current log group and decreases indentation.
|
|
@@ -1396,7 +1395,7 @@ function constructConsole(...args) {
|
|
|
1396
1395
|
const nodeConsole = require("node:console");
|
|
1397
1396
|
_Console = nodeConsole.Console;
|
|
1398
1397
|
}
|
|
1399
|
-
return ReflectConstruct(
|
|
1398
|
+
return (0, import_primordials.ReflectConstruct)(
|
|
1400
1399
|
_Console,
|
|
1401
1400
|
// eslint-disable-line no-undef
|
|
1402
1401
|
args
|