apitally 0.21.1 → 0.21.2

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.
Files changed (53) hide show
  1. package/dist/adonisjs/provider.cjs +441 -603
  2. package/dist/adonisjs/provider.cjs.map +1 -1
  3. package/dist/adonisjs/provider.js +441 -603
  4. package/dist/adonisjs/provider.js.map +1 -1
  5. package/dist/express/index.cjs +435 -597
  6. package/dist/express/index.cjs.map +1 -1
  7. package/dist/express/index.js +435 -597
  8. package/dist/express/index.js.map +1 -1
  9. package/dist/express/middleware.cjs +435 -597
  10. package/dist/express/middleware.cjs.map +1 -1
  11. package/dist/express/middleware.js +435 -597
  12. package/dist/express/middleware.js.map +1 -1
  13. package/dist/fastify/index.cjs +435 -597
  14. package/dist/fastify/index.cjs.map +1 -1
  15. package/dist/fastify/index.js +435 -597
  16. package/dist/fastify/index.js.map +1 -1
  17. package/dist/fastify/plugin.cjs +435 -597
  18. package/dist/fastify/plugin.cjs.map +1 -1
  19. package/dist/fastify/plugin.js +435 -597
  20. package/dist/fastify/plugin.js.map +1 -1
  21. package/dist/hapi/index.cjs +441 -603
  22. package/dist/hapi/index.cjs.map +1 -1
  23. package/dist/hapi/index.js +441 -603
  24. package/dist/hapi/index.js.map +1 -1
  25. package/dist/hapi/plugin.cjs +441 -603
  26. package/dist/hapi/plugin.cjs.map +1 -1
  27. package/dist/hapi/plugin.js +441 -603
  28. package/dist/hapi/plugin.js.map +1 -1
  29. package/dist/hono/index.cjs +14 -10
  30. package/dist/hono/index.cjs.map +1 -1
  31. package/dist/hono/index.js +14 -10
  32. package/dist/hono/index.js.map +1 -1
  33. package/dist/hono/middleware.cjs +14 -10
  34. package/dist/hono/middleware.cjs.map +1 -1
  35. package/dist/hono/middleware.js +14 -10
  36. package/dist/hono/middleware.js.map +1 -1
  37. package/dist/hono/utils.cjs +14 -10
  38. package/dist/hono/utils.cjs.map +1 -1
  39. package/dist/hono/utils.js +14 -10
  40. package/dist/hono/utils.js.map +1 -1
  41. package/dist/loggers/index.cjs +441 -603
  42. package/dist/loggers/index.cjs.map +1 -1
  43. package/dist/loggers/index.js +441 -603
  44. package/dist/loggers/index.js.map +1 -1
  45. package/dist/loggers/pino.cjs +435 -597
  46. package/dist/loggers/pino.cjs.map +1 -1
  47. package/dist/loggers/pino.js +435 -597
  48. package/dist/loggers/pino.js.map +1 -1
  49. package/dist/nestjs/index.cjs +436 -598
  50. package/dist/nestjs/index.cjs.map +1 -1
  51. package/dist/nestjs/index.js +436 -598
  52. package/dist/nestjs/index.js.map +1 -1
  53. package/package.json +2 -2
@@ -438,619 +438,458 @@ var require_caller = __commonJS({
438
438
  }
439
439
  });
440
440
 
441
- // node_modules/fast-redact/lib/validator.js
442
- var require_validator = __commonJS({
443
- "node_modules/fast-redact/lib/validator.js"(exports2, module2) {
441
+ // node_modules/@pinojs/redact/index.js
442
+ var require_redact = __commonJS({
443
+ "node_modules/@pinojs/redact/index.js"(exports2, module2) {
444
444
  "use strict";
445
- module2.exports = validator;
446
- function validator(opts = {}) {
447
- const { ERR_PATHS_MUST_BE_STRINGS = /* @__PURE__ */ __name(() => "fast-redact - Paths must be (non-empty) strings", "ERR_PATHS_MUST_BE_STRINGS"), ERR_INVALID_PATH = /* @__PURE__ */ __name((s) => `fast-redact \u2013 Invalid path (${s})`, "ERR_INVALID_PATH") } = opts;
448
- return /* @__PURE__ */ __name(function validate({ paths }) {
449
- paths.forEach((s) => {
450
- if (typeof s !== "string") {
451
- throw Error(ERR_PATHS_MUST_BE_STRINGS());
445
+ function deepClone(obj) {
446
+ if (obj === null || typeof obj !== "object") {
447
+ return obj;
448
+ }
449
+ if (obj instanceof Date) {
450
+ return new Date(obj.getTime());
451
+ }
452
+ if (obj instanceof Array) {
453
+ const cloned = [];
454
+ for (let i = 0; i < obj.length; i++) {
455
+ cloned[i] = deepClone(obj[i]);
456
+ }
457
+ return cloned;
458
+ }
459
+ if (typeof obj === "object") {
460
+ const cloned = Object.create(Object.getPrototypeOf(obj));
461
+ for (const key in obj) {
462
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
463
+ cloned[key] = deepClone(obj[key]);
452
464
  }
453
- try {
454
- if (/〇/.test(s)) throw Error();
455
- const expr = (s[0] === "[" ? "" : ".") + s.replace(/^\*/, "\u3007").replace(/\.\*/g, ".\u3007").replace(/\[\*\]/g, "[\u3007]");
456
- if (/\n|\r|;/.test(expr)) throw Error();
457
- if (/\/\*/.test(expr)) throw Error();
458
- Function(`
459
- 'use strict'
460
- const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
461
- const \u3007 = null;
462
- o${expr}
463
- if ([o${expr}].length !== 1) throw Error()`)();
464
- } catch (e) {
465
- throw Error(ERR_INVALID_PATH(s));
465
+ }
466
+ return cloned;
467
+ }
468
+ return obj;
469
+ }
470
+ __name(deepClone, "deepClone");
471
+ function parsePath(path) {
472
+ const parts = [];
473
+ let current = "";
474
+ let inBrackets = false;
475
+ let inQuotes = false;
476
+ let quoteChar = "";
477
+ for (let i = 0; i < path.length; i++) {
478
+ const char = path[i];
479
+ if (!inBrackets && char === ".") {
480
+ if (current) {
481
+ parts.push(current);
482
+ current = "";
483
+ }
484
+ } else if (char === "[") {
485
+ if (current) {
486
+ parts.push(current);
487
+ current = "";
488
+ }
489
+ inBrackets = true;
490
+ } else if (char === "]" && inBrackets) {
491
+ parts.push(current);
492
+ current = "";
493
+ inBrackets = false;
494
+ inQuotes = false;
495
+ } else if ((char === '"' || char === "'") && inBrackets) {
496
+ if (!inQuotes) {
497
+ inQuotes = true;
498
+ quoteChar = char;
499
+ } else if (char === quoteChar) {
500
+ inQuotes = false;
501
+ quoteChar = "";
502
+ } else {
503
+ current += char;
466
504
  }
467
- });
468
- }, "validate");
469
- }
470
- __name(validator, "validator");
471
- }
472
- });
473
-
474
- // node_modules/fast-redact/lib/rx.js
475
- var require_rx = __commonJS({
476
- "node_modules/fast-redact/lib/rx.js"(exports2, module2) {
477
- "use strict";
478
- module2.exports = /[^.[\]]+|\[((?:.)*?)\]/g;
479
- }
480
- });
481
-
482
- // node_modules/fast-redact/lib/parse.js
483
- var require_parse = __commonJS({
484
- "node_modules/fast-redact/lib/parse.js"(exports2, module2) {
485
- "use strict";
486
- var rx = require_rx();
487
- module2.exports = parse;
488
- function parse({ paths }) {
489
- const wildcards = [];
490
- var wcLen = 0;
491
- const secret = paths.reduce(function(o, strPath, ix) {
492
- var path = strPath.match(rx).map((p) => p.replace(/'|"|`/g, ""));
493
- const leadingBracket = strPath[0] === "[";
494
- path = path.map((p) => {
495
- if (p[0] === "[") return p.substr(1, p.length - 2);
496
- else return p;
497
- });
498
- const star = path.indexOf("*");
499
- if (star > -1) {
500
- const before = path.slice(0, star);
501
- const beforeStr = before.join(".");
502
- const after = path.slice(star + 1, path.length);
503
- const nested = after.length > 0;
504
- wcLen++;
505
- wildcards.push({
506
- before,
507
- beforeStr,
508
- after,
509
- nested
510
- });
511
505
  } else {
512
- o[strPath] = {
513
- path,
514
- val: void 0,
515
- precensored: false,
516
- circle: "",
517
- escPath: JSON.stringify(strPath),
518
- leadingBracket
519
- };
506
+ current += char;
520
507
  }
521
- return o;
522
- }, {});
523
- return {
524
- wildcards,
525
- wcLen,
526
- secret
527
- };
508
+ }
509
+ if (current) {
510
+ parts.push(current);
511
+ }
512
+ return parts;
528
513
  }
529
- __name(parse, "parse");
530
- }
531
- });
532
-
533
- // node_modules/fast-redact/lib/redactor.js
534
- var require_redactor = __commonJS({
535
- "node_modules/fast-redact/lib/redactor.js"(exports2, module2) {
536
- "use strict";
537
- var rx = require_rx();
538
- module2.exports = redactor;
539
- function redactor({ secret, serialize, wcLen, strict, isCensorFct, censorFctTakesPath }, state) {
540
- const redact = Function("o", `
541
- if (typeof o !== 'object' || o == null) {
542
- ${strictImpl(strict, serialize)}
543
- }
544
- const { censor, secret } = this
545
- const originalSecret = {}
546
- const secretKeys = Object.keys(secret)
547
- for (var i = 0; i < secretKeys.length; i++) {
548
- originalSecret[secretKeys[i]] = secret[secretKeys[i]]
514
+ __name(parsePath, "parsePath");
515
+ function setValue(obj, parts, value) {
516
+ let current = obj;
517
+ for (let i = 0; i < parts.length - 1; i++) {
518
+ const key = parts[i];
519
+ if (typeof current !== "object" || current === null || !(key in current)) {
520
+ return false;
521
+ }
522
+ if (typeof current[key] !== "object" || current[key] === null) {
523
+ return false;
524
+ }
525
+ current = current[key];
526
+ }
527
+ const lastKey = parts[parts.length - 1];
528
+ if (lastKey === "*") {
529
+ if (Array.isArray(current)) {
530
+ for (let i = 0; i < current.length; i++) {
531
+ current[i] = value;
532
+ }
533
+ } else if (typeof current === "object" && current !== null) {
534
+ for (const key in current) {
535
+ if (Object.prototype.hasOwnProperty.call(current, key)) {
536
+ current[key] = value;
537
+ }
538
+ }
539
+ }
540
+ } else {
541
+ if (typeof current === "object" && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) {
542
+ current[lastKey] = value;
543
+ }
544
+ }
545
+ return true;
549
546
  }
550
-
551
- ${redactTmpl(secret, isCensorFct, censorFctTakesPath)}
552
- this.compileRestore()
553
- ${dynamicRedactTmpl(wcLen > 0, isCensorFct, censorFctTakesPath)}
554
- this.secret = originalSecret
555
- ${resultTmpl(serialize)}
556
- `).bind(state);
557
- redact.state = state;
558
- if (serialize === false) {
559
- redact.restore = (o) => state.restore(o);
560
- }
561
- return redact;
562
- }
563
- __name(redactor, "redactor");
564
- function redactTmpl(secret, isCensorFct, censorFctTakesPath) {
565
- return Object.keys(secret).map((path) => {
566
- const { escPath, leadingBracket, path: arrPath } = secret[path];
567
- const skip = leadingBracket ? 1 : 0;
568
- const delim = leadingBracket ? "" : ".";
569
- const hops = [];
570
- var match;
571
- while ((match = rx.exec(path)) !== null) {
572
- const [, ix] = match;
573
- const { index, input } = match;
574
- if (index > skip) hops.push(input.substring(0, index - (ix ? 0 : 1)));
575
- }
576
- var existence = hops.map((p) => `o${delim}${p}`).join(" && ");
577
- if (existence.length === 0) existence += `o${delim}${path} != null`;
578
- else existence += ` && o${delim}${path} != null`;
579
- const circularDetection = `
580
- switch (true) {
581
- ${hops.reverse().map((p) => `
582
- case o${delim}${p} === censor:
583
- secret[${escPath}].circle = ${JSON.stringify(p)}
584
- break
585
- `).join("\n")}
586
- }
587
- `;
588
- const censorArgs = censorFctTakesPath ? `val, ${JSON.stringify(arrPath)}` : `val`;
589
- return `
590
- if (${existence}) {
591
- const val = o${delim}${path}
592
- if (val === censor) {
593
- secret[${escPath}].precensored = true
594
- } else {
595
- secret[${escPath}].val = val
596
- o${delim}${path} = ${isCensorFct ? `censor(${censorArgs})` : "censor"}
597
- ${circularDetection}
598
- }
599
- }
600
- `;
601
- }).join("\n");
602
- }
603
- __name(redactTmpl, "redactTmpl");
604
- function dynamicRedactTmpl(hasWildcards, isCensorFct, censorFctTakesPath) {
605
- return hasWildcards === true ? `
606
- {
607
- const { wildcards, wcLen, groupRedact, nestedRedact } = this
608
- for (var i = 0; i < wcLen; i++) {
609
- const { before, beforeStr, after, nested } = wildcards[i]
610
- if (nested === true) {
611
- secret[beforeStr] = secret[beforeStr] || []
612
- nestedRedact(secret[beforeStr], o, before, after, censor, ${isCensorFct}, ${censorFctTakesPath})
613
- } else secret[beforeStr] = groupRedact(o, before, censor, ${isCensorFct}, ${censorFctTakesPath})
614
- }
615
- }
616
- ` : "";
617
- }
618
- __name(dynamicRedactTmpl, "dynamicRedactTmpl");
619
- function resultTmpl(serialize) {
620
- return serialize === false ? `return o` : `
621
- var s = this.serialize(o)
622
- this.restore(o)
623
- return s
624
- `;
625
- }
626
- __name(resultTmpl, "resultTmpl");
627
- function strictImpl(strict, serialize) {
628
- return strict === true ? `throw Error('fast-redact: primitives cannot be redacted')` : serialize === false ? `return o` : `return this.serialize(o)`;
629
- }
630
- __name(strictImpl, "strictImpl");
631
- }
632
- });
633
-
634
- // node_modules/fast-redact/lib/modifiers.js
635
- var require_modifiers = __commonJS({
636
- "node_modules/fast-redact/lib/modifiers.js"(exports2, module2) {
637
- "use strict";
638
- module2.exports = {
639
- groupRedact,
640
- groupRestore,
641
- nestedRedact,
642
- nestedRestore
643
- };
644
- function groupRestore({ keys, values, target }) {
645
- if (target == null || typeof target === "string") return;
646
- const length = keys.length;
647
- for (var i = 0; i < length; i++) {
648
- const k = keys[i];
649
- target[k] = values[i];
650
- }
651
- }
652
- __name(groupRestore, "groupRestore");
653
- function groupRedact(o, path, censor, isCensorFct, censorFctTakesPath) {
654
- const target = get(o, path);
655
- if (target == null || typeof target === "string") return {
656
- keys: null,
657
- values: null,
658
- target,
659
- flat: true
660
- };
661
- const keys = Object.keys(target);
662
- const keysLength = keys.length;
663
- const pathLength = path.length;
664
- const pathWithKey = censorFctTakesPath ? [
665
- ...path
666
- ] : void 0;
667
- const values = new Array(keysLength);
668
- for (var i = 0; i < keysLength; i++) {
669
- const key = keys[i];
670
- values[i] = target[key];
671
- if (censorFctTakesPath) {
672
- pathWithKey[pathLength] = key;
673
- target[key] = censor(target[key], pathWithKey);
674
- } else if (isCensorFct) {
675
- target[key] = censor(target[key]);
547
+ __name(setValue, "setValue");
548
+ function removeKey(obj, parts) {
549
+ let current = obj;
550
+ for (let i = 0; i < parts.length - 1; i++) {
551
+ const key = parts[i];
552
+ if (typeof current !== "object" || current === null || !(key in current)) {
553
+ return false;
554
+ }
555
+ if (typeof current[key] !== "object" || current[key] === null) {
556
+ return false;
557
+ }
558
+ current = current[key];
559
+ }
560
+ const lastKey = parts[parts.length - 1];
561
+ if (lastKey === "*") {
562
+ if (Array.isArray(current)) {
563
+ for (let i = 0; i < current.length; i++) {
564
+ current[i] = void 0;
565
+ }
566
+ } else if (typeof current === "object" && current !== null) {
567
+ for (const key in current) {
568
+ if (Object.prototype.hasOwnProperty.call(current, key)) {
569
+ delete current[key];
570
+ }
571
+ }
572
+ }
573
+ } else {
574
+ if (typeof current === "object" && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) {
575
+ delete current[lastKey];
576
+ }
577
+ }
578
+ return true;
579
+ }
580
+ __name(removeKey, "removeKey");
581
+ var PATH_NOT_FOUND = Symbol("PATH_NOT_FOUND");
582
+ function getValueIfExists(obj, parts) {
583
+ let current = obj;
584
+ for (const part of parts) {
585
+ if (current === null || current === void 0) {
586
+ return PATH_NOT_FOUND;
587
+ }
588
+ if (typeof current !== "object" || current === null) {
589
+ return PATH_NOT_FOUND;
590
+ }
591
+ if (!(part in current)) {
592
+ return PATH_NOT_FOUND;
593
+ }
594
+ current = current[part];
595
+ }
596
+ return current;
597
+ }
598
+ __name(getValueIfExists, "getValueIfExists");
599
+ function getValue(obj, parts) {
600
+ let current = obj;
601
+ for (const part of parts) {
602
+ if (current === null || current === void 0) {
603
+ return void 0;
604
+ }
605
+ if (typeof current !== "object" || current === null) {
606
+ return void 0;
607
+ }
608
+ current = current[part];
609
+ }
610
+ return current;
611
+ }
612
+ __name(getValue, "getValue");
613
+ function redactPaths(obj, paths, censor, remove = false) {
614
+ for (const path of paths) {
615
+ const parts = parsePath(path);
616
+ if (parts.includes("*")) {
617
+ redactWildcardPath(obj, parts, censor, path, remove);
676
618
  } else {
677
- target[key] = censor;
619
+ if (remove) {
620
+ removeKey(obj, parts);
621
+ } else {
622
+ const value = getValueIfExists(obj, parts);
623
+ if (value === PATH_NOT_FOUND) {
624
+ continue;
625
+ }
626
+ const actualCensor = typeof censor === "function" ? censor(value, parts) : censor;
627
+ setValue(obj, parts, actualCensor);
628
+ }
678
629
  }
679
630
  }
680
- return {
681
- keys,
682
- values,
683
- target,
684
- flat: true
685
- };
686
631
  }
687
- __name(groupRedact, "groupRedact");
688
- function nestedRestore(instructions) {
689
- for (let i = 0; i < instructions.length; i++) {
690
- const { target, path, value } = instructions[i];
691
- let current = target;
692
- for (let i2 = path.length - 1; i2 > 0; i2--) {
693
- current = current[path[i2]];
694
- }
695
- current[path[0]] = value;
696
- }
697
- }
698
- __name(nestedRestore, "nestedRestore");
699
- function nestedRedact(store, o, path, ns, censor, isCensorFct, censorFctTakesPath) {
700
- const target = get(o, path);
701
- if (target == null) return;
702
- const keys = Object.keys(target);
703
- const keysLength = keys.length;
704
- for (var i = 0; i < keysLength; i++) {
705
- const key = keys[i];
706
- specialSet(store, target, key, path, ns, censor, isCensorFct, censorFctTakesPath);
707
- }
708
- return store;
709
- }
710
- __name(nestedRedact, "nestedRedact");
711
- function has(obj, prop) {
712
- return obj !== void 0 && obj !== null ? "hasOwn" in Object ? Object.hasOwn(obj, prop) : Object.prototype.hasOwnProperty.call(obj, prop) : false;
713
- }
714
- __name(has, "has");
715
- function specialSet(store, o, k, path, afterPath, censor, isCensorFct, censorFctTakesPath) {
716
- const afterPathLen = afterPath.length;
717
- const lastPathIndex = afterPathLen - 1;
718
- const originalKey = k;
719
- var i = -1;
720
- var n;
721
- var nv;
722
- var ov;
723
- var oov = null;
724
- var wc = null;
725
- var kIsWc;
726
- var wcov;
727
- var consecutive = false;
728
- var level = 0;
729
- var depth = 0;
730
- var redactPathCurrent = tree();
731
- ov = n = o[k];
732
- if (typeof n !== "object") return;
733
- while (n != null && ++i < afterPathLen) {
734
- depth += 1;
735
- k = afterPath[i];
736
- oov = ov;
737
- if (k !== "*" && !wc && !(typeof n === "object" && k in n)) {
738
- break;
632
+ __name(redactPaths, "redactPaths");
633
+ function redactWildcardPath(obj, parts, censor, originalPath, remove = false) {
634
+ const wildcardIndex = parts.indexOf("*");
635
+ if (wildcardIndex === parts.length - 1) {
636
+ const parentParts = parts.slice(0, -1);
637
+ let current = obj;
638
+ for (const part of parentParts) {
639
+ if (current === null || current === void 0) return;
640
+ if (typeof current !== "object" || current === null) return;
641
+ current = current[part];
739
642
  }
740
- if (k === "*") {
741
- if (wc === "*") {
742
- consecutive = true;
643
+ if (Array.isArray(current)) {
644
+ if (remove) {
645
+ for (let i = 0; i < current.length; i++) {
646
+ current[i] = void 0;
647
+ }
648
+ } else {
649
+ for (let i = 0; i < current.length; i++) {
650
+ const indexPath = [
651
+ ...parentParts,
652
+ i.toString()
653
+ ];
654
+ const actualCensor = typeof censor === "function" ? censor(current[i], indexPath) : censor;
655
+ current[i] = actualCensor;
656
+ }
743
657
  }
744
- wc = k;
745
- if (i !== lastPathIndex) {
746
- continue;
658
+ } else if (typeof current === "object" && current !== null) {
659
+ if (remove) {
660
+ const keysToDelete = [];
661
+ for (const key in current) {
662
+ if (Object.prototype.hasOwnProperty.call(current, key)) {
663
+ keysToDelete.push(key);
664
+ }
665
+ }
666
+ for (const key of keysToDelete) {
667
+ delete current[key];
668
+ }
669
+ } else {
670
+ for (const key in current) {
671
+ const keyPath = [
672
+ ...parentParts,
673
+ key
674
+ ];
675
+ const actualCensor = typeof censor === "function" ? censor(current[key], keyPath) : censor;
676
+ current[key] = actualCensor;
677
+ }
747
678
  }
748
679
  }
749
- if (wc) {
750
- const wcKeys = Object.keys(n);
751
- for (var j = 0; j < wcKeys.length; j++) {
752
- const wck = wcKeys[j];
753
- wcov = n[wck];
754
- kIsWc = k === "*";
755
- if (consecutive) {
756
- redactPathCurrent = node(redactPathCurrent, wck, depth);
757
- level = i;
758
- ov = iterateNthLevel(wcov, level - 1, k, path, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, o[originalKey], depth + 1);
759
- } else {
760
- if (kIsWc || typeof wcov === "object" && wcov !== null && k in wcov) {
761
- if (kIsWc) {
762
- ov = wcov;
763
- } else {
764
- ov = wcov[k];
765
- }
766
- nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [
767
- ...path,
768
- originalKey,
769
- ...afterPath
770
- ]) : censor(ov) : censor;
771
- if (kIsWc) {
772
- const rv = restoreInstr(node(redactPathCurrent, wck, depth), ov, o[originalKey]);
773
- store.push(rv);
774
- n[wck] = nv;
775
- } else {
776
- if (wcov[k] === nv) {
777
- } else if (nv === void 0 && censor !== void 0 || has(wcov, k) && nv === ov) {
778
- redactPathCurrent = node(redactPathCurrent, wck, depth);
779
- } else {
780
- redactPathCurrent = node(redactPathCurrent, wck, depth);
781
- const rv = restoreInstr(node(redactPathCurrent, k, depth + 1), ov, o[originalKey]);
782
- store.push(rv);
783
- wcov[k] = nv;
784
- }
785
- }
786
- }
680
+ } else {
681
+ redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove);
682
+ }
683
+ }
684
+ __name(redactWildcardPath, "redactWildcardPath");
685
+ function redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove = false) {
686
+ const beforeWildcard = parts.slice(0, wildcardIndex);
687
+ const afterWildcard = parts.slice(wildcardIndex + 1);
688
+ const pathArray = [];
689
+ function traverse(current, pathLength) {
690
+ if (pathLength === beforeWildcard.length) {
691
+ if (Array.isArray(current)) {
692
+ for (let i = 0; i < current.length; i++) {
693
+ pathArray[pathLength] = i.toString();
694
+ traverse(current[i], pathLength + 1);
787
695
  }
696
+ } else if (typeof current === "object" && current !== null) {
697
+ for (const key in current) {
698
+ pathArray[pathLength] = key;
699
+ traverse(current[key], pathLength + 1);
700
+ }
701
+ }
702
+ } else if (pathLength < beforeWildcard.length) {
703
+ const nextKey = beforeWildcard[pathLength];
704
+ if (current && typeof current === "object" && current !== null && nextKey in current) {
705
+ pathArray[pathLength] = nextKey;
706
+ traverse(current[nextKey], pathLength + 1);
788
707
  }
789
- wc = null;
790
708
  } else {
791
- ov = n[k];
792
- redactPathCurrent = node(redactPathCurrent, k, depth);
793
- nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [
794
- ...path,
795
- originalKey,
796
- ...afterPath
797
- ]) : censor(ov) : censor;
798
- if (has(n, k) && nv === ov || nv === void 0 && censor !== void 0) {
709
+ if (afterWildcard.includes("*")) {
710
+ const wrappedCensor = typeof censor === "function" ? (value, path) => {
711
+ const fullPath = [
712
+ ...pathArray.slice(0, pathLength),
713
+ ...path
714
+ ];
715
+ return censor(value, fullPath);
716
+ } : censor;
717
+ redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
799
718
  } else {
800
- const rv = restoreInstr(redactPathCurrent, ov, o[originalKey]);
801
- store.push(rv);
802
- n[k] = nv;
719
+ if (remove) {
720
+ removeKey(current, afterWildcard);
721
+ } else {
722
+ const actualCensor = typeof censor === "function" ? censor(getValue(current, afterWildcard), [
723
+ ...pathArray.slice(0, pathLength),
724
+ ...afterWildcard
725
+ ]) : censor;
726
+ setValue(current, afterWildcard, actualCensor);
727
+ }
803
728
  }
804
- n = n[k];
805
729
  }
806
- if (typeof n !== "object") break;
807
- if (ov === oov || typeof ov === "undefined") {
730
+ }
731
+ __name(traverse, "traverse");
732
+ if (beforeWildcard.length === 0) {
733
+ traverse(obj, 0);
734
+ } else {
735
+ let current = obj;
736
+ for (let i = 0; i < beforeWildcard.length; i++) {
737
+ const part = beforeWildcard[i];
738
+ if (current === null || current === void 0) return;
739
+ if (typeof current !== "object" || current === null) return;
740
+ current = current[part];
741
+ pathArray[i] = part;
742
+ }
743
+ if (current !== null && current !== void 0) {
744
+ traverse(current, beforeWildcard.length);
745
+ }
746
+ }
747
+ }
748
+ __name(redactIntermediateWildcard, "redactIntermediateWildcard");
749
+ function buildPathStructure(pathsToClone) {
750
+ if (pathsToClone.length === 0) {
751
+ return null;
752
+ }
753
+ const pathStructure = /* @__PURE__ */ new Map();
754
+ for (const path of pathsToClone) {
755
+ const parts = parsePath(path);
756
+ let current = pathStructure;
757
+ for (let i = 0; i < parts.length; i++) {
758
+ const part = parts[i];
759
+ if (!current.has(part)) {
760
+ current.set(part, /* @__PURE__ */ new Map());
761
+ }
762
+ current = current.get(part);
808
763
  }
809
764
  }
765
+ return pathStructure;
810
766
  }
811
- __name(specialSet, "specialSet");
812
- function get(o, p) {
813
- var i = -1;
814
- var l = p.length;
815
- var n = o;
816
- while (n != null && ++i < l) {
817
- n = n[p[i]];
767
+ __name(buildPathStructure, "buildPathStructure");
768
+ function selectiveClone(obj, pathStructure) {
769
+ if (!pathStructure) {
770
+ return obj;
818
771
  }
819
- return n;
820
- }
821
- __name(get, "get");
822
- function iterateNthLevel(wcov, level, k, path, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, parent, depth) {
823
- if (level === 0) {
824
- if (kIsWc || typeof wcov === "object" && wcov !== null && k in wcov) {
825
- if (kIsWc) {
826
- ov = wcov;
827
- } else {
828
- ov = wcov[k];
772
+ function cloneSelectively(source, pathMap, depth = 0) {
773
+ if (!pathMap || pathMap.size === 0) {
774
+ return source;
775
+ }
776
+ if (source === null || typeof source !== "object") {
777
+ return source;
778
+ }
779
+ if (source instanceof Date) {
780
+ return new Date(source.getTime());
781
+ }
782
+ if (Array.isArray(source)) {
783
+ const cloned2 = [];
784
+ for (let i = 0; i < source.length; i++) {
785
+ const indexStr = i.toString();
786
+ if (pathMap.has(indexStr) || pathMap.has("*")) {
787
+ cloned2[i] = cloneSelectively(source[i], pathMap.get(indexStr) || pathMap.get("*"));
788
+ } else {
789
+ cloned2[i] = source[i];
790
+ }
829
791
  }
830
- nv = i !== lastPathIndex ? ov : isCensorFct ? censorFctTakesPath ? censor(ov, [
831
- ...path,
832
- originalKey,
833
- ...afterPath
834
- ]) : censor(ov) : censor;
835
- if (kIsWc) {
836
- const rv = restoreInstr(redactPathCurrent, ov, parent);
837
- store.push(rv);
838
- n[wck] = nv;
839
- } else {
840
- if (wcov[k] === nv) {
841
- } else if (nv === void 0 && censor !== void 0 || has(wcov, k) && nv === ov) {
792
+ return cloned2;
793
+ }
794
+ const cloned = Object.create(Object.getPrototypeOf(source));
795
+ for (const key in source) {
796
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
797
+ if (pathMap.has(key) || pathMap.has("*")) {
798
+ cloned[key] = cloneSelectively(source[key], pathMap.get(key) || pathMap.get("*"));
842
799
  } else {
843
- const rv = restoreInstr(node(redactPathCurrent, k, depth + 1), ov, parent);
844
- store.push(rv);
845
- wcov[k] = nv;
800
+ cloned[key] = source[key];
846
801
  }
847
802
  }
848
803
  }
849
- }
850
- for (const key in wcov) {
851
- if (typeof wcov[key] === "object") {
852
- redactPathCurrent = node(redactPathCurrent, key, depth);
853
- iterateNthLevel(wcov[key], level - 1, k, path, afterPath, censor, isCensorFct, censorFctTakesPath, originalKey, n, nv, ov, kIsWc, wck, i, lastPathIndex, redactPathCurrent, store, parent, depth + 1);
804
+ return cloned;
805
+ }
806
+ __name(cloneSelectively, "cloneSelectively");
807
+ return cloneSelectively(obj, pathStructure);
808
+ }
809
+ __name(selectiveClone, "selectiveClone");
810
+ function validatePath(path) {
811
+ if (typeof path !== "string") {
812
+ throw new Error("Paths must be (non-empty) strings");
813
+ }
814
+ if (path === "") {
815
+ throw new Error("Invalid redaction path ()");
816
+ }
817
+ if (path.includes("..")) {
818
+ throw new Error(`Invalid redaction path (${path})`);
819
+ }
820
+ if (path.includes(",")) {
821
+ throw new Error(`Invalid redaction path (${path})`);
822
+ }
823
+ let bracketCount = 0;
824
+ let inQuotes = false;
825
+ let quoteChar = "";
826
+ for (let i = 0; i < path.length; i++) {
827
+ const char = path[i];
828
+ if ((char === '"' || char === "'") && bracketCount > 0) {
829
+ if (!inQuotes) {
830
+ inQuotes = true;
831
+ quoteChar = char;
832
+ } else if (char === quoteChar) {
833
+ inQuotes = false;
834
+ quoteChar = "";
835
+ }
836
+ } else if (char === "[" && !inQuotes) {
837
+ bracketCount++;
838
+ } else if (char === "]" && !inQuotes) {
839
+ bracketCount--;
840
+ if (bracketCount < 0) {
841
+ throw new Error(`Invalid redaction path (${path})`);
842
+ }
854
843
  }
855
844
  }
845
+ if (bracketCount !== 0) {
846
+ throw new Error(`Invalid redaction path (${path})`);
847
+ }
856
848
  }
857
- __name(iterateNthLevel, "iterateNthLevel");
858
- function tree() {
859
- return {
860
- parent: null,
861
- key: null,
862
- children: [],
863
- depth: 0
864
- };
865
- }
866
- __name(tree, "tree");
867
- function node(parent, key, depth) {
868
- if (parent.depth === depth) {
869
- return node(parent.parent, key, depth);
849
+ __name(validatePath, "validatePath");
850
+ function validatePaths(paths) {
851
+ if (!Array.isArray(paths)) {
852
+ throw new TypeError("paths must be an array");
853
+ }
854
+ for (const path of paths) {
855
+ validatePath(path);
870
856
  }
871
- var child = {
872
- parent,
873
- key,
874
- depth,
875
- children: []
876
- };
877
- parent.children.push(child);
878
- return child;
879
- }
880
- __name(node, "node");
881
- function restoreInstr(node2, value, target) {
882
- let current = node2;
883
- const path = [];
884
- do {
885
- path.push(current.key);
886
- current = current.parent;
887
- } while (current.parent != null);
888
- return {
889
- path,
890
- value,
891
- target
892
- };
893
857
  }
894
- __name(restoreInstr, "restoreInstr");
895
- }
896
- });
897
-
898
- // node_modules/fast-redact/lib/restorer.js
899
- var require_restorer = __commonJS({
900
- "node_modules/fast-redact/lib/restorer.js"(exports2, module2) {
901
- "use strict";
902
- var { groupRestore, nestedRestore } = require_modifiers();
903
- module2.exports = restorer;
904
- function restorer() {
905
- return /* @__PURE__ */ __name(function compileRestore() {
906
- if (this.restore) {
907
- this.restore.state.secret = this.secret;
908
- return;
858
+ __name(validatePaths, "validatePaths");
859
+ function slowRedact(options = {}) {
860
+ const { paths = [], censor = "[REDACTED]", serialize = JSON.stringify, strict = true, remove = false } = options;
861
+ validatePaths(paths);
862
+ const pathStructure = buildPathStructure(paths);
863
+ return /* @__PURE__ */ __name(function redact(obj) {
864
+ if (strict && (obj === null || typeof obj !== "object")) {
865
+ if (obj === null || obj === void 0) {
866
+ return serialize ? serialize(obj) : obj;
867
+ }
868
+ if (typeof obj !== "object") {
869
+ return serialize ? serialize(obj) : obj;
870
+ }
909
871
  }
910
- const { secret, wcLen } = this;
911
- const paths = Object.keys(secret);
912
- const resetters = resetTmpl(secret, paths);
913
- const hasWildcards = wcLen > 0;
914
- const state = hasWildcards ? {
915
- secret,
916
- groupRestore,
917
- nestedRestore
918
- } : {
919
- secret
920
- };
921
- this.restore = Function("o", restoreTmpl(resetters, paths, hasWildcards)).bind(state);
922
- this.restore.state = state;
923
- }, "compileRestore");
924
- }
925
- __name(restorer, "restorer");
926
- function resetTmpl(secret, paths) {
927
- return paths.map((path) => {
928
- const { circle, escPath, leadingBracket } = secret[path];
929
- const delim = leadingBracket ? "" : ".";
930
- const reset = circle ? `o.${circle} = secret[${escPath}].val` : `o${delim}${path} = secret[${escPath}].val`;
931
- const clear = `secret[${escPath}].val = undefined`;
932
- return `
933
- if (secret[${escPath}].val !== undefined) {
934
- try { ${reset} } catch (e) {}
935
- ${clear}
936
- }
937
- `;
938
- }).join("");
939
- }
940
- __name(resetTmpl, "resetTmpl");
941
- function restoreTmpl(resetters, paths, hasWildcards) {
942
- const dynamicReset = hasWildcards === true ? `
943
- const keys = Object.keys(secret)
944
- const len = keys.length
945
- for (var i = len - 1; i >= ${paths.length}; i--) {
946
- const k = keys[i]
947
- const o = secret[k]
948
- if (o) {
949
- if (o.flat === true) this.groupRestore(o)
950
- else this.nestedRestore(o)
951
- secret[k] = null
952
- }
953
- }
954
- ` : "";
955
- return `
956
- const secret = this.secret
957
- ${dynamicReset}
958
- ${resetters}
959
- return o
960
- `;
961
- }
962
- __name(restoreTmpl, "restoreTmpl");
963
- }
964
- });
965
-
966
- // node_modules/fast-redact/lib/state.js
967
- var require_state = __commonJS({
968
- "node_modules/fast-redact/lib/state.js"(exports2, module2) {
969
- "use strict";
970
- module2.exports = state;
971
- function state(o) {
972
- const { secret, censor, compileRestore, serialize, groupRedact, nestedRedact, wildcards, wcLen } = o;
973
- const builder = [
974
- {
975
- secret,
976
- censor,
977
- compileRestore
872
+ const cloned = selectiveClone(obj, pathStructure);
873
+ const original = obj;
874
+ let actualCensor = censor;
875
+ if (typeof censor === "function") {
876
+ actualCensor = censor;
978
877
  }
979
- ];
980
- if (serialize !== false) builder.push({
981
- serialize
982
- });
983
- if (wcLen > 0) builder.push({
984
- groupRedact,
985
- nestedRedact,
986
- wildcards,
987
- wcLen
988
- });
989
- return Object.assign(...builder);
878
+ redactPaths(cloned, paths, actualCensor, remove);
879
+ if (serialize === false) {
880
+ cloned.restore = function() {
881
+ return deepClone(original);
882
+ };
883
+ return cloned;
884
+ }
885
+ if (typeof serialize === "function") {
886
+ return serialize(cloned);
887
+ }
888
+ return JSON.stringify(cloned);
889
+ }, "redact");
990
890
  }
991
- __name(state, "state");
992
- }
993
- });
994
-
995
- // node_modules/fast-redact/index.js
996
- var require_fast_redact = __commonJS({
997
- "node_modules/fast-redact/index.js"(exports2, module2) {
998
- "use strict";
999
- var validator = require_validator();
1000
- var parse = require_parse();
1001
- var redactor = require_redactor();
1002
- var restorer = require_restorer();
1003
- var { groupRedact, nestedRedact } = require_modifiers();
1004
- var state = require_state();
1005
- var rx = require_rx();
1006
- var validate = validator();
1007
- var noop = /* @__PURE__ */ __name((o) => o, "noop");
1008
- noop.restore = noop;
1009
- var DEFAULT_CENSOR = "[REDACTED]";
1010
- fastRedact.rx = rx;
1011
- fastRedact.validator = validator;
1012
- module2.exports = fastRedact;
1013
- function fastRedact(opts = {}) {
1014
- const paths = Array.from(new Set(opts.paths || []));
1015
- const serialize = "serialize" in opts ? opts.serialize === false ? opts.serialize : typeof opts.serialize === "function" ? opts.serialize : JSON.stringify : JSON.stringify;
1016
- const remove = opts.remove;
1017
- if (remove === true && serialize !== JSON.stringify) {
1018
- throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");
1019
- }
1020
- const censor = remove === true ? void 0 : "censor" in opts ? opts.censor : DEFAULT_CENSOR;
1021
- const isCensorFct = typeof censor === "function";
1022
- const censorFctTakesPath = isCensorFct && censor.length > 1;
1023
- if (paths.length === 0) return serialize || noop;
1024
- validate({
1025
- paths,
1026
- serialize,
1027
- censor
1028
- });
1029
- const { wildcards, wcLen, secret } = parse({
1030
- paths,
1031
- censor
1032
- });
1033
- const compileRestore = restorer();
1034
- const strict = "strict" in opts ? opts.strict : true;
1035
- return redactor({
1036
- secret,
1037
- wcLen,
1038
- serialize,
1039
- strict,
1040
- isCensorFct,
1041
- censorFctTakesPath
1042
- }, state({
1043
- secret,
1044
- censor,
1045
- compileRestore,
1046
- serialize,
1047
- groupRedact,
1048
- nestedRedact,
1049
- wildcards,
1050
- wcLen
1051
- }));
1052
- }
1053
- __name(fastRedact, "fastRedact");
891
+ __name(slowRedact, "slowRedact");
892
+ module2.exports = slowRedact;
1054
893
  }
1055
894
  });
1056
895
 
@@ -1129,17 +968,13 @@ var require_symbols = __commonJS({
1129
968
  var require_redaction = __commonJS({
1130
969
  "node_modules/pino/lib/redaction.js"(exports2, module2) {
1131
970
  "use strict";
1132
- var fastRedact = require_fast_redact();
971
+ var Redact = require_redact();
1133
972
  var { redactFmtSym, wildcardFirstSym } = require_symbols();
1134
- var { rx, validator } = fastRedact;
1135
- var validate = validator({
1136
- ERR_PATHS_MUST_BE_STRINGS: /* @__PURE__ */ __name(() => "pino \u2013 redacted paths must be strings", "ERR_PATHS_MUST_BE_STRINGS"),
1137
- ERR_INVALID_PATH: /* @__PURE__ */ __name((s) => `pino \u2013 redact paths array contains an invalid path (${s})`, "ERR_INVALID_PATH")
1138
- });
973
+ var rx = /[^.[\]]+|\[([^[\]]*?)\]/g;
1139
974
  var CENSOR = "[Redacted]";
1140
975
  var strict = false;
1141
976
  function redaction(opts, serialize) {
1142
- const { paths, censor } = handle(opts);
977
+ const { paths, censor, remove } = handle(opts);
1143
978
  const shape = paths.reduce((o, str) => {
1144
979
  rx.lastIndex = 0;
1145
980
  const first = rx.exec(str);
@@ -1172,11 +1007,12 @@ var require_redaction = __commonJS({
1172
1007
  return o;
1173
1008
  }, {});
1174
1009
  const result = {
1175
- [redactFmtSym]: fastRedact({
1010
+ [redactFmtSym]: Redact({
1176
1011
  paths,
1177
1012
  censor,
1178
1013
  serialize,
1179
- strict
1014
+ strict,
1015
+ remove
1180
1016
  })
1181
1017
  };
1182
1018
  const topCensor = /* @__PURE__ */ __name((...args) => {
@@ -1197,11 +1033,12 @@ var require_redaction = __commonJS({
1197
1033
  ...path
1198
1034
  ]);
1199
1035
  } : censor;
1200
- o[k] = fastRedact({
1036
+ o[k] = Redact({
1201
1037
  paths: shape[k],
1202
1038
  censor: wrappedCensor,
1203
1039
  serialize,
1204
- strict
1040
+ strict,
1041
+ remove
1205
1042
  });
1206
1043
  }
1207
1044
  return o;
@@ -1214,7 +1051,6 @@ var require_redaction = __commonJS({
1214
1051
  paths: opts,
1215
1052
  censor: CENSOR
1216
1053
  };
1217
- validate(opts);
1218
1054
  return opts;
1219
1055
  }
1220
1056
  let { paths, censor = CENSOR, remove } = opts;
@@ -1222,13 +1058,10 @@ var require_redaction = __commonJS({
1222
1058
  throw Error("pino \u2013 redact must contain an array of strings");
1223
1059
  }
1224
1060
  if (remove === true) censor = void 0;
1225
- validate({
1226
- paths,
1227
- censor
1228
- });
1229
1061
  return {
1230
1062
  paths,
1231
- censor
1063
+ censor,
1064
+ remove
1232
1065
  };
1233
1066
  }
1234
1067
  __name(handle, "handle");
@@ -3043,7 +2876,7 @@ var require_tools = __commonJS({
3043
2876
  bindings = formatter(bindings);
3044
2877
  for (const key in bindings) {
3045
2878
  value = bindings[key];
3046
- const valid = key !== "level" && key !== "serializers" && key !== "formatters" && key !== "customLevels" && bindings.hasOwnProperty(key) && value !== void 0;
2879
+ const valid = (key.length < 5 || key !== "level" && key !== "serializers" && key !== "formatters" && key !== "customLevels") && bindings.hasOwnProperty(key) && value !== void 0;
3047
2880
  if (valid === true) {
3048
2881
  value = serializers[key] ? serializers[key](value) : value;
3049
2882
  value = (stringifiers[key] || wildcardStringifier || stringify2)(value, stringifySafe);
@@ -3417,7 +3250,7 @@ var require_meta = __commonJS({
3417
3250
  "node_modules/pino/lib/meta.js"(exports2, module2) {
3418
3251
  "use strict";
3419
3252
  module2.exports = {
3420
- version: "9.11.0"
3253
+ version: "9.14.0"
3421
3254
  };
3422
3255
  }
3423
3256
  });
@@ -3429,7 +3262,7 @@ var require_proto = __commonJS({
3429
3262
  var { EventEmitter } = require("events");
3430
3263
  var { lsCacheSym, levelValSym, setLevelSym, getLevelSym, chindingsSym, parsedChindingsSym, mixinSym, asJsonSym, writeSym, mixinMergeStrategySym, timeSym, timeSliceIndexSym, streamSym, serializersSym, formattersSym, errorKeySym, messageKeySym, useOnlyCustomLevelsSym, needsMetadataGsym, redactFmtSym, stringifySym, formatOptsSym, stringifiersSym, msgPrefixSym, hooksSym } = require_symbols();
3431
3264
  var { getLevel, setLevel, isLevelEnabled, mappings, initialLsCache, genLsCache, assertNoLevelCollisions } = require_levels();
3432
- var { asChindings, asJson, buildFormatters, stringify } = require_tools();
3265
+ var { asChindings, asJson, buildFormatters, stringify, noop } = require_tools();
3433
3266
  var { version } = require_meta();
3434
3267
  var redaction = require_redaction();
3435
3268
  var _a2;
@@ -3476,10 +3309,20 @@ var require_proto = __commonJS({
3476
3309
  if (!bindings2) {
3477
3310
  throw Error("missing bindings for child Pino");
3478
3311
  }
3479
- options = options || {};
3480
3312
  const serializers = this[serializersSym];
3481
3313
  const formatters = this[formattersSym];
3482
3314
  const instance = Object.create(this);
3315
+ if (options == null) {
3316
+ if (instance[formattersSym].bindings !== resetChildingsFormatter) {
3317
+ instance[formattersSym] = buildFormatters(formatters.level, resetChildingsFormatter, formatters.log);
3318
+ }
3319
+ instance[chindingsSym] = asChindings(instance, bindings2);
3320
+ instance[setLevelSym](this.level);
3321
+ if (this.onChild !== noop) {
3322
+ this.onChild(instance);
3323
+ }
3324
+ return instance;
3325
+ }
3483
3326
  if (options.hasOwnProperty("serializers") === true) {
3484
3327
  instance[serializersSym] = /* @__PURE__ */ Object.create(null);
3485
3328
  for (const k in serializers) {
@@ -3524,10 +3367,8 @@ var require_proto = __commonJS({
3524
3367
  instance[msgPrefixSym] = (this[msgPrefixSym] || "") + options.msgPrefix;
3525
3368
  }
3526
3369
  instance[chindingsSym] = asChindings(instance, bindings2);
3527
- if (options.level !== void 0 && options.level !== this.level || options.hasOwnProperty("customLevels")) {
3528
- const childLevel = options.level || this.level;
3529
- instance[setLevelSym](childLevel);
3530
- }
3370
+ const childLevel = options.level || this.level;
3371
+ instance[setLevelSym](childLevel);
3531
3372
  this.onChild(instance);
3532
3373
  return instance;
3533
3374
  }
@@ -3589,9 +3430,6 @@ var require_proto = __commonJS({
3589
3430
  stream.write(streamWriteHook ? streamWriteHook(s) : s);
3590
3431
  }
3591
3432
  __name(write, "write");
3592
- function noop() {
3593
- }
3594
- __name(noop, "noop");
3595
3433
  function flush(cb) {
3596
3434
  if (cb != null && typeof cb !== "function") {
3597
3435
  throw Error("callback must be a function");