@socketsecurity/lib 5.4.0 → 5.5.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.
@@ -11,22 +11,677 @@ var __commonJS = (cb, mod) => function __require() {
11
11
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
12
  };
13
13
 
14
- // stub:debug.cjs:debug
15
- var require_debug = __commonJS({
16
- "stub:debug.cjs:debug"(exports2, module2) {
17
- "use strict";
18
- function debug() {
19
- return /* @__PURE__ */ __name(function noop() {
20
- }, "noop");
21
- }
22
- __name(debug, "debug");
23
- debug.enabled = false;
24
- debug.names = [];
25
- debug.skips = [];
26
- debug.formatters = {};
27
- module2.exports = debug;
14
+ // node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
15
+ var require_ms = __commonJS({
16
+ "node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) {
17
+ var s = 1e3;
18
+ var m = s * 60;
19
+ var h = m * 60;
20
+ var d = h * 24;
21
+ var w = d * 7;
22
+ var y = d * 365.25;
23
+ module2.exports = function(val, options) {
24
+ options = options || {};
25
+ var type = typeof val;
26
+ if (type === "string" && val.length > 0) {
27
+ return parse(val);
28
+ } else if (type === "number" && isFinite(val)) {
29
+ return options.long ? fmtLong(val) : fmtShort(val);
30
+ }
31
+ throw new Error(
32
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
33
+ );
34
+ };
35
+ function parse(str) {
36
+ str = String(str);
37
+ if (str.length > 100) {
38
+ return;
39
+ }
40
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
41
+ str
42
+ );
43
+ if (!match) {
44
+ return;
45
+ }
46
+ var n = parseFloat(match[1]);
47
+ var type = (match[2] || "ms").toLowerCase();
48
+ switch (type) {
49
+ case "years":
50
+ case "year":
51
+ case "yrs":
52
+ case "yr":
53
+ case "y":
54
+ return n * y;
55
+ case "weeks":
56
+ case "week":
57
+ case "w":
58
+ return n * w;
59
+ case "days":
60
+ case "day":
61
+ case "d":
62
+ return n * d;
63
+ case "hours":
64
+ case "hour":
65
+ case "hrs":
66
+ case "hr":
67
+ case "h":
68
+ return n * h;
69
+ case "minutes":
70
+ case "minute":
71
+ case "mins":
72
+ case "min":
73
+ case "m":
74
+ return n * m;
75
+ case "seconds":
76
+ case "second":
77
+ case "secs":
78
+ case "sec":
79
+ case "s":
80
+ return n * s;
81
+ case "milliseconds":
82
+ case "millisecond":
83
+ case "msecs":
84
+ case "msec":
85
+ case "ms":
86
+ return n;
87
+ default:
88
+ return void 0;
89
+ }
90
+ }
91
+ __name(parse, "parse");
92
+ function fmtShort(ms) {
93
+ var msAbs = Math.abs(ms);
94
+ if (msAbs >= d) {
95
+ return Math.round(ms / d) + "d";
96
+ }
97
+ if (msAbs >= h) {
98
+ return Math.round(ms / h) + "h";
99
+ }
100
+ if (msAbs >= m) {
101
+ return Math.round(ms / m) + "m";
102
+ }
103
+ if (msAbs >= s) {
104
+ return Math.round(ms / s) + "s";
105
+ }
106
+ return ms + "ms";
107
+ }
108
+ __name(fmtShort, "fmtShort");
109
+ function fmtLong(ms) {
110
+ var msAbs = Math.abs(ms);
111
+ if (msAbs >= d) {
112
+ return plural(ms, msAbs, d, "day");
113
+ }
114
+ if (msAbs >= h) {
115
+ return plural(ms, msAbs, h, "hour");
116
+ }
117
+ if (msAbs >= m) {
118
+ return plural(ms, msAbs, m, "minute");
119
+ }
120
+ if (msAbs >= s) {
121
+ return plural(ms, msAbs, s, "second");
122
+ }
123
+ return ms + " ms";
124
+ }
125
+ __name(fmtLong, "fmtLong");
126
+ function plural(ms, msAbs, n, name) {
127
+ var isPlural = msAbs >= n * 1.5;
128
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
129
+ }
130
+ __name(plural, "plural");
131
+ }
132
+ });
133
+
134
+ // node_modules/.pnpm/debug@4.4.3_supports-color@10.0.0/node_modules/debug/src/common.js
135
+ var require_common = __commonJS({
136
+ "node_modules/.pnpm/debug@4.4.3_supports-color@10.0.0/node_modules/debug/src/common.js"(exports2, module2) {
137
+ function setup(env) {
138
+ createDebug.debug = createDebug;
139
+ createDebug.default = createDebug;
140
+ createDebug.coerce = coerce;
141
+ createDebug.disable = disable;
142
+ createDebug.enable = enable;
143
+ createDebug.enabled = enabled;
144
+ createDebug.humanize = require_ms();
145
+ createDebug.destroy = destroy;
146
+ Object.keys(env).forEach((key) => {
147
+ createDebug[key] = env[key];
148
+ });
149
+ createDebug.names = [];
150
+ createDebug.skips = [];
151
+ createDebug.formatters = {};
152
+ function selectColor(namespace) {
153
+ let hash = 0;
154
+ for (let i = 0; i < namespace.length; i++) {
155
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
156
+ hash |= 0;
157
+ }
158
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
159
+ }
160
+ __name(selectColor, "selectColor");
161
+ createDebug.selectColor = selectColor;
162
+ function createDebug(namespace) {
163
+ let prevTime;
164
+ let enableOverride = null;
165
+ let namespacesCache;
166
+ let enabledCache;
167
+ function debug(...args) {
168
+ if (!debug.enabled) {
169
+ return;
170
+ }
171
+ const self = debug;
172
+ const curr = Number(/* @__PURE__ */ new Date());
173
+ const ms = curr - (prevTime || curr);
174
+ self.diff = ms;
175
+ self.prev = prevTime;
176
+ self.curr = curr;
177
+ prevTime = curr;
178
+ args[0] = createDebug.coerce(args[0]);
179
+ if (typeof args[0] !== "string") {
180
+ args.unshift("%O");
181
+ }
182
+ let index = 0;
183
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
184
+ if (match === "%%") {
185
+ return "%";
186
+ }
187
+ index++;
188
+ const formatter = createDebug.formatters[format];
189
+ if (typeof formatter === "function") {
190
+ const val = args[index];
191
+ match = formatter.call(self, val);
192
+ args.splice(index, 1);
193
+ index--;
194
+ }
195
+ return match;
196
+ });
197
+ createDebug.formatArgs.call(self, args);
198
+ const logFn = self.log || createDebug.log;
199
+ logFn.apply(self, args);
200
+ }
201
+ __name(debug, "debug");
202
+ debug.namespace = namespace;
203
+ debug.useColors = createDebug.useColors();
204
+ debug.color = createDebug.selectColor(namespace);
205
+ debug.extend = extend;
206
+ debug.destroy = createDebug.destroy;
207
+ Object.defineProperty(debug, "enabled", {
208
+ enumerable: true,
209
+ configurable: false,
210
+ get: /* @__PURE__ */ __name(() => {
211
+ if (enableOverride !== null) {
212
+ return enableOverride;
213
+ }
214
+ if (namespacesCache !== createDebug.namespaces) {
215
+ namespacesCache = createDebug.namespaces;
216
+ enabledCache = createDebug.enabled(namespace);
217
+ }
218
+ return enabledCache;
219
+ }, "get"),
220
+ set: /* @__PURE__ */ __name((v) => {
221
+ enableOverride = v;
222
+ }, "set")
223
+ });
224
+ if (typeof createDebug.init === "function") {
225
+ createDebug.init(debug);
226
+ }
227
+ return debug;
228
+ }
229
+ __name(createDebug, "createDebug");
230
+ function extend(namespace, delimiter) {
231
+ const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
232
+ newDebug.log = this.log;
233
+ return newDebug;
234
+ }
235
+ __name(extend, "extend");
236
+ function enable(namespaces) {
237
+ createDebug.save(namespaces);
238
+ createDebug.namespaces = namespaces;
239
+ createDebug.names = [];
240
+ createDebug.skips = [];
241
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
242
+ for (const ns of split) {
243
+ if (ns[0] === "-") {
244
+ createDebug.skips.push(ns.slice(1));
245
+ } else {
246
+ createDebug.names.push(ns);
247
+ }
248
+ }
249
+ }
250
+ __name(enable, "enable");
251
+ function matchesTemplate(search, template) {
252
+ let searchIndex = 0;
253
+ let templateIndex = 0;
254
+ let starIndex = -1;
255
+ let matchIndex = 0;
256
+ while (searchIndex < search.length) {
257
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
258
+ if (template[templateIndex] === "*") {
259
+ starIndex = templateIndex;
260
+ matchIndex = searchIndex;
261
+ templateIndex++;
262
+ } else {
263
+ searchIndex++;
264
+ templateIndex++;
265
+ }
266
+ } else if (starIndex !== -1) {
267
+ templateIndex = starIndex + 1;
268
+ matchIndex++;
269
+ searchIndex = matchIndex;
270
+ } else {
271
+ return false;
272
+ }
273
+ }
274
+ while (templateIndex < template.length && template[templateIndex] === "*") {
275
+ templateIndex++;
276
+ }
277
+ return templateIndex === template.length;
278
+ }
279
+ __name(matchesTemplate, "matchesTemplate");
280
+ function disable() {
281
+ const namespaces = [
282
+ ...createDebug.names,
283
+ ...createDebug.skips.map((namespace) => "-" + namespace)
284
+ ].join(",");
285
+ createDebug.enable("");
286
+ return namespaces;
287
+ }
288
+ __name(disable, "disable");
289
+ function enabled(name) {
290
+ for (const skip of createDebug.skips) {
291
+ if (matchesTemplate(name, skip)) {
292
+ return false;
293
+ }
294
+ }
295
+ for (const ns of createDebug.names) {
296
+ if (matchesTemplate(name, ns)) {
297
+ return true;
298
+ }
299
+ }
300
+ return false;
301
+ }
302
+ __name(enabled, "enabled");
303
+ function coerce(val) {
304
+ if (val instanceof Error) {
305
+ return val.stack || val.message;
306
+ }
307
+ return val;
308
+ }
309
+ __name(coerce, "coerce");
310
+ function destroy() {
311
+ }
312
+ __name(destroy, "destroy");
313
+ createDebug.enable(createDebug.load());
314
+ return createDebug;
315
+ }
316
+ __name(setup, "setup");
317
+ module2.exports = setup;
318
+ }
319
+ });
320
+
321
+ // node_modules/.pnpm/debug@4.4.3_supports-color@10.0.0/node_modules/debug/src/browser.js
322
+ var require_browser = __commonJS({
323
+ "node_modules/.pnpm/debug@4.4.3_supports-color@10.0.0/node_modules/debug/src/browser.js"(exports2, module2) {
324
+ exports2.formatArgs = formatArgs;
325
+ exports2.save = save;
326
+ exports2.load = load;
327
+ exports2.useColors = useColors;
328
+ exports2.storage = localstorage();
329
+ exports2.destroy = /* @__PURE__ */ (() => {
330
+ let warned = false;
331
+ return () => {
332
+ if (!warned) {
333
+ warned = true;
334
+ }
335
+ };
336
+ })();
337
+ exports2.colors = [
338
+ "#0000CC",
339
+ "#0000FF",
340
+ "#0033CC",
341
+ "#0033FF",
342
+ "#0066CC",
343
+ "#0066FF",
344
+ "#0099CC",
345
+ "#0099FF",
346
+ "#00CC00",
347
+ "#00CC33",
348
+ "#00CC66",
349
+ "#00CC99",
350
+ "#00CCCC",
351
+ "#00CCFF",
352
+ "#3300CC",
353
+ "#3300FF",
354
+ "#3333CC",
355
+ "#3333FF",
356
+ "#3366CC",
357
+ "#3366FF",
358
+ "#3399CC",
359
+ "#3399FF",
360
+ "#33CC00",
361
+ "#33CC33",
362
+ "#33CC66",
363
+ "#33CC99",
364
+ "#33CCCC",
365
+ "#33CCFF",
366
+ "#6600CC",
367
+ "#6600FF",
368
+ "#6633CC",
369
+ "#6633FF",
370
+ "#66CC00",
371
+ "#66CC33",
372
+ "#9900CC",
373
+ "#9900FF",
374
+ "#9933CC",
375
+ "#9933FF",
376
+ "#99CC00",
377
+ "#99CC33",
378
+ "#CC0000",
379
+ "#CC0033",
380
+ "#CC0066",
381
+ "#CC0099",
382
+ "#CC00CC",
383
+ "#CC00FF",
384
+ "#CC3300",
385
+ "#CC3333",
386
+ "#CC3366",
387
+ "#CC3399",
388
+ "#CC33CC",
389
+ "#CC33FF",
390
+ "#CC6600",
391
+ "#CC6633",
392
+ "#CC9900",
393
+ "#CC9933",
394
+ "#CCCC00",
395
+ "#CCCC33",
396
+ "#FF0000",
397
+ "#FF0033",
398
+ "#FF0066",
399
+ "#FF0099",
400
+ "#FF00CC",
401
+ "#FF00FF",
402
+ "#FF3300",
403
+ "#FF3333",
404
+ "#FF3366",
405
+ "#FF3399",
406
+ "#FF33CC",
407
+ "#FF33FF",
408
+ "#FF6600",
409
+ "#FF6633",
410
+ "#FF9900",
411
+ "#FF9933",
412
+ "#FFCC00",
413
+ "#FFCC33"
414
+ ];
415
+ function useColors() {
416
+ if (false) {
417
+ return true;
418
+ }
419
+ if (false) {
420
+ return false;
421
+ }
422
+ let m;
423
+ return (
424
+ // Double check webkit in userAgent just in case we are in a worker
425
+ false
426
+ );
427
+ }
428
+ __name(useColors, "useColors");
429
+ function formatArgs(args) {
430
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
431
+ if (!this.useColors) {
432
+ return;
433
+ }
434
+ const c = "color: " + this.color;
435
+ args.splice(1, 0, c, "color: inherit");
436
+ let index = 0;
437
+ let lastC = 0;
438
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
439
+ if (match === "%%") {
440
+ return;
441
+ }
442
+ index++;
443
+ if (match === "%c") {
444
+ lastC = index;
445
+ }
446
+ });
447
+ args.splice(lastC, 0, c);
448
+ }
449
+ __name(formatArgs, "formatArgs");
450
+ exports2.log = console.debug || console.log || (() => {
451
+ });
452
+ function save(namespaces) {
453
+ try {
454
+ if (namespaces) {
455
+ exports2.storage.setItem("debug", namespaces);
456
+ } else {
457
+ exports2.storage.removeItem("debug");
458
+ }
459
+ } catch (error) {
460
+ }
461
+ }
462
+ __name(save, "save");
463
+ function load() {
464
+ let r;
465
+ try {
466
+ r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
467
+ } catch (error) {
468
+ }
469
+ if (!r && typeof process !== "undefined" && "env" in process) {
470
+ r = void 0;
471
+ }
472
+ return r;
473
+ }
474
+ __name(load, "load");
475
+ function localstorage() {
476
+ try {
477
+ return void 0;
478
+ } catch (error) {
479
+ }
480
+ }
481
+ __name(localstorage, "localstorage");
482
+ module2.exports = require_common()(exports2);
483
+ var { formatters } = module2.exports;
484
+ formatters.j = function(v) {
485
+ try {
486
+ return JSON.stringify(v);
487
+ } catch (error) {
488
+ return "[UnexpectedJSONParseError]: " + error.message;
489
+ }
490
+ };
491
+ }
492
+ });
493
+
494
+ // node_modules/.pnpm/debug@4.4.3_supports-color@10.0.0/node_modules/debug/src/node.js
495
+ var require_node = __commonJS({
496
+ "node_modules/.pnpm/debug@4.4.3_supports-color@10.0.0/node_modules/debug/src/node.js"(exports2, module2) {
497
+ var tty = require("tty");
498
+ var util = require("util");
499
+ exports2.init = init;
500
+ exports2.log = log;
501
+ exports2.formatArgs = formatArgs;
502
+ exports2.save = save;
503
+ exports2.load = load;
504
+ exports2.useColors = useColors;
505
+ exports2.destroy = util.deprecate(
506
+ () => {
507
+ },
508
+ "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
509
+ );
510
+ exports2.colors = [6, 2, 3, 4, 5, 1];
511
+ try {
512
+ const supportsColor = require("supports-color");
513
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
514
+ exports2.colors = [
515
+ 20,
516
+ 21,
517
+ 26,
518
+ 27,
519
+ 32,
520
+ 33,
521
+ 38,
522
+ 39,
523
+ 40,
524
+ 41,
525
+ 42,
526
+ 43,
527
+ 44,
528
+ 45,
529
+ 56,
530
+ 57,
531
+ 62,
532
+ 63,
533
+ 68,
534
+ 69,
535
+ 74,
536
+ 75,
537
+ 76,
538
+ 77,
539
+ 78,
540
+ 79,
541
+ 80,
542
+ 81,
543
+ 92,
544
+ 93,
545
+ 98,
546
+ 99,
547
+ 112,
548
+ 113,
549
+ 128,
550
+ 129,
551
+ 134,
552
+ 135,
553
+ 148,
554
+ 149,
555
+ 160,
556
+ 161,
557
+ 162,
558
+ 163,
559
+ 164,
560
+ 165,
561
+ 166,
562
+ 167,
563
+ 168,
564
+ 169,
565
+ 170,
566
+ 171,
567
+ 172,
568
+ 173,
569
+ 178,
570
+ 179,
571
+ 184,
572
+ 185,
573
+ 196,
574
+ 197,
575
+ 198,
576
+ 199,
577
+ 200,
578
+ 201,
579
+ 202,
580
+ 203,
581
+ 204,
582
+ 205,
583
+ 206,
584
+ 207,
585
+ 208,
586
+ 209,
587
+ 214,
588
+ 215,
589
+ 220,
590
+ 221
591
+ ];
592
+ }
593
+ } catch (error) {
594
+ }
595
+ exports2.inspectOpts = Object.keys(process.env).filter((key) => {
596
+ return /^debug_/i.test(key);
597
+ }).reduce((obj, key) => {
598
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
599
+ return k.toUpperCase();
600
+ });
601
+ let val = process.env[key];
602
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
603
+ val = true;
604
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
605
+ val = false;
606
+ } else if (val === "null") {
607
+ val = null;
608
+ } else {
609
+ val = Number(val);
610
+ }
611
+ obj[prop] = val;
612
+ return obj;
613
+ }, {});
614
+ function useColors() {
615
+ return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
616
+ }
617
+ __name(useColors, "useColors");
618
+ function formatArgs(args) {
619
+ const { namespace: name, useColors: useColors2 } = this;
620
+ if (useColors2) {
621
+ const c = this.color;
622
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
623
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
624
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
625
+ args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
626
+ } else {
627
+ args[0] = getDate() + name + " " + args[0];
628
+ }
629
+ }
630
+ __name(formatArgs, "formatArgs");
631
+ function getDate() {
632
+ if (exports2.inspectOpts.hideDate) {
633
+ return "";
634
+ }
635
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
636
+ }
637
+ __name(getDate, "getDate");
638
+ function log(...args) {
639
+ return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
640
+ }
641
+ __name(log, "log");
642
+ function save(namespaces) {
643
+ if (namespaces) {
644
+ process.env.DEBUG = namespaces;
645
+ } else {
646
+ delete void 0;
647
+ }
648
+ }
649
+ __name(save, "save");
650
+ function load() {
651
+ return void 0;
652
+ }
653
+ __name(load, "load");
654
+ function init(debug) {
655
+ debug.inspectOpts = {};
656
+ const keys = Object.keys(exports2.inspectOpts);
657
+ for (let i = 0; i < keys.length; i++) {
658
+ debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
659
+ }
660
+ }
661
+ __name(init, "init");
662
+ module2.exports = require_common()(exports2);
663
+ var { formatters } = module2.exports;
664
+ formatters.o = function(v) {
665
+ this.inspectOpts.colors = this.useColors;
666
+ return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
667
+ };
668
+ formatters.O = function(v) {
669
+ this.inspectOpts.colors = this.useColors;
670
+ return util.inspect(v, this.inspectOpts);
671
+ };
672
+ }
673
+ });
674
+
675
+ // node_modules/.pnpm/debug@4.4.3_supports-color@10.0.0/node_modules/debug/src/index.js
676
+ var require_src = __commonJS({
677
+ "node_modules/.pnpm/debug@4.4.3_supports-color@10.0.0/node_modules/debug/src/index.js"(exports2, module2) {
678
+ if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
679
+ module2.exports = require_browser();
680
+ } else {
681
+ module2.exports = require_node();
682
+ }
28
683
  }
29
684
  });
30
685
 
31
686
  // src/external/debug.js
32
- module.exports = require_debug();
687
+ module.exports = require_src();