@socketsecurity/lib 5.11.1 → 5.11.3
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 +20 -0
- package/dist/abort.js +1 -3
- package/dist/agent.js +12 -1
- package/dist/ansi.js +1 -1
- package/dist/archives.js +7 -6
- package/dist/argv/flags.d.ts +0 -7
- package/dist/argv/flags.js +12 -1
- package/dist/argv/parse.js +5 -9
- package/dist/bin.js +2 -1
- package/dist/cache-with-ttl.js +10 -3
- package/dist/constants/node.js +14 -3
- package/dist/cover/code.js +13 -2
- package/dist/cover/type.js +12 -1
- package/dist/dlx/binary.js +16 -5
- package/dist/dlx/manifest.js +22 -33
- package/dist/env/package-manager.js +12 -1
- package/dist/env/rewire.js +14 -3
- package/dist/external/@npmcli/package-json.js +5 -3
- package/dist/external/adm-zip.js +1 -0
- package/dist/external/debug.js +18 -10
- package/dist/external/external-pack.js +8 -2
- package/dist/external/libnpmexec.js +2 -2
- package/dist/external/npm-pack.js +380 -367
- package/dist/external/p-map.js +240 -0
- package/dist/external/pico-pack.js +245 -12
- package/dist/external/zod.js +1 -0
- package/dist/fs.d.ts +0 -4
- package/dist/fs.js +13 -2
- package/dist/git.js +12 -1
- package/dist/github.js +15 -6
- package/dist/http-request.d.ts +29 -0
- package/dist/http-request.js +23 -2
- package/dist/ipc.js +17 -5
- package/dist/json/edit.js +14 -3
- package/dist/logger.js +5 -4
- package/dist/memoization.js +46 -13
- package/dist/packages/isolation.js +9 -1
- package/dist/performance.js +13 -2
- package/dist/process-lock.js +16 -3
- package/dist/promise-queue.d.ts +2 -0
- package/dist/promise-queue.js +20 -9
- package/dist/promises.js +1 -3
- package/dist/releases/github.js +9 -4
- package/dist/sea.js +12 -1
- package/dist/shadow.js +14 -3
- package/dist/spawn.js +5 -4
- package/dist/spinner.d.ts +0 -4
- package/dist/spinner.js +2 -1
- package/dist/stdio/clear.d.ts +0 -21
- package/dist/stdio/clear.js +20 -9
- package/dist/stdio/mask.js +27 -16
- package/dist/stdio/progress.js +3 -2
- package/dist/stdio/stderr.d.ts +0 -13
- package/dist/stdio/stderr.js +12 -1
- package/dist/stdio/stdout.js +17 -6
- package/dist/suppress-warnings.d.ts +0 -9
- package/dist/suppress-warnings.js +17 -6
- package/dist/temporary-executor.js +14 -3
- package/dist/validation/json-parser.js +10 -12
- package/package.json +8 -6
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Bundled from p-map
|
|
4
|
+
* This is a zero-dependency bundle created by esbuild.
|
|
5
|
+
*/
|
|
6
|
+
"use strict";
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
12
|
+
var __esm = (fn, res) => function __init() {
|
|
13
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
14
|
+
};
|
|
15
|
+
var __export = (target, all) => {
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// node_modules/.pnpm/p-map@7.0.4/node_modules/p-map/index.js
|
|
30
|
+
var p_map_exports = {};
|
|
31
|
+
__export(p_map_exports, {
|
|
32
|
+
default: () => pMap,
|
|
33
|
+
pMapIterable: () => pMapIterable,
|
|
34
|
+
pMapSkip: () => pMapSkip
|
|
35
|
+
});
|
|
36
|
+
async function pMap(iterable, mapper, {
|
|
37
|
+
concurrency = Number.POSITIVE_INFINITY,
|
|
38
|
+
stopOnError = true,
|
|
39
|
+
signal
|
|
40
|
+
} = {}) {
|
|
41
|
+
return new Promise((resolve_, reject_) => {
|
|
42
|
+
if (iterable[Symbol.iterator] === void 0 && iterable[Symbol.asyncIterator] === void 0) {
|
|
43
|
+
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
|
44
|
+
}
|
|
45
|
+
if (typeof mapper !== "function") {
|
|
46
|
+
throw new TypeError("Mapper function is required");
|
|
47
|
+
}
|
|
48
|
+
if (!(Number.isSafeInteger(concurrency) && concurrency >= 1 || concurrency === Number.POSITIVE_INFINITY)) {
|
|
49
|
+
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
|
50
|
+
}
|
|
51
|
+
const result = [];
|
|
52
|
+
const errors = [];
|
|
53
|
+
const skippedIndexesMap = /* @__PURE__ */ new Map();
|
|
54
|
+
let isRejected = false;
|
|
55
|
+
let isResolved = false;
|
|
56
|
+
let isIterableDone = false;
|
|
57
|
+
let resolvingCount = 0;
|
|
58
|
+
let currentIndex = 0;
|
|
59
|
+
const iterator = iterable[Symbol.iterator] === void 0 ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
|
|
60
|
+
const signalListener = /* @__PURE__ */ __name(() => {
|
|
61
|
+
reject(signal.reason);
|
|
62
|
+
}, "signalListener");
|
|
63
|
+
const cleanup = /* @__PURE__ */ __name(() => {
|
|
64
|
+
signal?.removeEventListener("abort", signalListener);
|
|
65
|
+
}, "cleanup");
|
|
66
|
+
const resolve = /* @__PURE__ */ __name((value) => {
|
|
67
|
+
resolve_(value);
|
|
68
|
+
cleanup();
|
|
69
|
+
}, "resolve");
|
|
70
|
+
const reject = /* @__PURE__ */ __name((reason) => {
|
|
71
|
+
isRejected = true;
|
|
72
|
+
isResolved = true;
|
|
73
|
+
reject_(reason);
|
|
74
|
+
cleanup();
|
|
75
|
+
}, "reject");
|
|
76
|
+
if (signal) {
|
|
77
|
+
if (signal.aborted) {
|
|
78
|
+
reject(signal.reason);
|
|
79
|
+
}
|
|
80
|
+
signal.addEventListener("abort", signalListener, { once: true });
|
|
81
|
+
}
|
|
82
|
+
const next = /* @__PURE__ */ __name(async () => {
|
|
83
|
+
if (isResolved) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const nextItem = await iterator.next();
|
|
87
|
+
const index = currentIndex;
|
|
88
|
+
currentIndex++;
|
|
89
|
+
if (nextItem.done) {
|
|
90
|
+
isIterableDone = true;
|
|
91
|
+
if (resolvingCount === 0 && !isResolved) {
|
|
92
|
+
if (!stopOnError && errors.length > 0) {
|
|
93
|
+
reject(new AggregateError(errors));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
isResolved = true;
|
|
97
|
+
if (skippedIndexesMap.size === 0) {
|
|
98
|
+
resolve(result);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const pureResult = [];
|
|
102
|
+
for (const [index2, value] of result.entries()) {
|
|
103
|
+
if (skippedIndexesMap.get(index2) === pMapSkip) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
pureResult.push(value);
|
|
107
|
+
}
|
|
108
|
+
resolve(pureResult);
|
|
109
|
+
}
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
resolvingCount++;
|
|
113
|
+
(async () => {
|
|
114
|
+
try {
|
|
115
|
+
const element = await nextItem.value;
|
|
116
|
+
if (isResolved) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const value = await mapper(element, index);
|
|
120
|
+
if (value === pMapSkip) {
|
|
121
|
+
skippedIndexesMap.set(index, value);
|
|
122
|
+
}
|
|
123
|
+
result[index] = value;
|
|
124
|
+
resolvingCount--;
|
|
125
|
+
await next();
|
|
126
|
+
} catch (error) {
|
|
127
|
+
if (stopOnError) {
|
|
128
|
+
reject(error);
|
|
129
|
+
} else {
|
|
130
|
+
errors.push(error);
|
|
131
|
+
resolvingCount--;
|
|
132
|
+
try {
|
|
133
|
+
await next();
|
|
134
|
+
} catch (error2) {
|
|
135
|
+
reject(error2);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
})();
|
|
140
|
+
}, "next");
|
|
141
|
+
(async () => {
|
|
142
|
+
for (let index = 0; index < concurrency; index++) {
|
|
143
|
+
try {
|
|
144
|
+
await next();
|
|
145
|
+
} catch (error) {
|
|
146
|
+
reject(error);
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
if (isIterableDone || isRejected) {
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
})();
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function pMapIterable(iterable, mapper, {
|
|
157
|
+
concurrency = Number.POSITIVE_INFINITY,
|
|
158
|
+
backpressure = concurrency
|
|
159
|
+
} = {}) {
|
|
160
|
+
if (iterable[Symbol.iterator] === void 0 && iterable[Symbol.asyncIterator] === void 0) {
|
|
161
|
+
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
|
162
|
+
}
|
|
163
|
+
if (typeof mapper !== "function") {
|
|
164
|
+
throw new TypeError("Mapper function is required");
|
|
165
|
+
}
|
|
166
|
+
if (!(Number.isSafeInteger(concurrency) && concurrency >= 1 || concurrency === Number.POSITIVE_INFINITY)) {
|
|
167
|
+
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
|
168
|
+
}
|
|
169
|
+
if (!(Number.isSafeInteger(backpressure) && backpressure >= concurrency || backpressure === Number.POSITIVE_INFINITY)) {
|
|
170
|
+
throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${concurrency}) and up or \`Infinity\`, got \`${backpressure}\` (${typeof backpressure})`);
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
async *[Symbol.asyncIterator]() {
|
|
174
|
+
const iterator = iterable[Symbol.asyncIterator] === void 0 ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
|
|
175
|
+
const promises = [];
|
|
176
|
+
let pendingPromisesCount = 0;
|
|
177
|
+
let isDone = false;
|
|
178
|
+
let index = 0;
|
|
179
|
+
function trySpawn() {
|
|
180
|
+
if (isDone || !(pendingPromisesCount < concurrency && promises.length < backpressure)) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
pendingPromisesCount++;
|
|
184
|
+
const promise = (async () => {
|
|
185
|
+
const { done, value } = await iterator.next();
|
|
186
|
+
if (done) {
|
|
187
|
+
pendingPromisesCount--;
|
|
188
|
+
return { done: true };
|
|
189
|
+
}
|
|
190
|
+
trySpawn();
|
|
191
|
+
try {
|
|
192
|
+
const returnValue = await mapper(await value, index++);
|
|
193
|
+
pendingPromisesCount--;
|
|
194
|
+
if (returnValue === pMapSkip) {
|
|
195
|
+
const index2 = promises.indexOf(promise);
|
|
196
|
+
if (index2 > 0) {
|
|
197
|
+
promises.splice(index2, 1);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
trySpawn();
|
|
201
|
+
return { done: false, value: returnValue };
|
|
202
|
+
} catch (error) {
|
|
203
|
+
pendingPromisesCount--;
|
|
204
|
+
isDone = true;
|
|
205
|
+
return { error };
|
|
206
|
+
}
|
|
207
|
+
})();
|
|
208
|
+
promises.push(promise);
|
|
209
|
+
}
|
|
210
|
+
__name(trySpawn, "trySpawn");
|
|
211
|
+
trySpawn();
|
|
212
|
+
while (promises.length > 0) {
|
|
213
|
+
const { error, done, value } = await promises[0];
|
|
214
|
+
promises.shift();
|
|
215
|
+
if (error) {
|
|
216
|
+
throw error;
|
|
217
|
+
}
|
|
218
|
+
if (done) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
trySpawn();
|
|
222
|
+
if (value === pMapSkip) {
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
yield value;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
var pMapSkip;
|
|
231
|
+
var init_p_map = __esm({
|
|
232
|
+
"node_modules/.pnpm/p-map@7.0.4/node_modules/p-map/index.js"() {
|
|
233
|
+
__name(pMap, "pMap");
|
|
234
|
+
__name(pMapIterable, "pMapIterable");
|
|
235
|
+
pMapSkip = Symbol("skip");
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
// src/external/p-map.js
|
|
240
|
+
module.exports = (init_p_map(), __toCommonJS(p_map_exports));
|
|
@@ -39,12 +39,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
39
39
|
));
|
|
40
40
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
41
41
|
|
|
42
|
-
// node_modules/.pnpm/picomatch@4.0.
|
|
42
|
+
// node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
|
|
43
43
|
var require_constants = __commonJS({
|
|
44
|
-
"node_modules/.pnpm/picomatch@4.0.
|
|
44
|
+
"node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js"(exports2, module2) {
|
|
45
45
|
"use strict";
|
|
46
46
|
var WIN_SLASH = "\\\\/";
|
|
47
47
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
48
|
+
var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
48
49
|
var DOT_LITERAL = "\\.";
|
|
49
50
|
var PLUS_LITERAL = "\\+";
|
|
50
51
|
var QMARK_LITERAL = "\\?";
|
|
@@ -95,6 +96,7 @@ var require_constants = __commonJS({
|
|
|
95
96
|
SEP: "\\"
|
|
96
97
|
};
|
|
97
98
|
var POSIX_REGEX_SOURCE = {
|
|
99
|
+
__proto__: null,
|
|
98
100
|
alnum: "a-zA-Z0-9",
|
|
99
101
|
alpha: "a-zA-Z",
|
|
100
102
|
ascii: "\\x00-\\x7F",
|
|
@@ -111,6 +113,7 @@ var require_constants = __commonJS({
|
|
|
111
113
|
xdigit: "A-Fa-f0-9"
|
|
112
114
|
};
|
|
113
115
|
module2.exports = {
|
|
116
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
114
117
|
MAX_LENGTH: 1024 * 64,
|
|
115
118
|
POSIX_REGEX_SOURCE,
|
|
116
119
|
// regular expressions
|
|
@@ -238,9 +241,9 @@ var require_constants = __commonJS({
|
|
|
238
241
|
}
|
|
239
242
|
});
|
|
240
243
|
|
|
241
|
-
// node_modules/.pnpm/picomatch@4.0.
|
|
244
|
+
// node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js
|
|
242
245
|
var require_utils = __commonJS({
|
|
243
|
-
"node_modules/.pnpm/picomatch@4.0.
|
|
246
|
+
"node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js"(exports2) {
|
|
244
247
|
"use strict";
|
|
245
248
|
var {
|
|
246
249
|
REGEX_BACKSLASH,
|
|
@@ -302,9 +305,9 @@ var require_utils = __commonJS({
|
|
|
302
305
|
}
|
|
303
306
|
});
|
|
304
307
|
|
|
305
|
-
// node_modules/.pnpm/picomatch@4.0.
|
|
308
|
+
// node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js
|
|
306
309
|
var require_scan = __commonJS({
|
|
307
|
-
"node_modules/.pnpm/picomatch@4.0.
|
|
310
|
+
"node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js"(exports2, module2) {
|
|
308
311
|
"use strict";
|
|
309
312
|
var utils = require_utils();
|
|
310
313
|
var {
|
|
@@ -632,9 +635,9 @@ var require_scan = __commonJS({
|
|
|
632
635
|
}
|
|
633
636
|
});
|
|
634
637
|
|
|
635
|
-
// node_modules/.pnpm/picomatch@4.0.
|
|
638
|
+
// node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js
|
|
636
639
|
var require_parse = __commonJS({
|
|
637
|
-
"node_modules/.pnpm/picomatch@4.0.
|
|
640
|
+
"node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js"(exports2, module2) {
|
|
638
641
|
"use strict";
|
|
639
642
|
var constants = require_constants();
|
|
640
643
|
var utils = require_utils();
|
|
@@ -661,6 +664,213 @@ var require_parse = __commonJS({
|
|
|
661
664
|
var syntaxError = /* @__PURE__ */ __name((type, char) => {
|
|
662
665
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
663
666
|
}, "syntaxError");
|
|
667
|
+
var splitTopLevel = /* @__PURE__ */ __name((input) => {
|
|
668
|
+
const parts = [];
|
|
669
|
+
let bracket = 0;
|
|
670
|
+
let paren = 0;
|
|
671
|
+
let quote = 0;
|
|
672
|
+
let value = "";
|
|
673
|
+
let escaped = false;
|
|
674
|
+
for (const ch of input) {
|
|
675
|
+
if (escaped === true) {
|
|
676
|
+
value += ch;
|
|
677
|
+
escaped = false;
|
|
678
|
+
continue;
|
|
679
|
+
}
|
|
680
|
+
if (ch === "\\") {
|
|
681
|
+
value += ch;
|
|
682
|
+
escaped = true;
|
|
683
|
+
continue;
|
|
684
|
+
}
|
|
685
|
+
if (ch === '"') {
|
|
686
|
+
quote = quote === 1 ? 0 : 1;
|
|
687
|
+
value += ch;
|
|
688
|
+
continue;
|
|
689
|
+
}
|
|
690
|
+
if (quote === 0) {
|
|
691
|
+
if (ch === "[") {
|
|
692
|
+
bracket++;
|
|
693
|
+
} else if (ch === "]" && bracket > 0) {
|
|
694
|
+
bracket--;
|
|
695
|
+
} else if (bracket === 0) {
|
|
696
|
+
if (ch === "(") {
|
|
697
|
+
paren++;
|
|
698
|
+
} else if (ch === ")" && paren > 0) {
|
|
699
|
+
paren--;
|
|
700
|
+
} else if (ch === "|" && paren === 0) {
|
|
701
|
+
parts.push(value);
|
|
702
|
+
value = "";
|
|
703
|
+
continue;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
value += ch;
|
|
708
|
+
}
|
|
709
|
+
parts.push(value);
|
|
710
|
+
return parts;
|
|
711
|
+
}, "splitTopLevel");
|
|
712
|
+
var isPlainBranch = /* @__PURE__ */ __name((branch) => {
|
|
713
|
+
let escaped = false;
|
|
714
|
+
for (const ch of branch) {
|
|
715
|
+
if (escaped === true) {
|
|
716
|
+
escaped = false;
|
|
717
|
+
continue;
|
|
718
|
+
}
|
|
719
|
+
if (ch === "\\") {
|
|
720
|
+
escaped = true;
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
if (/[?*+@!()[\]{}]/.test(ch)) {
|
|
724
|
+
return false;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return true;
|
|
728
|
+
}, "isPlainBranch");
|
|
729
|
+
var normalizeSimpleBranch = /* @__PURE__ */ __name((branch) => {
|
|
730
|
+
let value = branch.trim();
|
|
731
|
+
let changed = true;
|
|
732
|
+
while (changed === true) {
|
|
733
|
+
changed = false;
|
|
734
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
735
|
+
value = value.slice(2, -1);
|
|
736
|
+
changed = true;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
if (!isPlainBranch(value)) {
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
return value.replace(/\\(.)/g, "$1");
|
|
743
|
+
}, "normalizeSimpleBranch");
|
|
744
|
+
var hasRepeatedCharPrefixOverlap = /* @__PURE__ */ __name((branches) => {
|
|
745
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
746
|
+
for (let i = 0; i < values.length; i++) {
|
|
747
|
+
for (let j = i + 1; j < values.length; j++) {
|
|
748
|
+
const a = values[i];
|
|
749
|
+
const b = values[j];
|
|
750
|
+
const char = a[0];
|
|
751
|
+
if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
|
|
752
|
+
continue;
|
|
753
|
+
}
|
|
754
|
+
if (a === b || a.startsWith(b) || b.startsWith(a)) {
|
|
755
|
+
return true;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
return false;
|
|
760
|
+
}, "hasRepeatedCharPrefixOverlap");
|
|
761
|
+
var parseRepeatedExtglob = /* @__PURE__ */ __name((pattern, requireEnd = true) => {
|
|
762
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
let bracket = 0;
|
|
766
|
+
let paren = 0;
|
|
767
|
+
let quote = 0;
|
|
768
|
+
let escaped = false;
|
|
769
|
+
for (let i = 1; i < pattern.length; i++) {
|
|
770
|
+
const ch = pattern[i];
|
|
771
|
+
if (escaped === true) {
|
|
772
|
+
escaped = false;
|
|
773
|
+
continue;
|
|
774
|
+
}
|
|
775
|
+
if (ch === "\\") {
|
|
776
|
+
escaped = true;
|
|
777
|
+
continue;
|
|
778
|
+
}
|
|
779
|
+
if (ch === '"') {
|
|
780
|
+
quote = quote === 1 ? 0 : 1;
|
|
781
|
+
continue;
|
|
782
|
+
}
|
|
783
|
+
if (quote === 1) {
|
|
784
|
+
continue;
|
|
785
|
+
}
|
|
786
|
+
if (ch === "[") {
|
|
787
|
+
bracket++;
|
|
788
|
+
continue;
|
|
789
|
+
}
|
|
790
|
+
if (ch === "]" && bracket > 0) {
|
|
791
|
+
bracket--;
|
|
792
|
+
continue;
|
|
793
|
+
}
|
|
794
|
+
if (bracket > 0) {
|
|
795
|
+
continue;
|
|
796
|
+
}
|
|
797
|
+
if (ch === "(") {
|
|
798
|
+
paren++;
|
|
799
|
+
continue;
|
|
800
|
+
}
|
|
801
|
+
if (ch === ")") {
|
|
802
|
+
paren--;
|
|
803
|
+
if (paren === 0) {
|
|
804
|
+
if (requireEnd === true && i !== pattern.length - 1) {
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
return {
|
|
808
|
+
type: pattern[0],
|
|
809
|
+
body: pattern.slice(2, i),
|
|
810
|
+
end: i
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}, "parseRepeatedExtglob");
|
|
816
|
+
var getStarExtglobSequenceOutput = /* @__PURE__ */ __name((pattern) => {
|
|
817
|
+
let index = 0;
|
|
818
|
+
const chars = [];
|
|
819
|
+
while (index < pattern.length) {
|
|
820
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
821
|
+
if (!match || match.type !== "*") {
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
824
|
+
const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
|
|
825
|
+
if (branches.length !== 1) {
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
829
|
+
if (!branch || branch.length !== 1) {
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
832
|
+
chars.push(branch);
|
|
833
|
+
index += match.end + 1;
|
|
834
|
+
}
|
|
835
|
+
if (chars.length < 1) {
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
|
|
839
|
+
return `${source}*`;
|
|
840
|
+
}, "getStarExtglobSequenceOutput");
|
|
841
|
+
var repeatedExtglobRecursion = /* @__PURE__ */ __name((pattern) => {
|
|
842
|
+
let depth = 0;
|
|
843
|
+
let value = pattern.trim();
|
|
844
|
+
let match = parseRepeatedExtglob(value);
|
|
845
|
+
while (match) {
|
|
846
|
+
depth++;
|
|
847
|
+
value = match.body.trim();
|
|
848
|
+
match = parseRepeatedExtglob(value);
|
|
849
|
+
}
|
|
850
|
+
return depth;
|
|
851
|
+
}, "repeatedExtglobRecursion");
|
|
852
|
+
var analyzeRepeatedExtglob = /* @__PURE__ */ __name((body, options) => {
|
|
853
|
+
if (options.maxExtglobRecursion === false) {
|
|
854
|
+
return { risky: false };
|
|
855
|
+
}
|
|
856
|
+
const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
857
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
858
|
+
if (branches.length > 1) {
|
|
859
|
+
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
|
|
860
|
+
return { risky: true };
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
for (const branch of branches) {
|
|
864
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
865
|
+
if (safeOutput) {
|
|
866
|
+
return { risky: true, safeOutput };
|
|
867
|
+
}
|
|
868
|
+
if (repeatedExtglobRecursion(branch) > max) {
|
|
869
|
+
return { risky: true };
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
return { risky: false };
|
|
873
|
+
}, "analyzeRepeatedExtglob");
|
|
664
874
|
var parse = /* @__PURE__ */ __name((input, options) => {
|
|
665
875
|
if (typeof input !== "string") {
|
|
666
876
|
throw new TypeError("Expected a string");
|
|
@@ -791,6 +1001,8 @@ var require_parse = __commonJS({
|
|
|
791
1001
|
token.prev = prev;
|
|
792
1002
|
token.parens = state.parens;
|
|
793
1003
|
token.output = state.output;
|
|
1004
|
+
token.startIndex = state.index;
|
|
1005
|
+
token.tokensIndex = tokens.length;
|
|
794
1006
|
const output = (opts.capture ? "(" : "") + token.open;
|
|
795
1007
|
increment("parens");
|
|
796
1008
|
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
@@ -798,6 +1010,26 @@ var require_parse = __commonJS({
|
|
|
798
1010
|
extglobs.push(token);
|
|
799
1011
|
}, "extglobOpen");
|
|
800
1012
|
const extglobClose = /* @__PURE__ */ __name((token) => {
|
|
1013
|
+
const literal = input.slice(token.startIndex, state.index + 1);
|
|
1014
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
1015
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
1016
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
1017
|
+
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
1018
|
+
const open = tokens[token.tokensIndex];
|
|
1019
|
+
open.type = "text";
|
|
1020
|
+
open.value = literal;
|
|
1021
|
+
open.output = safeOutput || utils.escapeRegex(literal);
|
|
1022
|
+
for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
|
|
1023
|
+
tokens[i].value = "";
|
|
1024
|
+
tokens[i].output = "";
|
|
1025
|
+
delete tokens[i].suffix;
|
|
1026
|
+
}
|
|
1027
|
+
state.output = token.output + open.output;
|
|
1028
|
+
state.backtrack = true;
|
|
1029
|
+
push({ type: "paren", extglob: true, value, output: "" });
|
|
1030
|
+
decrement("parens");
|
|
1031
|
+
return;
|
|
1032
|
+
}
|
|
801
1033
|
let output = token.close + (opts.capture ? ")" : "");
|
|
802
1034
|
let rest;
|
|
803
1035
|
if (token.type === "negate") {
|
|
@@ -1400,9 +1632,9 @@ var require_parse = __commonJS({
|
|
|
1400
1632
|
}
|
|
1401
1633
|
});
|
|
1402
1634
|
|
|
1403
|
-
// node_modules/.pnpm/picomatch@4.0.
|
|
1635
|
+
// node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js
|
|
1404
1636
|
var require_picomatch = __commonJS({
|
|
1405
|
-
"node_modules/.pnpm/picomatch@4.0.
|
|
1637
|
+
"node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
|
|
1406
1638
|
"use strict";
|
|
1407
1639
|
var scan = require_scan();
|
|
1408
1640
|
var parse = require_parse();
|
|
@@ -1540,9 +1772,9 @@ var require_picomatch = __commonJS({
|
|
|
1540
1772
|
}
|
|
1541
1773
|
});
|
|
1542
1774
|
|
|
1543
|
-
// node_modules/.pnpm/picomatch@4.0.
|
|
1775
|
+
// node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js
|
|
1544
1776
|
var require_picomatch2 = __commonJS({
|
|
1545
|
-
"node_modules/.pnpm/picomatch@4.0.
|
|
1777
|
+
"node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js"(exports2, module2) {
|
|
1546
1778
|
"use strict";
|
|
1547
1779
|
var pico = require_picomatch();
|
|
1548
1780
|
var utils = require_utils();
|
|
@@ -2618,6 +2850,7 @@ var require_compile = __commonJS({
|
|
|
2618
2850
|
return prefix + node.value;
|
|
2619
2851
|
}
|
|
2620
2852
|
if (node.isClose === true) {
|
|
2853
|
+
/* @__PURE__ */ console.log("node.isClose", prefix, node.value);
|
|
2621
2854
|
return prefix + node.value;
|
|
2622
2855
|
}
|
|
2623
2856
|
if (node.type === "open") {
|
package/dist/external/zod.js
CHANGED
|
@@ -13207,6 +13207,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
13207
13207
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
13208
13208
|
} else if (this.target === "openapi-3.0") {
|
|
13209
13209
|
} else {
|
|
13210
|
+
/* @__PURE__ */ console.warn(`Invalid target: ${this.target}`);
|
|
13210
13211
|
}
|
|
13211
13212
|
if (params.external?.uri) {
|
|
13212
13213
|
const id = params.external.registry.get(schema)?.id;
|
package/dist/fs.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview File system utilities with cross-platform path handling.
|
|
3
|
-
* Provides enhanced fs operations, glob matching, and directory traversal functions.
|
|
4
|
-
*/
|
|
5
1
|
import type { Abortable } from 'events';
|
|
6
2
|
import type { MakeDirectoryOptions, ObjectEncodingOptions, OpenMode, PathLike } from 'fs';
|
|
7
3
|
import type { JsonReviver } from './json/types';
|
package/dist/fs.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var fs_exports = {};
|
|
21
31
|
__export(fs_exports, {
|
|
@@ -50,6 +60,7 @@ __export(fs_exports, {
|
|
|
50
60
|
writeJsonSync: () => writeJsonSync
|
|
51
61
|
});
|
|
52
62
|
module.exports = __toCommonJS(fs_exports);
|
|
63
|
+
var import_node_process = __toESM(require("node:process"));
|
|
53
64
|
var import_process = require("./constants/process");
|
|
54
65
|
var import_arrays = require("./arrays");
|
|
55
66
|
var import_del = require("./external/del");
|
|
@@ -128,7 +139,7 @@ function stringify(json, EOL, finalEOL, replacer, spaces = 2) {
|
|
|
128
139
|
}
|
|
129
140
|
// @__NO_SIDE_EFFECTS__
|
|
130
141
|
async function findUp(name, options) {
|
|
131
|
-
const { cwd =
|
|
142
|
+
const { cwd = import_node_process.default.cwd(), signal = abortSignal } = {
|
|
132
143
|
__proto__: null,
|
|
133
144
|
...options
|
|
134
145
|
};
|
|
@@ -170,7 +181,7 @@ async function findUp(name, options) {
|
|
|
170
181
|
}
|
|
171
182
|
// @__NO_SIDE_EFFECTS__
|
|
172
183
|
function findUpSync(name, options) {
|
|
173
|
-
const { cwd =
|
|
184
|
+
const { cwd = import_node_process.default.cwd(), stopAt } = {
|
|
174
185
|
__proto__: null,
|
|
175
186
|
...options
|
|
176
187
|
};
|
package/dist/git.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var git_exports = {};
|
|
21
31
|
__export(git_exports, {
|
|
@@ -34,6 +44,7 @@ __export(git_exports, {
|
|
|
34
44
|
isUnstagedSync: () => isUnstagedSync
|
|
35
45
|
});
|
|
36
46
|
module.exports = __toCommonJS(git_exports);
|
|
47
|
+
var import_node_process = __toESM(require("node:process"));
|
|
37
48
|
var import_bin = require("./bin");
|
|
38
49
|
var import_debug = require("./debug");
|
|
39
50
|
var import_globs = require("./globs");
|
|
@@ -91,7 +102,7 @@ function getGitPath() {
|
|
|
91
102
|
return _gitPath;
|
|
92
103
|
}
|
|
93
104
|
function getCwd() {
|
|
94
|
-
return (/* @__PURE__ */ getFs()).realpathSync(
|
|
105
|
+
return (/* @__PURE__ */ getFs()).realpathSync(import_node_process.default.cwd());
|
|
95
106
|
}
|
|
96
107
|
function getGitDiffSpawnArgs(cwd) {
|
|
97
108
|
const resolvedCwd = cwd ? (/* @__PURE__ */ getFs()).realpathSync(cwd) : getCwd();
|