@adviser/cement 0.3.2 → 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 -273
- package/cf/index.cjs.map +1 -1
- package/cf/index.d.cts +3 -16
- package/cf/index.d.ts +3 -16
- package/cf/index.js +39 -6
- package/cf/index.js.map +1 -1
- package/{chunk-R2EEZNZN.js → chunk-5GJADB3C.js} +8 -6
- package/{chunk-R2EEZNZN.js.map → chunk-5GJADB3C.js.map} +1 -1
- package/chunk-MFC4AD5O.js +88 -0
- package/chunk-MFC4AD5O.js.map +1 -0
- package/{chunk-DZPKZQIT.js → chunk-OQ4NGEJR.js} +58 -502
- package/chunk-OQ4NGEJR.js.map +1 -0
- package/deno/index.cjs +86 -165
- 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 +102 -265
- 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 +55 -134
- 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 -45
- 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 +72 -235
- 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 -14
- package/ts/cf/cf-sys-abstraction.d.ts.map +1 -1
- package/ts/cf/cf-sys-abstraction.js +0 -42
- 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 +63 -238
- 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-DZPKZQIT.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,111 +816,73 @@ 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 {
|
858
|
+
constructor(env) {
|
859
|
+
this.injectOnRegister = {};
|
860
|
+
this.cfEnv = new Map(Object.entries(env.presetEnv || {}));
|
861
|
+
}
|
1011
862
|
static new(opts) {
|
1012
|
-
return
|
863
|
+
return once4.once(() => new _CFEnvActions(opts));
|
1013
864
|
}
|
1014
865
|
static inject(o) {
|
1015
|
-
var _a;
|
1016
866
|
const env = _CFEnvActions.new({});
|
1017
867
|
for (const key2 in o) {
|
1018
868
|
const value = o[key2];
|
1019
869
|
if (typeof value === "string") {
|
1020
|
-
(
|
870
|
+
if (env.env) {
|
871
|
+
env.env.set(key2, value);
|
872
|
+
} else {
|
873
|
+
env.injectOnRegister[key2] = value;
|
874
|
+
}
|
1021
875
|
}
|
1022
876
|
}
|
1023
877
|
}
|
1024
|
-
constructor(env) {
|
1025
|
-
this.cfEnv = new Map(Object.entries(env.presetEnv || {}));
|
1026
|
-
}
|
1027
878
|
active() {
|
1028
879
|
return runtimeFn().isCFWorker;
|
1029
880
|
}
|
1030
881
|
register(env) {
|
1031
882
|
this.env = env;
|
883
|
+
for (const key2 in this.injectOnRegister) {
|
884
|
+
env.set(key2, this.injectOnRegister[key2]);
|
885
|
+
}
|
1032
886
|
return env;
|
1033
887
|
}
|
1034
888
|
get(key2) {
|
@@ -1073,12 +927,12 @@ function envFactory(opts = {}) {
|
|
1073
927
|
}
|
1074
928
|
return _envFactories.get(found.id).once(() => {
|
1075
929
|
const action = found.fn(opts);
|
1076
|
-
const ret = new
|
930
|
+
const ret = new EnvImpl(action, opts);
|
1077
931
|
action.register(ret);
|
1078
932
|
return ret;
|
1079
933
|
});
|
1080
934
|
}
|
1081
|
-
var
|
935
|
+
var EnvImpl = class {
|
1082
936
|
constructor(map, opts = {}) {
|
1083
937
|
this._onSet = [];
|
1084
938
|
this._map = map;
|
@@ -1146,40 +1000,23 @@ var EnvImpl2 = class {
|
|
1146
1000
|
}
|
1147
1001
|
};
|
1148
1002
|
|
1149
|
-
// src/
|
1150
|
-
var
|
1151
|
-
var
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
}
|
1156
|
-
static new(opts) {
|
1157
|
-
return once4.once(() => new _BrowserEnvActions(opts));
|
1158
|
-
}
|
1159
|
-
get(key2) {
|
1160
|
-
return this.env.get(key2);
|
1161
|
-
}
|
1162
|
-
set(key2, value) {
|
1163
|
-
if (value) {
|
1164
|
-
this.env.set(key2, value);
|
1165
|
-
}
|
1166
|
-
}
|
1167
|
-
delete(key2) {
|
1168
|
-
this.env.delete(key2);
|
1169
|
-
}
|
1170
|
-
keys() {
|
1171
|
-
return Array.from(this.env.keys());
|
1172
|
-
}
|
1173
|
-
active() {
|
1174
|
-
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);
|
1175
1009
|
}
|
1176
|
-
|
1177
|
-
|
1178
|
-
const browser = globalThis;
|
1179
|
-
browser[sym] = env;
|
1180
|
-
return env;
|
1010
|
+
decode(data) {
|
1011
|
+
return decoder.decode(data);
|
1181
1012
|
}
|
1182
1013
|
};
|
1014
|
+
var utf8EnDecoder = new Utf8EnDecoder();
|
1015
|
+
function Utf8EnDecoderSingleton() {
|
1016
|
+
return utf8EnDecoder;
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
// src/web/web-sys-abstraction.ts
|
1183
1020
|
var WebFileService = class {
|
1184
1021
|
get baseDir() {
|
1185
1022
|
throw new Error("basedir-Method not implemented.");
|
@@ -1390,23 +1227,23 @@ var Path = class {
|
|
1390
1227
|
this.parts.push(part);
|
1391
1228
|
}
|
1392
1229
|
};
|
1393
|
-
function splitPath(
|
1230
|
+
function splitPath(path) {
|
1394
1231
|
const p = new Path();
|
1395
|
-
if (
|
1232
|
+
if (path === "") {
|
1396
1233
|
return p;
|
1397
1234
|
}
|
1398
|
-
for (let count = 0;
|
1399
|
-
if (
|
1235
|
+
for (let count = 0; path.length; count++) {
|
1236
|
+
if (path.match(/^\/+/)) {
|
1400
1237
|
if (count === 0) {
|
1401
1238
|
p.add(3 /* Root */);
|
1402
1239
|
} else {
|
1403
1240
|
p.add(1 /* Slash */);
|
1404
1241
|
}
|
1405
|
-
|
1242
|
+
path = path.replace(/^\/+/, "");
|
1406
1243
|
} else {
|
1407
|
-
const part =
|
1244
|
+
const part = path.replace(/\/.*$/, "");
|
1408
1245
|
p.add(part);
|
1409
|
-
|
1246
|
+
path = path.replace(/^[^/]+/, "");
|
1410
1247
|
}
|
1411
1248
|
}
|
1412
1249
|
return p;
|
@@ -1415,29 +1252,29 @@ function pathJoin(...paths) {
|
|
1415
1252
|
let prev = "";
|
1416
1253
|
const res = [];
|
1417
1254
|
for (let i = 0; i < paths.length; i++) {
|
1418
|
-
const
|
1419
|
-
if (
|
1255
|
+
const path = paths[i];
|
1256
|
+
if (path === "") {
|
1420
1257
|
continue;
|
1421
1258
|
}
|
1422
|
-
if (!(prev.endsWith("/") ||
|
1259
|
+
if (!(prev.endsWith("/") || path.startsWith("/"))) {
|
1423
1260
|
if (prev !== "") {
|
1424
1261
|
res.push("/");
|
1425
1262
|
}
|
1426
|
-
res.push(
|
1263
|
+
res.push(path);
|
1427
1264
|
} else {
|
1428
|
-
res.push(
|
1265
|
+
res.push(path);
|
1429
1266
|
}
|
1430
|
-
prev =
|
1267
|
+
prev = path;
|
1431
1268
|
}
|
1432
1269
|
return res.join("");
|
1433
1270
|
}
|
1434
|
-
function relativePath(
|
1435
|
-
const relativeParts = splitPath(
|
1271
|
+
function relativePath(path, relative) {
|
1272
|
+
const relativeParts = splitPath(relative);
|
1436
1273
|
let result;
|
1437
1274
|
if (relativeParts.parts[0] === 3 /* Root */) {
|
1438
|
-
result =
|
1275
|
+
result = relative;
|
1439
1276
|
} else {
|
1440
|
-
result = pathJoin(
|
1277
|
+
result = pathJoin(path, relative);
|
1441
1278
|
}
|
1442
1279
|
const unoptPath = splitPath(result);
|
1443
1280
|
const out = [];
|
@@ -1489,12 +1326,12 @@ function stripper(strip, obj) {
|
|
1489
1326
|
});
|
1490
1327
|
return localStripper(void 0, restrips, obj);
|
1491
1328
|
}
|
1492
|
-
function localStripper(
|
1329
|
+
function localStripper(path, restrips, obj) {
|
1493
1330
|
if (typeof obj !== "object" || obj === null) {
|
1494
1331
|
return obj;
|
1495
1332
|
}
|
1496
1333
|
if (Array.isArray(obj)) {
|
1497
|
-
return obj.map((i) => localStripper(
|
1334
|
+
return obj.map((i) => localStripper(path, restrips, i));
|
1498
1335
|
}
|
1499
1336
|
const ret = { ...obj };
|
1500
1337
|
const matcher = (key2, nextPath) => {
|
@@ -1508,8 +1345,8 @@ function localStripper(path3, restrips, obj) {
|
|
1508
1345
|
for (const key2 in ret) {
|
1509
1346
|
if (Object.prototype.hasOwnProperty.call(ret, key2)) {
|
1510
1347
|
let nextPath;
|
1511
|
-
if (
|
1512
|
-
nextPath = [
|
1348
|
+
if (path) {
|
1349
|
+
nextPath = [path, key2].join(".");
|
1513
1350
|
} else {
|
1514
1351
|
nextPath = key2;
|
1515
1352
|
}
|
@@ -2538,8 +2375,8 @@ var LoggerImpl = class _LoggerImpl {
|
|
2538
2375
|
return this.Uint64(key2, value);
|
2539
2376
|
}
|
2540
2377
|
async Flush() {
|
2541
|
-
return new Promise((
|
2542
|
-
this._logWriter._flush(void 0,
|
2378
|
+
return new Promise((resolve) => {
|
2379
|
+
this._logWriter._flush(void 0, resolve);
|
2543
2380
|
});
|
2544
2381
|
}
|
2545
2382
|
With() {
|
@@ -2850,8 +2687,8 @@ function MockLogger(params) {
|
|
2850
2687
|
|
2851
2688
|
// src/tracer.ts
|
2852
2689
|
var Metric = class {
|
2853
|
-
constructor(
|
2854
|
-
this.path =
|
2690
|
+
constructor(path) {
|
2691
|
+
this.path = path;
|
2855
2692
|
}
|
2856
2693
|
set(value) {
|
2857
2694
|
this.value = value;
|
@@ -2886,23 +2723,23 @@ var Metrics = class {
|
|
2886
2723
|
return obj;
|
2887
2724
|
}
|
2888
2725
|
get(ipath) {
|
2889
|
-
const
|
2890
|
-
if (
|
2891
|
-
if (
|
2892
|
-
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}`);
|
2893
2730
|
}
|
2894
|
-
let metric = this.map.get(
|
2731
|
+
let metric = this.map.get(path);
|
2895
2732
|
if (!metric) {
|
2896
|
-
metric = new Metric(
|
2897
|
-
this.map.set(
|
2733
|
+
metric = new Metric(path);
|
2734
|
+
this.map.set(path, metric);
|
2898
2735
|
}
|
2899
|
-
this.spanRefs.set(
|
2736
|
+
this.spanRefs.set(path, metric);
|
2900
2737
|
return metric;
|
2901
|
-
} else if (
|
2902
|
-
throw new Error(`Metrics path must start with /:${
|
2738
|
+
} else if (path.includes("/")) {
|
2739
|
+
throw new Error(`Metrics path must start with /:${path}`);
|
2903
2740
|
}
|
2904
2741
|
const rootPath = this.tracenode.getRootPath();
|
2905
|
-
return this.get(`${rootPath}/${
|
2742
|
+
return this.get(`${rootPath}/${path}`);
|
2906
2743
|
}
|
2907
2744
|
};
|
2908
2745
|
var TraceNode = class _TraceNode {
|
@@ -3326,8 +3163,8 @@ function rebuffer(a, chunkSize) {
|
|
3326
3163
|
};
|
3327
3164
|
return new ReadableStream({
|
3328
3165
|
async pull(controller) {
|
3329
|
-
return new Promise((
|
3330
|
-
pump(state, controller,
|
3166
|
+
return new Promise((resolve) => {
|
3167
|
+
pump(state, controller, resolve);
|
3331
3168
|
});
|
3332
3169
|
}
|
3333
3170
|
});
|