@adviser/cement 0.3.14 → 0.3.16

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 (116) hide show
  1. package/{base-sys-abstraction-8v83VyEU.d.ts → base-sys-abstraction-BnBZ6zd0.d.ts} +2 -2
  2. package/{base-sys-abstraction-4Vw4QGaI.d.cts → base-sys-abstraction-DAZ8tx5F.d.cts} +2 -2
  3. package/cf/index.cjs +46 -18
  4. package/cf/index.cjs.map +1 -1
  5. package/cf/index.d.cts +3 -3
  6. package/cf/index.d.ts +3 -3
  7. package/cf/index.js +3 -3
  8. package/{chunk-W53WEZWY.js → chunk-55W4AK2Z.js} +3 -5
  9. package/{chunk-W53WEZWY.js.map → chunk-55W4AK2Z.js.map} +1 -1
  10. package/{chunk-22GI5ETU.js → chunk-H3CAVBMO.js} +41 -42
  11. package/chunk-H3CAVBMO.js.map +1 -0
  12. package/{chunk-A57BAYWU.js → chunk-LXTKPZ6M.js} +10 -8
  13. package/chunk-LXTKPZ6M.js.map +1 -0
  14. package/{chunk-KY47QBK3.js → chunk-WGRZHIFK.js} +155 -152
  15. package/chunk-WGRZHIFK.js.map +1 -0
  16. package/{chunk-GLUGMVET.js → chunk-Z3IR6QEZ.js} +3 -3
  17. package/deno/index.cjs +46 -18
  18. package/deno/index.cjs.map +1 -1
  19. package/deno/index.d.cts +3 -3
  20. package/deno/index.d.ts +3 -3
  21. package/deno/index.js +2 -2
  22. package/{get-params-result-C2cbgB78.d.ts → get-params-result-4xHM5s4_.d.cts} +14 -10
  23. package/{get-params-result-C2cbgB78.d.cts → get-params-result-4xHM5s4_.d.ts} +14 -10
  24. package/index-CMLb7JSe.d.ts +97 -0
  25. package/{index-DixRvifF.d.cts → index-Cp1NspHH.d.cts} +10 -10
  26. package/{index-D2WPDt4R.d.ts → index-D1j1fPYg.d.ts} +10 -10
  27. package/index-LQOsS7gM.d.cts +97 -0
  28. package/index.cjs +370 -317
  29. package/index.cjs.map +1 -1
  30. package/index.d.cts +23 -10
  31. package/index.d.ts +23 -10
  32. package/index.js +86 -39
  33. package/index.js.map +1 -1
  34. package/metafile-cjs.json +1 -1
  35. package/metafile-esm.json +1 -1
  36. package/node/index.cjs +46 -18
  37. package/node/index.cjs.map +1 -1
  38. package/node/index.d.cts +3 -3
  39. package/node/index.d.ts +3 -3
  40. package/node/index.js +2 -2
  41. package/package.json +5 -4
  42. package/src/index.ts +4 -2
  43. package/src/jsr.json +1 -1
  44. package/src/logger.ts +8 -6
  45. package/src/lru-cache.ts +68 -0
  46. package/src/sys-abstraction.ts +18 -15
  47. package/src/time.ts +7 -9
  48. package/src/types.ts +19 -0
  49. package/src/uri.ts +4 -3
  50. package/src/utils/get-params-result.ts +2 -18
  51. package/src/utils/relative-path.ts +8 -6
  52. package/{sys-abstraction-3OXhCVsu.d.cts → sys-abstraction-B0x6IE7r.d.ts} +27 -23
  53. package/{sys-abstraction-DXeSUn9x.d.ts → sys-abstraction-BTs3Vzy4.d.cts} +27 -23
  54. package/test/index.cjs +87 -46
  55. package/test/index.cjs.map +1 -1
  56. package/test/index.d.cts +3 -3
  57. package/test/index.d.ts +3 -3
  58. package/test/index.js +4 -4
  59. package/ts/src/index.d.ts +2 -2
  60. package/ts/src/index.d.ts.map +1 -1
  61. package/ts/src/index.js +2 -2
  62. package/ts/src/index.js.map +1 -1
  63. package/ts/src/logger.d.ts +7 -6
  64. package/ts/src/logger.d.ts.map +1 -1
  65. package/ts/src/logger.js +6 -7
  66. package/ts/src/logger.js.map +1 -1
  67. package/ts/src/lru-cache.d.ts +15 -0
  68. package/ts/src/lru-cache.d.ts.map +1 -0
  69. package/ts/src/lru-cache.js +46 -0
  70. package/ts/src/lru-cache.js.map +1 -0
  71. package/ts/src/lru-cache.test.d.ts +2 -0
  72. package/ts/src/lru-cache.test.d.ts.map +1 -0
  73. package/ts/src/lru-cache.test.js +54 -0
  74. package/ts/src/lru-cache.test.js.map +1 -0
  75. package/ts/src/sys-abstraction.d.ts +18 -15
  76. package/ts/src/sys-abstraction.d.ts.map +1 -1
  77. package/ts/src/sys-abstraction.js +15 -18
  78. package/ts/src/sys-abstraction.js.map +1 -1
  79. package/ts/src/sys-env.test.js +1 -2
  80. package/ts/src/sys-env.test.js.map +1 -1
  81. package/ts/src/time.d.ts +7 -6
  82. package/ts/src/time.d.ts.map +1 -1
  83. package/ts/src/time.js +6 -7
  84. package/ts/src/time.js.map +1 -1
  85. package/ts/src/types.d.ts +16 -0
  86. package/ts/src/types.d.ts.map +1 -0
  87. package/ts/src/types.js +15 -0
  88. package/ts/src/types.js.map +1 -0
  89. package/ts/src/uri.d.ts +0 -1
  90. package/ts/src/uri.d.ts.map +1 -1
  91. package/ts/src/uri.js +1 -2
  92. package/ts/src/uri.js.map +1 -1
  93. package/ts/src/utils/get-params-result.d.ts +2 -13
  94. package/ts/src/utils/get-params-result.d.ts.map +1 -1
  95. package/ts/src/utils/get-params-result.js +1 -14
  96. package/ts/src/utils/get-params-result.js.map +1 -1
  97. package/ts/src/utils/relative-path.d.ts +7 -6
  98. package/ts/src/utils/relative-path.d.ts.map +1 -1
  99. package/ts/src/utils/relative-path.js +6 -7
  100. package/ts/src/utils/relative-path.js.map +1 -1
  101. package/utils/index.cjs +9 -9
  102. package/utils/index.cjs.map +1 -1
  103. package/utils/index.d.cts +2 -2
  104. package/utils/index.d.ts +2 -2
  105. package/utils/index.js +3 -5
  106. package/web/index.cjs +46 -18
  107. package/web/index.cjs.map +1 -1
  108. package/web/index.d.cts +3 -3
  109. package/web/index.d.ts +3 -3
  110. package/web/index.js +3 -3
  111. package/chunk-22GI5ETU.js.map +0 -1
  112. package/chunk-A57BAYWU.js.map +0 -1
  113. package/chunk-KY47QBK3.js.map +0 -1
  114. package/index-Dpc3oVOD.d.cts +0 -99
  115. package/index-MWn9Xel9.d.ts +0 -99
  116. /package/{chunk-GLUGMVET.js.map → chunk-Z3IR6QEZ.js.map} +0 -0
@@ -5,18 +5,17 @@ import {
5
5
  } from "./chunk-PHS255C5.js";
6
6
  import {
7
7
  WebSysAbstraction
8
- } from "./chunk-GLUGMVET.js";
8
+ } from "./chunk-Z3IR6QEZ.js";
9
9
  import {
10
10
  Future,
11
11
  runtimeFn
12
- } from "./chunk-22GI5ETU.js";
12
+ } from "./chunk-H3CAVBMO.js";
13
13
  import {
14
14
  Result,
15
15
  TxtEnDecoderSingleton,
16
16
  exception2Result,
17
- getParamsResult,
18
- param
19
- } from "./chunk-A57BAYWU.js";
17
+ getParamsResult
18
+ } from "./chunk-LXTKPZ6M.js";
20
19
 
21
20
  // src/test/log-write-stream.ts
22
21
  var LogWriteStream = class {
@@ -144,13 +143,12 @@ function bin2string(hex, size = 0) {
144
143
  }
145
144
 
146
145
  // src/logger.ts
147
- var Level = /* @__PURE__ */ ((Level2) => {
148
- Level2["WARN"] = "warn";
149
- Level2["DEBUG"] = "debug";
150
- Level2["INFO"] = "info";
151
- Level2["ERROR"] = "error";
152
- return Level2;
153
- })(Level || {});
146
+ var Level = {
147
+ WARN: "warn",
148
+ DEBUG: "debug",
149
+ INFO: "info",
150
+ ERROR: "error"
151
+ };
154
152
  var LogValue = class {
155
153
  constructor(fn) {
156
154
  this.fn = fn;
@@ -244,16 +242,16 @@ function logValueInternal(val, ctx) {
244
242
  }
245
243
  const res = {};
246
244
  const typedVal = val;
247
- for (const key2 in typedVal) {
248
- if (ctx.ignoreAttr.IsSome() && ctx.ignoreAttr.unwrap().test(key2)) {
245
+ for (const key in typedVal) {
246
+ if (ctx.ignoreAttr.IsSome() && ctx.ignoreAttr.unwrap().test(key)) {
249
247
  continue;
250
248
  }
251
- const element = typedVal[key2];
249
+ const element = typedVal[key];
252
250
  if (element instanceof LogValue) {
253
- res[key2] = element;
251
+ res[key] = element;
254
252
  } else {
255
253
  if (typeof element !== "function") {
256
- res[key2] = logValueInternal(element, ctx);
254
+ res[key] = logValueInternal(element, ctx);
257
255
  }
258
256
  }
259
257
  }
@@ -344,7 +342,7 @@ var None = class extends Option {
344
342
  // src/log-level-impl.ts
345
343
  var LevelHandlerImpl = class {
346
344
  constructor() {
347
- this._globalLevels = /* @__PURE__ */ new Set(["info" /* INFO */, "error" /* ERROR */, "warn" /* WARN */]);
345
+ this._globalLevels = /* @__PURE__ */ new Set([Level.INFO, Level.ERROR, Level.WARN]);
348
346
  this._modules = /* @__PURE__ */ new Map();
349
347
  this.ignoreAttr = Option.Some(/^_/);
350
348
  this.isStackExposed = false;
@@ -394,9 +392,9 @@ var LevelHandlerImpl = class {
394
392
  }
395
393
  setDebug(...modules) {
396
394
  this.forModules(
397
- "debug" /* DEBUG */,
395
+ Level.DEBUG,
398
396
  (p) => {
399
- this._modules.set(p, /* @__PURE__ */ new Set([...this._globalLevels, "debug" /* DEBUG */]));
397
+ this._modules.set(p, /* @__PURE__ */ new Set([...this._globalLevels, Level.DEBUG]));
400
398
  },
401
399
  ...modules
402
400
  );
@@ -430,6 +428,13 @@ function LevelHandlerSingleton() {
430
428
  import YAML from "yaml";
431
429
 
432
430
  // src/utils/relative-path.ts
431
+ var PartType = {
432
+ Slash: 1,
433
+ Root: 3,
434
+ Up: 4,
435
+ Noop: 8
436
+ // RootUp = 0x8 /* ../ */,
437
+ };
433
438
  var Path = class {
434
439
  constructor(parts = []) {
435
440
  this.parts = parts;
@@ -440,10 +445,10 @@ var Path = class {
440
445
  return part;
441
446
  } else {
442
447
  switch (part) {
443
- case 1 /* Slash */:
444
- case 3 /* Root */:
448
+ case PartType.Slash:
449
+ case PartType.Root:
445
450
  return "/";
446
- case 4 /* Up */:
451
+ case PartType.Up:
447
452
  return "..";
448
453
  default:
449
454
  return part;
@@ -452,22 +457,22 @@ var Path = class {
452
457
  }).join("");
453
458
  }
454
459
  add(part) {
455
- if (this.parts.includes(3 /* Root */) && part === 3 /* Root */) {
460
+ if (this.parts.includes(PartType.Root) && part === PartType.Root) {
456
461
  throw new Error("Cannot add absolute part to absolute path");
457
462
  }
458
463
  const last = this.parts[this.parts.length - 1];
459
- if (last & 1 /* Slash */ && part === 1 /* Slash */) {
464
+ if (last & PartType.Slash && part === PartType.Slash) {
460
465
  return;
461
466
  }
462
467
  switch (part) {
463
468
  case ".":
464
- this.parts.push(8 /* Noop */);
469
+ this.parts.push(PartType.Noop);
465
470
  return;
466
471
  case "..":
467
- part = 4 /* Up */;
472
+ part = PartType.Up;
468
473
  }
469
- if (last === 8 /* Noop */ && part === 1 /* Slash */) {
470
- if (last === 8 /* Noop */) {
474
+ if (last === PartType.Noop && part === PartType.Slash) {
475
+ if (last === PartType.Noop) {
471
476
  this.parts.pop();
472
477
  }
473
478
  return;
@@ -483,9 +488,9 @@ function splitPath(path) {
483
488
  for (let count = 0; path.length; count++) {
484
489
  if (path.match(/^\/+/)) {
485
490
  if (count === 0) {
486
- p.add(3 /* Root */);
491
+ p.add(PartType.Root);
487
492
  } else {
488
- p.add(1 /* Slash */);
493
+ p.add(PartType.Slash);
489
494
  }
490
495
  path = path.replace(/^\/+/, "");
491
496
  } else {
@@ -519,7 +524,7 @@ function pathJoin(...paths) {
519
524
  function relativePath(path, relative) {
520
525
  const relativeParts = splitPath(relative);
521
526
  let result;
522
- if (relativeParts.parts[0] === 3 /* Root */) {
527
+ if (relativeParts.parts[0] === PartType.Root) {
523
528
  result = relative;
524
529
  } else {
525
530
  result = pathJoin(path, relative);
@@ -529,13 +534,13 @@ function relativePath(path, relative) {
529
534
  let topUp = false;
530
535
  for (const part of unoptPath.parts) {
531
536
  switch (part) {
532
- case 3 /* Root */:
533
- out.push(3 /* Root */);
537
+ case PartType.Root:
538
+ out.push(PartType.Root);
534
539
  break;
535
- case 4 /* Up */:
540
+ case PartType.Up:
536
541
  if (out.length && !topUp) {
537
542
  const last = out.length - 1;
538
- if (typeof out[last] === "string" && out[last - 1] == 3 /* Root */) {
543
+ if (typeof out[last] === "string" && out[last - 1] == PartType.Root) {
539
544
  out.pop();
540
545
  } else {
541
546
  out.pop();
@@ -543,15 +548,15 @@ function relativePath(path, relative) {
543
548
  }
544
549
  if (out.length === 0) {
545
550
  topUp = !topUp ? true : topUp;
546
- out.push(4 /* Up */);
551
+ out.push(PartType.Up);
547
552
  }
548
553
  } else {
549
- out.push(4 /* Up */);
554
+ out.push(PartType.Up);
550
555
  }
551
556
  break;
552
- case 1 /* Slash */:
553
- if (!(out[out.length - 1] & 1 /* Slash */)) {
554
- out.push(1 /* Slash */);
557
+ case PartType.Slash:
558
+ if (!(out[out.length - 1] & PartType.Slash)) {
559
+ out.push(PartType.Slash);
555
560
  }
556
561
  break;
557
562
  default:
@@ -563,16 +568,15 @@ function relativePath(path, relative) {
563
568
  }
564
569
 
565
570
  // src/uri.ts
566
- var key = param;
567
- function coerceKey(key2, def) {
568
- if (typeof key2 === "object") {
569
- const keys = Object.keys(key2);
571
+ function coerceKey(key, def) {
572
+ if (typeof key === "object") {
573
+ const keys = Object.keys(key);
570
574
  if (keys.length !== 1) {
571
- throw new Error(`Invalid key: ${JSON.stringify(key2)}`);
575
+ throw new Error(`Invalid key: ${JSON.stringify(key)}`);
572
576
  }
573
- return { key: keys[0], def: key2[keys[0]] };
577
+ return { key: keys[0], def: key[keys[0]] };
574
578
  }
575
- return { key: key2, def };
579
+ return { key, def };
576
580
  }
577
581
  function falsy2undef(value) {
578
582
  return value === void 0 || value === null ? void 0 : value;
@@ -675,8 +679,8 @@ var MutableURL = class _MutableURL extends URL {
675
679
  toString() {
676
680
  let search = "";
677
681
  if (this._sysURL.searchParams.size) {
678
- for (const [key2, value] of Array.from(this._sysURL.searchParams.entries()).sort((a, b) => a[0].localeCompare(b[0]))) {
679
- search += `${!search.length ? "?" : "&"}${key2}=${encodeURIComponent(value)}`;
682
+ for (const [key, value] of Array.from(this._sysURL.searchParams.entries()).sort((a, b) => a[0].localeCompare(b[0]))) {
683
+ search += `${!search.length ? "?" : "&"}${key}=${encodeURIComponent(value)}`;
680
684
  }
681
685
  }
682
686
  let hostpart = "";
@@ -711,11 +715,11 @@ function from(fac, strURLUri, defaultProtocol) {
711
715
  throw new Error(`Invalid argument: ${typeof strURLUri}`);
712
716
  }
713
717
  }
714
- function getParamResult(key2, val, msgFn = (key3) => {
715
- return `missing parameter: ${key3}`;
718
+ function getParamResult(key, val, msgFn = (key2) => {
719
+ return `missing parameter: ${key2}`;
716
720
  }) {
717
721
  if (val === void 0) {
718
- return Result.Err(msgFn(key2));
722
+ return Result.Err(msgFn(key));
719
723
  }
720
724
  return Result.Ok(val);
721
725
  }
@@ -772,47 +776,47 @@ var BuildURI = class _BuildURI {
772
776
  const pathname = "./" + appendUrl.pathname;
773
777
  const basePath = this._url.pathname;
774
778
  this.pathname(relativePath(basePath, pathname));
775
- for (const [key2, value] of appendUrl.getParams) {
776
- this.setParam(key2, value);
779
+ for (const [key, value] of appendUrl.getParams) {
780
+ this.setParam(key, value);
777
781
  }
778
782
  return this;
779
783
  }
780
784
  cleanParams() {
781
- for (const key2 of Array.from(this._url.searchParams.keys())) {
782
- this._url.searchParams.delete(key2);
785
+ for (const key of Array.from(this._url.searchParams.keys())) {
786
+ this._url.searchParams.delete(key);
783
787
  }
784
788
  return this;
785
789
  }
786
- delParam(key2) {
787
- this._url.searchParams.delete(key2);
790
+ delParam(key) {
791
+ this._url.searchParams.delete(key);
788
792
  return this;
789
793
  }
790
- defParam(key2, str) {
791
- if (!this._url.searchParams.has(key2)) {
792
- this._url.searchParams.set(key2, str);
794
+ defParam(key, str) {
795
+ if (!this._url.searchParams.has(key)) {
796
+ this._url.searchParams.set(key, str);
793
797
  }
794
798
  return this;
795
799
  }
796
- setParam(key2, str) {
797
- this._url.searchParams.set(key2, str);
800
+ setParam(key, str) {
801
+ this._url.searchParams.set(key, str);
798
802
  return this;
799
803
  }
800
- hasParam(key2) {
801
- return this._url.searchParams.has(key2);
804
+ hasParam(key) {
805
+ return this._url.searchParams.has(key);
802
806
  }
803
807
  get getParams() {
804
808
  return this._url.searchParams.entries();
805
809
  }
806
- getParam(key2, def) {
807
- const { key: k, def: d } = coerceKey(key2, def);
810
+ getParam(key, def) {
811
+ const { key: k, def: d } = coerceKey(key, def);
808
812
  let val = this._url.searchParams.get(k);
809
813
  if (!falsy2undef(val) && d) {
810
814
  val = d;
811
815
  }
812
816
  return falsy2undef(val);
813
817
  }
814
- getParamResult(key2, msgFn) {
815
- return getParamResult(key2, this.getParam(key2), msgFn);
818
+ getParamResult(key, msgFn) {
819
+ return getParamResult(key, this.getParam(key), msgFn);
816
820
  }
817
821
  getParamsResult(...keys) {
818
822
  return getParamsResult(keys, this);
@@ -873,8 +877,8 @@ var URI = class _URI {
873
877
  if (!(fPath.length === 0 || fPath === "/" || fPath === "./")) {
874
878
  intoUrl.pathname(fromUrl.pathname);
875
879
  }
876
- for (const [key2, value] of fromUrl.getParams) {
877
- intoUrl.setParam(key2, value);
880
+ for (const [key, value] of fromUrl.getParams) {
881
+ intoUrl.setParam(key, value);
878
882
  }
879
883
  return intoUrl.URI();
880
884
  }
@@ -927,19 +931,19 @@ var URI = class _URI {
927
931
  get getParams() {
928
932
  return this._url.searchParams.entries();
929
933
  }
930
- hasParam(key2) {
931
- return this._url.searchParams.has(key2);
934
+ hasParam(key) {
935
+ return this._url.searchParams.has(key);
932
936
  }
933
- getParam(key2, def) {
934
- const { key: k, def: d } = coerceKey(key2, def);
937
+ getParam(key, def) {
938
+ const { key: k, def: d } = coerceKey(key, def);
935
939
  let val = this._url.searchParams.get(k);
936
940
  if (!falsy2undef(val) && d) {
937
941
  val = d;
938
942
  }
939
943
  return falsy2undef(val);
940
944
  }
941
- getParamResult(key2, msgFn) {
942
- return getParamResult(key2, this.getParam(key2), msgFn);
945
+ getParamResult(key, msgFn) {
946
+ return getParamResult(key, this.getParam(key), msgFn);
943
947
  }
944
948
  getParamsResult(...keys) {
945
949
  return getParamsResult(keys, this);
@@ -1144,9 +1148,9 @@ var LoggerImpl = class _LoggerImpl {
1144
1148
  this.levelHandler.disableLevel(level, ...modules);
1145
1149
  return this;
1146
1150
  }
1147
- Module(key2) {
1148
- this._attributes["module"] = logValue(key2, toLogValueCtx(this.levelHandler));
1149
- this._withAttributes["module"] = logValue(key2, toLogValueCtx(this.levelHandler));
1151
+ Module(key) {
1152
+ this._attributes["module"] = logValue(key, toLogValueCtx(this.levelHandler));
1153
+ this._withAttributes["module"] = logValue(key, toLogValueCtx(this.levelHandler));
1150
1154
  return this;
1151
1155
  }
1152
1156
  // if the string is "*" it will enable for all modules
@@ -1167,30 +1171,30 @@ var LoggerImpl = class _LoggerImpl {
1167
1171
  return this;
1168
1172
  }
1169
1173
  Warn() {
1170
- this._attributes["level"] = logValue("warn" /* WARN */, toLogValueCtx(this.levelHandler));
1174
+ this._attributes["level"] = logValue(Level.WARN, toLogValueCtx(this.levelHandler));
1171
1175
  return this;
1172
1176
  }
1173
1177
  Log() {
1174
1178
  return this;
1175
1179
  }
1176
1180
  Debug() {
1177
- this._attributes["level"] = logValue("debug" /* DEBUG */, toLogValueCtx(this.levelHandler));
1181
+ this._attributes["level"] = logValue(Level.DEBUG, toLogValueCtx(this.levelHandler));
1178
1182
  return this;
1179
1183
  }
1180
1184
  Error() {
1181
- this._attributes["level"] = logValue("error" /* ERROR */, toLogValueCtx(this.levelHandler));
1185
+ this._attributes["level"] = logValue(Level.ERROR, toLogValueCtx(this.levelHandler));
1182
1186
  return this;
1183
1187
  }
1184
1188
  Info() {
1185
- this._attributes["level"] = logValue("info" /* INFO */, toLogValueCtx(this.levelHandler));
1189
+ this._attributes["level"] = logValue(Level.INFO, toLogValueCtx(this.levelHandler));
1186
1190
  return this;
1187
1191
  }
1188
1192
  Err(err) {
1189
1193
  var _a;
1190
- let key2 = "error";
1194
+ let key = "error";
1191
1195
  if (Result.Is(err)) {
1192
1196
  if (err.isOk()) {
1193
- key2 = "noerror";
1197
+ key = "noerror";
1194
1198
  err = err.Ok();
1195
1199
  } else {
1196
1200
  err = err.Err();
@@ -1198,12 +1202,12 @@ var LoggerImpl = class _LoggerImpl {
1198
1202
  }
1199
1203
  if (err instanceof Error) {
1200
1204
  if (err.cause) {
1201
- this.coerceKey(key2, {
1205
+ this.coerceKey(key, {
1202
1206
  message: err.message,
1203
1207
  cause: err.cause
1204
1208
  });
1205
1209
  } else {
1206
- this._attributes[key2] = logValue(err.message, toLogValueCtx(this.levelHandler));
1210
+ this._attributes[key] = logValue(err.message, toLogValueCtx(this.levelHandler));
1207
1211
  }
1208
1212
  if (this.levelHandler.isStackExposed) {
1209
1213
  this._attributes["stack"] = logValue(
@@ -1212,7 +1216,7 @@ var LoggerImpl = class _LoggerImpl {
1212
1216
  );
1213
1217
  }
1214
1218
  } else {
1215
- this.Any(key2, err);
1219
+ this.Any(key, err);
1216
1220
  }
1217
1221
  return this;
1218
1222
  }
@@ -1220,22 +1224,22 @@ var LoggerImpl = class _LoggerImpl {
1220
1224
  this._attributes["level"] = logValue(l, toLogValueCtx(this.levelHandler));
1221
1225
  return this;
1222
1226
  }
1223
- Ref(key2, action) {
1227
+ Ref(key, action) {
1224
1228
  if (typeof action === "function") {
1225
- this._attributes[key2] = logValue(action, toLogValueCtx(this.levelHandler));
1229
+ this._attributes[key] = logValue(action, toLogValueCtx(this.levelHandler));
1226
1230
  } else if (typeof action.toString === "function") {
1227
- this._attributes[key2] = logValue(() => action.toString(), toLogValueCtx(this.levelHandler));
1231
+ this._attributes[key] = logValue(() => action.toString(), toLogValueCtx(this.levelHandler));
1228
1232
  } else {
1229
- this._attributes[key2] = logValue("INVALID REF", toLogValueCtx(this.levelHandler));
1233
+ this._attributes[key] = logValue("INVALID REF", toLogValueCtx(this.levelHandler));
1230
1234
  }
1231
1235
  return this;
1232
1236
  }
1233
- Bool(key2, value) {
1234
- this.coerceKey(key2, !!value);
1237
+ Bool(key, value) {
1238
+ this.coerceKey(key, !!value);
1235
1239
  return this;
1236
1240
  }
1237
1241
  Http(...mix) {
1238
- const key2 = mix.find((x) => typeof x === "string");
1242
+ const key = mix.find((x) => typeof x === "string");
1239
1243
  mix = mix.filter((x) => typeof x !== "string");
1240
1244
  const resErrors = mix.filter((x) => Result.Is(x) && x.isErr());
1241
1245
  if (resErrors.length) {
@@ -1255,70 +1259,70 @@ var LoggerImpl = class _LoggerImpl {
1255
1259
  reqAndOrres = req;
1256
1260
  }
1257
1261
  if (reqAndOrres) {
1258
- this.Any(key2 || "Http", reqAndOrres);
1262
+ this.Any(key || "Http", reqAndOrres);
1259
1263
  }
1260
1264
  return this;
1261
1265
  }
1262
1266
  Pair(x) {
1263
- for (const key2 of Object.keys(x)) {
1264
- const value = x[key2];
1267
+ for (const key of Object.keys(x)) {
1268
+ const value = x[key];
1265
1269
  if (value instanceof LogValue) {
1266
- this._attributes[key2] = value;
1270
+ this._attributes[key] = value;
1267
1271
  continue;
1268
1272
  }
1269
1273
  if (Result.Is(value)) {
1270
- this.Result(key2, value);
1274
+ this.Result(key, value);
1271
1275
  continue;
1272
1276
  }
1273
- this.Any(key2, value);
1277
+ this.Any(key, value);
1274
1278
  }
1275
1279
  return this;
1276
1280
  }
1277
- Result(key2, res) {
1281
+ Result(key, res) {
1278
1282
  if (res.isOk()) {
1279
- this._attributes[key2] = logValue(res.Ok(), toLogValueCtx(this.levelHandler));
1283
+ this._attributes[key] = logValue(res.Ok(), toLogValueCtx(this.levelHandler));
1280
1284
  } else {
1281
1285
  this.Err(res.Err());
1282
1286
  }
1283
1287
  return this;
1284
1288
  }
1285
- Len(value, key2 = "len") {
1286
- this._attributes[key2] = getLen(value, toLogValueCtx(this.levelHandler));
1289
+ Len(value, key = "len") {
1290
+ this._attributes[key] = getLen(value, toLogValueCtx(this.levelHandler));
1287
1291
  return this;
1288
1292
  }
1289
1293
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1290
- Hash(value, key2 = "hash") {
1294
+ Hash(value, key = "hash") {
1291
1295
  throw new Error("Not implemented");
1292
1296
  }
1293
- Url(url, key2 = "url") {
1294
- this.Ref(key2, () => URI.from(url).toString());
1297
+ Url(url, key = "url") {
1298
+ this.Ref(key, () => URI.from(url).toString());
1295
1299
  return this;
1296
1300
  }
1297
- coerceKey(key2, value) {
1298
- if (typeof key2 === "string") {
1299
- this._attributes[key2] = logValue(value, toLogValueCtx(this.levelHandler));
1301
+ coerceKey(key, value) {
1302
+ if (typeof key === "string") {
1303
+ this._attributes[key] = logValue(value, toLogValueCtx(this.levelHandler));
1300
1304
  } else {
1301
- this.Pair(key2);
1305
+ this.Pair(key);
1302
1306
  }
1303
1307
  }
1304
- Str(key2, value) {
1305
- this.coerceKey(key2, value);
1308
+ Str(key, value) {
1309
+ this.coerceKey(key, value);
1306
1310
  return this;
1307
1311
  }
1308
- Any(key2, value) {
1309
- this.coerceKey(key2, value);
1312
+ Any(key, value) {
1313
+ this.coerceKey(key, value);
1310
1314
  return this;
1311
1315
  }
1312
- Dur(key2, nsec) {
1313
- this._attributes[key2] = logValue(`${nsec}ms`, toLogValueCtx(this.levelHandler));
1316
+ Dur(key, nsec) {
1317
+ this._attributes[key] = logValue(`${nsec}ms`, toLogValueCtx(this.levelHandler));
1314
1318
  return this;
1315
1319
  }
1316
- Uint64(key2, value) {
1317
- this.coerceKey(key2, value);
1320
+ Uint64(key, value) {
1321
+ this.coerceKey(key, value);
1318
1322
  return this;
1319
1323
  }
1320
- Int(key2, value) {
1321
- return this.Uint64(key2, value);
1324
+ Int(key, value) {
1325
+ return this.Uint64(key, value);
1322
1326
  }
1323
1327
  async Flush() {
1324
1328
  return new Promise((resolve) => {
@@ -1341,8 +1345,8 @@ var LoggerImpl = class _LoggerImpl {
1341
1345
  }
1342
1346
  _resetAttributes(fn) {
1343
1347
  const ret = fn();
1344
- Object.keys(this._attributes).forEach((key2) => {
1345
- delete this._attributes[key2];
1348
+ Object.keys(this._attributes).forEach((key) => {
1349
+ delete this._attributes[key];
1346
1350
  });
1347
1351
  Object.assign(this._attributes, this._withAttributes);
1348
1352
  return ret;
@@ -1409,8 +1413,8 @@ var WithLoggerBuilder = class {
1409
1413
  this._li.levelHandler.enableLevel(level, ...modules);
1410
1414
  return this;
1411
1415
  }
1412
- Module(key2) {
1413
- this._li.Module(key2);
1416
+ Module(key) {
1417
+ this._li.Module(key);
1414
1418
  return this;
1415
1419
  }
1416
1420
  SetDebug(...modules) {
@@ -1425,36 +1429,36 @@ var WithLoggerBuilder = class {
1425
1429
  this._li.Pair(x);
1426
1430
  return this;
1427
1431
  }
1428
- Str(key2, value) {
1429
- this._li.Str(key2, value);
1432
+ Str(key, value) {
1433
+ this._li.Str(key, value);
1430
1434
  return this;
1431
1435
  }
1432
- Len(value, key2) {
1433
- this._li.Len(value, key2);
1436
+ Len(value, key) {
1437
+ this._li.Len(value, key);
1434
1438
  return this;
1435
1439
  }
1436
- Hash(value, key2) {
1437
- this._li.Hash(value, key2);
1440
+ Hash(value, key) {
1441
+ this._li.Hash(value, key);
1438
1442
  return this;
1439
1443
  }
1440
- Ref(key2, action) {
1441
- this._li.Ref(key2, action);
1444
+ Ref(key, action) {
1445
+ this._li.Ref(key, action);
1442
1446
  return this;
1443
1447
  }
1444
- Bool(key2, value) {
1445
- this._li.Bool(key2, value);
1448
+ Bool(key, value) {
1449
+ this._li.Bool(key, value);
1446
1450
  return this;
1447
1451
  }
1448
- Result(key2, res) {
1449
- this._li.Result(key2, res);
1452
+ Result(key, res) {
1453
+ this._li.Result(key, res);
1450
1454
  return this;
1451
1455
  }
1452
- Url(url, key2) {
1453
- this._li.Url(url, key2);
1456
+ Url(url, key) {
1457
+ this._li.Url(url, key);
1454
1458
  return this;
1455
1459
  }
1456
- Int(key2, value) {
1457
- this._li.Int(key2, value);
1460
+ Int(key, value) {
1461
+ this._li.Int(key, value);
1458
1462
  return this;
1459
1463
  }
1460
1464
  Log() {
@@ -1489,16 +1493,16 @@ var WithLoggerBuilder = class {
1489
1493
  this._li.Timestamp();
1490
1494
  return this;
1491
1495
  }
1492
- Any(key2, value) {
1493
- this._li.Any(key2, value);
1496
+ Any(key, value) {
1497
+ this._li.Any(key, value);
1494
1498
  return this;
1495
1499
  }
1496
- Dur(key2, nsec) {
1497
- this._li.Dur(key2, nsec);
1500
+ Dur(key, nsec) {
1501
+ this._li.Dur(key, nsec);
1498
1502
  return this;
1499
1503
  }
1500
- Uint64(key2, value) {
1501
- this._li.Uint64(key2, value);
1504
+ Uint64(key, value) {
1505
+ this._li.Uint64(key, value);
1502
1506
  return this;
1503
1507
  }
1504
1508
  };
@@ -1534,7 +1538,6 @@ export {
1534
1538
  asyncLogValue,
1535
1539
  logValue,
1536
1540
  IsLogger,
1537
- key,
1538
1541
  isURL,
1539
1542
  MutableURL,
1540
1543
  BuildURI,
@@ -1553,4 +1556,4 @@ export {
1553
1556
  LogCollector,
1554
1557
  MockLogger
1555
1558
  };
1556
- //# sourceMappingURL=chunk-KY47QBK3.js.map
1559
+ //# sourceMappingURL=chunk-WGRZHIFK.js.map