@adviser/cement 0.3.20 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base-sys-abstraction-DgTynXGV.d.cts +95 -0
- package/base-sys-abstraction-h0dB3nZ5.d.ts +95 -0
- package/cf/index.cjs +232 -283
- package/cf/index.cjs.map +1 -1
- package/cf/index.d.cts +10 -8
- package/cf/index.d.ts +10 -8
- package/cf/index.js +6 -41
- package/cf/index.js.map +1 -1
- package/{chunk-UEER5ZC2.js → chunk-6F3ACVHD.js} +8 -22
- package/chunk-6F3ACVHD.js.map +1 -0
- package/{chunk-PHS255C5.js → chunk-FOALXQST.js} +1 -68
- package/chunk-FOALXQST.js.map +1 -0
- package/{chunk-23MCJYE6.js → chunk-X3IV2RYT.js} +422 -602
- package/chunk-X3IV2RYT.js.map +1 -0
- package/chunk-YKGCONBX.js +677 -0
- package/chunk-YKGCONBX.js.map +1 -0
- package/{chunk-55W4AK2Z.js → chunk-YVACAIUX.js} +5 -5
- package/deno/index.cjs +257 -241
- package/deno/index.cjs.map +1 -1
- package/deno/index.d.cts +3 -5
- package/deno/index.d.ts +3 -5
- package/deno/index.js +14 -16
- package/deno/index.js.map +1 -1
- package/{index-BhmvYS_t.d.ts → index-N0bkrgSt.d.ts} +2 -2
- package/{index-DoK1OTgQ.d.cts → index-TtYD7HhB.d.cts} +2 -2
- package/index.cjs +1863 -1775
- package/index.cjs.map +1 -1
- package/index.d.cts +9 -8
- package/index.d.ts +9 -8
- package/index.js +21 -16
- package/index.js.map +1 -1
- package/metafile-cjs.json +1 -1
- package/metafile-esm.json +1 -1
- package/node/index.cjs +499 -474
- package/node/index.cjs.map +1 -1
- package/node/index.d.cts +3 -5
- package/node/index.d.ts +3 -5
- package/node/index.js +14 -16
- package/node/index.js.map +1 -1
- package/package.json +4 -4
- package/src/base-sys-abstraction.ts +106 -116
- package/src/cf/cf-basic-sys-abstraction.ts +79 -0
- package/src/cf/index.ts +1 -1
- package/src/cf-test-main.ts +10 -1
- package/src/deno/deno-basic-sys-abstraction.ts +39 -0
- package/src/deno/deno-file-service.ts +1 -1
- package/src/deno/deno-sys-abstraction.ts +19 -22
- package/src/jsr.json +1 -1
- package/src/log-writer-impl.ts +6 -0
- package/src/logger-impl.ts +17 -19
- package/src/node/node-basic-sys-abstraction.ts +59 -0
- package/src/node/node-sys-abstraction.ts +19 -22
- package/src/sys-abstraction.ts +12 -6
- package/src/test/mock-logger.ts +2 -2
- package/src/txt-en-decoder.ts +3 -3
- package/src/web/index.ts +1 -1
- package/src/web/web-basic-sys-abstraction.ts +105 -0
- package/{sys-abstraction-B0x6IE7r.d.ts → sys-abstraction-CeAxxg9H.d.ts} +11 -7
- package/{sys-abstraction-BTs3Vzy4.d.cts → sys-abstraction-DDAwGTnk.d.cts} +11 -7
- package/test/index.cjs +1546 -1485
- package/test/index.cjs.map +1 -1
- package/test/index.d.cts +2 -2
- package/test/index.d.ts +2 -2
- package/test/index.js +4 -5
- package/ts/smoke/smoke.js +7 -8
- package/ts/smoke/smoke.js.map +1 -1
- package/ts/src/base-basic-sys-abstraction.test.d.ts +2 -0
- package/ts/src/base-basic-sys-abstraction.test.d.ts.map +1 -0
- package/ts/src/{base-sys-abstraction.test.js → base-basic-sys-abstraction.test.js} +9 -9
- package/ts/src/base-basic-sys-abstraction.test.js.map +1 -0
- package/ts/src/base-sys-abstraction.d.ts +33 -21
- package/ts/src/base-sys-abstraction.d.ts.map +1 -1
- package/ts/src/base-sys-abstraction.js +54 -67
- package/ts/src/base-sys-abstraction.js.map +1 -1
- package/ts/src/cf/cf-basic-sys-abstraction.d.ts +14 -0
- package/ts/src/cf/cf-basic-sys-abstraction.d.ts.map +1 -0
- package/ts/src/cf/cf-basic-sys-abstraction.js +67 -0
- package/ts/src/cf/cf-basic-sys-abstraction.js.map +1 -0
- package/ts/src/cf/index.d.ts +1 -1
- package/ts/src/cf/index.d.ts.map +1 -1
- package/ts/src/cf/index.js +1 -1
- package/ts/src/cf/index.js.map +1 -1
- package/ts/src/cf-test-main.d.ts.map +1 -1
- package/ts/src/cf-test-main.js +7 -1
- package/ts/src/cf-test-main.js.map +1 -1
- package/ts/src/deno/deno-basic-sys-abstraction.d.ts +14 -0
- package/ts/src/deno/deno-basic-sys-abstraction.d.ts.map +1 -0
- package/ts/src/deno/deno-basic-sys-abstraction.js +35 -0
- package/ts/src/deno/deno-basic-sys-abstraction.js.map +1 -0
- package/ts/src/deno/deno-file-service.d.ts +1 -1
- package/ts/src/deno/deno-file-service.d.ts.map +1 -1
- package/ts/src/deno/deno-sys-abstraction.d.ts +3 -6
- package/ts/src/deno/deno-sys-abstraction.d.ts.map +1 -1
- package/ts/src/deno/deno-sys-abstraction.js +13 -17
- package/ts/src/deno/deno-sys-abstraction.js.map +1 -1
- package/ts/src/log-writer-impl.d.ts +1 -0
- package/ts/src/log-writer-impl.d.ts.map +1 -1
- package/ts/src/log-writer-impl.js +1 -0
- package/ts/src/log-writer-impl.js.map +1 -1
- package/ts/src/logger-impl.d.ts +3 -3
- package/ts/src/logger-impl.d.ts.map +1 -1
- package/ts/src/logger-impl.js +3 -18
- package/ts/src/logger-impl.js.map +1 -1
- package/ts/src/logger.test.js +3 -4
- package/ts/src/logger.test.js.map +1 -1
- package/ts/src/node/node-basic-sys-abstraction.d.ts +25 -0
- package/ts/src/node/node-basic-sys-abstraction.d.ts.map +1 -0
- package/ts/src/node/node-basic-sys-abstraction.js +44 -0
- package/ts/src/node/node-basic-sys-abstraction.js.map +1 -0
- package/ts/src/node/node-sys-abstraction.d.ts +3 -6
- package/ts/src/node/node-sys-abstraction.d.ts.map +1 -1
- package/ts/src/node/node-sys-abstraction.js +13 -17
- package/ts/src/node/node-sys-abstraction.js.map +1 -1
- package/ts/src/node/node-sys-abstraction.test.js +1 -1
- package/ts/src/node/node-sys-abstraction.test.js.map +1 -1
- package/ts/src/sys-abstraction.d.ts +10 -6
- package/ts/src/sys-abstraction.d.ts.map +1 -1
- package/ts/src/test/mock-logger.d.ts +2 -2
- package/ts/src/test/mock-logger.d.ts.map +1 -1
- package/ts/src/test/mock-logger.js.map +1 -1
- package/ts/src/tracer.test.js +5 -8
- package/ts/src/tracer.test.js.map +1 -1
- package/ts/src/txt-en-decoder.d.ts.map +1 -1
- package/ts/src/txt-en-decoder.js +3 -3
- package/ts/src/txt-en-decoder.js.map +1 -1
- package/ts/src/web/index.d.ts +1 -1
- package/ts/src/web/index.d.ts.map +1 -1
- package/ts/src/web/index.js +1 -1
- package/ts/src/web/index.js.map +1 -1
- package/ts/src/web/web-basic-sys-abstraction.d.ts +4 -0
- package/ts/src/web/web-basic-sys-abstraction.d.ts.map +1 -0
- package/ts/src/web/web-basic-sys-abstraction.js +45 -0
- package/ts/src/web/web-basic-sys-abstraction.js.map +1 -0
- package/utils/index.cjs +132 -3
- package/utils/index.cjs.map +1 -1
- package/utils/index.js +5 -5
- package/web/index.cjs +277 -281
- package/web/index.cjs.map +1 -1
- package/web/index.d.cts +4 -17
- package/web/index.d.ts +4 -17
- package/web/index.js +4 -7
- package/base-sys-abstraction-BnBZ6zd0.d.ts +0 -84
- package/base-sys-abstraction-DAZ8tx5F.d.cts +0 -84
- package/chunk-23MCJYE6.js.map +0 -1
- package/chunk-H6MLKWIZ.js +0 -88
- package/chunk-H6MLKWIZ.js.map +0 -1
- package/chunk-LXTKPZ6M.js +0 -255
- package/chunk-LXTKPZ6M.js.map +0 -1
- package/chunk-PHS255C5.js.map +0 -1
- package/chunk-UEER5ZC2.js.map +0 -1
- package/src/cf/cf-sys-abstraction.ts +0 -34
- package/src/web/web-sys-abstraction.ts +0 -80
- package/ts/src/base-sys-abstraction.test.d.ts +0 -2
- package/ts/src/base-sys-abstraction.test.d.ts.map +0 -1
- package/ts/src/base-sys-abstraction.test.js.map +0 -1
- package/ts/src/cf/cf-sys-abstraction.d.ts +0 -11
- package/ts/src/cf/cf-sys-abstraction.d.ts.map +0 -1
- package/ts/src/cf/cf-sys-abstraction.js +0 -30
- package/ts/src/cf/cf-sys-abstraction.js.map +0 -1
- package/ts/src/web/web-sys-abstraction.d.ts +0 -18
- package/ts/src/web/web-sys-abstraction.d.ts.map +0 -1
- package/ts/src/web/web-sys-abstraction.js +0 -64
- package/ts/src/web/web-sys-abstraction.js.map +0 -1
- /package/{chunk-55W4AK2Z.js.map → chunk-YVACAIUX.js.map} +0 -0
package/index.cjs
CHANGED
@@ -38,7 +38,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
38
38
|
// src/index.ts
|
39
39
|
var index_exports = {};
|
40
40
|
__export(index_exports, {
|
41
|
+
BaseBasicSysAbstraction: () => BaseBasicSysAbstraction,
|
41
42
|
BaseSysAbstraction: () => BaseSysAbstraction,
|
43
|
+
BasicSysAbstractionFactory: () => BasicSysAbstractionFactory,
|
42
44
|
BuildURI: () => BuildURI,
|
43
45
|
ConstTime: () => ConstTime,
|
44
46
|
EnvImpl: () => EnvImpl,
|
@@ -87,7 +89,8 @@ __export(index_exports, {
|
|
87
89
|
TxtEnDecoderSingleton: () => TxtEnDecoderSingleton,
|
88
90
|
URI: () => URI,
|
89
91
|
VERSION: () => VERSION,
|
90
|
-
|
92
|
+
WrapperBasicSysAbstraction: () => WrapperBasicSysAbstraction,
|
93
|
+
WrapperRuntimeSysAbstraction: () => WrapperRuntimeSysAbstraction,
|
91
94
|
YAMLFormatter: () => YAMLFormatter,
|
92
95
|
asyncLogValue: () => asyncLogValue,
|
93
96
|
bin2string: () => bin2string,
|
@@ -299,1899 +302,1821 @@ function IsLogger(obj) {
|
|
299
302
|
].map((fn) => typeof obj[fn] === "function").reduce((a, b) => a && b, true);
|
300
303
|
}
|
301
304
|
|
302
|
-
// src/
|
303
|
-
var
|
304
|
-
|
305
|
-
|
306
|
-
STEP: "step"
|
307
|
-
};
|
308
|
-
var RandomMode = {
|
309
|
-
CONST: "const",
|
310
|
-
STEP: "step",
|
311
|
-
RANDOM: "random"
|
312
|
-
};
|
313
|
-
var IDMode = {
|
314
|
-
UUID: "uuid",
|
315
|
-
CONST: "const",
|
316
|
-
STEP: "step"
|
317
|
-
};
|
318
|
-
function String2TimeMode(s) {
|
319
|
-
switch (s == null ? void 0 : s.toLowerCase()) {
|
320
|
-
case "real":
|
321
|
-
return TimeMode.REAL;
|
322
|
-
case "const":
|
323
|
-
return TimeMode.CONST;
|
324
|
-
case "step":
|
325
|
-
return TimeMode.STEP;
|
326
|
-
default:
|
327
|
-
return TimeMode.REAL;
|
305
|
+
// src/result.ts
|
306
|
+
var Result = class _Result {
|
307
|
+
static Ok(t) {
|
308
|
+
return new ResultOK(t);
|
328
309
|
}
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
310
|
+
static Err(t) {
|
311
|
+
if (typeof t === "string") {
|
312
|
+
return new ResultError(new Error(t));
|
313
|
+
}
|
314
|
+
if (_Result.Is(t)) {
|
315
|
+
if (t.is_ok()) {
|
316
|
+
return new ResultError(new Error("Result Error is Ok"));
|
317
|
+
}
|
318
|
+
return t;
|
319
|
+
}
|
320
|
+
return new ResultError(t);
|
336
321
|
}
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
var SysTime = class extends Time {
|
350
|
-
Now() {
|
351
|
-
return /* @__PURE__ */ new Date();
|
322
|
+
static Is(t) {
|
323
|
+
if (!t) {
|
324
|
+
return false;
|
325
|
+
}
|
326
|
+
if (t instanceof _Result) {
|
327
|
+
return true;
|
328
|
+
}
|
329
|
+
const rt = t;
|
330
|
+
if ([typeof rt.is_ok, typeof rt.is_err, typeof rt.unwrap, typeof rt.unwrap_err].every((x) => x === "function")) {
|
331
|
+
return true;
|
332
|
+
}
|
333
|
+
return false;
|
352
334
|
}
|
353
|
-
|
354
|
-
return
|
355
|
-
setTimeout(() => {
|
356
|
-
resolve();
|
357
|
-
}, duration);
|
358
|
-
});
|
335
|
+
isOk() {
|
336
|
+
return this.is_ok();
|
359
337
|
}
|
360
|
-
|
361
|
-
|
362
|
-
Now() {
|
363
|
-
return new Date(2021, 1, 1, 0, 0, 0, 0);
|
338
|
+
isErr() {
|
339
|
+
return this.is_err();
|
364
340
|
}
|
365
|
-
|
366
|
-
|
367
|
-
|
341
|
+
Ok() {
|
342
|
+
return this.unwrap();
|
343
|
+
}
|
344
|
+
Err() {
|
345
|
+
return this.unwrap_err();
|
368
346
|
}
|
369
347
|
};
|
370
|
-
var
|
371
|
-
constructor() {
|
348
|
+
var ResultOK = class extends Result {
|
349
|
+
constructor(t) {
|
372
350
|
super();
|
373
|
-
this.
|
374
|
-
this._start = this._step;
|
351
|
+
this._t = t;
|
375
352
|
}
|
376
|
-
|
377
|
-
|
378
|
-
this._step = new Date(this._step.getTime() + 1e3);
|
379
|
-
}
|
380
|
-
if (steps < 1) {
|
381
|
-
this._step = new Date(this._start.getTime() + steps * -1e3);
|
382
|
-
}
|
383
|
-
return this._step;
|
353
|
+
is_ok() {
|
354
|
+
return true;
|
384
355
|
}
|
385
|
-
|
386
|
-
|
387
|
-
|
356
|
+
is_err() {
|
357
|
+
return false;
|
358
|
+
}
|
359
|
+
unwrap_err() {
|
360
|
+
throw new Error("Result is Ok");
|
361
|
+
}
|
362
|
+
unwrap() {
|
363
|
+
return this._t;
|
388
364
|
}
|
389
365
|
};
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
case TimeMode.CONST:
|
395
|
-
return new ConstTime();
|
396
|
-
case TimeMode.STEP:
|
397
|
-
return new StepTime();
|
366
|
+
var ResultError = class extends Result {
|
367
|
+
constructor(t) {
|
368
|
+
super();
|
369
|
+
this._error = t;
|
398
370
|
}
|
399
|
-
|
400
|
-
|
401
|
-
var RandomService = class {
|
402
|
-
constructor(mode) {
|
403
|
-
this._step = 0;
|
404
|
-
this._mode = mode;
|
371
|
+
is_ok() {
|
372
|
+
return false;
|
405
373
|
}
|
406
|
-
|
407
|
-
|
408
|
-
case RandomMode.CONST:
|
409
|
-
return 0.5 * value;
|
410
|
-
case RandomMode.STEP:
|
411
|
-
this._step += 1e-4;
|
412
|
-
return this._step * value;
|
413
|
-
case RandomMode.RANDOM:
|
414
|
-
return Math.random() * value;
|
415
|
-
default:
|
416
|
-
throw new Error("Unknown RandomMode");
|
417
|
-
}
|
374
|
+
is_err() {
|
375
|
+
return true;
|
418
376
|
}
|
419
|
-
|
420
|
-
|
421
|
-
constructor(mode) {
|
422
|
-
this._step = 0;
|
423
|
-
if (!mode) {
|
424
|
-
mode = IDMode.UUID;
|
425
|
-
}
|
426
|
-
this._mode = mode;
|
377
|
+
unwrap() {
|
378
|
+
throw new Error(`Result is Err: ${this._error}`);
|
427
379
|
}
|
428
|
-
|
429
|
-
|
430
|
-
case IDMode.UUID:
|
431
|
-
return crypto.randomUUID();
|
432
|
-
case IDMode.CONST:
|
433
|
-
return "VeryUniqueID";
|
434
|
-
case IDMode.STEP:
|
435
|
-
return `STEPId-${this._step++}`;
|
436
|
-
default:
|
437
|
-
throw new Error("Unknown IDMode");
|
438
|
-
}
|
380
|
+
unwrap_err() {
|
381
|
+
return this._error;
|
439
382
|
}
|
440
383
|
};
|
441
|
-
function
|
442
|
-
|
443
|
-
|
444
|
-
|
384
|
+
function exception2Result(fn) {
|
385
|
+
try {
|
386
|
+
const res = fn();
|
387
|
+
if (res instanceof Promise) {
|
388
|
+
return res.then((value) => Result.Ok(value)).catch((e) => Result.Err(e));
|
445
389
|
}
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
});
|
451
|
-
}).catch((e) => {
|
452
|
-
console.error("consumeReadableStream:read", e);
|
453
|
-
});
|
454
|
-
}
|
455
|
-
function CFWriteableStream(writeFn) {
|
456
|
-
const ts = new TransformStream();
|
457
|
-
consumeReadableStream(ts.readable.getReader(), writeFn);
|
458
|
-
return ts.writable;
|
390
|
+
return Result.Ok(res);
|
391
|
+
} catch (e) {
|
392
|
+
return Result.Err(e);
|
393
|
+
}
|
459
394
|
}
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
this.
|
465
|
-
this._fileSystem = params.FileSystem;
|
466
|
-
this._systemService = params.SystemService;
|
467
|
-
this._txtEnDe = params.TxtEnDecoder;
|
468
|
-
const decoder = this._txtEnDe;
|
469
|
-
this._stdout = CFWriteableStream((chunk) => {
|
470
|
-
const decoded = decoder.decode(chunk);
|
471
|
-
console.log(decoded.trimEnd());
|
472
|
-
return Promise.resolve();
|
473
|
-
});
|
474
|
-
this._stderr = CFWriteableStream((chunk) => {
|
475
|
-
const decoded = decoder.decode(chunk);
|
476
|
-
console.error(decoded.trimEnd());
|
477
|
-
return Promise.resolve();
|
478
|
-
});
|
395
|
+
|
396
|
+
// src/types.ts
|
397
|
+
var _Required = class {
|
398
|
+
constructor() {
|
399
|
+
this.type = "REQUIRED";
|
479
400
|
}
|
480
401
|
};
|
481
|
-
var
|
482
|
-
constructor(
|
483
|
-
this.
|
484
|
-
this._stdout = base._stdout;
|
485
|
-
this._stderr = base._stderr;
|
486
|
-
this._idService = base._idService;
|
487
|
-
this._randomService = base._randomService;
|
488
|
-
this._fileSystem = base._fileSystem;
|
489
|
-
this._systemService = base._systemService;
|
490
|
-
if (params) {
|
491
|
-
if (params.TimeMode) {
|
492
|
-
this._time = TimeFactory(params.TimeMode);
|
493
|
-
}
|
494
|
-
if (params.Stdout) {
|
495
|
-
this._stdout = params.Stdout;
|
496
|
-
}
|
497
|
-
if (params.Stderr) {
|
498
|
-
this._stderr = params.Stderr;
|
499
|
-
}
|
500
|
-
if (params.IdMode) {
|
501
|
-
this._idService = new IdService(params.IdMode);
|
502
|
-
}
|
503
|
-
if (params.RandomMode) {
|
504
|
-
this._randomService = new RandomService(params.RandomMode);
|
505
|
-
}
|
506
|
-
if (params.FileSystem) {
|
507
|
-
this._fileSystem = params.FileSystem;
|
508
|
-
}
|
509
|
-
if (params.SystemService) {
|
510
|
-
this._systemService = params.SystemService;
|
511
|
-
}
|
512
|
-
}
|
513
|
-
}
|
514
|
-
Time() {
|
515
|
-
return this._time;
|
516
|
-
}
|
517
|
-
NextId() {
|
518
|
-
return this._idService.NextId();
|
519
|
-
}
|
520
|
-
Random0ToValue(value) {
|
521
|
-
return this._randomService.Random0ToValue(value);
|
522
|
-
}
|
523
|
-
Stdout() {
|
524
|
-
return this._stdout;
|
525
|
-
}
|
526
|
-
Stderr() {
|
527
|
-
return this._stderr;
|
402
|
+
var _Optional = class {
|
403
|
+
constructor() {
|
404
|
+
this.type = "OPTIONAL";
|
528
405
|
}
|
529
|
-
|
530
|
-
|
406
|
+
};
|
407
|
+
var param = {
|
408
|
+
REQUIRED: new _Required(),
|
409
|
+
OPTIONAL: new _Optional()
|
410
|
+
};
|
411
|
+
|
412
|
+
// src/utils/get-params-result.ts
|
413
|
+
function getParamsResult(keys, getParam) {
|
414
|
+
const keyDef = keys.flat().reduce(
|
415
|
+
(acc, i) => {
|
416
|
+
if (typeof i === "string") {
|
417
|
+
acc.push({ key: i, def: void 0, isOptional: false });
|
418
|
+
} else if (typeof i === "object") {
|
419
|
+
acc.push(
|
420
|
+
...Object.keys(i).map((k) => ({
|
421
|
+
key: k,
|
422
|
+
def: typeof i[k] === "string" ? i[k] : void 0,
|
423
|
+
isOptional: i[k] === param.OPTIONAL
|
424
|
+
}))
|
425
|
+
);
|
426
|
+
}
|
427
|
+
return acc;
|
428
|
+
},
|
429
|
+
[]
|
430
|
+
);
|
431
|
+
const msgFn = keys.find((k) => typeof k === "function") || ((...keys2) => {
|
432
|
+
const msg = keys2.join(",");
|
433
|
+
return `missing parameters: ${msg}`;
|
434
|
+
});
|
435
|
+
const errors = [];
|
436
|
+
const result = {};
|
437
|
+
for (const kd of keyDef) {
|
438
|
+
const val = getParam.getParam(kd.key);
|
439
|
+
if (val === void 0) {
|
440
|
+
if (typeof kd.def === "string") {
|
441
|
+
result[kd.key] = kd.def;
|
442
|
+
} else {
|
443
|
+
if (!kd.isOptional) {
|
444
|
+
errors.push(kd.key);
|
445
|
+
}
|
446
|
+
}
|
447
|
+
} else {
|
448
|
+
result[kd.key] = val;
|
449
|
+
}
|
531
450
|
}
|
532
|
-
|
533
|
-
return
|
451
|
+
if (errors.length) {
|
452
|
+
return Result.Err(msgFn(...errors));
|
453
|
+
}
|
454
|
+
return Result.Ok(result);
|
455
|
+
}
|
456
|
+
|
457
|
+
// src/utils/relative-path.ts
|
458
|
+
var PartType = {
|
459
|
+
Slash: 1,
|
460
|
+
Root: 3,
|
461
|
+
Up: 4,
|
462
|
+
Noop: 8
|
463
|
+
// RootUp = 0x8 /* ../ */,
|
464
|
+
};
|
465
|
+
var Path = class {
|
466
|
+
constructor(parts = []) {
|
467
|
+
this.parts = parts;
|
468
|
+
}
|
469
|
+
toString() {
|
470
|
+
return this.parts.map((part) => {
|
471
|
+
if (typeof part === "string") {
|
472
|
+
return part;
|
473
|
+
} else {
|
474
|
+
switch (part) {
|
475
|
+
case PartType.Slash:
|
476
|
+
case PartType.Root:
|
477
|
+
return "/";
|
478
|
+
case PartType.Up:
|
479
|
+
return "..";
|
480
|
+
default:
|
481
|
+
return part;
|
482
|
+
}
|
483
|
+
}
|
484
|
+
}).join("");
|
485
|
+
}
|
486
|
+
add(part) {
|
487
|
+
if (this.parts.includes(PartType.Root) && part === PartType.Root) {
|
488
|
+
throw new Error("Cannot add absolute part to absolute path");
|
489
|
+
}
|
490
|
+
const last = this.parts[this.parts.length - 1];
|
491
|
+
if (last & PartType.Slash && part === PartType.Slash) {
|
492
|
+
return;
|
493
|
+
}
|
494
|
+
switch (part) {
|
495
|
+
case ".":
|
496
|
+
this.parts.push(PartType.Noop);
|
497
|
+
return;
|
498
|
+
case "..":
|
499
|
+
part = PartType.Up;
|
500
|
+
}
|
501
|
+
if (last === PartType.Noop && part === PartType.Slash) {
|
502
|
+
if (last === PartType.Noop) {
|
503
|
+
this.parts.pop();
|
504
|
+
}
|
505
|
+
return;
|
506
|
+
}
|
507
|
+
this.parts.push(part);
|
534
508
|
}
|
535
509
|
};
|
510
|
+
function splitPath(path) {
|
511
|
+
const p = new Path();
|
512
|
+
if (path === "") {
|
513
|
+
return p;
|
514
|
+
}
|
515
|
+
for (let count = 0; path.length; count++) {
|
516
|
+
if (path.match(/^\/+/)) {
|
517
|
+
if (count === 0) {
|
518
|
+
p.add(PartType.Root);
|
519
|
+
} else {
|
520
|
+
p.add(PartType.Slash);
|
521
|
+
}
|
522
|
+
path = path.replace(/^\/+/, "");
|
523
|
+
} else {
|
524
|
+
const part = path.replace(/\/.*$/, "");
|
525
|
+
p.add(part);
|
526
|
+
path = path.replace(/^[^/]+/, "");
|
527
|
+
}
|
528
|
+
}
|
529
|
+
return p;
|
530
|
+
}
|
531
|
+
function pathJoin(...paths) {
|
532
|
+
let prev = "";
|
533
|
+
const res = [];
|
534
|
+
for (let i = 0; i < paths.length; i++) {
|
535
|
+
const path = paths[i];
|
536
|
+
if (path === "") {
|
537
|
+
continue;
|
538
|
+
}
|
539
|
+
if (!(prev.endsWith("/") || path.startsWith("/"))) {
|
540
|
+
if (prev !== "") {
|
541
|
+
res.push("/");
|
542
|
+
}
|
543
|
+
res.push(path);
|
544
|
+
} else {
|
545
|
+
res.push(path);
|
546
|
+
}
|
547
|
+
prev = path;
|
548
|
+
}
|
549
|
+
return res.join("");
|
550
|
+
}
|
551
|
+
function relativePath(path, relative) {
|
552
|
+
const relativeParts = splitPath(relative);
|
553
|
+
let result;
|
554
|
+
if (relativeParts.parts[0] === PartType.Root) {
|
555
|
+
result = relative;
|
556
|
+
} else {
|
557
|
+
result = pathJoin(path, relative);
|
558
|
+
}
|
559
|
+
const unoptPath = splitPath(result);
|
560
|
+
const out = [];
|
561
|
+
let topUp = false;
|
562
|
+
for (const part of unoptPath.parts) {
|
563
|
+
switch (part) {
|
564
|
+
case PartType.Root:
|
565
|
+
out.push(PartType.Root);
|
566
|
+
break;
|
567
|
+
case PartType.Up:
|
568
|
+
if (out.length && !topUp) {
|
569
|
+
const last = out.length - 1;
|
570
|
+
if (typeof out[last] === "string" && out[last - 1] == PartType.Root) {
|
571
|
+
out.pop();
|
572
|
+
} else {
|
573
|
+
out.pop();
|
574
|
+
out.pop();
|
575
|
+
}
|
576
|
+
if (out.length === 0) {
|
577
|
+
topUp = !topUp ? true : topUp;
|
578
|
+
out.push(PartType.Up);
|
579
|
+
}
|
580
|
+
} else {
|
581
|
+
out.push(PartType.Up);
|
582
|
+
}
|
583
|
+
break;
|
584
|
+
case PartType.Slash:
|
585
|
+
if (!(out[out.length - 1] & PartType.Slash)) {
|
586
|
+
out.push(PartType.Slash);
|
587
|
+
}
|
588
|
+
break;
|
589
|
+
default:
|
590
|
+
out.push(part);
|
591
|
+
break;
|
592
|
+
}
|
593
|
+
}
|
594
|
+
return new Path(out).toString();
|
595
|
+
}
|
536
596
|
|
537
|
-
// src/
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
}
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
597
|
+
// src/utils/stripper.ts
|
598
|
+
function stripper(strip, obj) {
|
599
|
+
const strips = Array.isArray(strip) ? strip : [strip];
|
600
|
+
const restrips = strips.map((s) => {
|
601
|
+
if (typeof s === "string") {
|
602
|
+
const escaped = s.replace(/[-\\[\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\^\\$\\|]/g, "\\$&");
|
603
|
+
return new RegExp(`^${escaped}$`);
|
604
|
+
}
|
605
|
+
return s;
|
606
|
+
});
|
607
|
+
return localStripper(void 0, restrips, obj);
|
608
|
+
}
|
609
|
+
function localStripper(path, restrips, obj) {
|
610
|
+
if (typeof obj !== "object" || obj === null) {
|
611
|
+
return obj;
|
552
612
|
}
|
553
|
-
|
554
|
-
return
|
613
|
+
if (Array.isArray(obj)) {
|
614
|
+
return obj.map((i) => localStripper(path, restrips, i));
|
555
615
|
}
|
556
|
-
|
557
|
-
|
616
|
+
const ret = { ...obj };
|
617
|
+
const matcher = (key, nextPath) => {
|
618
|
+
for (const re of restrips) {
|
619
|
+
if (re.test(key) || re.test(nextPath)) {
|
620
|
+
return true;
|
621
|
+
}
|
622
|
+
}
|
623
|
+
return false;
|
624
|
+
};
|
625
|
+
for (const key in ret) {
|
626
|
+
if (Object.prototype.hasOwnProperty.call(ret, key)) {
|
627
|
+
let nextPath;
|
628
|
+
if (path) {
|
629
|
+
nextPath = [path, key].join(".");
|
630
|
+
} else {
|
631
|
+
nextPath = key;
|
632
|
+
}
|
633
|
+
if (matcher(key, nextPath)) {
|
634
|
+
delete ret[key];
|
635
|
+
continue;
|
636
|
+
}
|
637
|
+
if (typeof ret[key] === "object") {
|
638
|
+
if (Array.isArray(ret[key])) {
|
639
|
+
ret[key] = ret[key].reduce((acc, v, i) => {
|
640
|
+
const toDelete = matcher(key, `${nextPath}[${i}]`);
|
641
|
+
if (!toDelete) {
|
642
|
+
acc.push(localStripper(`${nextPath}[${i}]`, restrips, v));
|
643
|
+
}
|
644
|
+
return acc;
|
645
|
+
}, []);
|
646
|
+
} else {
|
647
|
+
ret[key] = localStripper(nextPath, restrips, ret[key]);
|
648
|
+
}
|
649
|
+
}
|
650
|
+
}
|
651
|
+
}
|
652
|
+
return ret;
|
653
|
+
}
|
654
|
+
|
655
|
+
// src/uri.ts
|
656
|
+
function match(iref, ioth) {
|
657
|
+
const mr = {
|
658
|
+
score: 0,
|
659
|
+
protocol: false,
|
660
|
+
hostname: false,
|
661
|
+
port: false,
|
662
|
+
pathname: false,
|
663
|
+
pathParts: [],
|
664
|
+
params: {}
|
665
|
+
};
|
666
|
+
const ref = URI.from(iref);
|
667
|
+
const oth = URI.from(ioth);
|
668
|
+
if (ref.protocol === oth.protocol) {
|
669
|
+
mr.score += 1;
|
670
|
+
mr.protocol = true;
|
671
|
+
}
|
672
|
+
try {
|
673
|
+
const refH = ref.hostname;
|
674
|
+
const refP = ref.port;
|
675
|
+
if (refH === oth.hostname) {
|
676
|
+
mr.score += 1;
|
677
|
+
mr.hostname = true;
|
678
|
+
}
|
679
|
+
if (refP.length && refP === oth.port) {
|
680
|
+
mr.score += 1;
|
681
|
+
mr.port = true;
|
682
|
+
}
|
683
|
+
} catch (e) {
|
684
|
+
}
|
685
|
+
if (ref.pathname.length && ref.pathname !== "/") {
|
686
|
+
const pref = ref.pathname.split("/").filter((p) => p.length);
|
687
|
+
const poth = oth.pathname.split("/").filter((p) => p.length);
|
688
|
+
for (let i = 0; i < pref.length && i < poth.length; i++) {
|
689
|
+
if (poth[i] === pref[i]) {
|
690
|
+
mr.score += 1;
|
691
|
+
mr.pathname = true;
|
692
|
+
mr.pathParts.push(pref[i]);
|
693
|
+
}
|
694
|
+
}
|
695
|
+
}
|
696
|
+
for (const [key, value] of ref.getParams) {
|
697
|
+
if (oth.getParam(key) === value) {
|
698
|
+
mr.score += 1;
|
699
|
+
mr.params[key] = value;
|
700
|
+
}
|
701
|
+
}
|
702
|
+
return mr;
|
703
|
+
}
|
704
|
+
function coerceKey(key, def) {
|
705
|
+
if (typeof key === "object") {
|
706
|
+
const keys = Object.keys(key);
|
707
|
+
if (keys.length !== 1) {
|
708
|
+
throw new Error(`Invalid key: ${JSON.stringify(key)}`);
|
709
|
+
}
|
710
|
+
return { key: keys[0], def: key[keys[0]] };
|
711
|
+
}
|
712
|
+
return { key, def };
|
713
|
+
}
|
714
|
+
function falsy2undef(value) {
|
715
|
+
return value === void 0 || value === null ? void 0 : value;
|
716
|
+
}
|
717
|
+
function ensureURLWithDefaultProto(url, defaultProtocol) {
|
718
|
+
if (!url) {
|
719
|
+
return new MutableURL(`${defaultProtocol}//`);
|
720
|
+
}
|
721
|
+
if (typeof url === "string") {
|
722
|
+
try {
|
723
|
+
return new MutableURL(url);
|
724
|
+
} catch (e) {
|
725
|
+
return new MutableURL(`${defaultProtocol}//${url}`);
|
726
|
+
}
|
727
|
+
} else {
|
728
|
+
return new MutableURL(url.toString());
|
729
|
+
}
|
730
|
+
}
|
731
|
+
function isURL(value) {
|
732
|
+
return value instanceof URL || !!value && typeof value.searchParams === "object" && typeof value.searchParams.sort === "function" && typeof value.hash === "string";
|
733
|
+
}
|
734
|
+
var MutableURL = class _MutableURL extends URL {
|
735
|
+
constructor(urlStr) {
|
736
|
+
super("defect://does.not.exist");
|
737
|
+
const partedURL = urlStr.split(":");
|
738
|
+
this._hasHostpart = hasHostPartProtocols.has(partedURL[0]);
|
739
|
+
let hostPartUrl = ["http", ...partedURL.slice(1)].join(":");
|
740
|
+
if (!this._hasHostpart) {
|
741
|
+
const pathname = hostPartUrl.replace(/http:\/\/[/]*/, "").replace(/[#?].*$/, "");
|
742
|
+
hostPartUrl = hostPartUrl.replace(/http:\/\//, `http://localhost/${pathname}`);
|
743
|
+
}
|
744
|
+
try {
|
745
|
+
this._sysURL = new URL(hostPartUrl);
|
746
|
+
} catch (ie) {
|
747
|
+
const e = ie;
|
748
|
+
e.message = `${e.message} for URL: ${urlStr}`;
|
749
|
+
throw e;
|
750
|
+
}
|
751
|
+
this._protocol = `${partedURL[0]}:`;
|
752
|
+
if (this._hasHostpart) {
|
753
|
+
this._pathname = this._sysURL.pathname;
|
754
|
+
} else {
|
755
|
+
this._pathname = urlStr.replace(new RegExp(`^${this._protocol}//`), "").replace(/[#?].*$/, "");
|
756
|
+
}
|
757
|
+
this.hash = this._sysURL.hash;
|
558
758
|
}
|
559
|
-
|
560
|
-
|
759
|
+
clone() {
|
760
|
+
return new _MutableURL(this.toString());
|
561
761
|
}
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
constructor(param2 = {}) {
|
570
|
-
this._lruMap = new LRUMap(param2);
|
762
|
+
get host() {
|
763
|
+
if (!this._hasHostpart) {
|
764
|
+
throw new Error(
|
765
|
+
`you can use hostname only if protocol is ${this.toString()} ${JSON.stringify(Array.from(hasHostPartProtocols.keys()))}`
|
766
|
+
);
|
767
|
+
}
|
768
|
+
return this._sysURL.host;
|
571
769
|
}
|
572
|
-
|
573
|
-
this.
|
770
|
+
get port() {
|
771
|
+
if (!this._hasHostpart) {
|
772
|
+
throw new Error(`you can use hostname only if protocol is ${JSON.stringify(Array.from(hasHostPartProtocols.keys()))}`);
|
773
|
+
}
|
774
|
+
return this._sysURL.port;
|
574
775
|
}
|
575
|
-
|
576
|
-
|
776
|
+
set port(p) {
|
777
|
+
if (!this._hasHostpart) {
|
778
|
+
throw new Error(`you can use port only if protocol is ${JSON.stringify(Array.from(hasHostPartProtocols.keys()))}`);
|
779
|
+
}
|
780
|
+
this._sysURL.port = p;
|
577
781
|
}
|
578
|
-
|
579
|
-
|
782
|
+
get hostname() {
|
783
|
+
if (!this._hasHostpart) {
|
784
|
+
throw new Error(`you can use hostname only if protocol is ${JSON.stringify(Array.from(hasHostPartProtocols.keys()))}`);
|
785
|
+
}
|
786
|
+
return this._sysURL.hostname;
|
580
787
|
}
|
581
|
-
|
582
|
-
this.
|
788
|
+
set hostname(h) {
|
789
|
+
if (!this._hasHostpart) {
|
790
|
+
throw new Error(`you can use hostname only if protocol is ${JSON.stringify(Array.from(hasHostPartProtocols.keys()))}`);
|
791
|
+
}
|
792
|
+
this._sysURL.hostname = h;
|
583
793
|
}
|
584
|
-
|
585
|
-
this.
|
794
|
+
set pathname(p) {
|
795
|
+
this._pathname = p;
|
586
796
|
}
|
587
|
-
|
588
|
-
this.
|
797
|
+
get pathname() {
|
798
|
+
return this._pathname;
|
589
799
|
}
|
590
|
-
|
591
|
-
this.
|
800
|
+
get protocol() {
|
801
|
+
return this._protocol;
|
592
802
|
}
|
593
|
-
|
594
|
-
|
803
|
+
set protocol(p) {
|
804
|
+
if (!p.endsWith(":")) {
|
805
|
+
p = `${p}:`;
|
806
|
+
}
|
807
|
+
this._protocol = p;
|
595
808
|
}
|
596
|
-
|
597
|
-
|
598
|
-
constructor(c = {}) {
|
599
|
-
this._map = /* @__PURE__ */ new Map();
|
600
|
-
this.param = {
|
601
|
-
maxEntries: c.maxEntries || 100,
|
602
|
-
maxAge: c.maxAge || 0
|
603
|
-
};
|
809
|
+
get searchParams() {
|
810
|
+
return this._sysURL.searchParams;
|
604
811
|
}
|
605
|
-
|
606
|
-
|
607
|
-
|
812
|
+
toString() {
|
813
|
+
let search = "";
|
814
|
+
if (this._sysURL.searchParams.size) {
|
815
|
+
for (const [key, value] of Array.from(this._sysURL.searchParams.entries()).sort((a, b) => a[0].localeCompare(b[0]))) {
|
816
|
+
search += `${!search.length ? "?" : "&"}${key}=${encodeURIComponent(value)}`;
|
817
|
+
}
|
608
818
|
}
|
609
|
-
|
610
|
-
this.
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
if (param2.maxEntries > 0 && this._map.size > param2.maxEntries) {
|
618
|
-
const toDelete = [];
|
619
|
-
let cacheSize = this._map.size;
|
620
|
-
for (const key of this._map.keys()) {
|
621
|
-
if (cacheSize > param2.maxEntries) {
|
622
|
-
toDelete.push(key);
|
623
|
-
cacheSize--;
|
624
|
-
} else {
|
625
|
-
break;
|
626
|
-
}
|
627
|
-
}
|
628
|
-
for (const key of toDelete) {
|
629
|
-
this._map.delete(key);
|
630
|
-
}
|
819
|
+
let hostpart = "";
|
820
|
+
if (this._hasHostpart) {
|
821
|
+
hostpart = this._sysURL.hostname;
|
822
|
+
if (this._sysURL.port) {
|
823
|
+
hostpart += `:${this._sysURL.port}`;
|
824
|
+
}
|
825
|
+
if (!this._pathname.startsWith("/")) {
|
826
|
+
hostpart += "/";
|
631
827
|
}
|
632
828
|
}
|
829
|
+
return `${this._protocol}//${hostpart}${this._pathname}${search}`;
|
633
830
|
}
|
634
|
-
|
635
|
-
|
831
|
+
};
|
832
|
+
function from(fac, strURLUri, defaultProtocol) {
|
833
|
+
switch (typeof falsy2undef(strURLUri)) {
|
834
|
+
case "undefined":
|
835
|
+
return fac(new MutableURL(`${defaultProtocol}///`));
|
836
|
+
case "string":
|
837
|
+
return fac(ensureURLWithDefaultProto(strURLUri, defaultProtocol));
|
838
|
+
case "object":
|
839
|
+
if (BuildURI.is(strURLUri)) {
|
840
|
+
return fac(new MutableURL(strURLUri._url.toString()));
|
841
|
+
} else if (URI.is(strURLUri)) {
|
842
|
+
return fac(new MutableURL(strURLUri._url.toString()));
|
843
|
+
} else if (isURL(strURLUri)) {
|
844
|
+
return fac(new MutableURL(strURLUri.toString()));
|
845
|
+
}
|
846
|
+
throw new Error(`unknown object type: ${strURLUri}`);
|
847
|
+
default:
|
848
|
+
throw new Error(`Invalid argument: ${typeof strURLUri}`);
|
636
849
|
}
|
637
|
-
|
638
|
-
|
850
|
+
}
|
851
|
+
function getParamResult(key, val, msgFn = (key2) => {
|
852
|
+
return `missing parameter: ${key2}`;
|
853
|
+
}) {
|
854
|
+
if (val === void 0) {
|
855
|
+
return Result.Err(msgFn(key));
|
639
856
|
}
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
this.set(key, val2);
|
647
|
-
return val2;
|
648
|
-
}
|
857
|
+
return Result.Ok(val);
|
858
|
+
}
|
859
|
+
var BuildURI = class _BuildURI {
|
860
|
+
// pathname needs this
|
861
|
+
constructor(url) {
|
862
|
+
this._url = url;
|
649
863
|
}
|
650
|
-
|
651
|
-
|
652
|
-
return this.touch(key);
|
653
|
-
}
|
654
|
-
return this._map.get(key);
|
864
|
+
static is(value) {
|
865
|
+
return value instanceof _BuildURI || !!value && typeof value.delParam === "function" && typeof value.setParam === "function";
|
655
866
|
}
|
656
|
-
|
657
|
-
|
658
|
-
if (this.param.maxEntries > 0 && this._map.size >= this.param.maxEntries) {
|
659
|
-
this._map.delete(this._map.keys().next().value);
|
660
|
-
this._map.set(key, value);
|
661
|
-
} else {
|
662
|
-
this._map.set(key, value);
|
663
|
-
}
|
867
|
+
static from(strURLUri, defaultProtocol = "file:") {
|
868
|
+
return from((url) => new _BuildURI(url), strURLUri, defaultProtocol);
|
664
869
|
}
|
665
|
-
|
666
|
-
this.
|
870
|
+
match(other) {
|
871
|
+
return match(this.URI(), URI.from(other));
|
667
872
|
}
|
668
|
-
|
669
|
-
this.
|
873
|
+
port(p) {
|
874
|
+
this._url.port = p;
|
875
|
+
return this;
|
670
876
|
}
|
671
|
-
|
672
|
-
this.
|
877
|
+
hostname(h) {
|
878
|
+
this._url.hostname = h;
|
879
|
+
return this;
|
673
880
|
}
|
674
|
-
|
675
|
-
|
881
|
+
protocol(p) {
|
882
|
+
if (!p.endsWith(":")) {
|
883
|
+
p = `${p}:`;
|
884
|
+
}
|
885
|
+
this._url.protocol = p;
|
886
|
+
return this;
|
676
887
|
}
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
// }
|
681
|
-
// }
|
682
|
-
// getLeastRecent(): K {
|
683
|
-
// return Array.from(this.cache)[0];
|
684
|
-
// }
|
685
|
-
// getMostRecent(): K {
|
686
|
-
// return Array.from(this.cache)[this.cache.size - 1];
|
687
|
-
// }
|
688
|
-
};
|
689
|
-
|
690
|
-
// src/result.ts
|
691
|
-
var Result = class _Result {
|
692
|
-
static Ok(t) {
|
693
|
-
return new ResultOK(t);
|
888
|
+
pathname(p) {
|
889
|
+
this._url.pathname = p;
|
890
|
+
return this;
|
694
891
|
}
|
695
|
-
|
696
|
-
|
697
|
-
|
892
|
+
// could pass a relative path or a full URL
|
893
|
+
// if relative path, it will be appended to the current path
|
894
|
+
resolve(p) {
|
895
|
+
if (!p) {
|
896
|
+
return this;
|
698
897
|
}
|
699
|
-
if (
|
700
|
-
if (
|
701
|
-
|
898
|
+
if (typeof p === "string") {
|
899
|
+
if (!p.match(/^[a-zA-Z0-9]+:/)) {
|
900
|
+
if (p.startsWith("/")) {
|
901
|
+
this.pathname(p);
|
902
|
+
return this;
|
903
|
+
}
|
904
|
+
return this.appendRelative(p);
|
702
905
|
}
|
703
|
-
return t;
|
704
906
|
}
|
705
|
-
|
907
|
+
this._url = new MutableURL(p.toString());
|
908
|
+
return this;
|
909
|
+
}
|
910
|
+
appendRelative(p) {
|
911
|
+
const appendUrl = URI.from(p);
|
912
|
+
const pathname = "./" + appendUrl.pathname;
|
913
|
+
const basePath = this._url.pathname;
|
914
|
+
this.pathname(relativePath(basePath, pathname));
|
915
|
+
for (const [key, value] of appendUrl.getParams) {
|
916
|
+
this.setParam(key, value);
|
917
|
+
}
|
918
|
+
return this;
|
706
919
|
}
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
}
|
711
|
-
if (t instanceof _Result) {
|
712
|
-
return true;
|
713
|
-
}
|
714
|
-
const rt = t;
|
715
|
-
if ([typeof rt.is_ok, typeof rt.is_err, typeof rt.unwrap, typeof rt.unwrap_err].every((x) => x === "function")) {
|
716
|
-
return true;
|
920
|
+
cleanParams() {
|
921
|
+
for (const key of Array.from(this._url.searchParams.keys())) {
|
922
|
+
this._url.searchParams.delete(key);
|
717
923
|
}
|
718
|
-
return
|
924
|
+
return this;
|
719
925
|
}
|
720
|
-
|
721
|
-
|
926
|
+
delParam(key) {
|
927
|
+
this._url.searchParams.delete(key);
|
928
|
+
return this;
|
722
929
|
}
|
723
|
-
|
724
|
-
|
930
|
+
defParam(key, str) {
|
931
|
+
if (!this._url.searchParams.has(key)) {
|
932
|
+
this._url.searchParams.set(key, str);
|
933
|
+
}
|
934
|
+
return this;
|
725
935
|
}
|
726
|
-
|
727
|
-
|
936
|
+
setParam(key, str) {
|
937
|
+
this._url.searchParams.set(key, str);
|
938
|
+
return this;
|
728
939
|
}
|
729
|
-
|
730
|
-
return this.
|
940
|
+
hasParam(key) {
|
941
|
+
return this._url.searchParams.has(key);
|
731
942
|
}
|
732
|
-
|
733
|
-
|
734
|
-
constructor(t) {
|
735
|
-
super();
|
736
|
-
this._t = t;
|
943
|
+
get getParams() {
|
944
|
+
return this._url.searchParams.entries();
|
737
945
|
}
|
738
|
-
|
739
|
-
|
946
|
+
getParam(key, def) {
|
947
|
+
const { key: k, def: d } = coerceKey(key, def);
|
948
|
+
let val = this._url.searchParams.get(k);
|
949
|
+
if (!falsy2undef(val) && d) {
|
950
|
+
val = d;
|
951
|
+
}
|
952
|
+
return falsy2undef(val);
|
740
953
|
}
|
741
|
-
|
742
|
-
return
|
954
|
+
getParamResult(key, msgFn) {
|
955
|
+
return getParamResult(key, this.getParam(key), msgFn);
|
743
956
|
}
|
744
|
-
|
745
|
-
|
957
|
+
getParamsResult(...keys) {
|
958
|
+
return getParamsResult(keys, this);
|
746
959
|
}
|
747
|
-
|
748
|
-
|
960
|
+
toString() {
|
961
|
+
this._url.searchParams.sort();
|
962
|
+
return this._url.toString();
|
749
963
|
}
|
750
|
-
|
751
|
-
|
752
|
-
constructor(t) {
|
753
|
-
super();
|
754
|
-
this._error = t;
|
964
|
+
toJSON() {
|
965
|
+
return this.toString();
|
755
966
|
}
|
756
|
-
|
757
|
-
return
|
967
|
+
asURL() {
|
968
|
+
return this.URI().asURL();
|
758
969
|
}
|
759
|
-
|
760
|
-
return
|
970
|
+
asObj(...strips) {
|
971
|
+
return this.URI().asObj(...strips);
|
761
972
|
}
|
762
|
-
|
763
|
-
|
973
|
+
clone() {
|
974
|
+
return _BuildURI.from(this.toString());
|
764
975
|
}
|
765
|
-
|
766
|
-
return this.
|
976
|
+
URI() {
|
977
|
+
return URI.from(this._url);
|
767
978
|
}
|
768
979
|
};
|
769
|
-
function
|
770
|
-
|
771
|
-
|
772
|
-
if (res instanceof Promise) {
|
773
|
-
return res.then((value) => Result.Ok(value)).catch((e) => Result.Err(e));
|
774
|
-
}
|
775
|
-
return Result.Ok(res);
|
776
|
-
} catch (e) {
|
777
|
-
return Result.Err(e);
|
778
|
-
}
|
779
|
-
}
|
780
|
-
|
781
|
-
// src/resolve-once.ts
|
782
|
-
var ResolveSeq = class {
|
783
|
-
constructor(ctx) {
|
784
|
-
this._flushWaiting = [];
|
785
|
-
this._seqFutures = [];
|
786
|
-
this.ctx = ctx;
|
787
|
-
}
|
788
|
-
reset() {
|
980
|
+
function isCoerceURI(value) {
|
981
|
+
if (!value) {
|
982
|
+
return false;
|
789
983
|
}
|
790
|
-
|
791
|
-
|
792
|
-
if (this._seqFutures.length > 0) {
|
793
|
-
const waitForFlush = new Future();
|
794
|
-
(_a = this._flushWaiting) == null ? void 0 : _a.push(waitForFlush);
|
795
|
-
return waitForFlush.asPromise();
|
796
|
-
}
|
797
|
-
return Promise.resolve();
|
984
|
+
if (isURL(value)) {
|
985
|
+
return true;
|
798
986
|
}
|
799
|
-
|
800
|
-
|
801
|
-
if (!item) {
|
802
|
-
this._flushWaiting.forEach((f) => f.resolve());
|
803
|
-
(_a = this._flushWaiting) == null ? void 0 : _a.splice(0, this._flushWaiting.length);
|
804
|
-
return Promise.resolve();
|
805
|
-
}
|
806
|
-
item.fn(this.ctx).then((value) => item.future.resolve(value)).catch((e) => item.future.reject(e)).finally(() => {
|
807
|
-
this._seqFutures.shift();
|
808
|
-
void this._step(this._seqFutures[0]);
|
809
|
-
});
|
810
|
-
return Promise.resolve();
|
987
|
+
if (URI.is(value)) {
|
988
|
+
return true;
|
811
989
|
}
|
812
|
-
|
813
|
-
|
814
|
-
this._seqFutures.push({ future, fn, id });
|
815
|
-
if (this._seqFutures.length === 1) {
|
816
|
-
void this._step(this._seqFutures[0]);
|
817
|
-
}
|
818
|
-
return future.asPromise();
|
990
|
+
if (BuildURI.is(value)) {
|
991
|
+
return true;
|
819
992
|
}
|
820
|
-
|
821
|
-
|
822
|
-
constructor(ctx) {
|
823
|
-
this._onceDone = false;
|
824
|
-
this._onceFutures = [];
|
825
|
-
this._onceOk = false;
|
826
|
-
this._isPromise = false;
|
827
|
-
this.ctx = ctx;
|
993
|
+
if (typeof value === "string") {
|
994
|
+
return true;
|
828
995
|
}
|
829
|
-
|
830
|
-
|
996
|
+
return false;
|
997
|
+
}
|
998
|
+
var hasHostPartProtocols = /* @__PURE__ */ new Set(["http", "https", "ws", "wss"]);
|
999
|
+
var URI = class _URI {
|
1000
|
+
static protocolHasHostpart(protocol) {
|
1001
|
+
protocol = protocol.replace(/:$/, "");
|
1002
|
+
hasHostPartProtocols.add(protocol);
|
1003
|
+
return () => {
|
1004
|
+
hasHostPartProtocols.delete(protocol);
|
1005
|
+
};
|
831
1006
|
}
|
832
|
-
|
833
|
-
this
|
834
|
-
this._onceOk = false;
|
835
|
-
this._onceValue = void 0;
|
836
|
-
this._onceError = void 0;
|
837
|
-
if (this._inProgress) {
|
838
|
-
const idx = this._onceFutures.findIndex((f) => f === this._inProgress);
|
839
|
-
if (idx >= 0) {
|
840
|
-
this._onceFutures.push(...this._onceFutures.splice(2).slice(1));
|
841
|
-
}
|
842
|
-
} else {
|
843
|
-
this._onceFutures.length = 0;
|
844
|
-
}
|
1007
|
+
match(other) {
|
1008
|
+
return match(this, other);
|
845
1009
|
}
|
846
|
-
//
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
}
|
855
|
-
}
|
856
|
-
if (this._onceOk) {
|
857
|
-
if (this._isPromise) {
|
858
|
-
return Promise.resolve(this._onceValue);
|
859
|
-
} else {
|
860
|
-
return this._onceValue;
|
861
|
-
}
|
862
|
-
}
|
863
|
-
throw new Error("ResolveOnce.once impossible");
|
864
|
-
}
|
865
|
-
const future = new Future();
|
866
|
-
this._onceFutures.push(future);
|
867
|
-
if (this._onceFutures.length === 1) {
|
868
|
-
const okFn = (value) => {
|
869
|
-
this._onceValue = value;
|
870
|
-
this._onceOk = true;
|
871
|
-
this._onceDone = true;
|
872
|
-
if (this._isPromise) {
|
873
|
-
this._onceFutures.forEach((f) => f.resolve(this._onceValue));
|
874
|
-
}
|
875
|
-
this._onceFutures.length = 0;
|
876
|
-
};
|
877
|
-
const catchFn = (e) => {
|
878
|
-
this._onceError = e;
|
879
|
-
this._onceOk = false;
|
880
|
-
this._onceValue = void 0;
|
881
|
-
this._onceDone = true;
|
882
|
-
if (this._isPromise) {
|
883
|
-
this._onceFutures.forEach((f) => f.reject(this._onceError));
|
884
|
-
}
|
885
|
-
this._onceFutures.length = 0;
|
886
|
-
};
|
887
|
-
this._inProgress = future;
|
888
|
-
try {
|
889
|
-
const ret = fn(this.ctx);
|
890
|
-
if (typeof ret.then === "function") {
|
891
|
-
this._isPromise = true;
|
892
|
-
ret.then(okFn).catch(catchFn).finally(() => {
|
893
|
-
this._inProgress = void 0;
|
894
|
-
});
|
895
|
-
} else {
|
896
|
-
okFn(ret);
|
897
|
-
}
|
898
|
-
} catch (e) {
|
899
|
-
catchFn(e);
|
900
|
-
}
|
901
|
-
if (!this._isPromise) {
|
902
|
-
this._inProgress = void 0;
|
903
|
-
}
|
904
|
-
}
|
905
|
-
if (this._isPromise) {
|
906
|
-
return future.asPromise();
|
907
|
-
} else {
|
908
|
-
return this.once(fn);
|
1010
|
+
// if no protocol is provided, default to file:
|
1011
|
+
static merge(into, from2, defaultProtocol = "file:") {
|
1012
|
+
const intoUrl = BuildURI.from(into, defaultProtocol);
|
1013
|
+
const fromUrl = _URI.from(from2, defaultProtocol);
|
1014
|
+
intoUrl.protocol(fromUrl.protocol);
|
1015
|
+
const fPath = fromUrl.pathname;
|
1016
|
+
if (!(fPath.length === 0 || fPath === "/" || fPath === "./")) {
|
1017
|
+
intoUrl.pathname(fromUrl.pathname);
|
909
1018
|
}
|
1019
|
+
for (const [key, value] of fromUrl.getParams) {
|
1020
|
+
intoUrl.setParam(key, value);
|
1021
|
+
}
|
1022
|
+
return intoUrl.URI();
|
910
1023
|
}
|
911
|
-
|
912
|
-
|
913
|
-
constructor(factory, params) {
|
914
|
-
var _a;
|
915
|
-
this.factory = factory;
|
916
|
-
this._map = new LRUMap((_a = params == null ? void 0 : params.lru) != null ? _a : { maxEntries: -1 });
|
1024
|
+
static is(value) {
|
1025
|
+
return value instanceof _URI || !!value && typeof value.asURL === "function" && typeof value.getParam === "function" && typeof value.hasParam === "function";
|
917
1026
|
}
|
918
|
-
|
919
|
-
|
1027
|
+
// if no protocol is provided, default to file:
|
1028
|
+
static from(strURLUri, defaultProtocol = "file:") {
|
1029
|
+
return from((url) => new _URI(url), strURLUri, defaultProtocol);
|
920
1030
|
}
|
921
|
-
|
922
|
-
return
|
1031
|
+
static fromResult(strURLUri, defaultProtocol = "file:") {
|
1032
|
+
return exception2Result(() => from((url) => new _URI(url), strURLUri, defaultProtocol));
|
923
1033
|
}
|
924
|
-
|
925
|
-
|
926
|
-
key = key();
|
927
|
-
}
|
928
|
-
let keyed = this._map.get(key);
|
929
|
-
if (!keyed) {
|
930
|
-
keyed = this.factory(key);
|
931
|
-
this._map.set(key, keyed);
|
932
|
-
}
|
933
|
-
return keyed;
|
1034
|
+
constructor(url) {
|
1035
|
+
this._url = url.clone();
|
934
1036
|
}
|
935
|
-
|
936
|
-
|
937
|
-
keyed == null ? void 0 : keyed.reset();
|
938
|
-
this._map.delete(key);
|
1037
|
+
build() {
|
1038
|
+
return BuildURI.from(this._url);
|
939
1039
|
}
|
940
|
-
|
941
|
-
this.
|
942
|
-
this._map.clear();
|
1040
|
+
get hostname() {
|
1041
|
+
return this._url.hostname;
|
943
1042
|
}
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
1043
|
+
// get password(): string {
|
1044
|
+
// return this._url.password;
|
1045
|
+
// }
|
1046
|
+
get port() {
|
1047
|
+
return this._url.port;
|
948
1048
|
}
|
949
|
-
|
950
|
-
|
951
|
-
* @returns The values of the resolved keys
|
952
|
-
*/
|
953
|
-
values() {
|
954
|
-
return Array.from(this._map.entries()).filter(([_, v]) => v._onceDone).map(([k, v]) => {
|
955
|
-
if (v._onceDone) {
|
956
|
-
if (v._onceError) {
|
957
|
-
return {
|
958
|
-
key: k,
|
959
|
-
value: Result.Err(v._onceError)
|
960
|
-
};
|
961
|
-
}
|
962
|
-
return {
|
963
|
-
key: k,
|
964
|
-
value: Result.Ok(v._onceValue)
|
965
|
-
};
|
966
|
-
}
|
967
|
-
throw new Error("KeyedResolvOnce.values impossible");
|
968
|
-
});
|
1049
|
+
get host() {
|
1050
|
+
return this._url.host;
|
969
1051
|
}
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
1052
|
+
// get username(): string {
|
1053
|
+
// return this._url.username;
|
1054
|
+
// }
|
1055
|
+
// get search(): string {
|
1056
|
+
// return this._url.search;
|
1057
|
+
// }
|
1058
|
+
get protocol() {
|
1059
|
+
return this._url.protocol;
|
974
1060
|
}
|
975
|
-
|
976
|
-
|
977
|
-
// src/runtime.ts
|
978
|
-
function isSet(value, ref = globalThis) {
|
979
|
-
const [head, ...tail] = value.split(".");
|
980
|
-
if (["object", "function"].includes(typeof ref) && ref && ["object", "function"].includes(typeof ref[head]) && ref[head]) {
|
981
|
-
if (tail.length <= 1) {
|
982
|
-
return true;
|
983
|
-
}
|
984
|
-
return isSet(tail.join("."), ref[head]);
|
1061
|
+
get pathname() {
|
1062
|
+
return this._url.pathname;
|
985
1063
|
}
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
let isNodeIsh = false;
|
995
|
-
if (!isSet("Deno")) {
|
996
|
-
isNodeIsh = isSet("process.versions.node") && !isReactNative;
|
1064
|
+
// get hash(): string {
|
1065
|
+
// return this._url.hash;
|
1066
|
+
// }
|
1067
|
+
// get host(): string {
|
1068
|
+
// return this._url.host;
|
1069
|
+
// }
|
1070
|
+
get getParams() {
|
1071
|
+
return this._url.searchParams.entries();
|
997
1072
|
}
|
998
|
-
|
999
|
-
|
1000
|
-
if (isCFWorker) {
|
1001
|
-
isDeno = false;
|
1002
|
-
isNodeIsh = false;
|
1003
|
-
isReactNative = false;
|
1073
|
+
hasParam(key) {
|
1074
|
+
return this._url.searchParams.has(key);
|
1004
1075
|
}
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
}
|
1013
|
-
|
1014
|
-
// src/deno/deno-env-actions.ts
|
1015
|
-
var once = new ResolveOnce();
|
1016
|
-
var _deno;
|
1017
|
-
var _DenoEnvActions = class _DenoEnvActions {
|
1018
|
-
constructor(opts) {
|
1019
|
-
__privateAdd(this, _deno, globalThis);
|
1020
|
-
this.opts = opts;
|
1076
|
+
getParam(key, def) {
|
1077
|
+
const { key: k, def: d } = coerceKey(key, def);
|
1078
|
+
let val = this._url.searchParams.get(k);
|
1079
|
+
if (!falsy2undef(val) && d) {
|
1080
|
+
val = d;
|
1081
|
+
}
|
1082
|
+
return falsy2undef(val);
|
1021
1083
|
}
|
1022
|
-
|
1023
|
-
return
|
1084
|
+
getParamResult(key, msgFn) {
|
1085
|
+
return getParamResult(key, this.getParam(key), msgFn);
|
1024
1086
|
}
|
1025
|
-
|
1026
|
-
return
|
1087
|
+
getParamsResult(...keys) {
|
1088
|
+
return getParamsResult(keys, this);
|
1027
1089
|
}
|
1028
|
-
|
1029
|
-
|
1030
|
-
this._env.set(key, env.get(key) || "");
|
1031
|
-
}
|
1032
|
-
return env;
|
1090
|
+
clone() {
|
1091
|
+
return new _URI(this._url);
|
1033
1092
|
}
|
1034
|
-
|
1035
|
-
return
|
1093
|
+
asURL() {
|
1094
|
+
return this._url.clone();
|
1036
1095
|
}
|
1037
|
-
|
1038
|
-
return
|
1096
|
+
toString() {
|
1097
|
+
return this._url.toString();
|
1039
1098
|
}
|
1040
|
-
|
1041
|
-
return this.
|
1099
|
+
toJSON() {
|
1100
|
+
return this.toString();
|
1042
1101
|
}
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1102
|
+
asObj(...strips) {
|
1103
|
+
const pathURI = {
|
1104
|
+
style: "path",
|
1105
|
+
protocol: this.protocol,
|
1106
|
+
pathname: this.pathname,
|
1107
|
+
searchParams: Object.fromEntries(this.getParams)
|
1108
|
+
};
|
1109
|
+
if (hasHostPartProtocols.has(this.protocol.replace(/:$/, ""))) {
|
1110
|
+
return stripper(strips, {
|
1111
|
+
...pathURI,
|
1112
|
+
style: "host",
|
1113
|
+
hostname: this.hostname,
|
1114
|
+
port: this.port
|
1115
|
+
});
|
1046
1116
|
}
|
1047
|
-
|
1048
|
-
delete(key) {
|
1049
|
-
this._env.delete(key);
|
1117
|
+
return stripper(strips, pathURI);
|
1050
1118
|
}
|
1051
1119
|
};
|
1052
|
-
_deno = new WeakMap();
|
1053
|
-
var DenoEnvActions = _DenoEnvActions;
|
1054
1120
|
|
1055
|
-
// src/
|
1056
|
-
var
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
this.
|
1062
|
-
this.
|
1121
|
+
// src/log-writer-impl.ts
|
1122
|
+
var LogWriterStream = class {
|
1123
|
+
constructor(out) {
|
1124
|
+
this._toFlush = [];
|
1125
|
+
this._flushIsRunning = false;
|
1126
|
+
this._flushDoneFns = [];
|
1127
|
+
this._out = out;
|
1128
|
+
this._id = Math.random();
|
1063
1129
|
}
|
1064
|
-
|
1065
|
-
|
1130
|
+
write(encoded) {
|
1131
|
+
const my = async () => {
|
1132
|
+
try {
|
1133
|
+
const writer = this._out.getWriter();
|
1134
|
+
await writer.ready;
|
1135
|
+
await writer.write(encoded);
|
1136
|
+
writer.releaseLock();
|
1137
|
+
} catch (err) {
|
1138
|
+
console.error("Chunk error:", err);
|
1139
|
+
}
|
1140
|
+
};
|
1141
|
+
this._toFlush.push(my);
|
1142
|
+
this._flush();
|
1066
1143
|
}
|
1067
|
-
|
1068
|
-
|
1069
|
-
this.
|
1144
|
+
_flush(toFlush = void 0, done) {
|
1145
|
+
if (done) {
|
1146
|
+
this._flushDoneFns.push(done);
|
1070
1147
|
}
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
}
|
1082
|
-
set(key, value) {
|
1083
|
-
if (value) {
|
1084
|
-
this._env[key] = value;
|
1148
|
+
if (this._toFlush.length == 0) {
|
1149
|
+
this._flushIsRunning = false;
|
1150
|
+
this._flushDoneFns.forEach((fn) => fn());
|
1151
|
+
this._flushDoneFns = [];
|
1152
|
+
return;
|
1153
|
+
}
|
1154
|
+
if (!toFlush && this._toFlush.length == 1 && !this._flushIsRunning) {
|
1155
|
+
this._flushIsRunning = true;
|
1156
|
+
} else if (!toFlush) {
|
1157
|
+
return;
|
1085
1158
|
}
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1159
|
+
const my = this._toFlush.shift();
|
1160
|
+
my == null ? void 0 : my().catch((e) => {
|
1161
|
+
console.error("Flush error:", e);
|
1162
|
+
}).finally(() => {
|
1163
|
+
this._flush(this._toFlush);
|
1164
|
+
});
|
1089
1165
|
}
|
1090
1166
|
};
|
1091
|
-
_node = new WeakMap();
|
1092
|
-
var NodeEnvActions = _NodeEnvActions;
|
1093
1167
|
|
1094
|
-
// src/
|
1095
|
-
var
|
1096
|
-
var
|
1097
|
-
constructor(
|
1098
|
-
this
|
1099
|
-
this
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
this.env.set(key, value);
|
1110
|
-
}
|
1111
|
-
}
|
1112
|
-
delete(key) {
|
1113
|
-
this.env.delete(key);
|
1168
|
+
// src/future.ts
|
1169
|
+
var _promise, _resolveFn, _rejectFn;
|
1170
|
+
var Future = class {
|
1171
|
+
constructor() {
|
1172
|
+
__privateAdd(this, _promise);
|
1173
|
+
__privateAdd(this, _resolveFn, () => {
|
1174
|
+
throw new Error("This Promise is not working as expected.");
|
1175
|
+
});
|
1176
|
+
__privateAdd(this, _rejectFn, () => {
|
1177
|
+
throw new Error("This Promise is not working as expected.");
|
1178
|
+
});
|
1179
|
+
__privateSet(this, _promise, new Promise((resolve, reject) => {
|
1180
|
+
__privateSet(this, _resolveFn, resolve);
|
1181
|
+
__privateSet(this, _rejectFn, reject);
|
1182
|
+
}));
|
1114
1183
|
}
|
1115
|
-
|
1116
|
-
return
|
1184
|
+
async asPromise() {
|
1185
|
+
return __privateGet(this, _promise);
|
1117
1186
|
}
|
1118
|
-
|
1119
|
-
|
1187
|
+
resolve(value) {
|
1188
|
+
__privateGet(this, _resolveFn).call(this, value);
|
1120
1189
|
}
|
1121
|
-
|
1122
|
-
|
1123
|
-
const browser = globalThis;
|
1124
|
-
browser[sym] = env;
|
1125
|
-
return env;
|
1190
|
+
reject(reason) {
|
1191
|
+
__privateGet(this, _rejectFn).call(this, reason);
|
1126
1192
|
}
|
1127
1193
|
};
|
1194
|
+
_promise = new WeakMap();
|
1195
|
+
_resolveFn = new WeakMap();
|
1196
|
+
_rejectFn = new WeakMap();
|
1128
1197
|
|
1129
|
-
// src/
|
1130
|
-
var
|
1131
|
-
|
1132
|
-
|
1133
|
-
this.injectOnRegister = {};
|
1134
|
-
this.cfEnv = new Map(Object.entries(env.presetEnv || {}));
|
1135
|
-
}
|
1136
|
-
static new(opts) {
|
1137
|
-
return once4.once(() => new _CFEnvActions(opts));
|
1138
|
-
}
|
1139
|
-
static inject(o) {
|
1140
|
-
const env = _CFEnvActions.new({});
|
1141
|
-
for (const key in o) {
|
1142
|
-
const value = o[key];
|
1143
|
-
if (typeof value === "string") {
|
1144
|
-
if (env.env) {
|
1145
|
-
env.env.set(key, value);
|
1146
|
-
} else {
|
1147
|
-
env.injectOnRegister[key] = value;
|
1148
|
-
}
|
1149
|
-
}
|
1150
|
-
}
|
1198
|
+
// src/lru-map-set.ts
|
1199
|
+
var LRUSet = class {
|
1200
|
+
constructor(param2 = {}) {
|
1201
|
+
this._lruMap = new LRUMap(param2);
|
1151
1202
|
}
|
1152
|
-
|
1153
|
-
|
1203
|
+
setParam(param2 = {}) {
|
1204
|
+
this._lruMap.setParam(param2);
|
1154
1205
|
}
|
1155
|
-
|
1156
|
-
this.
|
1157
|
-
for (const key in this.injectOnRegister) {
|
1158
|
-
env.set(key, this.injectOnRegister[key]);
|
1159
|
-
}
|
1160
|
-
return env;
|
1206
|
+
get size() {
|
1207
|
+
return this._lruMap.size;
|
1161
1208
|
}
|
1162
|
-
|
1163
|
-
return this.
|
1209
|
+
has(key) {
|
1210
|
+
return this._lruMap.has(key);
|
1164
1211
|
}
|
1165
|
-
|
1166
|
-
|
1167
|
-
this.cfEnv.set(key, value);
|
1168
|
-
}
|
1212
|
+
add(key) {
|
1213
|
+
this._lruMap.set(key, key);
|
1169
1214
|
}
|
1170
1215
|
delete(key) {
|
1171
|
-
this.
|
1216
|
+
this._lruMap.delete(key);
|
1172
1217
|
}
|
1173
|
-
|
1174
|
-
|
1218
|
+
clear() {
|
1219
|
+
this._lruMap.clear();
|
1175
1220
|
}
|
1176
|
-
|
1177
|
-
|
1178
|
-
// src/types.ts
|
1179
|
-
var _Required = class {
|
1180
|
-
constructor() {
|
1181
|
-
this.type = "REQUIRED";
|
1221
|
+
forEach(callbackfn) {
|
1222
|
+
this._lruMap.forEach((value) => callbackfn(value, value));
|
1182
1223
|
}
|
1183
|
-
|
1184
|
-
|
1185
|
-
constructor() {
|
1186
|
-
this.type = "OPTIONAL";
|
1224
|
+
entries() {
|
1225
|
+
return this._lruMap.entries();
|
1187
1226
|
}
|
1188
1227
|
};
|
1189
|
-
var
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
const keyDef = keys.flat().reduce(
|
1197
|
-
(acc, i) => {
|
1198
|
-
if (typeof i === "string") {
|
1199
|
-
acc.push({ key: i, def: void 0, isOptional: false });
|
1200
|
-
} else if (typeof i === "object") {
|
1201
|
-
acc.push(
|
1202
|
-
...Object.keys(i).map((k) => ({
|
1203
|
-
key: k,
|
1204
|
-
def: typeof i[k] === "string" ? i[k] : void 0,
|
1205
|
-
isOptional: i[k] === param.OPTIONAL
|
1206
|
-
}))
|
1207
|
-
);
|
1208
|
-
}
|
1209
|
-
return acc;
|
1210
|
-
},
|
1211
|
-
[]
|
1212
|
-
);
|
1213
|
-
const msgFn = keys.find((k) => typeof k === "function") || ((...keys2) => {
|
1214
|
-
const msg = keys2.join(",");
|
1215
|
-
return `missing parameters: ${msg}`;
|
1216
|
-
});
|
1217
|
-
const errors = [];
|
1218
|
-
const result = {};
|
1219
|
-
for (const kd of keyDef) {
|
1220
|
-
const val = getParam.getParam(kd.key);
|
1221
|
-
if (val === void 0) {
|
1222
|
-
if (typeof kd.def === "string") {
|
1223
|
-
result[kd.key] = kd.def;
|
1224
|
-
} else {
|
1225
|
-
if (!kd.isOptional) {
|
1226
|
-
errors.push(kd.key);
|
1227
|
-
}
|
1228
|
-
}
|
1229
|
-
} else {
|
1230
|
-
result[kd.key] = val;
|
1231
|
-
}
|
1232
|
-
}
|
1233
|
-
if (errors.length) {
|
1234
|
-
return Result.Err(msgFn(...errors));
|
1228
|
+
var LRUMap = class {
|
1229
|
+
constructor(c = {}) {
|
1230
|
+
this._map = /* @__PURE__ */ new Map();
|
1231
|
+
this.param = {
|
1232
|
+
maxEntries: c.maxEntries || 100,
|
1233
|
+
maxAge: c.maxAge || 0
|
1234
|
+
};
|
1235
1235
|
}
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
// src/sys-env.ts
|
1240
|
-
var envActions = [
|
1241
|
-
{ id: "cf", fn: (opts) => CFEnvActions.new(opts) },
|
1242
|
-
{ id: "node", fn: (opts) => NodeEnvActions.new(opts) },
|
1243
|
-
{ id: "deno", fn: (opts) => DenoEnvActions.new(opts) },
|
1244
|
-
{ id: "browser", fn: (opts) => BrowserEnvActions.new(opts) }
|
1245
|
-
];
|
1246
|
-
function registerEnvAction(fn) {
|
1247
|
-
const id = `id-${Math.random()}`;
|
1248
|
-
envActions.unshift({ id, fn });
|
1249
|
-
_envFactories.unget(id);
|
1250
|
-
return () => {
|
1251
|
-
const index = envActions.findIndex((i) => i.id === id);
|
1252
|
-
if (index >= 0) {
|
1253
|
-
envActions.splice(index, 1);
|
1236
|
+
touch(key) {
|
1237
|
+
if (!this._map.has(key)) {
|
1238
|
+
throw new Error(`key not found in cache: ${key}`);
|
1254
1239
|
}
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
return false;
|
1273
|
-
}
|
1274
|
-
return typeof obj[Symbol.iterator] === "function";
|
1275
|
-
}
|
1276
|
-
var EnvImpl = class {
|
1277
|
-
constructor(map, opts = {}) {
|
1278
|
-
this._onSet = [];
|
1279
|
-
this._map = map;
|
1280
|
-
this._updatePresets(opts.presetEnv);
|
1281
|
-
}
|
1282
|
-
gets(...kparams) {
|
1283
|
-
return getParamsResult(kparams, {
|
1284
|
-
getParam: (k) => this.get(k)
|
1285
|
-
});
|
1286
|
-
}
|
1287
|
-
sets(...keys) {
|
1288
|
-
keys.forEach((key) => {
|
1289
|
-
if (Array.isArray(key)) {
|
1290
|
-
if (key.length === 2) {
|
1291
|
-
const [k, v] = key;
|
1292
|
-
if (typeof k === "string" && typeof v === "string") {
|
1293
|
-
this.set(k, v);
|
1294
|
-
return;
|
1295
|
-
}
|
1296
|
-
}
|
1297
|
-
for (const item of key) {
|
1298
|
-
if (Array.isArray(item)) {
|
1299
|
-
if (item.length === 2) {
|
1300
|
-
const [k, v] = item;
|
1301
|
-
if (typeof k === "string" && typeof v === "string") {
|
1302
|
-
this.set(k, v);
|
1303
|
-
}
|
1304
|
-
}
|
1240
|
+
const value = this._map.get(key);
|
1241
|
+
this._map.delete(key);
|
1242
|
+
this._map.set(key, value);
|
1243
|
+
return value;
|
1244
|
+
}
|
1245
|
+
setParam(param2 = {}) {
|
1246
|
+
if (typeof param2.maxEntries === "number") {
|
1247
|
+
this.param.maxEntries = param2.maxEntries;
|
1248
|
+
if (param2.maxEntries > 0 && this._map.size > param2.maxEntries) {
|
1249
|
+
const toDelete = [];
|
1250
|
+
let cacheSize = this._map.size;
|
1251
|
+
for (const key of this._map.keys()) {
|
1252
|
+
if (cacheSize > param2.maxEntries) {
|
1253
|
+
toDelete.push(key);
|
1254
|
+
cacheSize--;
|
1255
|
+
} else {
|
1256
|
+
break;
|
1305
1257
|
}
|
1306
1258
|
}
|
1307
|
-
|
1308
|
-
|
1309
|
-
for (const [k, v] of key) {
|
1310
|
-
if (typeof k === "string" && typeof v === "string") {
|
1311
|
-
this.set(k, v);
|
1312
|
-
}
|
1313
|
-
}
|
1314
|
-
} else {
|
1315
|
-
const rKey = key;
|
1316
|
-
for (const k in rKey) {
|
1317
|
-
const v = rKey[k];
|
1318
|
-
if (typeof k === "string" && typeof v === "string") {
|
1319
|
-
this.set(k, v);
|
1320
|
-
}
|
1321
|
-
}
|
1259
|
+
for (const key of toDelete) {
|
1260
|
+
this._map.delete(key);
|
1322
1261
|
}
|
1323
1262
|
}
|
1324
|
-
});
|
1325
|
-
}
|
1326
|
-
_updatePresets(presetEnv) {
|
1327
|
-
if (!presetEnv) {
|
1328
|
-
return;
|
1329
|
-
}
|
1330
|
-
for (const [key, value] of presetEnv) {
|
1331
|
-
this._map.set(key, value);
|
1332
1263
|
}
|
1333
1264
|
}
|
1334
|
-
|
1335
|
-
|
1336
|
-
let keys = [];
|
1337
|
-
if (key) {
|
1338
|
-
keys = [key];
|
1339
|
-
} else {
|
1340
|
-
keys = this._map.keys();
|
1341
|
-
}
|
1342
|
-
keys.filter((k) => {
|
1343
|
-
if (item.filter.size === 0) {
|
1344
|
-
return true;
|
1345
|
-
}
|
1346
|
-
if (item.filter.has(k)) {
|
1347
|
-
return true;
|
1348
|
-
}
|
1349
|
-
return false;
|
1350
|
-
}).forEach((k) => {
|
1351
|
-
let v;
|
1352
|
-
if (!key && !value) {
|
1353
|
-
v = this._map.get(k);
|
1354
|
-
} else if (key && !value) {
|
1355
|
-
v = void 0;
|
1356
|
-
} else {
|
1357
|
-
v = value;
|
1358
|
-
}
|
1359
|
-
item.fn(k, v);
|
1360
|
-
});
|
1361
|
-
});
|
1265
|
+
has(key) {
|
1266
|
+
return this._map.has(key);
|
1362
1267
|
}
|
1363
|
-
|
1364
|
-
return this._map.
|
1268
|
+
get size() {
|
1269
|
+
return this._map.size;
|
1365
1270
|
}
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1271
|
+
async getSet(key, createFN) {
|
1272
|
+
const val = this.get(key);
|
1273
|
+
if (val) {
|
1274
|
+
return val;
|
1275
|
+
} else {
|
1276
|
+
const val2 = await createFN(key);
|
1277
|
+
this.set(key, val2);
|
1278
|
+
return val2;
|
1279
|
+
}
|
1371
1280
|
}
|
1372
1281
|
get(key) {
|
1282
|
+
if (this._map.has(key)) {
|
1283
|
+
return this.touch(key);
|
1284
|
+
}
|
1373
1285
|
return this._map.get(key);
|
1374
1286
|
}
|
1375
1287
|
set(key, value) {
|
1376
|
-
|
1377
|
-
|
1288
|
+
this._map.delete(key);
|
1289
|
+
if (this.param.maxEntries > 0 && this._map.size >= this.param.maxEntries) {
|
1290
|
+
this._map.delete(this._map.keys().next().value);
|
1291
|
+
this._map.set(key, value);
|
1292
|
+
} else {
|
1293
|
+
this._map.set(key, value);
|
1378
1294
|
}
|
1379
|
-
this._map.set(key, value);
|
1380
|
-
this._applyOnSet(this._onSet, key, value);
|
1381
1295
|
}
|
1382
1296
|
delete(key) {
|
1383
1297
|
this._map.delete(key);
|
1384
|
-
this._applyOnSet(this._onSet, key);
|
1385
1298
|
}
|
1299
|
+
clear() {
|
1300
|
+
this._map.clear();
|
1301
|
+
}
|
1302
|
+
forEach(callbackfn) {
|
1303
|
+
this._map.forEach(callbackfn);
|
1304
|
+
}
|
1305
|
+
entries() {
|
1306
|
+
return this._map.entries();
|
1307
|
+
}
|
1308
|
+
// *entries(): IterableIterator<[T, K]> {
|
1309
|
+
// for (const x of this._cache.entries()) {
|
1310
|
+
// yield x;
|
1311
|
+
// }
|
1312
|
+
// }
|
1313
|
+
// getLeastRecent(): K {
|
1314
|
+
// return Array.from(this.cache)[0];
|
1315
|
+
// }
|
1316
|
+
// getMostRecent(): K {
|
1317
|
+
// return Array.from(this.cache)[this.cache.size - 1];
|
1318
|
+
// }
|
1386
1319
|
};
|
1387
1320
|
|
1388
|
-
// src/
|
1389
|
-
var
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
if (ArrayBuffer.isView(raw)) {
|
1395
|
-
return Result.Ok(new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength));
|
1321
|
+
// src/resolve-once.ts
|
1322
|
+
var ResolveSeq = class {
|
1323
|
+
constructor(ctx) {
|
1324
|
+
this._flushWaiting = [];
|
1325
|
+
this._seqFutures = [];
|
1326
|
+
this.ctx = ctx;
|
1396
1327
|
}
|
1397
|
-
|
1398
|
-
return Result.Err("Blob not supported");
|
1328
|
+
reset() {
|
1399
1329
|
}
|
1400
|
-
|
1401
|
-
|
1330
|
+
flush() {
|
1331
|
+
var _a;
|
1332
|
+
if (this._seqFutures.length > 0) {
|
1333
|
+
const waitForFlush = new Future();
|
1334
|
+
(_a = this._flushWaiting) == null ? void 0 : _a.push(waitForFlush);
|
1335
|
+
return waitForFlush.asPromise();
|
1336
|
+
}
|
1337
|
+
return Promise.resolve();
|
1402
1338
|
}
|
1403
|
-
|
1404
|
-
|
1339
|
+
_step(item) {
|
1340
|
+
var _a;
|
1341
|
+
if (!item) {
|
1342
|
+
this._flushWaiting.forEach((f) => f.resolve());
|
1343
|
+
(_a = this._flushWaiting) == null ? void 0 : _a.splice(0, this._flushWaiting.length);
|
1344
|
+
return Promise.resolve();
|
1345
|
+
}
|
1346
|
+
item.fn(this.ctx).then((value) => item.future.resolve(value)).catch((e) => item.future.reject(e)).finally(() => {
|
1347
|
+
this._seqFutures.shift();
|
1348
|
+
void this._step(this._seqFutures[0]);
|
1349
|
+
});
|
1350
|
+
return Promise.resolve();
|
1405
1351
|
}
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1352
|
+
async add(fn, id) {
|
1353
|
+
const future = new Future();
|
1354
|
+
this._seqFutures.push({ future, fn, id });
|
1355
|
+
if (this._seqFutures.length === 1) {
|
1356
|
+
void this._step(this._seqFutures[0]);
|
1409
1357
|
}
|
1410
|
-
return
|
1358
|
+
return future.asPromise();
|
1411
1359
|
}
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1360
|
+
};
|
1361
|
+
var ResolveOnce = class {
|
1362
|
+
constructor(ctx) {
|
1363
|
+
this._onceDone = false;
|
1364
|
+
this._onceFutures = [];
|
1365
|
+
this._onceOk = false;
|
1366
|
+
this._isPromise = false;
|
1367
|
+
this.ctx = ctx;
|
1418
1368
|
}
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
// src/txt-en-decoder.ts
|
1423
|
-
var TxtOps = class {
|
1424
|
-
constructor() {
|
1425
|
-
this.encoder = new TextEncoder();
|
1426
|
-
this.decoder = new TextDecoder();
|
1369
|
+
get ready() {
|
1370
|
+
return this._onceDone;
|
1427
1371
|
}
|
1428
|
-
|
1429
|
-
|
1372
|
+
reset() {
|
1373
|
+
this._onceDone = false;
|
1374
|
+
this._onceOk = false;
|
1375
|
+
this._onceValue = void 0;
|
1376
|
+
this._onceError = void 0;
|
1377
|
+
if (this._inProgress) {
|
1378
|
+
const idx = this._onceFutures.findIndex((f) => f === this._inProgress);
|
1379
|
+
if (idx >= 0) {
|
1380
|
+
this._onceFutures.push(...this._onceFutures.splice(2).slice(1));
|
1381
|
+
}
|
1382
|
+
} else {
|
1383
|
+
this._onceFutures.length = 0;
|
1384
|
+
}
|
1430
1385
|
}
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1386
|
+
// T extends Option<infer U> ? U : T
|
1387
|
+
once(fn) {
|
1388
|
+
if (this._onceDone) {
|
1389
|
+
if (this._onceError) {
|
1390
|
+
if (this._isPromise) {
|
1391
|
+
return Promise.reject(this._onceError);
|
1392
|
+
} else {
|
1393
|
+
throw this._onceError;
|
1394
|
+
}
|
1395
|
+
}
|
1396
|
+
if (this._onceOk) {
|
1397
|
+
if (this._isPromise) {
|
1398
|
+
return Promise.resolve(this._onceValue);
|
1399
|
+
} else {
|
1400
|
+
return this._onceValue;
|
1401
|
+
}
|
1402
|
+
}
|
1403
|
+
throw new Error("ResolveOnce.once impossible");
|
1404
|
+
}
|
1405
|
+
const future = new Future();
|
1406
|
+
this._onceFutures.push(future);
|
1407
|
+
if (this._onceFutures.length === 1) {
|
1408
|
+
const okFn = (value) => {
|
1409
|
+
this._onceValue = value;
|
1410
|
+
this._onceOk = true;
|
1411
|
+
this._onceDone = true;
|
1412
|
+
if (this._isPromise) {
|
1413
|
+
this._onceFutures.forEach((f) => f.resolve(this._onceValue));
|
1414
|
+
}
|
1415
|
+
this._onceFutures.length = 0;
|
1416
|
+
};
|
1417
|
+
const catchFn = (e) => {
|
1418
|
+
this._onceError = e;
|
1419
|
+
this._onceOk = false;
|
1420
|
+
this._onceValue = void 0;
|
1421
|
+
this._onceDone = true;
|
1422
|
+
if (this._isPromise) {
|
1423
|
+
this._onceFutures.forEach((f) => f.reject(this._onceError));
|
1424
|
+
}
|
1425
|
+
this._onceFutures.length = 0;
|
1426
|
+
};
|
1427
|
+
this._inProgress = future;
|
1428
|
+
try {
|
1429
|
+
const ret = fn(this.ctx);
|
1430
|
+
if (typeof ret.then === "function") {
|
1431
|
+
this._isPromise = true;
|
1432
|
+
ret.then(okFn).catch(catchFn).finally(() => {
|
1433
|
+
this._inProgress = void 0;
|
1434
|
+
});
|
1435
|
+
} else {
|
1436
|
+
okFn(ret);
|
1437
|
+
}
|
1438
|
+
} catch (e) {
|
1439
|
+
catchFn(e);
|
1435
1440
|
}
|
1436
|
-
|
1437
|
-
|
1438
|
-
return this.decode(unwrapped);
|
1441
|
+
if (!this._isPromise) {
|
1442
|
+
this._inProgress = void 0;
|
1439
1443
|
}
|
1440
1444
|
}
|
1441
|
-
if (
|
1442
|
-
return
|
1443
|
-
}
|
1444
|
-
|
1445
|
-
}
|
1446
|
-
async asyncDecode(data) {
|
1447
|
-
let resolved = await data;
|
1448
|
-
if (resolved instanceof Blob) {
|
1449
|
-
resolved = await resolved.arrayBuffer();
|
1445
|
+
if (this._isPromise) {
|
1446
|
+
return future.asPromise();
|
1447
|
+
} else {
|
1448
|
+
return this.once(fn);
|
1450
1449
|
}
|
1451
|
-
return this.decode(resolved);
|
1452
1450
|
}
|
1453
1451
|
};
|
1454
|
-
var
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
}
|
1459
|
-
|
1460
|
-
// src/web/web-sys-abstraction.ts
|
1461
|
-
var WebFileService = class {
|
1462
|
-
get baseDir() {
|
1463
|
-
throw new Error("basedir-Method not implemented.");
|
1464
|
-
}
|
1465
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1466
|
-
create(fname) {
|
1467
|
-
throw new Error("create-Method not implemented.");
|
1468
|
-
}
|
1469
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1470
|
-
readFileString(fname) {
|
1471
|
-
throw new Error("readFileString-Method not implemented.");
|
1472
|
-
}
|
1473
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1474
|
-
writeFileString(fname, content) {
|
1475
|
-
throw new Error("writeFileString-Method not implemented.");
|
1476
|
-
}
|
1477
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1478
|
-
abs(fname) {
|
1479
|
-
throw new Error("abs-Method not implemented.");
|
1480
|
-
}
|
1481
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1482
|
-
join(...paths) {
|
1483
|
-
throw new Error("join-Method not implemented.");
|
1484
|
-
}
|
1485
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1486
|
-
relative(from2, to) {
|
1487
|
-
throw new Error("relative-Method not implemented.");
|
1488
|
-
}
|
1489
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1490
|
-
dirname(fname) {
|
1491
|
-
throw new Error("dirname-Method not implemented.");
|
1492
|
-
}
|
1493
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1494
|
-
basename(fname) {
|
1495
|
-
throw new Error("basename-Method not implemented.");
|
1496
|
-
}
|
1497
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1498
|
-
nodeImport(fname) {
|
1499
|
-
throw new Error("nodeImport-Method not implemented.");
|
1500
|
-
}
|
1501
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1502
|
-
isAbsolute(fname) {
|
1503
|
-
throw new Error("isAbsolute-Method not implemented.");
|
1452
|
+
var Keyed = class {
|
1453
|
+
constructor(factory, params) {
|
1454
|
+
var _a;
|
1455
|
+
this.factory = factory;
|
1456
|
+
this._map = new LRUMap((_a = params == null ? void 0 : params.lru) != null ? _a : { maxEntries: -1 });
|
1504
1457
|
}
|
1505
|
-
|
1506
|
-
|
1507
|
-
Env() {
|
1508
|
-
return envFactory();
|
1458
|
+
setParam(params) {
|
1459
|
+
this._map.setParam(params.lru);
|
1509
1460
|
}
|
1510
|
-
|
1511
|
-
|
1461
|
+
async asyncGet(key) {
|
1462
|
+
return this.get(await key());
|
1512
1463
|
}
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1464
|
+
get(key) {
|
1465
|
+
if (typeof key === "function") {
|
1466
|
+
key = key();
|
1467
|
+
}
|
1468
|
+
let keyed = this._map.get(key);
|
1469
|
+
if (!keyed) {
|
1470
|
+
keyed = this.factory(key);
|
1471
|
+
this._map.set(key, keyed);
|
1472
|
+
}
|
1473
|
+
return keyed;
|
1516
1474
|
}
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1475
|
+
unget(key) {
|
1476
|
+
const keyed = this._map.get(key);
|
1477
|
+
keyed == null ? void 0 : keyed.reset();
|
1478
|
+
this._map.delete(key);
|
1520
1479
|
}
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
if (!my) {
|
1525
|
-
my = new BaseSysAbstraction({
|
1526
|
-
TxtEnDecoder: (param2 == null ? void 0 : param2.TxtEnDecoder) || TxtEnDecoderSingleton(),
|
1527
|
-
FileSystem: new WebFileService(),
|
1528
|
-
SystemService: new WebSystemService()
|
1529
|
-
});
|
1480
|
+
reset() {
|
1481
|
+
this._map.forEach((keyed) => keyed.reset());
|
1482
|
+
this._map.clear();
|
1530
1483
|
}
|
1531
|
-
return new WrapperSysAbstraction(my, param2);
|
1532
|
-
}
|
1533
|
-
|
1534
|
-
// src/utils/relative-path.ts
|
1535
|
-
var PartType = {
|
1536
|
-
Slash: 1,
|
1537
|
-
Root: 3,
|
1538
|
-
Up: 4,
|
1539
|
-
Noop: 8
|
1540
|
-
// RootUp = 0x8 /* ../ */,
|
1541
1484
|
};
|
1542
|
-
var
|
1543
|
-
constructor(
|
1544
|
-
|
1485
|
+
var KeyedResolvOnce = class extends Keyed {
|
1486
|
+
constructor(kp = {}) {
|
1487
|
+
super((key) => new ResolveOnce(key), kp);
|
1545
1488
|
}
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
return part;
|
1489
|
+
/**
|
1490
|
+
*
|
1491
|
+
* @returns The values of the resolved keys
|
1492
|
+
*/
|
1493
|
+
values() {
|
1494
|
+
return Array.from(this._map.entries()).filter(([_, v]) => v._onceDone).map(([k, v]) => {
|
1495
|
+
if (v._onceDone) {
|
1496
|
+
if (v._onceError) {
|
1497
|
+
return {
|
1498
|
+
key: k,
|
1499
|
+
value: Result.Err(v._onceError)
|
1500
|
+
};
|
1559
1501
|
}
|
1502
|
+
return {
|
1503
|
+
key: k,
|
1504
|
+
value: Result.Ok(v._onceValue)
|
1505
|
+
};
|
1560
1506
|
}
|
1561
|
-
|
1562
|
-
|
1563
|
-
add(part) {
|
1564
|
-
if (this.parts.includes(PartType.Root) && part === PartType.Root) {
|
1565
|
-
throw new Error("Cannot add absolute part to absolute path");
|
1566
|
-
}
|
1567
|
-
const last = this.parts[this.parts.length - 1];
|
1568
|
-
if (last & PartType.Slash && part === PartType.Slash) {
|
1569
|
-
return;
|
1570
|
-
}
|
1571
|
-
switch (part) {
|
1572
|
-
case ".":
|
1573
|
-
this.parts.push(PartType.Noop);
|
1574
|
-
return;
|
1575
|
-
case "..":
|
1576
|
-
part = PartType.Up;
|
1577
|
-
}
|
1578
|
-
if (last === PartType.Noop && part === PartType.Slash) {
|
1579
|
-
if (last === PartType.Noop) {
|
1580
|
-
this.parts.pop();
|
1581
|
-
}
|
1582
|
-
return;
|
1583
|
-
}
|
1584
|
-
this.parts.push(part);
|
1507
|
+
throw new Error("KeyedResolvOnce.values impossible");
|
1508
|
+
});
|
1585
1509
|
}
|
1586
1510
|
};
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
return p;
|
1591
|
-
}
|
1592
|
-
for (let count = 0; path.length; count++) {
|
1593
|
-
if (path.match(/^\/+/)) {
|
1594
|
-
if (count === 0) {
|
1595
|
-
p.add(PartType.Root);
|
1596
|
-
} else {
|
1597
|
-
p.add(PartType.Slash);
|
1598
|
-
}
|
1599
|
-
path = path.replace(/^\/+/, "");
|
1600
|
-
} else {
|
1601
|
-
const part = path.replace(/\/.*$/, "");
|
1602
|
-
p.add(part);
|
1603
|
-
path = path.replace(/^[^/]+/, "");
|
1604
|
-
}
|
1511
|
+
var KeyedResolvSeq = class extends Keyed {
|
1512
|
+
constructor(kp = {}) {
|
1513
|
+
super((key) => new ResolveSeq(key), kp);
|
1605
1514
|
}
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
if (path === "") {
|
1614
|
-
continue;
|
1615
|
-
}
|
1616
|
-
if (!(prev.endsWith("/") || path.startsWith("/"))) {
|
1617
|
-
if (prev !== "") {
|
1618
|
-
res.push("/");
|
1619
|
-
}
|
1620
|
-
res.push(path);
|
1621
|
-
} else {
|
1622
|
-
res.push(path);
|
1623
|
-
}
|
1624
|
-
prev = path;
|
1515
|
+
};
|
1516
|
+
|
1517
|
+
// src/utils/coerce-uint8.ts
|
1518
|
+
var globalBuffer = globalThis;
|
1519
|
+
function coerceIntoUint8(raw) {
|
1520
|
+
if (raw instanceof ArrayBuffer) {
|
1521
|
+
return Result.Ok(new Uint8Array(raw));
|
1625
1522
|
}
|
1626
|
-
|
1627
|
-
|
1628
|
-
function relativePath(path, relative) {
|
1629
|
-
const relativeParts = splitPath(relative);
|
1630
|
-
let result;
|
1631
|
-
if (relativeParts.parts[0] === PartType.Root) {
|
1632
|
-
result = relative;
|
1633
|
-
} else {
|
1634
|
-
result = pathJoin(path, relative);
|
1523
|
+
if (ArrayBuffer.isView(raw)) {
|
1524
|
+
return Result.Ok(new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength));
|
1635
1525
|
}
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
out.pop();
|
1649
|
-
} else {
|
1650
|
-
out.pop();
|
1651
|
-
out.pop();
|
1652
|
-
}
|
1653
|
-
if (out.length === 0) {
|
1654
|
-
topUp = !topUp ? true : topUp;
|
1655
|
-
out.push(PartType.Up);
|
1656
|
-
}
|
1657
|
-
} else {
|
1658
|
-
out.push(PartType.Up);
|
1659
|
-
}
|
1660
|
-
break;
|
1661
|
-
case PartType.Slash:
|
1662
|
-
if (!(out[out.length - 1] & PartType.Slash)) {
|
1663
|
-
out.push(PartType.Slash);
|
1664
|
-
}
|
1665
|
-
break;
|
1666
|
-
default:
|
1667
|
-
out.push(part);
|
1668
|
-
break;
|
1526
|
+
if (raw instanceof Blob) {
|
1527
|
+
return Result.Err("Blob not supported");
|
1528
|
+
}
|
1529
|
+
if (globalBuffer.Buffer && globalBuffer.Buffer.isBuffer(raw)) {
|
1530
|
+
return Result.Ok(new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength));
|
1531
|
+
}
|
1532
|
+
if (raw instanceof Uint8Array) {
|
1533
|
+
return Result.Ok(raw);
|
1534
|
+
}
|
1535
|
+
if (Result.Is(raw)) {
|
1536
|
+
if (raw.isErr()) {
|
1537
|
+
return Result.Err(raw);
|
1669
1538
|
}
|
1539
|
+
return coerceIntoUint8(raw.unwrap());
|
1670
1540
|
}
|
1671
|
-
return
|
1541
|
+
return Result.Err("Not a Uint8Array");
|
1672
1542
|
}
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
const escaped = s.replace(/[-\\[\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\^\\$\\|]/g, "\\$&");
|
1680
|
-
return new RegExp(`^${escaped}$`);
|
1681
|
-
}
|
1682
|
-
return s;
|
1683
|
-
});
|
1684
|
-
return localStripper(void 0, restrips, obj);
|
1543
|
+
async function asyncCoerceIntoUint8(raw) {
|
1544
|
+
let resolved = await raw;
|
1545
|
+
if (resolved instanceof Blob) {
|
1546
|
+
resolved = await resolved.arrayBuffer();
|
1547
|
+
}
|
1548
|
+
return coerceIntoUint8(resolved);
|
1685
1549
|
}
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1550
|
+
|
1551
|
+
// src/txt-en-decoder.ts
|
1552
|
+
var TxtOps = class {
|
1553
|
+
constructor() {
|
1554
|
+
this.encoder = new TextEncoder();
|
1555
|
+
this.decoder = new TextDecoder();
|
1689
1556
|
}
|
1690
|
-
|
1691
|
-
return
|
1557
|
+
encode(str) {
|
1558
|
+
return this.encoder.encode(str);
|
1692
1559
|
}
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
return true;
|
1698
|
-
}
|
1699
|
-
}
|
1700
|
-
return false;
|
1701
|
-
};
|
1702
|
-
for (const key in ret) {
|
1703
|
-
if (Object.prototype.hasOwnProperty.call(ret, key)) {
|
1704
|
-
let nextPath;
|
1705
|
-
if (path) {
|
1706
|
-
nextPath = [path, key].join(".");
|
1707
|
-
} else {
|
1708
|
-
nextPath = key;
|
1709
|
-
}
|
1710
|
-
if (matcher(key, nextPath)) {
|
1711
|
-
delete ret[key];
|
1712
|
-
continue;
|
1560
|
+
decode(data) {
|
1561
|
+
if (Result.Is(data)) {
|
1562
|
+
if (data.isErr()) {
|
1563
|
+
throw data.Err();
|
1713
1564
|
}
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
const toDelete = matcher(key, `${nextPath}[${i}]`);
|
1718
|
-
if (!toDelete) {
|
1719
|
-
acc.push(localStripper(`${nextPath}[${i}]`, restrips, v));
|
1720
|
-
}
|
1721
|
-
return acc;
|
1722
|
-
}, []);
|
1723
|
-
} else {
|
1724
|
-
ret[key] = localStripper(nextPath, restrips, ret[key]);
|
1725
|
-
}
|
1565
|
+
const unwrapped = data.unwrap();
|
1566
|
+
if (typeof unwrapped === "string") {
|
1567
|
+
return this.decode(unwrapped);
|
1726
1568
|
}
|
1727
1569
|
}
|
1570
|
+
if (typeof data === "string") {
|
1571
|
+
return data;
|
1572
|
+
}
|
1573
|
+
return this.decoder.decode(coerceIntoUint8(data).Ok());
|
1574
|
+
}
|
1575
|
+
async asyncDecode(data) {
|
1576
|
+
let resolved = await data;
|
1577
|
+
if (resolved instanceof Blob) {
|
1578
|
+
resolved = await resolved.arrayBuffer();
|
1579
|
+
}
|
1580
|
+
return this.decode(resolved);
|
1728
1581
|
}
|
1729
|
-
|
1582
|
+
};
|
1583
|
+
var txtEnDecoder = new ResolveOnce();
|
1584
|
+
function TxtEnDecoderSingleton() {
|
1585
|
+
return txtEnDecoder.once(() => new TxtOps());
|
1730
1586
|
}
|
1731
1587
|
|
1732
|
-
// src/
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
protocol: false,
|
1737
|
-
hostname: false,
|
1738
|
-
port: false,
|
1739
|
-
pathname: false,
|
1740
|
-
pathParts: [],
|
1741
|
-
params: {}
|
1742
|
-
};
|
1743
|
-
const ref = URI.from(iref);
|
1744
|
-
const oth = URI.from(ioth);
|
1745
|
-
if (ref.protocol === oth.protocol) {
|
1746
|
-
mr.score += 1;
|
1747
|
-
mr.protocol = true;
|
1588
|
+
// src/option.ts
|
1589
|
+
var Option = class _Option {
|
1590
|
+
static Some(t) {
|
1591
|
+
return new Some(t);
|
1748
1592
|
}
|
1749
|
-
|
1750
|
-
|
1751
|
-
const refP = ref.port;
|
1752
|
-
if (refH === oth.hostname) {
|
1753
|
-
mr.score += 1;
|
1754
|
-
mr.hostname = true;
|
1755
|
-
}
|
1756
|
-
if (refP.length && refP === oth.port) {
|
1757
|
-
mr.score += 1;
|
1758
|
-
mr.port = true;
|
1759
|
-
}
|
1760
|
-
} catch (e) {
|
1593
|
+
static None() {
|
1594
|
+
return new None();
|
1761
1595
|
}
|
1762
|
-
|
1763
|
-
|
1764
|
-
const poth = oth.pathname.split("/").filter((p) => p.length);
|
1765
|
-
for (let i = 0; i < pref.length && i < poth.length; i++) {
|
1766
|
-
if (poth[i] === pref[i]) {
|
1767
|
-
mr.score += 1;
|
1768
|
-
mr.pathname = true;
|
1769
|
-
mr.pathParts.push(pref[i]);
|
1770
|
-
}
|
1771
|
-
}
|
1596
|
+
static Is(t) {
|
1597
|
+
return t instanceof _Option;
|
1772
1598
|
}
|
1773
|
-
|
1774
|
-
if (
|
1775
|
-
|
1776
|
-
mr.params[key] = value;
|
1599
|
+
static From(t) {
|
1600
|
+
if (!t) {
|
1601
|
+
return new None();
|
1777
1602
|
}
|
1603
|
+
return new Some(t);
|
1778
1604
|
}
|
1779
|
-
|
1780
|
-
|
1781
|
-
function coerceKey(key, def) {
|
1782
|
-
if (typeof key === "object") {
|
1783
|
-
const keys = Object.keys(key);
|
1784
|
-
if (keys.length !== 1) {
|
1785
|
-
throw new Error(`Invalid key: ${JSON.stringify(key)}`);
|
1786
|
-
}
|
1787
|
-
return { key: keys[0], def: key[keys[0]] };
|
1605
|
+
IsNone() {
|
1606
|
+
return this.is_none();
|
1788
1607
|
}
|
1789
|
-
|
1790
|
-
|
1791
|
-
function falsy2undef(value) {
|
1792
|
-
return value === void 0 || value === null ? void 0 : value;
|
1793
|
-
}
|
1794
|
-
function ensureURLWithDefaultProto(url, defaultProtocol) {
|
1795
|
-
if (!url) {
|
1796
|
-
return new MutableURL(`${defaultProtocol}//`);
|
1608
|
+
IsSome() {
|
1609
|
+
return this.is_some();
|
1797
1610
|
}
|
1798
|
-
|
1799
|
-
|
1800
|
-
return new MutableURL(url);
|
1801
|
-
} catch (e) {
|
1802
|
-
return new MutableURL(`${defaultProtocol}//${url}`);
|
1803
|
-
}
|
1804
|
-
} else {
|
1805
|
-
return new MutableURL(url.toString());
|
1611
|
+
Unwrap() {
|
1612
|
+
return this.unwrap();
|
1806
1613
|
}
|
1807
|
-
}
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
constructor(urlStr) {
|
1813
|
-
super("defect://does.not.exist");
|
1814
|
-
const partedURL = urlStr.split(":");
|
1815
|
-
this._hasHostpart = hasHostPartProtocols.has(partedURL[0]);
|
1816
|
-
let hostPartUrl = ["http", ...partedURL.slice(1)].join(":");
|
1817
|
-
if (!this._hasHostpart) {
|
1818
|
-
const pathname = hostPartUrl.replace(/http:\/\/[/]*/, "").replace(/[#?].*$/, "");
|
1819
|
-
hostPartUrl = hostPartUrl.replace(/http:\/\//, `http://localhost/${pathname}`);
|
1820
|
-
}
|
1821
|
-
try {
|
1822
|
-
this._sysURL = new URL(hostPartUrl);
|
1823
|
-
} catch (ie) {
|
1824
|
-
const e = ie;
|
1825
|
-
e.message = `${e.message} for URL: ${urlStr}`;
|
1826
|
-
throw e;
|
1827
|
-
}
|
1828
|
-
this._protocol = `${partedURL[0]}:`;
|
1829
|
-
if (this._hasHostpart) {
|
1830
|
-
this._pathname = this._sysURL.pathname;
|
1831
|
-
} else {
|
1832
|
-
this._pathname = urlStr.replace(new RegExp(`^${this._protocol}//`), "").replace(/[#?].*$/, "");
|
1833
|
-
}
|
1834
|
-
this.hash = this._sysURL.hash;
|
1614
|
+
};
|
1615
|
+
var Some = class extends Option {
|
1616
|
+
constructor(_t) {
|
1617
|
+
super();
|
1618
|
+
this._t = _t;
|
1835
1619
|
}
|
1836
|
-
|
1837
|
-
return
|
1620
|
+
is_none() {
|
1621
|
+
return false;
|
1838
1622
|
}
|
1839
|
-
|
1840
|
-
|
1841
|
-
throw new Error(
|
1842
|
-
`you can use hostname only if protocol is ${this.toString()} ${JSON.stringify(Array.from(hasHostPartProtocols.keys()))}`
|
1843
|
-
);
|
1844
|
-
}
|
1845
|
-
return this._sysURL.host;
|
1623
|
+
is_some() {
|
1624
|
+
return true;
|
1846
1625
|
}
|
1847
|
-
|
1848
|
-
|
1849
|
-
throw new Error(`you can use hostname only if protocol is ${JSON.stringify(Array.from(hasHostPartProtocols.keys()))}`);
|
1850
|
-
}
|
1851
|
-
return this._sysURL.port;
|
1626
|
+
unwrap() {
|
1627
|
+
return this._t;
|
1852
1628
|
}
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1629
|
+
};
|
1630
|
+
var None = class extends Option {
|
1631
|
+
is_none() {
|
1632
|
+
return true;
|
1633
|
+
}
|
1634
|
+
is_some() {
|
1635
|
+
return false;
|
1636
|
+
}
|
1637
|
+
unwrap() {
|
1638
|
+
throw new Error("None.unwrap");
|
1639
|
+
}
|
1640
|
+
};
|
1641
|
+
|
1642
|
+
// src/log-level-impl.ts
|
1643
|
+
var LevelHandlerImpl = class {
|
1644
|
+
constructor() {
|
1645
|
+
this._globalLevels = /* @__PURE__ */ new Set([Level.INFO, Level.ERROR, Level.WARN]);
|
1646
|
+
this._modules = /* @__PURE__ */ new Map();
|
1647
|
+
this.ignoreAttr = Option.Some(/^_/);
|
1648
|
+
this.isStackExposed = false;
|
1858
1649
|
}
|
1859
|
-
|
1860
|
-
if (
|
1861
|
-
|
1650
|
+
enableLevel(level, ...modules) {
|
1651
|
+
if (modules.length == 0) {
|
1652
|
+
this._globalLevels.add(level);
|
1653
|
+
return;
|
1862
1654
|
}
|
1863
|
-
|
1655
|
+
this.forModules(
|
1656
|
+
level,
|
1657
|
+
(p) => {
|
1658
|
+
this._modules.set(p, /* @__PURE__ */ new Set([...this._globalLevels, level]));
|
1659
|
+
},
|
1660
|
+
...modules
|
1661
|
+
);
|
1864
1662
|
}
|
1865
|
-
|
1866
|
-
if (
|
1867
|
-
|
1663
|
+
disableLevel(level, ...modules) {
|
1664
|
+
if (modules.length == 0) {
|
1665
|
+
this._globalLevels.delete(level);
|
1666
|
+
return;
|
1868
1667
|
}
|
1869
|
-
this.
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1668
|
+
this.forModules(
|
1669
|
+
level,
|
1670
|
+
(p) => {
|
1671
|
+
this._modules.delete(p);
|
1672
|
+
},
|
1673
|
+
...modules
|
1674
|
+
);
|
1873
1675
|
}
|
1874
|
-
|
1875
|
-
|
1676
|
+
setExposeStack(enable) {
|
1677
|
+
this.isStackExposed = !!enable;
|
1876
1678
|
}
|
1877
|
-
|
1878
|
-
|
1679
|
+
setIgnoreAttr(re) {
|
1680
|
+
this.ignoreAttr = Option.From(re);
|
1879
1681
|
}
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1682
|
+
forModules(level, fnAction, ...modules) {
|
1683
|
+
for (const m of modules.flat()) {
|
1684
|
+
if (typeof m !== "string") {
|
1685
|
+
continue;
|
1686
|
+
}
|
1687
|
+
const parts = m.split(",").map((s) => s.trim()).filter((s) => s.length);
|
1688
|
+
for (const p of parts) {
|
1689
|
+
fnAction(p);
|
1690
|
+
}
|
1883
1691
|
}
|
1884
|
-
this._protocol = p;
|
1885
1692
|
}
|
1886
|
-
|
1887
|
-
|
1693
|
+
setDebug(...modules) {
|
1694
|
+
this.forModules(
|
1695
|
+
Level.DEBUG,
|
1696
|
+
(p) => {
|
1697
|
+
this._modules.set(p, /* @__PURE__ */ new Set([...this._globalLevels, Level.DEBUG]));
|
1698
|
+
},
|
1699
|
+
...modules
|
1700
|
+
);
|
1888
1701
|
}
|
1889
|
-
|
1890
|
-
|
1891
|
-
if (
|
1892
|
-
|
1893
|
-
|
1702
|
+
isEnabled(ilevel, module2) {
|
1703
|
+
const level = ilevel;
|
1704
|
+
if (typeof module2 === "string") {
|
1705
|
+
const levels = this._modules.get(module2);
|
1706
|
+
if (levels && levels.has(level)) {
|
1707
|
+
return true;
|
1894
1708
|
}
|
1895
1709
|
}
|
1896
|
-
|
1897
|
-
if (
|
1898
|
-
|
1899
|
-
|
1900
|
-
hostpart += `:${this._sysURL.port}`;
|
1901
|
-
}
|
1902
|
-
if (!this._pathname.startsWith("/")) {
|
1903
|
-
hostpart += "/";
|
1710
|
+
const wlevel = this._modules.get("*");
|
1711
|
+
if (wlevel && typeof level === "string") {
|
1712
|
+
if (wlevel.has(level)) {
|
1713
|
+
return true;
|
1904
1714
|
}
|
1905
1715
|
}
|
1906
|
-
|
1716
|
+
if (typeof level !== "string") {
|
1717
|
+
return true;
|
1718
|
+
}
|
1719
|
+
return this._globalLevels.has(level);
|
1907
1720
|
}
|
1908
1721
|
};
|
1909
|
-
|
1910
|
-
|
1911
|
-
|
1912
|
-
return fac(new MutableURL(`${defaultProtocol}///`));
|
1913
|
-
case "string":
|
1914
|
-
return fac(ensureURLWithDefaultProto(strURLUri, defaultProtocol));
|
1915
|
-
case "object":
|
1916
|
-
if (BuildURI.is(strURLUri)) {
|
1917
|
-
return fac(new MutableURL(strURLUri._url.toString()));
|
1918
|
-
} else if (URI.is(strURLUri)) {
|
1919
|
-
return fac(new MutableURL(strURLUri._url.toString()));
|
1920
|
-
} else if (isURL(strURLUri)) {
|
1921
|
-
return fac(new MutableURL(strURLUri.toString()));
|
1922
|
-
}
|
1923
|
-
throw new Error(`unknown object type: ${strURLUri}`);
|
1924
|
-
default:
|
1925
|
-
throw new Error(`Invalid argument: ${typeof strURLUri}`);
|
1926
|
-
}
|
1722
|
+
var levelSingleton = new LevelHandlerImpl();
|
1723
|
+
function LevelHandlerSingleton() {
|
1724
|
+
return levelSingleton;
|
1927
1725
|
}
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1726
|
+
|
1727
|
+
// src/runtime.ts
|
1728
|
+
function isSet(value, ref = globalThis) {
|
1729
|
+
const [head, ...tail] = value.split(".");
|
1730
|
+
if (["object", "function"].includes(typeof ref) && ref && ["object", "function"].includes(typeof ref[head]) && ref[head]) {
|
1731
|
+
if (tail.length <= 1) {
|
1732
|
+
return true;
|
1733
|
+
}
|
1734
|
+
return isSet(tail.join("."), ref[head]);
|
1933
1735
|
}
|
1934
|
-
return
|
1736
|
+
return false;
|
1935
1737
|
}
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
return from((url) => new _BuildURI(url), strURLUri, defaultProtocol);
|
1946
|
-
}
|
1947
|
-
match(other) {
|
1948
|
-
return match(this.URI(), URI.from(other));
|
1949
|
-
}
|
1950
|
-
port(p) {
|
1951
|
-
this._url.port = p;
|
1952
|
-
return this;
|
1953
|
-
}
|
1954
|
-
hostname(h) {
|
1955
|
-
this._url.hostname = h;
|
1956
|
-
return this;
|
1738
|
+
function runtimeFn() {
|
1739
|
+
const gt = globalThis;
|
1740
|
+
let isReactNative = (
|
1741
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
1742
|
+
isSet("navigator.product") && typeof gt["navigator"] === "object" && gt["navigator"]["product"] === "ReactNative"
|
1743
|
+
);
|
1744
|
+
let isNodeIsh = false;
|
1745
|
+
if (!isSet("Deno")) {
|
1746
|
+
isNodeIsh = isSet("process.versions.node") && !isReactNative;
|
1957
1747
|
}
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1748
|
+
let isDeno = isSet("Deno");
|
1749
|
+
const isCFWorker = isSet("caches.default") && isSet("WebSocketPair");
|
1750
|
+
if (isCFWorker) {
|
1751
|
+
isDeno = false;
|
1752
|
+
isNodeIsh = false;
|
1753
|
+
isReactNative = false;
|
1964
1754
|
}
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
1755
|
+
return {
|
1756
|
+
isNodeIsh,
|
1757
|
+
isBrowser: !(isNodeIsh || isDeno || isCFWorker || isReactNative),
|
1758
|
+
isDeno,
|
1759
|
+
isReactNative,
|
1760
|
+
isCFWorker
|
1761
|
+
};
|
1762
|
+
}
|
1763
|
+
|
1764
|
+
// src/sys-abstraction.ts
|
1765
|
+
var TimeMode = {
|
1766
|
+
REAL: "real",
|
1767
|
+
CONST: "const",
|
1768
|
+
STEP: "step"
|
1769
|
+
};
|
1770
|
+
var RandomMode = {
|
1771
|
+
CONST: "const",
|
1772
|
+
STEP: "step",
|
1773
|
+
RANDOM: "random"
|
1774
|
+
};
|
1775
|
+
var IDMode = {
|
1776
|
+
UUID: "uuid",
|
1777
|
+
CONST: "const",
|
1778
|
+
STEP: "step"
|
1779
|
+
};
|
1780
|
+
function String2TimeMode(s) {
|
1781
|
+
switch (s == null ? void 0 : s.toLowerCase()) {
|
1782
|
+
case "real":
|
1783
|
+
return TimeMode.REAL;
|
1784
|
+
case "const":
|
1785
|
+
return TimeMode.CONST;
|
1786
|
+
case "step":
|
1787
|
+
return TimeMode.STEP;
|
1788
|
+
default:
|
1789
|
+
return TimeMode.REAL;
|
1968
1790
|
}
|
1969
|
-
|
1970
|
-
|
1971
|
-
|
1972
|
-
|
1973
|
-
|
1974
|
-
|
1975
|
-
|
1976
|
-
if (!p.match(/^[a-zA-Z0-9]+:/)) {
|
1977
|
-
if (p.startsWith("/")) {
|
1978
|
-
this.pathname(p);
|
1979
|
-
return this;
|
1980
|
-
}
|
1981
|
-
return this.appendRelative(p);
|
1982
|
-
}
|
1983
|
-
}
|
1984
|
-
this._url = new MutableURL(p.toString());
|
1985
|
-
return this;
|
1791
|
+
}
|
1792
|
+
|
1793
|
+
// src/time.ts
|
1794
|
+
var Time = class {
|
1795
|
+
TimeSince(start) {
|
1796
|
+
const now = this.Now();
|
1797
|
+
return now.getTime() - start.getTime();
|
1986
1798
|
}
|
1987
|
-
|
1988
|
-
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1799
|
+
};
|
1800
|
+
var TimeUnits = {
|
1801
|
+
Microsecond: 1,
|
1802
|
+
Second: 1e3 * 1,
|
1803
|
+
//Microsecond,
|
1804
|
+
Minute: 60 * 1e3 * 1,
|
1805
|
+
//Second,
|
1806
|
+
Hour: 60 * 60 * 1e3 * 1
|
1807
|
+
// Minute,
|
1808
|
+
};
|
1809
|
+
|
1810
|
+
// src/deno/deno-env-actions.ts
|
1811
|
+
var once = new ResolveOnce();
|
1812
|
+
var _deno;
|
1813
|
+
var _DenoEnvActions = class _DenoEnvActions {
|
1814
|
+
constructor(opts) {
|
1815
|
+
__privateAdd(this, _deno, globalThis);
|
1816
|
+
this.opts = opts;
|
1996
1817
|
}
|
1997
|
-
|
1998
|
-
|
1999
|
-
this._url.searchParams.delete(key);
|
2000
|
-
}
|
2001
|
-
return this;
|
1818
|
+
static new(opts) {
|
1819
|
+
return once.once(() => new _DenoEnvActions(opts));
|
2002
1820
|
}
|
2003
|
-
|
2004
|
-
this.
|
2005
|
-
return this;
|
1821
|
+
get _env() {
|
1822
|
+
return __privateGet(this, _deno).Deno.env;
|
2006
1823
|
}
|
2007
|
-
|
2008
|
-
|
2009
|
-
this.
|
1824
|
+
register(env) {
|
1825
|
+
for (const key of env.keys()) {
|
1826
|
+
this._env.set(key, env.get(key) || "");
|
2010
1827
|
}
|
2011
|
-
return
|
1828
|
+
return env;
|
2012
1829
|
}
|
2013
|
-
|
2014
|
-
|
2015
|
-
return this;
|
1830
|
+
active() {
|
1831
|
+
return runtimeFn().isDeno;
|
2016
1832
|
}
|
2017
|
-
|
2018
|
-
return this.
|
1833
|
+
keys() {
|
1834
|
+
return Object.keys(this._env.toObject());
|
2019
1835
|
}
|
2020
|
-
get
|
2021
|
-
return this.
|
1836
|
+
get(key) {
|
1837
|
+
return this._env.get(key);
|
2022
1838
|
}
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
2026
|
-
if (!falsy2undef(val) && d) {
|
2027
|
-
val = d;
|
1839
|
+
set(key, value) {
|
1840
|
+
if (value) {
|
1841
|
+
this._env.set(key, value);
|
2028
1842
|
}
|
2029
|
-
return falsy2undef(val);
|
2030
1843
|
}
|
2031
|
-
|
2032
|
-
|
1844
|
+
delete(key) {
|
1845
|
+
this._env.delete(key);
|
2033
1846
|
}
|
2034
|
-
|
2035
|
-
|
1847
|
+
};
|
1848
|
+
_deno = new WeakMap();
|
1849
|
+
var DenoEnvActions = _DenoEnvActions;
|
1850
|
+
|
1851
|
+
// src/node/node-env-actions.ts
|
1852
|
+
var once2 = new ResolveOnce();
|
1853
|
+
var _node;
|
1854
|
+
var _NodeEnvActions = class _NodeEnvActions {
|
1855
|
+
constructor(opts) {
|
1856
|
+
__privateAdd(this, _node, globalThis);
|
1857
|
+
this._env = this.active() ? __privateGet(this, _node).process.env : {};
|
1858
|
+
this.opts = opts;
|
2036
1859
|
}
|
2037
|
-
|
2038
|
-
|
2039
|
-
return this._url.toString();
|
1860
|
+
static new(opts) {
|
1861
|
+
return once2.once(() => new _NodeEnvActions(opts));
|
2040
1862
|
}
|
2041
|
-
|
2042
|
-
|
1863
|
+
register(env) {
|
1864
|
+
for (const key of env.keys()) {
|
1865
|
+
this._env[key] = env.get(key) || "";
|
1866
|
+
}
|
1867
|
+
return env;
|
2043
1868
|
}
|
2044
|
-
|
2045
|
-
return
|
1869
|
+
active() {
|
1870
|
+
return runtimeFn().isNodeIsh;
|
2046
1871
|
}
|
2047
|
-
|
2048
|
-
return
|
1872
|
+
keys() {
|
1873
|
+
return Object.keys(this._env);
|
2049
1874
|
}
|
2050
|
-
|
2051
|
-
return
|
1875
|
+
get(key) {
|
1876
|
+
return this._env[key];
|
2052
1877
|
}
|
2053
|
-
|
2054
|
-
|
1878
|
+
set(key, value) {
|
1879
|
+
if (value) {
|
1880
|
+
this._env[key] = value;
|
1881
|
+
}
|
1882
|
+
}
|
1883
|
+
delete(key) {
|
1884
|
+
delete this._env[key];
|
2055
1885
|
}
|
2056
1886
|
};
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
1887
|
+
_node = new WeakMap();
|
1888
|
+
var NodeEnvActions = _NodeEnvActions;
|
1889
|
+
|
1890
|
+
// src/web/web-env-actions.ts
|
1891
|
+
var once3 = new ResolveOnce();
|
1892
|
+
var BrowserEnvActions = class _BrowserEnvActions {
|
1893
|
+
constructor(opts) {
|
1894
|
+
this.env = /* @__PURE__ */ new Map();
|
1895
|
+
this.opts = opts;
|
2060
1896
|
}
|
2061
|
-
|
2062
|
-
return
|
1897
|
+
static new(opts) {
|
1898
|
+
return once3.once(() => new _BrowserEnvActions(opts));
|
2063
1899
|
}
|
2064
|
-
|
2065
|
-
return
|
1900
|
+
get(key) {
|
1901
|
+
return this.env.get(key);
|
2066
1902
|
}
|
2067
|
-
|
2068
|
-
|
1903
|
+
set(key, value) {
|
1904
|
+
if (value) {
|
1905
|
+
this.env.set(key, value);
|
1906
|
+
}
|
2069
1907
|
}
|
2070
|
-
|
2071
|
-
|
1908
|
+
delete(key) {
|
1909
|
+
this.env.delete(key);
|
2072
1910
|
}
|
2073
|
-
|
2074
|
-
|
2075
|
-
var hasHostPartProtocols = /* @__PURE__ */ new Set(["http", "https", "ws", "wss"]);
|
2076
|
-
var URI = class _URI {
|
2077
|
-
static protocolHasHostpart(protocol) {
|
2078
|
-
protocol = protocol.replace(/:$/, "");
|
2079
|
-
hasHostPartProtocols.add(protocol);
|
2080
|
-
return () => {
|
2081
|
-
hasHostPartProtocols.delete(protocol);
|
2082
|
-
};
|
1911
|
+
keys() {
|
1912
|
+
return Array.from(this.env.keys());
|
2083
1913
|
}
|
2084
|
-
|
2085
|
-
return
|
1914
|
+
active() {
|
1915
|
+
return true;
|
2086
1916
|
}
|
2087
|
-
|
2088
|
-
|
2089
|
-
const
|
2090
|
-
|
2091
|
-
|
2092
|
-
const fPath = fromUrl.pathname;
|
2093
|
-
if (!(fPath.length === 0 || fPath === "/" || fPath === "./")) {
|
2094
|
-
intoUrl.pathname(fromUrl.pathname);
|
2095
|
-
}
|
2096
|
-
for (const [key, value] of fromUrl.getParams) {
|
2097
|
-
intoUrl.setParam(key, value);
|
2098
|
-
}
|
2099
|
-
return intoUrl.URI();
|
1917
|
+
register(env) {
|
1918
|
+
const sym = Symbol.for(this.opts.symbol || "CP_ENV");
|
1919
|
+
const browser = globalThis;
|
1920
|
+
browser[sym] = env;
|
1921
|
+
return env;
|
2100
1922
|
}
|
2101
|
-
|
2102
|
-
|
1923
|
+
};
|
1924
|
+
|
1925
|
+
// src/cf/cf-env-actions.ts
|
1926
|
+
var once4 = new ResolveOnce();
|
1927
|
+
var CFEnvActions = class _CFEnvActions {
|
1928
|
+
constructor(env) {
|
1929
|
+
this.injectOnRegister = {};
|
1930
|
+
this.cfEnv = new Map(Object.entries(env.presetEnv || {}));
|
2103
1931
|
}
|
2104
|
-
|
2105
|
-
|
2106
|
-
return from((url) => new _URI(url), strURLUri, defaultProtocol);
|
1932
|
+
static new(opts) {
|
1933
|
+
return once4.once(() => new _CFEnvActions(opts));
|
2107
1934
|
}
|
2108
|
-
static
|
2109
|
-
|
1935
|
+
static inject(o) {
|
1936
|
+
const env = _CFEnvActions.new({});
|
1937
|
+
for (const key in o) {
|
1938
|
+
const value = o[key];
|
1939
|
+
if (typeof value === "string") {
|
1940
|
+
if (env.env) {
|
1941
|
+
env.env.set(key, value);
|
1942
|
+
} else {
|
1943
|
+
env.injectOnRegister[key] = value;
|
1944
|
+
}
|
1945
|
+
}
|
1946
|
+
}
|
2110
1947
|
}
|
2111
|
-
|
2112
|
-
|
1948
|
+
active() {
|
1949
|
+
return runtimeFn().isCFWorker;
|
2113
1950
|
}
|
2114
|
-
|
2115
|
-
|
1951
|
+
register(env) {
|
1952
|
+
this.env = env;
|
1953
|
+
for (const key in this.injectOnRegister) {
|
1954
|
+
env.set(key, this.injectOnRegister[key]);
|
1955
|
+
}
|
1956
|
+
return env;
|
2116
1957
|
}
|
2117
|
-
get
|
2118
|
-
return this.
|
1958
|
+
get(key) {
|
1959
|
+
return this.cfEnv.get(key);
|
2119
1960
|
}
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2123
|
-
|
2124
|
-
return this._url.port;
|
1961
|
+
set(key, value) {
|
1962
|
+
if (value) {
|
1963
|
+
this.cfEnv.set(key, value);
|
1964
|
+
}
|
2125
1965
|
}
|
2126
|
-
|
2127
|
-
|
1966
|
+
delete(key) {
|
1967
|
+
this.cfEnv.delete(key);
|
2128
1968
|
}
|
2129
|
-
|
2130
|
-
|
2131
|
-
// }
|
2132
|
-
// get search(): string {
|
2133
|
-
// return this._url.search;
|
2134
|
-
// }
|
2135
|
-
get protocol() {
|
2136
|
-
return this._url.protocol;
|
1969
|
+
keys() {
|
1970
|
+
return Array.from(this.cfEnv.keys());
|
2137
1971
|
}
|
2138
|
-
|
2139
|
-
|
1972
|
+
};
|
1973
|
+
|
1974
|
+
// src/sys-env.ts
|
1975
|
+
var envActions = [
|
1976
|
+
{ id: "cf", fn: (opts) => CFEnvActions.new(opts) },
|
1977
|
+
{ id: "node", fn: (opts) => NodeEnvActions.new(opts) },
|
1978
|
+
{ id: "deno", fn: (opts) => DenoEnvActions.new(opts) },
|
1979
|
+
{ id: "browser", fn: (opts) => BrowserEnvActions.new(opts) }
|
1980
|
+
];
|
1981
|
+
function registerEnvAction(fn) {
|
1982
|
+
const id = `id-${Math.random()}`;
|
1983
|
+
envActions.unshift({ id, fn });
|
1984
|
+
_envFactories.unget(id);
|
1985
|
+
return () => {
|
1986
|
+
const index = envActions.findIndex((i) => i.id === id);
|
1987
|
+
if (index >= 0) {
|
1988
|
+
envActions.splice(index, 1);
|
1989
|
+
}
|
1990
|
+
};
|
1991
|
+
}
|
1992
|
+
var _envFactories = new KeyedResolvOnce();
|
1993
|
+
function envFactory(opts = {}) {
|
1994
|
+
const found = envActions.find((fi) => fi.fn(opts).active());
|
1995
|
+
if (!found) {
|
1996
|
+
throw new Error("SysContainer:envFactory: no env available");
|
2140
1997
|
}
|
2141
|
-
|
2142
|
-
|
2143
|
-
|
2144
|
-
|
2145
|
-
|
2146
|
-
|
2147
|
-
|
2148
|
-
|
1998
|
+
return _envFactories.get(found.id).once(() => {
|
1999
|
+
const action = found.fn(opts);
|
2000
|
+
const ret = new EnvImpl(action, opts);
|
2001
|
+
action.register(ret);
|
2002
|
+
return ret;
|
2003
|
+
});
|
2004
|
+
}
|
2005
|
+
function isIterable(obj) {
|
2006
|
+
if (obj == null) {
|
2007
|
+
return false;
|
2149
2008
|
}
|
2150
|
-
|
2151
|
-
|
2009
|
+
return typeof obj[Symbol.iterator] === "function";
|
2010
|
+
}
|
2011
|
+
var EnvImpl = class {
|
2012
|
+
constructor(map, opts = {}) {
|
2013
|
+
this._onSet = [];
|
2014
|
+
this._map = map;
|
2015
|
+
this._updatePresets(opts.presetEnv);
|
2152
2016
|
}
|
2153
|
-
|
2154
|
-
|
2155
|
-
|
2156
|
-
|
2157
|
-
val = d;
|
2158
|
-
}
|
2159
|
-
return falsy2undef(val);
|
2017
|
+
gets(...kparams) {
|
2018
|
+
return getParamsResult(kparams, {
|
2019
|
+
getParam: (k) => this.get(k)
|
2020
|
+
});
|
2160
2021
|
}
|
2161
|
-
|
2162
|
-
|
2022
|
+
sets(...keys) {
|
2023
|
+
keys.forEach((key) => {
|
2024
|
+
if (Array.isArray(key)) {
|
2025
|
+
if (key.length === 2) {
|
2026
|
+
const [k, v] = key;
|
2027
|
+
if (typeof k === "string" && typeof v === "string") {
|
2028
|
+
this.set(k, v);
|
2029
|
+
return;
|
2030
|
+
}
|
2031
|
+
}
|
2032
|
+
for (const item of key) {
|
2033
|
+
if (Array.isArray(item)) {
|
2034
|
+
if (item.length === 2) {
|
2035
|
+
const [k, v] = item;
|
2036
|
+
if (typeof k === "string" && typeof v === "string") {
|
2037
|
+
this.set(k, v);
|
2038
|
+
}
|
2039
|
+
}
|
2040
|
+
}
|
2041
|
+
}
|
2042
|
+
} else {
|
2043
|
+
if (isIterable(key)) {
|
2044
|
+
for (const [k, v] of key) {
|
2045
|
+
if (typeof k === "string" && typeof v === "string") {
|
2046
|
+
this.set(k, v);
|
2047
|
+
}
|
2048
|
+
}
|
2049
|
+
} else {
|
2050
|
+
const rKey = key;
|
2051
|
+
for (const k in rKey) {
|
2052
|
+
const v = rKey[k];
|
2053
|
+
if (typeof k === "string" && typeof v === "string") {
|
2054
|
+
this.set(k, v);
|
2055
|
+
}
|
2056
|
+
}
|
2057
|
+
}
|
2058
|
+
}
|
2059
|
+
});
|
2163
2060
|
}
|
2164
|
-
|
2165
|
-
|
2061
|
+
_updatePresets(presetEnv) {
|
2062
|
+
if (!presetEnv) {
|
2063
|
+
return;
|
2064
|
+
}
|
2065
|
+
for (const [key, value] of presetEnv) {
|
2066
|
+
this._map.set(key, value);
|
2067
|
+
}
|
2166
2068
|
}
|
2167
|
-
|
2168
|
-
|
2069
|
+
_applyOnSet(onSet, key, value) {
|
2070
|
+
onSet.forEach((item) => {
|
2071
|
+
let keys = [];
|
2072
|
+
if (key) {
|
2073
|
+
keys = [key];
|
2074
|
+
} else {
|
2075
|
+
keys = this._map.keys();
|
2076
|
+
}
|
2077
|
+
keys.filter((k) => {
|
2078
|
+
if (item.filter.size === 0) {
|
2079
|
+
return true;
|
2080
|
+
}
|
2081
|
+
if (item.filter.has(k)) {
|
2082
|
+
return true;
|
2083
|
+
}
|
2084
|
+
return false;
|
2085
|
+
}).forEach((k) => {
|
2086
|
+
let v;
|
2087
|
+
if (!key && !value) {
|
2088
|
+
v = this._map.get(k);
|
2089
|
+
} else if (key && !value) {
|
2090
|
+
v = void 0;
|
2091
|
+
} else {
|
2092
|
+
v = value;
|
2093
|
+
}
|
2094
|
+
item.fn(k, v);
|
2095
|
+
});
|
2096
|
+
});
|
2169
2097
|
}
|
2170
|
-
|
2171
|
-
return this.
|
2098
|
+
keys() {
|
2099
|
+
return this._map.keys();
|
2172
2100
|
}
|
2173
|
-
|
2174
|
-
|
2101
|
+
// filter is not set all sets passed
|
2102
|
+
onSet(fn, ...filter) {
|
2103
|
+
const item = { filter: new Set(filter), fn };
|
2104
|
+
this._onSet.push(item);
|
2105
|
+
this._applyOnSet([item]);
|
2175
2106
|
}
|
2176
|
-
|
2177
|
-
return this.
|
2107
|
+
get(key) {
|
2108
|
+
return this._map.get(key);
|
2178
2109
|
}
|
2179
|
-
|
2180
|
-
|
2181
|
-
|
2182
|
-
protocol: this.protocol,
|
2183
|
-
pathname: this.pathname,
|
2184
|
-
searchParams: Object.fromEntries(this.getParams)
|
2185
|
-
};
|
2186
|
-
if (hasHostPartProtocols.has(this.protocol.replace(/:$/, ""))) {
|
2187
|
-
return stripper(strips, {
|
2188
|
-
...pathURI,
|
2189
|
-
style: "host",
|
2190
|
-
hostname: this.hostname,
|
2191
|
-
port: this.port
|
2192
|
-
});
|
2110
|
+
set(key, value) {
|
2111
|
+
if (!value) {
|
2112
|
+
return;
|
2193
2113
|
}
|
2194
|
-
|
2114
|
+
this._map.set(key, value);
|
2115
|
+
this._applyOnSet(this._onSet, key, value);
|
2116
|
+
}
|
2117
|
+
delete(key) {
|
2118
|
+
this._map.delete(key);
|
2119
|
+
this._applyOnSet(this._onSet, key);
|
2195
2120
|
}
|
2196
2121
|
};
|
2197
2122
|
|
@@ -2260,190 +2185,361 @@ var ConsoleWriterStream = class {
|
|
2260
2185
|
}
|
2261
2186
|
};
|
2262
2187
|
|
2263
|
-
// src/
|
2264
|
-
var
|
2265
|
-
constructor(
|
2266
|
-
this.
|
2267
|
-
this._flushIsRunning = false;
|
2268
|
-
this._flushDoneFns = [];
|
2269
|
-
this._out = out;
|
2188
|
+
// src/web/web-basic-sys-abstraction.ts
|
2189
|
+
var WebSystemService = class {
|
2190
|
+
constructor(ende) {
|
2191
|
+
this._txtEnDe = ende;
|
2270
2192
|
}
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2193
|
+
Env() {
|
2194
|
+
return envFactory();
|
2195
|
+
}
|
2196
|
+
Args() {
|
2197
|
+
throw new Error("Args-Method not implemented.");
|
2198
|
+
}
|
2199
|
+
Stdout() {
|
2200
|
+
return new ConsoleWriterStream();
|
2201
|
+
}
|
2202
|
+
Stderr() {
|
2203
|
+
const decoder = this._txtEnDe;
|
2204
|
+
return new WritableStream({
|
2205
|
+
write(chunk) {
|
2206
|
+
return new Promise((resolve) => {
|
2207
|
+
const decoded = decoder.decode(chunk);
|
2208
|
+
console.error(decoded.trimEnd());
|
2209
|
+
resolve();
|
2210
|
+
});
|
2280
2211
|
}
|
2281
|
-
};
|
2282
|
-
this._toFlush.push(my2);
|
2283
|
-
this._flush();
|
2212
|
+
});
|
2284
2213
|
}
|
2285
|
-
|
2214
|
+
};
|
2215
|
+
var baseSysAbstraction = new ResolveOnce();
|
2216
|
+
function WebBasicSysAbstraction(param2) {
|
2217
|
+
var _a;
|
2218
|
+
const my = baseSysAbstraction.once(() => {
|
2219
|
+
return new BaseBasicSysAbstraction({
|
2220
|
+
TxtEnDecoder: (param2 == null ? void 0 : param2.TxtEnDecoder) || TxtEnDecoderSingleton()
|
2221
|
+
});
|
2222
|
+
});
|
2223
|
+
return new WrapperBasicSysAbstraction(my, {
|
2224
|
+
basicRuntimeService: new WebSystemService((_a = param2 == null ? void 0 : param2.TxtEnDecoder) != null ? _a : my._txtEnDe),
|
2225
|
+
...param2
|
2226
|
+
});
|
2227
|
+
}
|
2228
|
+
|
2229
|
+
// src/cf/cf-basic-sys-abstraction.ts
|
2230
|
+
var CFRuntimeService = class {
|
2231
|
+
constructor(ende) {
|
2232
|
+
this._txtEnDe = ende;
|
2233
|
+
}
|
2234
|
+
Env() {
|
2235
|
+
return envFactory();
|
2236
|
+
}
|
2237
|
+
Args() {
|
2238
|
+
throw new Error("Args-Method not implemented.");
|
2239
|
+
}
|
2240
|
+
Stdout() {
|
2241
|
+
return CFWriteableStream((chunk) => {
|
2242
|
+
const decoded = this._txtEnDe.decode(chunk);
|
2243
|
+
console.log(decoded.trimEnd());
|
2244
|
+
return Promise.resolve();
|
2245
|
+
});
|
2246
|
+
}
|
2247
|
+
Stderr() {
|
2248
|
+
return CFWriteableStream((chunk) => {
|
2249
|
+
const decoded = this._txtEnDe.decode(chunk);
|
2250
|
+
console.error(decoded.trimEnd());
|
2251
|
+
return Promise.resolve();
|
2252
|
+
});
|
2253
|
+
}
|
2254
|
+
};
|
2255
|
+
function consumeReadableStream(reader, writeFn) {
|
2256
|
+
reader.read().then(({ done, value }) => {
|
2286
2257
|
if (done) {
|
2287
|
-
this._flushDoneFns.push(done);
|
2288
|
-
}
|
2289
|
-
if (this._toFlush.length == 0) {
|
2290
|
-
this._flushIsRunning = false;
|
2291
|
-
this._flushDoneFns.forEach((fn) => fn());
|
2292
|
-
this._flushDoneFns = [];
|
2293
2258
|
return;
|
2294
2259
|
}
|
2295
|
-
|
2296
|
-
|
2297
|
-
}
|
2298
|
-
|
2299
|
-
}
|
2300
|
-
|
2301
|
-
|
2302
|
-
|
2303
|
-
|
2304
|
-
|
2260
|
+
writeFn(value).then(() => {
|
2261
|
+
consumeReadableStream(reader, writeFn);
|
2262
|
+
}).catch((e) => {
|
2263
|
+
console.error("consumeReadableStream:writeFn", e);
|
2264
|
+
});
|
2265
|
+
}).catch((e) => {
|
2266
|
+
console.error("consumeReadableStream:read", e);
|
2267
|
+
});
|
2268
|
+
}
|
2269
|
+
function CFWriteableStream(writeFn) {
|
2270
|
+
const ts = new TransformStream();
|
2271
|
+
consumeReadableStream(ts.readable.getReader(), writeFn);
|
2272
|
+
return ts.writable;
|
2273
|
+
}
|
2274
|
+
var baseSysAbstraction2 = new ResolveOnce();
|
2275
|
+
function CFBasicSysAbstraction(param2) {
|
2276
|
+
var _a;
|
2277
|
+
const my = baseSysAbstraction2.once(() => {
|
2278
|
+
return new BaseBasicSysAbstraction({
|
2279
|
+
TxtEnDecoder: (param2 == null ? void 0 : param2.TxtEnDecoder) || TxtEnDecoderSingleton()
|
2305
2280
|
});
|
2281
|
+
});
|
2282
|
+
return new WrapperBasicSysAbstraction(my, {
|
2283
|
+
basicRuntimeService: new CFRuntimeService((_a = param2 == null ? void 0 : param2.TxtEnDecoder) != null ? _a : my._txtEnDe),
|
2284
|
+
...param2
|
2285
|
+
});
|
2286
|
+
}
|
2287
|
+
|
2288
|
+
// src/deno/deno-basic-sys-abstraction.ts
|
2289
|
+
var DenoRuntimeService = class {
|
2290
|
+
constructor(ende) {
|
2291
|
+
this._txtEnDe = ende;
|
2292
|
+
}
|
2293
|
+
Env() {
|
2294
|
+
return envFactory();
|
2295
|
+
}
|
2296
|
+
Args() {
|
2297
|
+
return globalThis.Deno.args;
|
2298
|
+
}
|
2299
|
+
Stdout() {
|
2300
|
+
return globalThis.Deno.stdout.writable;
|
2301
|
+
}
|
2302
|
+
Stderr() {
|
2303
|
+
return globalThis.Deno.stderr.writable;
|
2306
2304
|
}
|
2307
2305
|
};
|
2306
|
+
var baseSysAbstraction3 = new ResolveOnce();
|
2307
|
+
function DenoBasicSysAbstraction(param2) {
|
2308
|
+
var _a;
|
2309
|
+
const my = baseSysAbstraction3.once(() => {
|
2310
|
+
return new BaseBasicSysAbstraction({
|
2311
|
+
TxtEnDecoder: (param2 == null ? void 0 : param2.TxtEnDecoder) || TxtEnDecoderSingleton()
|
2312
|
+
});
|
2313
|
+
});
|
2314
|
+
return new WrapperBasicSysAbstraction(my, {
|
2315
|
+
basicRuntimeService: new DenoRuntimeService((_a = param2 == null ? void 0 : param2.TxtEnDecoder) != null ? _a : my._txtEnDe),
|
2316
|
+
...param2
|
2317
|
+
});
|
2318
|
+
}
|
2308
2319
|
|
2309
|
-
// src/
|
2310
|
-
var
|
2311
|
-
|
2312
|
-
|
2313
|
-
|
2314
|
-
static None() {
|
2315
|
-
return new None();
|
2316
|
-
}
|
2317
|
-
static Is(t) {
|
2318
|
-
return t instanceof _Option;
|
2320
|
+
// src/node/node-basic-sys-abstraction.ts
|
2321
|
+
var NodeRuntimeService = class {
|
2322
|
+
constructor(ende) {
|
2323
|
+
this._txtEnDe = ende;
|
2324
|
+
this._gthis = globalThis;
|
2319
2325
|
}
|
2320
|
-
|
2321
|
-
|
2322
|
-
return new None();
|
2323
|
-
}
|
2324
|
-
return new Some(t);
|
2326
|
+
Env() {
|
2327
|
+
return envFactory();
|
2325
2328
|
}
|
2326
|
-
|
2327
|
-
return this.
|
2329
|
+
Args() {
|
2330
|
+
return this._gthis.process.argv;
|
2328
2331
|
}
|
2329
|
-
|
2330
|
-
return
|
2332
|
+
Stdout() {
|
2333
|
+
return new WritableStream({
|
2334
|
+
write: (chunk) => {
|
2335
|
+
this._gthis.process.stdout.write(chunk);
|
2336
|
+
}
|
2337
|
+
});
|
2331
2338
|
}
|
2332
|
-
|
2333
|
-
return
|
2339
|
+
Stderr() {
|
2340
|
+
return new WritableStream({
|
2341
|
+
write: (chunk) => {
|
2342
|
+
this._gthis.process.stderr.write(chunk);
|
2343
|
+
}
|
2344
|
+
});
|
2334
2345
|
}
|
2335
2346
|
};
|
2336
|
-
var
|
2337
|
-
|
2338
|
-
|
2339
|
-
|
2347
|
+
var baseSysAbstraction4 = new ResolveOnce();
|
2348
|
+
function NodeBasicSysAbstraction(param2) {
|
2349
|
+
var _a;
|
2350
|
+
const my = baseSysAbstraction4.once(() => {
|
2351
|
+
return new BaseBasicSysAbstraction({
|
2352
|
+
TxtEnDecoder: (param2 == null ? void 0 : param2.TxtEnDecoder) || TxtEnDecoderSingleton()
|
2353
|
+
});
|
2354
|
+
});
|
2355
|
+
return new WrapperBasicSysAbstraction(my, {
|
2356
|
+
basicRuntimeService: new NodeRuntimeService((_a = param2 == null ? void 0 : param2.TxtEnDecoder) != null ? _a : my._txtEnDe),
|
2357
|
+
...param2
|
2358
|
+
});
|
2359
|
+
}
|
2360
|
+
|
2361
|
+
// src/base-sys-abstraction.ts
|
2362
|
+
var SysTime = class extends Time {
|
2363
|
+
Now() {
|
2364
|
+
return /* @__PURE__ */ new Date();
|
2340
2365
|
}
|
2341
|
-
|
2342
|
-
return
|
2366
|
+
Sleep(duration) {
|
2367
|
+
return new Promise((resolve) => {
|
2368
|
+
setTimeout(() => {
|
2369
|
+
resolve();
|
2370
|
+
}, duration);
|
2371
|
+
});
|
2343
2372
|
}
|
2344
|
-
|
2345
|
-
|
2373
|
+
};
|
2374
|
+
var ConstTime = class extends Time {
|
2375
|
+
Now() {
|
2376
|
+
return new Date(2021, 1, 1, 0, 0, 0, 0);
|
2346
2377
|
}
|
2347
|
-
|
2348
|
-
|
2378
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2379
|
+
Sleep(duration) {
|
2380
|
+
return Promise.resolve();
|
2349
2381
|
}
|
2350
2382
|
};
|
2351
|
-
var
|
2352
|
-
|
2353
|
-
|
2383
|
+
var StepTime = class extends Time {
|
2384
|
+
constructor() {
|
2385
|
+
super();
|
2386
|
+
this._step = new ConstTime().Now();
|
2387
|
+
this._start = this._step;
|
2354
2388
|
}
|
2355
|
-
|
2356
|
-
|
2389
|
+
Now(steps = 1) {
|
2390
|
+
for (let i = 0; steps > 0 && i < steps; i++) {
|
2391
|
+
this._step = new Date(this._step.getTime() + 1e3);
|
2392
|
+
}
|
2393
|
+
if (steps < 1) {
|
2394
|
+
this._step = new Date(this._start.getTime() + steps * -1e3);
|
2395
|
+
}
|
2396
|
+
return this._step;
|
2357
2397
|
}
|
2358
|
-
|
2359
|
-
|
2398
|
+
Sleep(duration) {
|
2399
|
+
this._step = new Date(this._step.getTime() + duration);
|
2400
|
+
return Promise.resolve();
|
2360
2401
|
}
|
2361
2402
|
};
|
2362
|
-
|
2363
|
-
|
2364
|
-
|
2365
|
-
|
2366
|
-
|
2367
|
-
|
2368
|
-
|
2369
|
-
|
2403
|
+
function TimeFactory(timeMode) {
|
2404
|
+
switch (timeMode) {
|
2405
|
+
case TimeMode.REAL:
|
2406
|
+
return new SysTime();
|
2407
|
+
case TimeMode.CONST:
|
2408
|
+
return new ConstTime();
|
2409
|
+
case TimeMode.STEP:
|
2410
|
+
return new StepTime();
|
2370
2411
|
}
|
2371
|
-
|
2372
|
-
|
2373
|
-
|
2374
|
-
|
2412
|
+
return new SysTime();
|
2413
|
+
}
|
2414
|
+
var RandomService = class {
|
2415
|
+
constructor(mode) {
|
2416
|
+
this._step = 0;
|
2417
|
+
this._mode = mode;
|
2418
|
+
}
|
2419
|
+
Random0ToValue(value) {
|
2420
|
+
switch (this._mode) {
|
2421
|
+
case RandomMode.CONST:
|
2422
|
+
return 0.5 * value;
|
2423
|
+
case RandomMode.STEP:
|
2424
|
+
this._step += 1e-4;
|
2425
|
+
return this._step * value;
|
2426
|
+
case RandomMode.RANDOM:
|
2427
|
+
return Math.random() * value;
|
2428
|
+
default:
|
2429
|
+
throw new Error("Unknown RandomMode");
|
2375
2430
|
}
|
2376
|
-
this.forModules(
|
2377
|
-
level,
|
2378
|
-
(p) => {
|
2379
|
-
this._modules.set(p, /* @__PURE__ */ new Set([...this._globalLevels, level]));
|
2380
|
-
},
|
2381
|
-
...modules
|
2382
|
-
);
|
2383
2431
|
}
|
2384
|
-
|
2385
|
-
|
2386
|
-
|
2387
|
-
|
2432
|
+
};
|
2433
|
+
var IdService = class {
|
2434
|
+
constructor(mode) {
|
2435
|
+
this._step = 0;
|
2436
|
+
if (!mode) {
|
2437
|
+
mode = IDMode.UUID;
|
2388
2438
|
}
|
2389
|
-
this.
|
2390
|
-
level,
|
2391
|
-
(p) => {
|
2392
|
-
this._modules.delete(p);
|
2393
|
-
},
|
2394
|
-
...modules
|
2395
|
-
);
|
2439
|
+
this._mode = mode;
|
2396
2440
|
}
|
2397
|
-
|
2398
|
-
this.
|
2441
|
+
NextId() {
|
2442
|
+
switch (this._mode) {
|
2443
|
+
case IDMode.UUID:
|
2444
|
+
return crypto.randomUUID();
|
2445
|
+
case IDMode.CONST:
|
2446
|
+
return "VeryUniqueID";
|
2447
|
+
case IDMode.STEP:
|
2448
|
+
return `STEPId-${this._step++}`;
|
2449
|
+
default:
|
2450
|
+
throw new Error("Unknown IDMode");
|
2451
|
+
}
|
2399
2452
|
}
|
2400
|
-
|
2401
|
-
|
2453
|
+
};
|
2454
|
+
var BaseBasicSysAbstraction = class {
|
2455
|
+
constructor(params) {
|
2456
|
+
this._time = new SysTime();
|
2457
|
+
// system independent services
|
2458
|
+
this._idService = new IdService();
|
2459
|
+
this._randomService = new RandomService(RandomMode.RANDOM);
|
2460
|
+
this._txtEnDe = params.TxtEnDecoder;
|
2402
2461
|
}
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
2406
|
-
|
2407
|
-
|
2408
|
-
|
2409
|
-
for (const p of parts) {
|
2410
|
-
fnAction(p);
|
2411
|
-
}
|
2412
|
-
}
|
2462
|
+
};
|
2463
|
+
var BaseSysAbstraction = class extends BaseBasicSysAbstraction {
|
2464
|
+
constructor(params) {
|
2465
|
+
super(params);
|
2466
|
+
this._fileSystem = params.FileSystem;
|
2467
|
+
this._systemService = params.SystemService;
|
2413
2468
|
}
|
2414
|
-
|
2415
|
-
|
2416
|
-
|
2417
|
-
|
2418
|
-
|
2419
|
-
|
2420
|
-
|
2421
|
-
|
2469
|
+
};
|
2470
|
+
function BasicSysAbstractionFactory(params) {
|
2471
|
+
const fn = runtimeFn();
|
2472
|
+
switch (true) {
|
2473
|
+
case fn.isBrowser:
|
2474
|
+
return WebBasicSysAbstraction(params);
|
2475
|
+
case fn.isDeno:
|
2476
|
+
return DenoBasicSysAbstraction(params);
|
2477
|
+
case fn.isCFWorker:
|
2478
|
+
return CFBasicSysAbstraction(params);
|
2479
|
+
case fn.isNodeIsh:
|
2480
|
+
return NodeBasicSysAbstraction(params);
|
2481
|
+
default:
|
2482
|
+
throw new Error("Unknown runtime");
|
2422
2483
|
}
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2426
|
-
|
2427
|
-
|
2428
|
-
|
2429
|
-
|
2484
|
+
}
|
2485
|
+
var WrapperBasicSysAbstraction = class {
|
2486
|
+
constructor(base, params) {
|
2487
|
+
this._time = base._time;
|
2488
|
+
this._basicRuntimeService = params.basicRuntimeService;
|
2489
|
+
this._idService = base._idService;
|
2490
|
+
this._randomService = base._randomService;
|
2491
|
+
if (params.TimeMode) {
|
2492
|
+
this._time = TimeFactory(params.TimeMode);
|
2430
2493
|
}
|
2431
|
-
|
2432
|
-
|
2433
|
-
if (wlevel.has(level)) {
|
2434
|
-
return true;
|
2435
|
-
}
|
2494
|
+
if (params.IdMode) {
|
2495
|
+
this._idService = new IdService(params.IdMode);
|
2436
2496
|
}
|
2437
|
-
if (
|
2438
|
-
|
2497
|
+
if (params.RandomMode) {
|
2498
|
+
this._randomService = new RandomService(params.RandomMode);
|
2439
2499
|
}
|
2440
|
-
|
2500
|
+
}
|
2501
|
+
Time() {
|
2502
|
+
return this._time;
|
2503
|
+
}
|
2504
|
+
NextId() {
|
2505
|
+
return this._idService.NextId();
|
2506
|
+
}
|
2507
|
+
Random0ToValue(value) {
|
2508
|
+
return this._randomService.Random0ToValue(value);
|
2509
|
+
}
|
2510
|
+
Stdout() {
|
2511
|
+
return this._basicRuntimeService.Stdout();
|
2512
|
+
}
|
2513
|
+
Stderr() {
|
2514
|
+
return this._basicRuntimeService.Stderr();
|
2515
|
+
}
|
2516
|
+
Env() {
|
2517
|
+
return this._basicRuntimeService.Env();
|
2518
|
+
}
|
2519
|
+
Args() {
|
2520
|
+
return this._basicRuntimeService.Args();
|
2521
|
+
}
|
2522
|
+
// System(): SystemService {
|
2523
|
+
// return this._systemService;
|
2524
|
+
// }
|
2525
|
+
// FileSystem(): FileService {
|
2526
|
+
// return this._fileSystem;
|
2527
|
+
// }
|
2528
|
+
};
|
2529
|
+
var WrapperRuntimeSysAbstraction = class extends WrapperBasicSysAbstraction {
|
2530
|
+
constructor(base, params) {
|
2531
|
+
var _a, _b;
|
2532
|
+
super(base, params);
|
2533
|
+
this._systemService = (_a = params.systemService) != null ? _a : base._systemService;
|
2534
|
+
this._fileSystem = (_b = params.fileSystem) != null ? _b : base._fileSystem;
|
2535
|
+
}
|
2536
|
+
System() {
|
2537
|
+
return this._systemService;
|
2538
|
+
}
|
2539
|
+
FileSystem() {
|
2540
|
+
return this._fileSystem;
|
2441
2541
|
}
|
2442
2542
|
};
|
2443
|
-
var levelSingleton = new LevelHandlerImpl();
|
2444
|
-
function LevelHandlerSingleton() {
|
2445
|
-
return levelSingleton;
|
2446
|
-
}
|
2447
2543
|
|
2448
2544
|
// src/logger-impl.ts
|
2449
2545
|
function getLen(value, lvs) {
|
@@ -2504,7 +2600,7 @@ var LoggerImpl = class _LoggerImpl {
|
|
2504
2600
|
params = {};
|
2505
2601
|
}
|
2506
2602
|
if (!params.sys) {
|
2507
|
-
this._sys =
|
2603
|
+
this._sys = BasicSysAbstractionFactory();
|
2508
2604
|
} else {
|
2509
2605
|
this._sys = params.sys;
|
2510
2606
|
}
|
@@ -2522,18 +2618,7 @@ var LoggerImpl = class _LoggerImpl {
|
|
2522
2618
|
this._logWriter = params.logWriter;
|
2523
2619
|
} else {
|
2524
2620
|
if (!params.out) {
|
2525
|
-
|
2526
|
-
let stream;
|
2527
|
-
if (rt.isBrowser) {
|
2528
|
-
stream = new ConsoleWriterStream();
|
2529
|
-
} else {
|
2530
|
-
if (rt.isNodeIsh || rt.isReactNative || rt.isDeno || rt.isCFWorker) {
|
2531
|
-
stream = this._sys.Stdout();
|
2532
|
-
} else {
|
2533
|
-
throw new Error("No output defined for runtime");
|
2534
|
-
}
|
2535
|
-
}
|
2536
|
-
this._logWriter = new LogWriterStream(stream);
|
2621
|
+
this._logWriter = new LogWriterStream(this._sys.Stdout());
|
2537
2622
|
} else {
|
2538
2623
|
this._logWriter = new LogWriterStream(params.out);
|
2539
2624
|
}
|
@@ -3713,7 +3798,9 @@ function UInt8ArrayEqual(a, b) {
|
|
3713
3798
|
}
|
3714
3799
|
// Annotate the CommonJS export names for ESM import in node:
|
3715
3800
|
0 && (module.exports = {
|
3801
|
+
BaseBasicSysAbstraction,
|
3716
3802
|
BaseSysAbstraction,
|
3803
|
+
BasicSysAbstractionFactory,
|
3717
3804
|
BuildURI,
|
3718
3805
|
ConstTime,
|
3719
3806
|
EnvImpl,
|
@@ -3762,7 +3849,8 @@ function UInt8ArrayEqual(a, b) {
|
|
3762
3849
|
TxtEnDecoderSingleton,
|
3763
3850
|
URI,
|
3764
3851
|
VERSION,
|
3765
|
-
|
3852
|
+
WrapperBasicSysAbstraction,
|
3853
|
+
WrapperRuntimeSysAbstraction,
|
3766
3854
|
YAMLFormatter,
|
3767
3855
|
asyncLogValue,
|
3768
3856
|
bin2string,
|