@adviser/cement 0.3.3 → 0.3.4
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-CR_Z-Ceg.d.ts → base-sys-abstraction-B-PcaG0B.d.ts} +1 -1
- package/{base-sys-abstraction-DWtPI7Kg.d.cts → base-sys-abstraction-CLlfCI2Q.d.cts} +1 -1
- package/cf/index.cjs +100 -280
- package/cf/index.cjs.map +1 -1
- package/cf/index.d.cts +3 -17
- package/cf/index.d.ts +3 -17
- package/cf/index.js +39 -6
- package/cf/index.js.map +1 -1
- package/{chunk-PRCFKZR7.js → chunk-5GJADB3C.js} +8 -6
- package/{chunk-PRCFKZR7.js.map → chunk-5GJADB3C.js.map} +1 -1
- package/chunk-MFC4AD5O.js +88 -0
- package/chunk-MFC4AD5O.js.map +1 -0
- package/{chunk-P6LDM7PY.js → chunk-OQ4NGEJR.js} +46 -497
- package/chunk-OQ4NGEJR.js.map +1 -0
- package/deno/index.cjs +74 -160
- package/deno/index.cjs.map +1 -1
- package/deno/index.d.cts +3 -23
- package/deno/index.d.ts +3 -23
- package/deno/index.js +174 -8
- package/deno/index.js.map +1 -1
- package/{index-BfZxTAe_.d.cts → index-CI2cJ0-W.d.cts} +1 -1
- package/{index-CfSl8Gmj.d.ts → index-ChpAZoUE.d.ts} +1 -1
- package/index.cjs +90 -260
- package/index.cjs.map +1 -1
- package/index.d.cts +5 -5
- package/index.d.ts +5 -5
- package/index.js +7 -6
- package/index.js.map +1 -1
- package/node/index.cjs +43 -129
- package/node/index.cjs.map +1 -1
- package/node/index.d.cts +3 -16
- package/node/index.d.ts +3 -16
- package/node/index.js +179 -8
- package/node/index.js.map +1 -1
- package/package.json +1 -1
- package/src/cf/cf-env-actions.ts +53 -0
- package/src/cf/cf-sys-abstraction.ts +1 -53
- package/src/deno/deno-env-actions.ts +57 -0
- package/src/deno/deno-sys-abstraction.ts +1 -57
- package/src/jsr.json +1 -1
- package/src/node/node-env-actions.ts +45 -0
- package/src/node/node-sys-abstraction.ts +1 -45
- package/src/sys-env.ts +4 -4
- package/src/web/web-env-actions.ts +41 -0
- package/src/web/web-sys-abstraction.ts +1 -41
- package/{sys-abstraction-GNnBj2sz.d.cts → sys-abstraction-Coxu8BjZ.d.cts} +1 -1
- package/{sys-abstraction-GNnBj2sz.d.ts → sys-abstraction-Coxu8BjZ.d.ts} +1 -1
- package/test/index.cjs +60 -230
- 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 +3 -2
- package/ts/cf/cf-env-actions.d.ts +16 -0
- package/ts/cf/cf-env-actions.d.ts.map +1 -0
- package/ts/cf/cf-env-actions.js +51 -0
- package/ts/cf/cf-env-actions.js.map +1 -0
- package/ts/cf/cf-sys-abstraction.d.ts +1 -15
- package/ts/cf/cf-sys-abstraction.d.ts.map +1 -1
- package/ts/cf/cf-sys-abstraction.js +0 -50
- package/ts/cf/cf-sys-abstraction.js.map +1 -1
- package/ts/crypto.test.js +8 -1
- package/ts/crypto.test.js.map +1 -1
- package/ts/deno/deno-env-actions.d.ts +23 -0
- package/ts/deno/deno-env-actions.d.ts.map +1 -0
- package/ts/deno/deno-env-actions.js +46 -0
- package/ts/deno/deno-env-actions.js.map +1 -0
- package/ts/deno/deno-sys-abstraction.d.ts +1 -22
- package/ts/deno/deno-sys-abstraction.d.ts.map +1 -1
- package/ts/deno/deno-sys-abstraction.js +0 -45
- package/ts/deno/deno-sys-abstraction.js.map +1 -1
- package/ts/node/node-env-actions.d.ts +15 -0
- package/ts/node/node-env-actions.d.ts.map +1 -0
- package/ts/node/node-env-actions.js +44 -0
- package/ts/node/node-env-actions.js.map +1 -0
- package/ts/node/node-sys-abstraction.d.ts +1 -14
- package/ts/node/node-sys-abstraction.d.ts.map +1 -1
- package/ts/node/node-sys-abstraction.js +0 -43
- package/ts/node/node-sys-abstraction.js.map +1 -1
- package/ts/sys-env.js +4 -4
- package/ts/sys-env.js.map +1 -1
- package/ts/sys-env.test.js +2 -2
- package/ts/sys-env.test.js.map +1 -1
- package/ts/web/web-env-actions.d.ts +14 -0
- package/ts/web/web-env-actions.d.ts.map +1 -0
- package/ts/web/web-env-actions.js +35 -0
- package/ts/web/web-env-actions.js.map +1 -0
- package/ts/web/web-sys-abstraction.d.ts +0 -13
- package/ts/web/web-sys-abstraction.d.ts.map +1 -1
- package/ts/web/web-sys-abstraction.js +0 -34
- package/ts/web/web-sys-abstraction.js.map +1 -1
- package/web/index.cjs +51 -233
- package/web/index.cjs.map +1 -1
- package/web/index.d.cts +3 -15
- package/web/index.d.ts +3 -15
- package/web/index.js +2 -3
- package/chunk-P6LDM7PY.js.map +0 -1
package/index.cjs
CHANGED
@@ -40,7 +40,7 @@ __export(src_exports, {
|
|
40
40
|
BaseSysAbstraction: () => BaseSysAbstraction,
|
41
41
|
BuildURI: () => BuildURI,
|
42
42
|
ConstTime: () => ConstTime,
|
43
|
-
EnvImpl: () =>
|
43
|
+
EnvImpl: () => EnvImpl,
|
44
44
|
Future: () => Future,
|
45
45
|
HeadersImpl: () => HeadersImpl,
|
46
46
|
HttpHeader: () => HttpHeader,
|
@@ -348,9 +348,9 @@ var SysTime = class extends Time {
|
|
348
348
|
return /* @__PURE__ */ new Date();
|
349
349
|
}
|
350
350
|
Sleep(duration) {
|
351
|
-
return new Promise((
|
351
|
+
return new Promise((resolve) => {
|
352
352
|
setTimeout(() => {
|
353
|
-
|
353
|
+
resolve();
|
354
354
|
}, duration);
|
355
355
|
});
|
356
356
|
}
|
@@ -540,8 +540,8 @@ var Future = class {
|
|
540
540
|
__privateAdd(this, _rejectFn, () => {
|
541
541
|
throw new Error("This Promise is not working as expected.");
|
542
542
|
});
|
543
|
-
__privateSet(this, _promise, new Promise((
|
544
|
-
__privateSet(this, _resolveFn,
|
543
|
+
__privateSet(this, _promise, new Promise((resolve, reject) => {
|
544
|
+
__privateSet(this, _resolveFn, resolve);
|
545
545
|
__privateSet(this, _rejectFn, reject);
|
546
546
|
}));
|
547
547
|
}
|
@@ -737,28 +737,7 @@ function runtimeFn() {
|
|
737
737
|
};
|
738
738
|
}
|
739
739
|
|
740
|
-
// src/
|
741
|
-
var encoder = new TextEncoder();
|
742
|
-
var decoder = new TextDecoder();
|
743
|
-
var Utf8EnDecoder = class {
|
744
|
-
encode(str) {
|
745
|
-
return encoder.encode(str);
|
746
|
-
}
|
747
|
-
decode(data) {
|
748
|
-
return decoder.decode(data);
|
749
|
-
}
|
750
|
-
};
|
751
|
-
var utf8EnDecoder = new Utf8EnDecoder();
|
752
|
-
function Utf8EnDecoderSingleton() {
|
753
|
-
return utf8EnDecoder;
|
754
|
-
}
|
755
|
-
|
756
|
-
// src/deno/deno-file-service.ts
|
757
|
-
var path = __toESM(require("path"), 1);
|
758
|
-
var Deno = globalThis.Deno;
|
759
|
-
|
760
|
-
// src/deno/deno-sys-abstraction.ts
|
761
|
-
var Deno2 = globalThis.Deno;
|
740
|
+
// src/deno/deno-env-actions.ts
|
762
741
|
var once = new ResolveOnce();
|
763
742
|
var _deno;
|
764
743
|
var _DenoEnvActions = class _DenoEnvActions {
|
@@ -798,95 +777,8 @@ var _DenoEnvActions = class _DenoEnvActions {
|
|
798
777
|
};
|
799
778
|
_deno = new WeakMap();
|
800
779
|
var DenoEnvActions = _DenoEnvActions;
|
801
|
-
var DenoExitServiceImpl = class {
|
802
|
-
constructor() {
|
803
|
-
this._exitHandlers = [];
|
804
|
-
this.invoked = false;
|
805
|
-
this._handleExit = async () => {
|
806
|
-
if (this.invoked) {
|
807
|
-
return;
|
808
|
-
}
|
809
|
-
this.invoked = true;
|
810
|
-
for (const h of this._exitHandlers) {
|
811
|
-
try {
|
812
|
-
const ret = h.hdl();
|
813
|
-
if (typeof ret.then === "function") {
|
814
|
-
await ret;
|
815
|
-
}
|
816
|
-
} finally {
|
817
|
-
}
|
818
|
-
}
|
819
|
-
};
|
820
|
-
globalThis.addEventListener("unhandledrejection", (e) => {
|
821
|
-
e.preventDefault();
|
822
|
-
this.exit(19);
|
823
|
-
});
|
824
|
-
globalThis.addEventListener("error", () => {
|
825
|
-
this.exit(19);
|
826
|
-
});
|
827
|
-
globalThis.addEventListener("uncaughtException", () => {
|
828
|
-
this.exit(19);
|
829
|
-
});
|
830
|
-
globalThis.addEventListener("unload", () => {
|
831
|
-
this.exit(0);
|
832
|
-
});
|
833
|
-
Deno2.addSignalListener("SIGQUIT", () => {
|
834
|
-
this.exit(3);
|
835
|
-
});
|
836
|
-
Deno2.addSignalListener("SIGINT", () => {
|
837
|
-
this.exit(2);
|
838
|
-
});
|
839
|
-
Deno2.addSignalListener("SIGTERM", () => {
|
840
|
-
this.exit(9);
|
841
|
-
});
|
842
|
-
}
|
843
|
-
injectExitHandlers(hdls) {
|
844
|
-
this._exitHandlers = hdls;
|
845
|
-
}
|
846
|
-
exit(code) {
|
847
|
-
this._handleExit().then(() => {
|
848
|
-
Deno2.exit(code);
|
849
|
-
}).catch((err) => {
|
850
|
-
console.error("ExitService: failed to handle exit", err);
|
851
|
-
Deno2.exit(code);
|
852
|
-
});
|
853
|
-
}
|
854
|
-
};
|
855
|
-
var _DenoSystemService = class _DenoSystemService {
|
856
|
-
constructor() {
|
857
|
-
this._exitService = new DenoExitServiceImpl();
|
858
|
-
this._exitService.injectExitHandlers(_DenoSystemService._exitHandlers);
|
859
|
-
}
|
860
|
-
Env() {
|
861
|
-
return envFactory();
|
862
|
-
}
|
863
|
-
Args() {
|
864
|
-
return Deno2.args;
|
865
|
-
}
|
866
|
-
OnExit(hdl) {
|
867
|
-
const id = crypto.randomUUID();
|
868
|
-
_DenoSystemService._exitHandlers.push({ hdl, id });
|
869
|
-
return () => {
|
870
|
-
const idx = _DenoSystemService._exitHandlers.findIndex((h) => h.id === id);
|
871
|
-
if (idx >= 0) {
|
872
|
-
_DenoSystemService._exitHandlers.splice(idx, 1);
|
873
|
-
}
|
874
|
-
};
|
875
|
-
}
|
876
|
-
Exit(code) {
|
877
|
-
this._exitService.exit(code);
|
878
|
-
}
|
879
|
-
};
|
880
|
-
_DenoSystemService._exitHandlers = [];
|
881
|
-
var DenoSystemService = _DenoSystemService;
|
882
|
-
|
883
|
-
// src/node/node-file-service.ts
|
884
|
-
var import_node_path = __toESM(require("path"), 1);
|
885
|
-
var import_node_fs = __toESM(require("fs"), 1);
|
886
|
-
var import_node_process = __toESM(require("process"), 1);
|
887
780
|
|
888
|
-
// src/node/node-
|
889
|
-
var import_node_process2 = __toESM(require("process"), 1);
|
781
|
+
// src/node/node-env-actions.ts
|
890
782
|
var once2 = new ResolveOnce();
|
891
783
|
var _node;
|
892
784
|
var _NodeEnvActions = class _NodeEnvActions {
|
@@ -924,96 +816,51 @@ var _NodeEnvActions = class _NodeEnvActions {
|
|
924
816
|
};
|
925
817
|
_node = new WeakMap();
|
926
818
|
var NodeEnvActions = _NodeEnvActions;
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
}
|
935
|
-
this.invoked = true;
|
936
|
-
for (const h of this._exitHandlers) {
|
937
|
-
try {
|
938
|
-
const ret = h.hdl();
|
939
|
-
if (typeof ret.then === "function") {
|
940
|
-
await ret;
|
941
|
-
}
|
942
|
-
} finally {
|
943
|
-
}
|
944
|
-
}
|
945
|
-
};
|
946
|
-
import_node_process2.default.on("unhandledRejection", (reason, p) => {
|
947
|
-
this.exit(19);
|
948
|
-
});
|
949
|
-
import_node_process2.default.on("uncaughtException", (error) => {
|
950
|
-
this.exit(18);
|
951
|
-
});
|
952
|
-
import_node_process2.default.on("close", () => {
|
953
|
-
this.exit(0);
|
954
|
-
});
|
955
|
-
import_node_process2.default.on("exit", () => {
|
956
|
-
this.exit(0);
|
957
|
-
});
|
958
|
-
import_node_process2.default.on("SIGQUIT", () => {
|
959
|
-
this.exit(3);
|
960
|
-
});
|
961
|
-
import_node_process2.default.on("SIGINT", () => {
|
962
|
-
this.exit(2);
|
963
|
-
});
|
964
|
-
import_node_process2.default.on("SIGTERM", () => {
|
965
|
-
this.exit(9);
|
966
|
-
});
|
819
|
+
|
820
|
+
// src/web/web-env-actions.ts
|
821
|
+
var once3 = new ResolveOnce();
|
822
|
+
var BrowserEnvActions = class _BrowserEnvActions {
|
823
|
+
constructor(opts) {
|
824
|
+
this.env = /* @__PURE__ */ new Map();
|
825
|
+
this.opts = opts;
|
967
826
|
}
|
968
|
-
|
969
|
-
|
827
|
+
static new(opts) {
|
828
|
+
return once3.once(() => new _BrowserEnvActions(opts));
|
970
829
|
}
|
971
|
-
|
972
|
-
this.
|
973
|
-
import_node_process2.default.exit(code);
|
974
|
-
}).catch((err) => {
|
975
|
-
console.error("ExitService: failed to handle exit", err);
|
976
|
-
import_node_process2.default.exit(code);
|
977
|
-
});
|
830
|
+
get(key2) {
|
831
|
+
return this.env.get(key2);
|
978
832
|
}
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
this._exitService.injectExitHandlers(_NodeSystemService._exitHandlers);
|
833
|
+
set(key2, value) {
|
834
|
+
if (value) {
|
835
|
+
this.env.set(key2, value);
|
836
|
+
}
|
984
837
|
}
|
985
|
-
|
986
|
-
|
838
|
+
delete(key2) {
|
839
|
+
this.env.delete(key2);
|
987
840
|
}
|
988
|
-
|
989
|
-
return
|
841
|
+
keys() {
|
842
|
+
return Array.from(this.env.keys());
|
990
843
|
}
|
991
|
-
|
992
|
-
|
993
|
-
_NodeSystemService._exitHandlers.push({ hdl, id });
|
994
|
-
return () => {
|
995
|
-
const idx = _NodeSystemService._exitHandlers.findIndex((h) => h.id === id);
|
996
|
-
if (idx >= 0) {
|
997
|
-
_NodeSystemService._exitHandlers.splice(idx, 1);
|
998
|
-
}
|
999
|
-
};
|
844
|
+
active() {
|
845
|
+
return true;
|
1000
846
|
}
|
1001
|
-
|
1002
|
-
this.
|
847
|
+
register(env) {
|
848
|
+
const sym = Symbol.for(this.opts.symbol || "CP_ENV");
|
849
|
+
const browser = globalThis;
|
850
|
+
browser[sym] = env;
|
851
|
+
return env;
|
1003
852
|
}
|
1004
853
|
};
|
1005
|
-
_NodeSystemService._exitHandlers = [];
|
1006
|
-
var NodeSystemService = _NodeSystemService;
|
1007
854
|
|
1008
|
-
// src/cf/cf-
|
1009
|
-
var
|
855
|
+
// src/cf/cf-env-actions.ts
|
856
|
+
var once4 = new ResolveOnce();
|
1010
857
|
var CFEnvActions = class _CFEnvActions {
|
1011
858
|
constructor(env) {
|
1012
859
|
this.injectOnRegister = {};
|
1013
860
|
this.cfEnv = new Map(Object.entries(env.presetEnv || {}));
|
1014
861
|
}
|
1015
862
|
static new(opts) {
|
1016
|
-
return
|
863
|
+
return once4.once(() => new _CFEnvActions(opts));
|
1017
864
|
}
|
1018
865
|
static inject(o) {
|
1019
866
|
const env = _CFEnvActions.new({});
|
@@ -1080,12 +927,12 @@ function envFactory(opts = {}) {
|
|
1080
927
|
}
|
1081
928
|
return _envFactories.get(found.id).once(() => {
|
1082
929
|
const action = found.fn(opts);
|
1083
|
-
const ret = new
|
930
|
+
const ret = new EnvImpl(action, opts);
|
1084
931
|
action.register(ret);
|
1085
932
|
return ret;
|
1086
933
|
});
|
1087
934
|
}
|
1088
|
-
var
|
935
|
+
var EnvImpl = class {
|
1089
936
|
constructor(map, opts = {}) {
|
1090
937
|
this._onSet = [];
|
1091
938
|
this._map = map;
|
@@ -1153,40 +1000,23 @@ var EnvImpl2 = class {
|
|
1153
1000
|
}
|
1154
1001
|
};
|
1155
1002
|
|
1156
|
-
// src/
|
1157
|
-
var
|
1158
|
-
var
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
}
|
1163
|
-
static new(opts) {
|
1164
|
-
return once4.once(() => new _BrowserEnvActions(opts));
|
1165
|
-
}
|
1166
|
-
get(key2) {
|
1167
|
-
return this.env.get(key2);
|
1168
|
-
}
|
1169
|
-
set(key2, value) {
|
1170
|
-
if (value) {
|
1171
|
-
this.env.set(key2, value);
|
1172
|
-
}
|
1173
|
-
}
|
1174
|
-
delete(key2) {
|
1175
|
-
this.env.delete(key2);
|
1176
|
-
}
|
1177
|
-
keys() {
|
1178
|
-
return Array.from(this.env.keys());
|
1179
|
-
}
|
1180
|
-
active() {
|
1181
|
-
return true;
|
1003
|
+
// src/txt-en-decoder.ts
|
1004
|
+
var encoder = new TextEncoder();
|
1005
|
+
var decoder = new TextDecoder();
|
1006
|
+
var Utf8EnDecoder = class {
|
1007
|
+
encode(str) {
|
1008
|
+
return encoder.encode(str);
|
1182
1009
|
}
|
1183
|
-
|
1184
|
-
|
1185
|
-
const browser = globalThis;
|
1186
|
-
browser[sym] = env;
|
1187
|
-
return env;
|
1010
|
+
decode(data) {
|
1011
|
+
return decoder.decode(data);
|
1188
1012
|
}
|
1189
1013
|
};
|
1014
|
+
var utf8EnDecoder = new Utf8EnDecoder();
|
1015
|
+
function Utf8EnDecoderSingleton() {
|
1016
|
+
return utf8EnDecoder;
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
// src/web/web-sys-abstraction.ts
|
1190
1020
|
var WebFileService = class {
|
1191
1021
|
get baseDir() {
|
1192
1022
|
throw new Error("basedir-Method not implemented.");
|
@@ -1397,23 +1227,23 @@ var Path = class {
|
|
1397
1227
|
this.parts.push(part);
|
1398
1228
|
}
|
1399
1229
|
};
|
1400
|
-
function splitPath(
|
1230
|
+
function splitPath(path) {
|
1401
1231
|
const p = new Path();
|
1402
|
-
if (
|
1232
|
+
if (path === "") {
|
1403
1233
|
return p;
|
1404
1234
|
}
|
1405
|
-
for (let count = 0;
|
1406
|
-
if (
|
1235
|
+
for (let count = 0; path.length; count++) {
|
1236
|
+
if (path.match(/^\/+/)) {
|
1407
1237
|
if (count === 0) {
|
1408
1238
|
p.add(3 /* Root */);
|
1409
1239
|
} else {
|
1410
1240
|
p.add(1 /* Slash */);
|
1411
1241
|
}
|
1412
|
-
|
1242
|
+
path = path.replace(/^\/+/, "");
|
1413
1243
|
} else {
|
1414
|
-
const part =
|
1244
|
+
const part = path.replace(/\/.*$/, "");
|
1415
1245
|
p.add(part);
|
1416
|
-
|
1246
|
+
path = path.replace(/^[^/]+/, "");
|
1417
1247
|
}
|
1418
1248
|
}
|
1419
1249
|
return p;
|
@@ -1422,29 +1252,29 @@ function pathJoin(...paths) {
|
|
1422
1252
|
let prev = "";
|
1423
1253
|
const res = [];
|
1424
1254
|
for (let i = 0; i < paths.length; i++) {
|
1425
|
-
const
|
1426
|
-
if (
|
1255
|
+
const path = paths[i];
|
1256
|
+
if (path === "") {
|
1427
1257
|
continue;
|
1428
1258
|
}
|
1429
|
-
if (!(prev.endsWith("/") ||
|
1259
|
+
if (!(prev.endsWith("/") || path.startsWith("/"))) {
|
1430
1260
|
if (prev !== "") {
|
1431
1261
|
res.push("/");
|
1432
1262
|
}
|
1433
|
-
res.push(
|
1263
|
+
res.push(path);
|
1434
1264
|
} else {
|
1435
|
-
res.push(
|
1265
|
+
res.push(path);
|
1436
1266
|
}
|
1437
|
-
prev =
|
1267
|
+
prev = path;
|
1438
1268
|
}
|
1439
1269
|
return res.join("");
|
1440
1270
|
}
|
1441
|
-
function relativePath(
|
1442
|
-
const relativeParts = splitPath(
|
1271
|
+
function relativePath(path, relative) {
|
1272
|
+
const relativeParts = splitPath(relative);
|
1443
1273
|
let result;
|
1444
1274
|
if (relativeParts.parts[0] === 3 /* Root */) {
|
1445
|
-
result =
|
1275
|
+
result = relative;
|
1446
1276
|
} else {
|
1447
|
-
result = pathJoin(
|
1277
|
+
result = pathJoin(path, relative);
|
1448
1278
|
}
|
1449
1279
|
const unoptPath = splitPath(result);
|
1450
1280
|
const out = [];
|
@@ -1496,12 +1326,12 @@ function stripper(strip, obj) {
|
|
1496
1326
|
});
|
1497
1327
|
return localStripper(void 0, restrips, obj);
|
1498
1328
|
}
|
1499
|
-
function localStripper(
|
1329
|
+
function localStripper(path, restrips, obj) {
|
1500
1330
|
if (typeof obj !== "object" || obj === null) {
|
1501
1331
|
return obj;
|
1502
1332
|
}
|
1503
1333
|
if (Array.isArray(obj)) {
|
1504
|
-
return obj.map((i) => localStripper(
|
1334
|
+
return obj.map((i) => localStripper(path, restrips, i));
|
1505
1335
|
}
|
1506
1336
|
const ret = { ...obj };
|
1507
1337
|
const matcher = (key2, nextPath) => {
|
@@ -1515,8 +1345,8 @@ function localStripper(path3, restrips, obj) {
|
|
1515
1345
|
for (const key2 in ret) {
|
1516
1346
|
if (Object.prototype.hasOwnProperty.call(ret, key2)) {
|
1517
1347
|
let nextPath;
|
1518
|
-
if (
|
1519
|
-
nextPath = [
|
1348
|
+
if (path) {
|
1349
|
+
nextPath = [path, key2].join(".");
|
1520
1350
|
} else {
|
1521
1351
|
nextPath = key2;
|
1522
1352
|
}
|
@@ -2545,8 +2375,8 @@ var LoggerImpl = class _LoggerImpl {
|
|
2545
2375
|
return this.Uint64(key2, value);
|
2546
2376
|
}
|
2547
2377
|
async Flush() {
|
2548
|
-
return new Promise((
|
2549
|
-
this._logWriter._flush(void 0,
|
2378
|
+
return new Promise((resolve) => {
|
2379
|
+
this._logWriter._flush(void 0, resolve);
|
2550
2380
|
});
|
2551
2381
|
}
|
2552
2382
|
With() {
|
@@ -2857,8 +2687,8 @@ function MockLogger(params) {
|
|
2857
2687
|
|
2858
2688
|
// src/tracer.ts
|
2859
2689
|
var Metric = class {
|
2860
|
-
constructor(
|
2861
|
-
this.path =
|
2690
|
+
constructor(path) {
|
2691
|
+
this.path = path;
|
2862
2692
|
}
|
2863
2693
|
set(value) {
|
2864
2694
|
this.value = value;
|
@@ -2893,23 +2723,23 @@ var Metrics = class {
|
|
2893
2723
|
return obj;
|
2894
2724
|
}
|
2895
2725
|
get(ipath) {
|
2896
|
-
const
|
2897
|
-
if (
|
2898
|
-
if (
|
2899
|
-
throw new Error(`Metrics path must contain value /:${
|
2726
|
+
const path = ipath.replace(/[/]+/g, "/").trim();
|
2727
|
+
if (path.startsWith("/")) {
|
2728
|
+
if (path.slice(1).length === 0) {
|
2729
|
+
throw new Error(`Metrics path must contain value /:${path}`);
|
2900
2730
|
}
|
2901
|
-
let metric = this.map.get(
|
2731
|
+
let metric = this.map.get(path);
|
2902
2732
|
if (!metric) {
|
2903
|
-
metric = new Metric(
|
2904
|
-
this.map.set(
|
2733
|
+
metric = new Metric(path);
|
2734
|
+
this.map.set(path, metric);
|
2905
2735
|
}
|
2906
|
-
this.spanRefs.set(
|
2736
|
+
this.spanRefs.set(path, metric);
|
2907
2737
|
return metric;
|
2908
|
-
} else if (
|
2909
|
-
throw new Error(`Metrics path must start with /:${
|
2738
|
+
} else if (path.includes("/")) {
|
2739
|
+
throw new Error(`Metrics path must start with /:${path}`);
|
2910
2740
|
}
|
2911
2741
|
const rootPath = this.tracenode.getRootPath();
|
2912
|
-
return this.get(`${rootPath}/${
|
2742
|
+
return this.get(`${rootPath}/${path}`);
|
2913
2743
|
}
|
2914
2744
|
};
|
2915
2745
|
var TraceNode = class _TraceNode {
|
@@ -3333,8 +3163,8 @@ function rebuffer(a, chunkSize) {
|
|
3333
3163
|
};
|
3334
3164
|
return new ReadableStream({
|
3335
3165
|
async pull(controller) {
|
3336
|
-
return new Promise((
|
3337
|
-
pump(state, controller,
|
3166
|
+
return new Promise((resolve) => {
|
3167
|
+
pump(state, controller, resolve);
|
3338
3168
|
});
|
3339
3169
|
}
|
3340
3170
|
});
|