@adviser/cement 0.2.45 → 0.3.1

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WebSysAbstraction
3
- } from "./chunk-N3NUTN4B.js";
3
+ } from "./chunk-STUPETPE.js";
4
4
  import {
5
5
  BaseSysAbstraction,
6
6
  BrowserEnvActions,
@@ -24,8 +24,9 @@ import {
24
24
  TimeMode,
25
25
  TimeUnits,
26
26
  WrapperSysAbstraction,
27
- envFactory
28
- } from "./chunk-N5LQQXOU.js";
27
+ envFactory,
28
+ registerEnvAction
29
+ } from "./chunk-PSPOGR2I.js";
29
30
  import {
30
31
  ConsoleWriterStream,
31
32
  FanoutWriteStream,
@@ -181,16 +182,16 @@ function logValueInternal(val, ctx) {
181
182
  }
182
183
  const res = {};
183
184
  const typedVal = val;
184
- for (const key in typedVal) {
185
- if (ctx.ignoreAttr.IsSome() && ctx.ignoreAttr.unwrap().test(key)) {
185
+ for (const key2 in typedVal) {
186
+ if (ctx.ignoreAttr.IsSome() && ctx.ignoreAttr.unwrap().test(key2)) {
186
187
  continue;
187
188
  }
188
- const element = typedVal[key];
189
+ const element = typedVal[key2];
189
190
  if (element instanceof LogValue) {
190
- res[key] = element;
191
+ res[key2] = element;
191
192
  } else {
192
193
  if (typeof element !== "function") {
193
- res[key] = logValueInternal(element, ctx);
194
+ res[key2] = logValueInternal(element, ctx);
194
195
  }
195
196
  }
196
197
  }
@@ -468,37 +469,37 @@ function localStripper(path, restrips, obj) {
468
469
  return obj.map((i) => localStripper(path, restrips, i));
469
470
  }
470
471
  const ret = { ...obj };
471
- const matcher = (key, nextPath) => {
472
+ const matcher = (key2, nextPath) => {
472
473
  for (const re of restrips) {
473
- if (re.test(key) || re.test(nextPath)) {
474
+ if (re.test(key2) || re.test(nextPath)) {
474
475
  return true;
475
476
  }
476
477
  }
477
478
  return false;
478
479
  };
479
- for (const key in ret) {
480
- if (Object.prototype.hasOwnProperty.call(ret, key)) {
480
+ for (const key2 in ret) {
481
+ if (Object.prototype.hasOwnProperty.call(ret, key2)) {
481
482
  let nextPath;
482
483
  if (path) {
483
- nextPath = [path, key].join(".");
484
+ nextPath = [path, key2].join(".");
484
485
  } else {
485
- nextPath = key;
486
+ nextPath = key2;
486
487
  }
487
- if (matcher(key, nextPath)) {
488
- delete ret[key];
488
+ if (matcher(key2, nextPath)) {
489
+ delete ret[key2];
489
490
  continue;
490
491
  }
491
- if (typeof ret[key] === "object") {
492
- if (Array.isArray(ret[key])) {
493
- ret[key] = ret[key].reduce((acc, v, i) => {
494
- const toDelete = matcher(key, `${nextPath}[${i}]`);
492
+ if (typeof ret[key2] === "object") {
493
+ if (Array.isArray(ret[key2])) {
494
+ ret[key2] = ret[key2].reduce((acc, v, i) => {
495
+ const toDelete = matcher(key2, `${nextPath}[${i}]`);
495
496
  if (!toDelete) {
496
497
  acc.push(localStripper(`${nextPath}[${i}]`, restrips, v));
497
498
  }
498
499
  return acc;
499
500
  }, []);
500
501
  } else {
501
- ret[key] = localStripper(nextPath, restrips, ret[key]);
502
+ ret[key2] = localStripper(nextPath, restrips, ret[key2]);
502
503
  }
503
504
  }
504
505
  }
@@ -507,16 +508,29 @@ function localStripper(path, restrips, obj) {
507
508
  }
508
509
 
509
510
  // src/uri.ts
510
- var REQUIRED = 4711;
511
- function coerceKey(key, def) {
512
- if (typeof key === "object") {
513
- const keys = Object.keys(key);
511
+ var _REQUIRED = class {
512
+ constructor() {
513
+ this.val = "REQUIRED";
514
+ }
515
+ };
516
+ var _OPTIONAL = class {
517
+ constructor() {
518
+ this.val = "OPTIONAL";
519
+ }
520
+ };
521
+ var key = {
522
+ REQUIRED: new _REQUIRED(),
523
+ OPTIONAL: new _OPTIONAL()
524
+ };
525
+ function coerceKey(key2, def) {
526
+ if (typeof key2 === "object") {
527
+ const keys = Object.keys(key2);
514
528
  if (keys.length !== 1) {
515
- throw new Error(`Invalid key: ${JSON.stringify(key)}`);
529
+ throw new Error(`Invalid key: ${JSON.stringify(key2)}`);
516
530
  }
517
- return { key: keys[0], def: key[keys[0]] };
531
+ return { key: keys[0], def: key2[keys[0]] };
518
532
  }
519
- return { key, def };
533
+ return { key: key2, def };
520
534
  }
521
535
  function falsy2undef(value) {
522
536
  return value === void 0 || value === null ? void 0 : value;
@@ -619,8 +633,8 @@ var MutableURL = class _MutableURL extends URL {
619
633
  toString() {
620
634
  let search = "";
621
635
  if (this._sysURL.searchParams.size) {
622
- for (const [key, value] of Array.from(this._sysURL.searchParams.entries()).sort((a, b) => a[0].localeCompare(b[0]))) {
623
- search += `${!search.length ? "?" : "&"}${key}=${encodeURIComponent(value)}`;
636
+ for (const [key2, value] of Array.from(this._sysURL.searchParams.entries()).sort((a, b) => a[0].localeCompare(b[0]))) {
637
+ search += `${!search.length ? "?" : "&"}${key2}=${encodeURIComponent(value)}`;
624
638
  }
625
639
  }
626
640
  let hostpart = "";
@@ -655,11 +669,11 @@ function from(fac, strURLUri, defaultProtocol) {
655
669
  throw new Error(`Invalid argument: ${typeof strURLUri}`);
656
670
  }
657
671
  }
658
- function getParamResult(key, val, msgFn = (key2) => {
659
- return `missing parameter: ${key2}`;
672
+ function getParamResult(key2, val, msgFn = (key3) => {
673
+ return `missing parameter: ${key3}`;
660
674
  }) {
661
675
  if (val === void 0) {
662
- return Result.Err(msgFn(key));
676
+ return Result.Err(msgFn(key2));
663
677
  }
664
678
  return Result.Ok(val);
665
679
  }
@@ -667,9 +681,15 @@ function getParamsResult(keys, getParam) {
667
681
  const keyDef = keys.flat().reduce(
668
682
  (acc, i) => {
669
683
  if (typeof i === "string") {
670
- acc.push({ key: i });
684
+ acc.push({ key: i, def: void 0, isOptional: false });
671
685
  } else if (typeof i === "object") {
672
- acc.push(...Object.keys(i).map((k) => ({ key: k, def: typeof i[k] === "string" ? i[k] : void 0 })));
686
+ acc.push(
687
+ ...Object.keys(i).map((k) => ({
688
+ key: k,
689
+ def: typeof i[k] === "string" ? i[k] : void 0,
690
+ isOptional: i[k] instanceof _OPTIONAL
691
+ }))
692
+ );
673
693
  }
674
694
  return acc;
675
695
  },
@@ -687,7 +707,9 @@ function getParamsResult(keys, getParam) {
687
707
  if (typeof kd.def === "string") {
688
708
  result[kd.key] = kd.def;
689
709
  } else {
690
- errors.push(kd.key);
710
+ if (!kd.isOptional) {
711
+ errors.push(kd.key);
712
+ }
691
713
  }
692
714
  } else {
693
715
  result[kd.key] = val;
@@ -751,47 +773,47 @@ var BuildURI = class _BuildURI {
751
773
  const pathname = "./" + appendUrl.pathname;
752
774
  const basePath = this._url.pathname;
753
775
  this.pathname(relativePath(basePath, pathname));
754
- for (const [key, value] of appendUrl.getParams) {
755
- this.setParam(key, value);
776
+ for (const [key2, value] of appendUrl.getParams) {
777
+ this.setParam(key2, value);
756
778
  }
757
779
  return this;
758
780
  }
759
781
  cleanParams() {
760
- for (const key of Array.from(this._url.searchParams.keys())) {
761
- this._url.searchParams.delete(key);
782
+ for (const key2 of Array.from(this._url.searchParams.keys())) {
783
+ this._url.searchParams.delete(key2);
762
784
  }
763
785
  return this;
764
786
  }
765
- delParam(key) {
766
- this._url.searchParams.delete(key);
787
+ delParam(key2) {
788
+ this._url.searchParams.delete(key2);
767
789
  return this;
768
790
  }
769
- defParam(key, str) {
770
- if (!this._url.searchParams.has(key)) {
771
- this._url.searchParams.set(key, str);
791
+ defParam(key2, str) {
792
+ if (!this._url.searchParams.has(key2)) {
793
+ this._url.searchParams.set(key2, str);
772
794
  }
773
795
  return this;
774
796
  }
775
- setParam(key, str) {
776
- this._url.searchParams.set(key, str);
797
+ setParam(key2, str) {
798
+ this._url.searchParams.set(key2, str);
777
799
  return this;
778
800
  }
779
- hasParam(key) {
780
- return this._url.searchParams.has(key);
801
+ hasParam(key2) {
802
+ return this._url.searchParams.has(key2);
781
803
  }
782
804
  get getParams() {
783
805
  return this._url.searchParams.entries();
784
806
  }
785
- getParam(key, def) {
786
- const { key: k, def: d } = coerceKey(key, def);
807
+ getParam(key2, def) {
808
+ const { key: k, def: d } = coerceKey(key2, def);
787
809
  let val = this._url.searchParams.get(k);
788
810
  if (!falsy2undef(val) && d) {
789
811
  val = d;
790
812
  }
791
813
  return falsy2undef(val);
792
814
  }
793
- getParamResult(key, msgFn) {
794
- return getParamResult(key, this.getParam(key), msgFn);
815
+ getParamResult(key2, msgFn) {
816
+ return getParamResult(key2, this.getParam(key2), msgFn);
795
817
  }
796
818
  getParamsResult(...keys) {
797
819
  return getParamsResult(keys, this);
@@ -834,8 +856,8 @@ var URI = class _URI {
834
856
  if (!(fPath.length === 0 || fPath === "/" || fPath === "./")) {
835
857
  intoUrl.pathname(fromUrl.pathname);
836
858
  }
837
- for (const [key, value] of fromUrl.getParams) {
838
- intoUrl.setParam(key, value);
859
+ for (const [key2, value] of fromUrl.getParams) {
860
+ intoUrl.setParam(key2, value);
839
861
  }
840
862
  return intoUrl.URI();
841
863
  }
@@ -888,19 +910,19 @@ var URI = class _URI {
888
910
  get getParams() {
889
911
  return this._url.searchParams.entries();
890
912
  }
891
- hasParam(key) {
892
- return this._url.searchParams.has(key);
913
+ hasParam(key2) {
914
+ return this._url.searchParams.has(key2);
893
915
  }
894
- getParam(key, def) {
895
- const { key: k, def: d } = coerceKey(key, def);
916
+ getParam(key2, def) {
917
+ const { key: k, def: d } = coerceKey(key2, def);
896
918
  let val = this._url.searchParams.get(k);
897
919
  if (!falsy2undef(val) && d) {
898
920
  val = d;
899
921
  }
900
922
  return falsy2undef(val);
901
923
  }
902
- getParamResult(key, msgFn) {
903
- return getParamResult(key, this.getParam(key), msgFn);
924
+ getParamResult(key2, msgFn) {
925
+ return getParamResult(key2, this.getParam(key2), msgFn);
904
926
  }
905
927
  getParamsResult(...keys) {
906
928
  return getParamsResult(keys, this);
@@ -1272,9 +1294,9 @@ var LoggerImpl = class _LoggerImpl {
1272
1294
  this.levelHandler.disableLevel(level, ...modules);
1273
1295
  return this;
1274
1296
  }
1275
- Module(key) {
1276
- this._attributes["module"] = logValue(key, toLogValueCtx(this.levelHandler));
1277
- this._withAttributes["module"] = logValue(key, toLogValueCtx(this.levelHandler));
1297
+ Module(key2) {
1298
+ this._attributes["module"] = logValue(key2, toLogValueCtx(this.levelHandler));
1299
+ this._withAttributes["module"] = logValue(key2, toLogValueCtx(this.levelHandler));
1278
1300
  return this;
1279
1301
  }
1280
1302
  // if the string is "*" it will enable for all modules
@@ -1315,10 +1337,10 @@ var LoggerImpl = class _LoggerImpl {
1315
1337
  }
1316
1338
  Err(err) {
1317
1339
  var _a;
1318
- let key = "error";
1340
+ let key2 = "error";
1319
1341
  if (Result.Is(err)) {
1320
1342
  if (err.isOk()) {
1321
- key = "noerror";
1343
+ key2 = "noerror";
1322
1344
  err = err.Ok();
1323
1345
  } else {
1324
1346
  err = err.Err();
@@ -1326,12 +1348,12 @@ var LoggerImpl = class _LoggerImpl {
1326
1348
  }
1327
1349
  if (err instanceof Error) {
1328
1350
  if (err.cause) {
1329
- this.coerceKey(key, {
1351
+ this.coerceKey(key2, {
1330
1352
  message: err.message,
1331
1353
  cause: err.cause
1332
1354
  });
1333
1355
  } else {
1334
- this._attributes[key] = logValue(err.message, toLogValueCtx(this.levelHandler));
1356
+ this._attributes[key2] = logValue(err.message, toLogValueCtx(this.levelHandler));
1335
1357
  }
1336
1358
  if (this.levelHandler.isStackExposed) {
1337
1359
  this._attributes["stack"] = logValue(
@@ -1340,7 +1362,7 @@ var LoggerImpl = class _LoggerImpl {
1340
1362
  );
1341
1363
  }
1342
1364
  } else {
1343
- this.Any(key, err);
1365
+ this.Any(key2, err);
1344
1366
  }
1345
1367
  return this;
1346
1368
  }
@@ -1348,22 +1370,22 @@ var LoggerImpl = class _LoggerImpl {
1348
1370
  this._attributes["level"] = logValue(l, toLogValueCtx(this.levelHandler));
1349
1371
  return this;
1350
1372
  }
1351
- Ref(key, action) {
1373
+ Ref(key2, action) {
1352
1374
  if (typeof action === "function") {
1353
- this._attributes[key] = logValue(action, toLogValueCtx(this.levelHandler));
1375
+ this._attributes[key2] = logValue(action, toLogValueCtx(this.levelHandler));
1354
1376
  } else if (typeof action.toString === "function") {
1355
- this._attributes[key] = logValue(() => action.toString(), toLogValueCtx(this.levelHandler));
1377
+ this._attributes[key2] = logValue(() => action.toString(), toLogValueCtx(this.levelHandler));
1356
1378
  } else {
1357
- this._attributes[key] = logValue("INVALID REF", toLogValueCtx(this.levelHandler));
1379
+ this._attributes[key2] = logValue("INVALID REF", toLogValueCtx(this.levelHandler));
1358
1380
  }
1359
1381
  return this;
1360
1382
  }
1361
- Bool(key, value) {
1362
- this.coerceKey(key, !!value);
1383
+ Bool(key2, value) {
1384
+ this.coerceKey(key2, !!value);
1363
1385
  return this;
1364
1386
  }
1365
1387
  Http(...mix) {
1366
- const key = mix.find((x) => typeof x === "string");
1388
+ const key2 = mix.find((x) => typeof x === "string");
1367
1389
  mix = mix.filter((x) => typeof x !== "string");
1368
1390
  const resErrors = mix.filter((x) => Result.Is(x) && x.isErr());
1369
1391
  if (resErrors.length) {
@@ -1383,72 +1405,72 @@ var LoggerImpl = class _LoggerImpl {
1383
1405
  reqAndOrres = req;
1384
1406
  }
1385
1407
  if (reqAndOrres) {
1386
- this.Any(key || "Http", reqAndOrres);
1408
+ this.Any(key2 || "Http", reqAndOrres);
1387
1409
  }
1388
1410
  return this;
1389
1411
  }
1390
1412
  Pair(x) {
1391
- for (const key of Object.keys(x)) {
1392
- const value = x[key];
1413
+ for (const key2 of Object.keys(x)) {
1414
+ const value = x[key2];
1393
1415
  if (value instanceof LogValue) {
1394
- this._attributes[key] = value;
1416
+ this._attributes[key2] = value;
1395
1417
  continue;
1396
1418
  }
1397
1419
  if (Result.Is(value)) {
1398
- this.Result(key, value);
1420
+ this.Result(key2, value);
1399
1421
  continue;
1400
1422
  }
1401
- this.Any(key, value);
1423
+ this.Any(key2, value);
1402
1424
  }
1403
1425
  return this;
1404
1426
  }
1405
- Result(key, res) {
1427
+ Result(key2, res) {
1406
1428
  if (res.isOk()) {
1407
- this._attributes[key] = logValue(res.Ok(), toLogValueCtx(this.levelHandler));
1429
+ this._attributes[key2] = logValue(res.Ok(), toLogValueCtx(this.levelHandler));
1408
1430
  } else {
1409
1431
  this.Err(res.Err());
1410
1432
  }
1411
1433
  return this;
1412
1434
  }
1413
- Len(value, key = "len") {
1414
- this._attributes[key] = getLen(value, toLogValueCtx(this.levelHandler));
1435
+ Len(value, key2 = "len") {
1436
+ this._attributes[key2] = getLen(value, toLogValueCtx(this.levelHandler));
1415
1437
  return this;
1416
1438
  }
1417
- Hash(value, key = "hash") {
1418
- this._attributes[key] = asyncLogValue(
1439
+ Hash(value, key2 = "hash") {
1440
+ this._attributes[key2] = asyncLogValue(
1419
1441
  async () => `${getLen(value, toLogValueCtx(this.levelHandler)).value()}:${await hash(value)}`
1420
1442
  );
1421
1443
  return this;
1422
1444
  }
1423
- Url(url, key = "url") {
1424
- this.Ref(key, () => URI.from(url).toString());
1445
+ Url(url, key2 = "url") {
1446
+ this.Ref(key2, () => URI.from(url).toString());
1425
1447
  return this;
1426
1448
  }
1427
- coerceKey(key, value) {
1428
- if (typeof key === "string") {
1429
- this._attributes[key] = logValue(value, toLogValueCtx(this.levelHandler));
1449
+ coerceKey(key2, value) {
1450
+ if (typeof key2 === "string") {
1451
+ this._attributes[key2] = logValue(value, toLogValueCtx(this.levelHandler));
1430
1452
  } else {
1431
- this.Pair(key);
1453
+ this.Pair(key2);
1432
1454
  }
1433
1455
  }
1434
- Str(key, value) {
1435
- this.coerceKey(key, value);
1456
+ Str(key2, value) {
1457
+ this.coerceKey(key2, value);
1436
1458
  return this;
1437
1459
  }
1438
- Any(key, value) {
1439
- this.coerceKey(key, value);
1460
+ Any(key2, value) {
1461
+ this.coerceKey(key2, value);
1440
1462
  return this;
1441
1463
  }
1442
- Dur(key, nsec) {
1443
- this._attributes[key] = logValue(`${nsec}ms`, toLogValueCtx(this.levelHandler));
1464
+ Dur(key2, nsec) {
1465
+ this._attributes[key2] = logValue(`${nsec}ms`, toLogValueCtx(this.levelHandler));
1444
1466
  return this;
1445
1467
  }
1446
- Uint64(key, value) {
1447
- this.coerceKey(key, value);
1468
+ Uint64(key2, value) {
1469
+ this.coerceKey(key2, value);
1448
1470
  return this;
1449
1471
  }
1450
- Int(key, value) {
1451
- return this.Uint64(key, value);
1472
+ Int(key2, value) {
1473
+ return this.Uint64(key2, value);
1452
1474
  }
1453
1475
  async Flush() {
1454
1476
  return new Promise((resolve) => {
@@ -1471,8 +1493,8 @@ var LoggerImpl = class _LoggerImpl {
1471
1493
  }
1472
1494
  _resetAttributes(fn) {
1473
1495
  const ret = fn();
1474
- Object.keys(this._attributes).forEach((key) => {
1475
- delete this._attributes[key];
1496
+ Object.keys(this._attributes).forEach((key2) => {
1497
+ delete this._attributes[key2];
1476
1498
  });
1477
1499
  Object.assign(this._attributes, this._withAttributes);
1478
1500
  return ret;
@@ -1539,8 +1561,8 @@ var WithLoggerBuilder = class {
1539
1561
  this._li.levelHandler.enableLevel(level, ...modules);
1540
1562
  return this;
1541
1563
  }
1542
- Module(key) {
1543
- this._li.Module(key);
1564
+ Module(key2) {
1565
+ this._li.Module(key2);
1544
1566
  return this;
1545
1567
  }
1546
1568
  SetDebug(...modules) {
@@ -1555,36 +1577,36 @@ var WithLoggerBuilder = class {
1555
1577
  this._li.Pair(x);
1556
1578
  return this;
1557
1579
  }
1558
- Str(key, value) {
1559
- this._li.Str(key, value);
1580
+ Str(key2, value) {
1581
+ this._li.Str(key2, value);
1560
1582
  return this;
1561
1583
  }
1562
- Len(value, key) {
1563
- this._li.Len(value, key);
1584
+ Len(value, key2) {
1585
+ this._li.Len(value, key2);
1564
1586
  return this;
1565
1587
  }
1566
- Hash(value, key) {
1567
- this._li.Hash(value, key);
1588
+ Hash(value, key2) {
1589
+ this._li.Hash(value, key2);
1568
1590
  return this;
1569
1591
  }
1570
- Ref(key, action) {
1571
- this._li.Ref(key, action);
1592
+ Ref(key2, action) {
1593
+ this._li.Ref(key2, action);
1572
1594
  return this;
1573
1595
  }
1574
- Bool(key, value) {
1575
- this._li.Bool(key, value);
1596
+ Bool(key2, value) {
1597
+ this._li.Bool(key2, value);
1576
1598
  return this;
1577
1599
  }
1578
- Result(key, res) {
1579
- this._li.Result(key, res);
1600
+ Result(key2, res) {
1601
+ this._li.Result(key2, res);
1580
1602
  return this;
1581
1603
  }
1582
- Url(url, key) {
1583
- this._li.Url(url, key);
1604
+ Url(url, key2) {
1605
+ this._li.Url(url, key2);
1584
1606
  return this;
1585
1607
  }
1586
- Int(key, value) {
1587
- this._li.Int(key, value);
1608
+ Int(key2, value) {
1609
+ this._li.Int(key2, value);
1588
1610
  return this;
1589
1611
  }
1590
1612
  Log() {
@@ -1619,16 +1641,16 @@ var WithLoggerBuilder = class {
1619
1641
  this._li.Timestamp();
1620
1642
  return this;
1621
1643
  }
1622
- Any(key, value) {
1623
- this._li.Any(key, value);
1644
+ Any(key2, value) {
1645
+ this._li.Any(key2, value);
1624
1646
  return this;
1625
1647
  }
1626
- Dur(key, nsec) {
1627
- this._li.Dur(key, nsec);
1648
+ Dur(key2, nsec) {
1649
+ this._li.Dur(key2, nsec);
1628
1650
  return this;
1629
1651
  }
1630
- Uint64(key, value) {
1631
- this._li.Uint64(key, value);
1652
+ Uint64(key2, value) {
1653
+ this._li.Uint64(key2, value);
1632
1654
  return this;
1633
1655
  }
1634
1656
  };
@@ -1767,8 +1789,8 @@ var Metrics = class {
1767
1789
  }
1768
1790
  toJSON() {
1769
1791
  const obj = {};
1770
- for (const [key, value] of this.map) {
1771
- obj[key] = value.value;
1792
+ for (const [key2, value] of this.map) {
1793
+ obj[key2] = value.value;
1772
1794
  }
1773
1795
  return obj;
1774
1796
  }
@@ -1941,15 +1963,15 @@ var HeadersImpl = class extends Headers {
1941
1963
  values() {
1942
1964
  return this._headers.values();
1943
1965
  }
1944
- append(key, value) {
1945
- const values = this._headers.get(key);
1966
+ append(key2, value) {
1967
+ const values = this._headers.get(key2);
1946
1968
  if (typeof value === "undefined") {
1947
1969
  value = "";
1948
1970
  }
1949
1971
  if (Array.isArray(value)) {
1950
- this._headers.set(key, [values, ...value].filter((i) => i).join(", "));
1972
+ this._headers.set(key2, [values, ...value].filter((i) => i).join(", "));
1951
1973
  } else {
1952
- this._headers.set(key, [values, value].filter((i) => i).join(", "));
1974
+ this._headers.set(key2, [values, value].filter((i) => i).join(", "));
1953
1975
  }
1954
1976
  return this;
1955
1977
  }
@@ -1992,38 +2014,38 @@ var HttpHeader = class _HttpHeader {
1992
2014
  }
1993
2015
  _asStringString() {
1994
2016
  const ret = /* @__PURE__ */ new Map();
1995
- for (const [key, values] of this._headers) {
1996
- ret.set(key, values.join(", "));
2017
+ for (const [key2, values] of this._headers) {
2018
+ ret.set(key2, values.join(", "));
1997
2019
  }
1998
2020
  return ret;
1999
2021
  }
2000
- _key(key) {
2001
- return key.toLowerCase();
2022
+ _key(key2) {
2023
+ return key2.toLowerCase();
2002
2024
  }
2003
- Values(key) {
2004
- const values = this._headers.get(this._key(key));
2025
+ Values(key2) {
2026
+ const values = this._headers.get(this._key(key2));
2005
2027
  return values || [];
2006
2028
  }
2007
- Get(key) {
2008
- const values = this._headers.get(this._key(key));
2029
+ Get(key2) {
2030
+ const values = this._headers.get(this._key(key2));
2009
2031
  if (values === void 0 || values.length === 0) {
2010
2032
  return void 0;
2011
2033
  }
2012
2034
  return values[0];
2013
2035
  }
2014
- Set(key, valueOr) {
2036
+ Set(key2, valueOr) {
2015
2037
  const value = Array.isArray(valueOr) ? valueOr : [valueOr];
2016
- this._headers.set(this._key(key), value);
2038
+ this._headers.set(this._key(key2), value);
2017
2039
  return this;
2018
2040
  }
2019
- Add(key, value) {
2041
+ Add(key2, value) {
2020
2042
  if (typeof value === "undefined") {
2021
2043
  return this;
2022
2044
  }
2023
2045
  const vs = Array.isArray(value) ? value : [value];
2024
- const values = this._headers.get(this._key(key));
2046
+ const values = this._headers.get(this._key(key2));
2025
2047
  if (values === void 0) {
2026
- this._headers.set(this._key(key), vs);
2048
+ this._headers.set(this._key(key2), vs);
2027
2049
  } else {
2028
2050
  values.push(...vs);
2029
2051
  }
@@ -2041,29 +2063,29 @@ var HttpHeader = class _HttpHeader {
2041
2063
  }
2042
2064
  Clone() {
2043
2065
  const clone = new _HttpHeader();
2044
- for (const [key, values] of this._headers.entries()) {
2045
- clone._headers.set(key, values.slice());
2066
+ for (const [key2, values] of this._headers.entries()) {
2067
+ clone._headers.set(key2, values.slice());
2046
2068
  }
2047
2069
  return clone;
2048
2070
  }
2049
2071
  AsRecordStringStringArray() {
2050
2072
  const obj = {};
2051
- for (const [key, values] of this._headers.entries()) {
2052
- obj[key] = [...values];
2073
+ for (const [key2, values] of this._headers.entries()) {
2074
+ obj[key2] = [...values];
2053
2075
  }
2054
2076
  return obj;
2055
2077
  }
2056
2078
  AsRecordStringString() {
2057
2079
  const obj = {};
2058
- for (const [key, values] of this._headers.entries()) {
2059
- obj[key] = values.join(", ");
2080
+ for (const [key2, values] of this._headers.entries()) {
2081
+ obj[key2] = values.join(", ");
2060
2082
  }
2061
2083
  return obj;
2062
2084
  }
2063
2085
  AsHeaderInit() {
2064
2086
  const obj = {};
2065
- for (const [key, values] of this._headers.entries()) {
2066
- obj[key] = values[0];
2087
+ for (const [key2, values] of this._headers.entries()) {
2088
+ obj[key2] = values[0];
2067
2089
  }
2068
2090
  return obj;
2069
2091
  }
@@ -2073,8 +2095,8 @@ var HttpHeader = class _HttpHeader {
2073
2095
  Merge(other) {
2074
2096
  const ret = this.Clone();
2075
2097
  if (other) {
2076
- for (const [key, values] of other.Items()) {
2077
- ret.Add(key, values);
2098
+ for (const [key2, values] of other.Items()) {
2099
+ ret.Add(key2, values);
2078
2100
  }
2079
2101
  }
2080
2102
  return ret;
@@ -2109,7 +2131,6 @@ export {
2109
2131
  MutableURL,
2110
2132
  None,
2111
2133
  Option,
2112
- REQUIRED,
2113
2134
  RandomMode,
2114
2135
  RandomService,
2115
2136
  ResolveOnce,
@@ -2139,7 +2160,9 @@ export {
2139
2160
  exception2Result,
2140
2161
  hasHostPartProtocols,
2141
2162
  isURL,
2163
+ key,
2142
2164
  logValue,
2165
+ registerEnvAction,
2143
2166
  runtimeFn,
2144
2167
  toCryptoRuntime,
2145
2168
  utils_exports as utils