@powerlines/deepkit 0.6.167 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/bin/deepkit-install.cjs +55 -90
  2. package/dist/capnp-BLx1WTBU.cjs +5175 -0
  3. package/dist/capnp-BiGNkOmV.mjs +4905 -0
  4. package/dist/capnp.cjs +47 -186
  5. package/dist/capnp.d.cts +78 -77
  6. package/dist/{capnp.d.ts → capnp.d.mts} +78 -77
  7. package/dist/capnp.mjs +3 -0
  8. package/dist/chunk-C0xms8kb.cjs +34 -0
  9. package/dist/esbuild-plugin.cjs +47 -11
  10. package/dist/esbuild-plugin.d.cts +20 -18
  11. package/dist/esbuild-plugin.d.mts +35 -0
  12. package/dist/esbuild-plugin.mjs +48 -0
  13. package/dist/index.cjs +69 -250
  14. package/dist/index.d.cts +10 -19
  15. package/dist/index.d.mts +10 -0
  16. package/dist/index.mjs +11 -0
  17. package/dist/reflect-type.cjs +24 -12
  18. package/dist/reflect-type.d.cts +7 -5
  19. package/dist/{reflect-type.d.ts → reflect-type.d.mts} +7 -5
  20. package/dist/reflect-type.mjs +24 -0
  21. package/dist/{reflection-9KUpjPqV.d.cts → reflection-BwdnCwaK.d.cts} +11 -17
  22. package/dist/{reflection-9KUpjPqV.d.ts → reflection-Chr4fE0i.d.mts} +11 -17
  23. package/dist/reflection-D9R8cdSo.d.mts +1561 -0
  24. package/dist/resolve-reflections.cjs +15 -9
  25. package/dist/resolve-reflections.d.cts +4 -2
  26. package/dist/{resolve-reflections.d.ts → resolve-reflections.d.mts} +4 -2
  27. package/dist/resolve-reflections.mjs +16 -0
  28. package/dist/rolldown-plugin.cjs +44 -11
  29. package/dist/rolldown-plugin.d.cts +5 -3
  30. package/dist/{rolldown-plugin.d.ts → rolldown-plugin.d.mts} +5 -3
  31. package/dist/rolldown-plugin.mjs +45 -0
  32. package/dist/transformer.cjs +52 -13
  33. package/dist/transformer.d.cts +6 -4
  34. package/dist/{transformer.d.ts → transformer.d.mts} +6 -4
  35. package/dist/transformer.mjs +51 -0
  36. package/dist/transpile.cjs +29 -10
  37. package/dist/transpile.d.cts +6 -4
  38. package/dist/{transpile.d.ts → transpile.d.mts} +6 -4
  39. package/dist/transpile.mjs +29 -0
  40. package/dist/types.cjs +0 -4
  41. package/dist/types.d.cts +9 -9
  42. package/dist/{types.d.ts → types.d.mts} +9 -9
  43. package/dist/types.mjs +1 -0
  44. package/dist/utilities.cjs +116 -33
  45. package/dist/utilities.d.cts +4 -2
  46. package/dist/{utilities.d.ts → utilities.d.mts} +4 -2
  47. package/dist/utilities.mjs +111 -0
  48. package/dist/vendor/core.cjs +1240 -513
  49. package/dist/vendor/core.mjs +1116 -0
  50. package/dist/vendor/string-BoXo0wS7.cjs +2983 -0
  51. package/dist/vendor/string-BuMgdahD.mjs +2467 -0
  52. package/dist/vendor/type-BMLjRtLY.cjs +202 -0
  53. package/dist/vendor/type-Dgeqs-rL.mjs +190 -0
  54. package/dist/vendor/type-compiler/compiler-BUrWMhGi.cjs +6792 -0
  55. package/dist/vendor/type-compiler/compiler-Bg8jX6qU.mjs +6739 -0
  56. package/dist/vendor/type-compiler/compiler-D1z5h1MK.d.cts +578 -0
  57. package/dist/vendor/type-compiler/compiler-Nkxc4PLJ.d.mts +578 -0
  58. package/dist/vendor/type-compiler/compiler.cjs +11 -43
  59. package/dist/vendor/type-compiler/compiler.d.cts +2 -3
  60. package/dist/vendor/type-compiler/compiler.d.mts +2 -0
  61. package/dist/vendor/type-compiler/compiler.mjs +3 -0
  62. package/dist/vendor/type-compiler/config-BEX924PC.cjs +3709 -0
  63. package/dist/vendor/type-compiler/config-B_cKkYZm.d.cts +116 -0
  64. package/dist/vendor/type-compiler/config-D9DM7Du_.d.mts +116 -0
  65. package/dist/vendor/type-compiler/config-y0HNkbCH.mjs +3640 -0
  66. package/dist/vendor/type-compiler/config.cjs +9 -34
  67. package/dist/vendor/type-compiler/config.d.cts +2 -1
  68. package/dist/vendor/type-compiler/config.d.mts +2 -0
  69. package/dist/vendor/type-compiler/config.mjs +3 -0
  70. package/dist/vendor/type-compiler/index.cjs +56 -129
  71. package/dist/vendor/type-compiler/index.d.cts +22 -3
  72. package/dist/vendor/type-compiler/index.d.mts +22 -0
  73. package/dist/vendor/type-compiler/index.mjs +50 -0
  74. package/dist/vendor/type-spec.cjs +11 -12
  75. package/dist/vendor/type-spec.mjs +3 -0
  76. package/dist/vendor/type.cjs +8407 -17892
  77. package/dist/vendor/type.d.cts +10 -196
  78. package/dist/vendor/{type.d.ts → type.d.mts} +10 -196
  79. package/dist/vendor/type.mjs +9109 -0
  80. package/package.json +43 -31
  81. package/schemas/reflection.cjs +4018 -4129
  82. package/schemas/reflection.d.cts +30 -38
  83. package/schemas/{reflection.d.ts → reflection.d.mts} +30 -38
  84. package/schemas/reflection.mjs +4036 -0
  85. package/dist/capnp.js +0 -2
  86. package/dist/chunk-23YNDVRG.js +0 -34
  87. package/dist/chunk-27RKMKSF.cjs +0 -50
  88. package/dist/chunk-2XDQUCXZ.js +0 -2392
  89. package/dist/chunk-34OFD7LS.cjs +0 -68
  90. package/dist/chunk-7FXYDYVQ.cjs +0 -5246
  91. package/dist/chunk-7QZGCBH7.cjs +0 -11
  92. package/dist/chunk-ALM6UMVU.js +0 -9
  93. package/dist/chunk-BLLXF42T.cjs +0 -41
  94. package/dist/chunk-H3Q3XL3D.js +0 -19
  95. package/dist/chunk-HPVJ6OV3.cjs +0 -31
  96. package/dist/chunk-JQUKKAFM.js +0 -48
  97. package/dist/chunk-KK7TQA7L.cjs +0 -25
  98. package/dist/chunk-NPV2346T.js +0 -25
  99. package/dist/chunk-ORA4UQMU.cjs +0 -2
  100. package/dist/chunk-OUGDFUKJ.cjs +0 -2400
  101. package/dist/chunk-OULCUN6I.js +0 -1
  102. package/dist/chunk-SHUYVCID.js +0 -4
  103. package/dist/chunk-TDYIUJGY.js +0 -5180
  104. package/dist/chunk-USNT2KNT.cjs +0 -6
  105. package/dist/chunk-WYEFKIRL.js +0 -66
  106. package/dist/esbuild-plugin.d.ts +0 -33
  107. package/dist/esbuild-plugin.js +0 -4
  108. package/dist/index.d.ts +0 -19
  109. package/dist/index.js +0 -10
  110. package/dist/reflect-type.js +0 -5
  111. package/dist/resolve-reflections.js +0 -2
  112. package/dist/rolldown-plugin.js +0 -4
  113. package/dist/transformer.js +0 -2
  114. package/dist/transpile.js +0 -3
  115. package/dist/types.js +0 -1
  116. package/dist/utilities.js +0 -2
  117. package/dist/vendor/chunk-5BKT4CS5.js +0 -28
  118. package/dist/vendor/chunk-BLN7QVCP.js +0 -3704
  119. package/dist/vendor/chunk-BR2FK5K7.js +0 -109
  120. package/dist/vendor/chunk-EPQZMVJO.cjs +0 -3859
  121. package/dist/vendor/chunk-IFK6AU6M.cjs +0 -42
  122. package/dist/vendor/chunk-SHDAXCXF.cjs +0 -115
  123. package/dist/vendor/core.js +0 -2
  124. package/dist/vendor/type-compiler/chunk-3LL3TSRJ.js +0 -3762
  125. package/dist/vendor/type-compiler/chunk-CUTGHVNY.js +0 -7100
  126. package/dist/vendor/type-compiler/chunk-IAWCLVUK.cjs +0 -3780
  127. package/dist/vendor/type-compiler/chunk-UIWPG352.cjs +0 -7114
  128. package/dist/vendor/type-compiler/compiler.d.ts +0 -3
  129. package/dist/vendor/type-compiler/compiler.js +0 -5
  130. package/dist/vendor/type-compiler/config.d.ts +0 -1
  131. package/dist/vendor/type-compiler/config.js +0 -5
  132. package/dist/vendor/type-compiler/index.d.ts +0 -3
  133. package/dist/vendor/type-compiler/index.js +0 -66
  134. package/dist/vendor/type-spec.js +0 -2
  135. package/dist/vendor/type.js +0 -18359
  136. package/schemas/reflection.js +0 -4153
  137. /package/dist/vendor/{core.d.ts → core.d.mts} +0 -0
  138. /package/dist/vendor/{type-spec.d.ts → type-spec.d.mts} +0 -0
@@ -0,0 +1,1116 @@
1
+ import { $ as isFunction, A as first, At as eachKey, B as getObjectKeysSize, C as copy, Ct as setPathValue, D as empty, Dt as time, E as deletePathValue, Et as stringifyValueWithType, F as getClassName, G as identifyType, H as getPathValue, I as getClassPropertyName, J as isArray, K as inDebugMode, L as getClassTypeFromInstance, M as fixAsyncOperation, N as formatError, O as ensureError, Ot as zip, P as forwardTypeArguments, Q as isConstructable, R as getCurrentFileName, S as collectForMicrotask, St as rangeArray, T as createStack, Tt as sleep, U as hasProperty, V as getParentClass, W as humanBytes, X as isClass, Y as isAsyncFunction, Z as isClassInstance, _ as assertDefined, _t as mergePromiseStack, a as arrayHasItem, at as isNumeric, b as average, bt as prettyPrintObject, c as toFastProperties, ct as isPlainObject, d as __ΩAbstractClassType, dt as isSet, et as isGlobalClass, f as __ΩClassType, ft as isString, g as applyDefaults, gt as lastKey, h as appendObject, ht as last, i as arrayClear, it as isNumber, j as firstKey, jt as eachPair, k as escapeRegExp, kt as each, l as AsyncFunction, lt as isPromise, m as __ΩExtractClassType, mt as iterableSize, n as indent, nt as isIterable, o as arrayMoveItem, ot as isObject, p as __ΩCustomError, pt as isUndefined, q as indexOf, r as CompilerContext, rt as isNull, s as arrayRemoveItem, st as isObjectLiteral, t as capitalize, tt as isInteger, u as CustomError, ut as isPrototypeOfBase, v as assertInstanceOf, vt as mergeStack, w as createDynamicClass, wt as size, x as changeClass, xt as range, y as asyncOperation, yt as prependObjectKeys, z as getInheritanceChain } from "./string-BuMgdahD.mjs";
2
+
3
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/decorators.js
4
+ const __ΩPropertyDescriptor = [
5
+ "configurable",
6
+ "enumerable",
7
+ "value",
8
+ "writable",
9
+ "get",
10
+ "v",
11
+ "set",
12
+ "PropertyDescriptor",
13
+ "P)4!8)4\"8\"4#8)4$8P\"1%P\"2&$1'Mw(y"
14
+ ];
15
+ const __ΩTypedPropertyDescriptor = [
16
+ "T",
17
+ "enumerable",
18
+ "configurable",
19
+ "writable",
20
+ "value",
21
+ "",
22
+ "get",
23
+ "set",
24
+ "TypedPropertyDescriptor",
25
+ "b!P)4\"8)4#8)4$8e\"!4%8Pe#!/&4'8Pe#!2%$/&4(8Mw)y"
26
+ ];
27
+ function __assignType$6(fn, args) {
28
+ fn.__type = args;
29
+ return fn;
30
+ }
31
+ /**
32
+ * Logs every call to this method on stdout.
33
+ *
34
+ * @public
35
+ */
36
+ function log() {
37
+ return __assignType$6(function(target, propertyKey, descriptor) {
38
+ const orig = descriptor.value;
39
+ descriptor.value = __assignType$6(function(...args) {
40
+ const a = args.map(__assignType$6((v) => typeof v, [
41
+ "v",
42
+ "",
43
+ "P\"2!\"/\""
44
+ ])).join(",");
45
+ console.info(getClassName(target) + "::" + String(propertyKey) + "(" + a + ")");
46
+ return orig.apply(this, args);
47
+ }, [
48
+ "args",
49
+ "",
50
+ "P\"@2!\"/\""
51
+ ]);
52
+ return descriptor;
53
+ }, [
54
+ "target",
55
+ "propertyKey",
56
+ () => __ΩPropertyDescriptor,
57
+ "descriptor",
58
+ "",
59
+ "P%2!P&+J2\"n#2$\"/%"
60
+ ]);
61
+ }
62
+ log.__type = ["log", "P\"/!"];
63
+ /**
64
+ * Makes sure that calls to this async method are stacked up and are called one after another and not parallel.
65
+ *
66
+ * @public
67
+ */
68
+ function stack() {
69
+ return __assignType$6(function(target, propertyKey, descriptor) {
70
+ const orig = descriptor.value;
71
+ descriptor.value = __assignType$6(async function(...args) {
72
+ const name = "__c_" + propertyKey;
73
+ if (this[name] === void 0) {
74
+ this[name] = null;
75
+ toFastProperties(this);
76
+ }
77
+ while (this[name]) await this[name];
78
+ this[name] = orig.apply(this, args);
79
+ try {
80
+ return await this[name];
81
+ } finally {
82
+ this[name] = null;
83
+ }
84
+ }, [
85
+ "args",
86
+ "",
87
+ "P\"@2!\"/\""
88
+ ]);
89
+ }, [
90
+ "target",
91
+ "propertyKey",
92
+ () => __ΩTypedPropertyDescriptor,
93
+ "args",
94
+ "",
95
+ "descriptor",
96
+ "P%2!&2\"P\"@2$\"`/%o#\"2&\"/%"
97
+ ]);
98
+ }
99
+ stack.__type = ["stack", "P\"/!"];
100
+ /**
101
+ * Makes sure that this async method is only running once at a time. When this method is running and it is tried
102
+ * to call it another times, that call is "dropped" and it returns simply the result of the previous running call (waiting for it to complete first).
103
+ *
104
+ * @public
105
+ */
106
+ function singleStack() {
107
+ return __assignType$6(function(target, propertyKey, descriptor) {
108
+ const orig = descriptor.value;
109
+ descriptor.value = __assignType$6(async function(...args) {
110
+ const name = "__sc_" + propertyKey;
111
+ if (this[name] === void 0) {
112
+ this[name] = null;
113
+ toFastProperties(this);
114
+ }
115
+ if (this[name]) return await this[name];
116
+ this[name] = orig.apply(this, args);
117
+ try {
118
+ return await this[name];
119
+ } finally {
120
+ this[name] = null;
121
+ }
122
+ }, [
123
+ "args",
124
+ "",
125
+ "P\"@2!\"/\""
126
+ ]);
127
+ }, [
128
+ "target",
129
+ "propertyKey",
130
+ () => __ΩTypedPropertyDescriptor,
131
+ "args",
132
+ "",
133
+ "descriptor",
134
+ "P%2!&2\"P\"@2$\"`/%o#\"2&\"/%"
135
+ ]);
136
+ }
137
+ singleStack.__type = ["singleStack", "P\"/!"];
138
+
139
+ //#endregion
140
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/enum.js
141
+ const __ΩObject = [
142
+ () => Function,
143
+ "constructor",
144
+ "toString",
145
+ "toLocaleString",
146
+ 0,
147
+ "valueOf",
148
+ () => __ΩPropertyKey,
149
+ "v",
150
+ "hasOwnProperty",
151
+ 0,
152
+ "isPrototypeOf",
153
+ () => __ΩPropertyKey,
154
+ "propertyIsEnumerable",
155
+ "Object",
156
+ "PPu!4\"P&1#P&1$Pn%1&Pn'2()1)Pn*2()1+Pn,2()1-Mw.y"
157
+ ];
158
+ const __ΩPropertyKey = ["PropertyKey", "P&'+Jw!y"];
159
+ function __assignType$5(fn, args) {
160
+ fn.__type = args;
161
+ return fn;
162
+ }
163
+ const cacheEnumLabels = (Map.Ω = [[() => __ΩObject, "n!"], ["&F"]], /* @__PURE__ */ new Map());
164
+ /**
165
+ * Returns the enum label for a given enum value.
166
+ *
167
+ * @public
168
+ */
169
+ function getEnumLabel(enumType, id) {
170
+ for (const i of eachKey(enumType)) if (id === enumType[i]) return i;
171
+ }
172
+ getEnumLabel.__type = [
173
+ "enumType",
174
+ "id",
175
+ "getEnumLabel",
176
+ "PP&\"LM2!\"2\"\"/#"
177
+ ];
178
+ /**
179
+ * Returns all possible enum labels.
180
+ *
181
+ * @public
182
+ */
183
+ function getEnumLabels(enumDefinition) {
184
+ let value = cacheEnumLabels.get(enumDefinition);
185
+ if (!value) {
186
+ value = Object.keys(enumDefinition).filter(__assignType$5((v) => !Number.isFinite(parseInt(v, 10)), [
187
+ "v",
188
+ "",
189
+ "P\"2!\"/\""
190
+ ]));
191
+ cacheEnumLabels.set(enumDefinition, value);
192
+ }
193
+ return value;
194
+ }
195
+ getEnumLabels.__type = [
196
+ "enumDefinition",
197
+ "getEnumLabels",
198
+ "P\"2!\"/\""
199
+ ];
200
+ const cacheEnumKeys = (Map.Ω = [[() => __ΩObject, "n!"], ["&F"]], /* @__PURE__ */ new Map());
201
+ /**
202
+ * Returns all possible enum keys.
203
+ *
204
+ * @public
205
+ */
206
+ function getEnumValues(enumDefinition) {
207
+ let value = cacheEnumKeys.get(enumDefinition);
208
+ if (!value) {
209
+ value = Object.values(enumDefinition).filter(__assignType$5((v) => {
210
+ return "number" !== typeof enumDefinition[v];
211
+ }, [
212
+ "v",
213
+ "",
214
+ "P\"2!\"/\""
215
+ ]));
216
+ cacheEnumKeys.set(enumDefinition, value);
217
+ }
218
+ return value;
219
+ }
220
+ getEnumValues.__type = [
221
+ "enumDefinition",
222
+ "getEnumValues",
223
+ "P\"2!\"F/\""
224
+ ];
225
+ function getEnumKeyLabelMap(enumDefinition) {
226
+ const map = (Map.Ω = [["\""], ["&"]], /* @__PURE__ */ new Map());
227
+ const keys = getEnumValues(enumDefinition);
228
+ const labels = getEnumLabels(enumDefinition);
229
+ for (let i = 0; i < keys.length; i++) map.set(keys[i], labels[i]);
230
+ return map;
231
+ }
232
+ getEnumKeyLabelMap.__type = [
233
+ "enumDefinition",
234
+ "getEnumKeyLabelMap",
235
+ "P\"2!\"&E/\""
236
+ ];
237
+ /**
238
+ * Checks whether given enum value is valid.
239
+ *
240
+ * @public
241
+ */
242
+ function isValidEnumValue(enumDefinition, value, allowLabelsAsValue = false) {
243
+ if (allowLabelsAsValue) {
244
+ if (-1 !== getEnumLabels(enumDefinition).indexOf(String(value))) return true;
245
+ }
246
+ const values = getEnumValues(enumDefinition);
247
+ return -1 !== values.indexOf(+value) || -1 !== values.indexOf(value) || -1 !== values.indexOf(String(value));
248
+ }
249
+ isValidEnumValue.__type = [
250
+ "enumDefinition",
251
+ "value",
252
+ "allowLabelsAsValue",
253
+ "isValidEnumValue",
254
+ "P\"2!\"2\"\"2#\"/$"
255
+ ];
256
+ /**
257
+ * @public
258
+ */
259
+ function getValidEnumValue(enumDefinition, value, allowLabelsAsValue = false) {
260
+ if (allowLabelsAsValue) {
261
+ if (-1 !== getEnumLabels(enumDefinition).indexOf(String(value))) return enumDefinition[String(value)];
262
+ }
263
+ const values = getEnumValues(enumDefinition);
264
+ if (-1 !== values.indexOf(value)) return value;
265
+ if (-1 !== values.indexOf(+value)) return +value;
266
+ if (-1 !== values.indexOf(String(value))) return String(value);
267
+ }
268
+ getValidEnumValue.__type = [
269
+ "enumDefinition",
270
+ "value",
271
+ "allowLabelsAsValue",
272
+ "getValidEnumValue",
273
+ "P\"2!\"2\"\"2#\"/$"
274
+ ];
275
+
276
+ //#endregion
277
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/timer.js
278
+ var Timer = class {
279
+ constructor() {
280
+ this.timeoutTimers = [];
281
+ }
282
+ setTimeout(cb, timeout) {
283
+ const timer = setTimeout(cb, timeout);
284
+ this.timeoutTimers.push(timer);
285
+ return timer;
286
+ }
287
+ /**
288
+ * Clears all timers at once.
289
+ */
290
+ clear() {
291
+ for (const timeout of this.timeoutTimers) clearTimeout(timeout);
292
+ }
293
+ };
294
+ Timer.__type = [
295
+ "timeoutTimers",
296
+ function() {
297
+ return [];
298
+ },
299
+ "",
300
+ "cb",
301
+ "timeout",
302
+ "setTimeout",
303
+ "clear",
304
+ "Timer",
305
+ "\"F3!<>\"PP$/#2$'2%\"0&P\"0'5w("
306
+ ];
307
+
308
+ //#endregion
309
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/process-locker.js
310
+ function __assignType$4(fn, args) {
311
+ fn.__type = args;
312
+ return fn;
313
+ }
314
+ const LOCKS = {};
315
+ /**
316
+ * This lock mechanism works only for one process (worker).
317
+ *
318
+ * live-mutex: has horrible API and doesn't allow to check if an key is currently locked.
319
+ * proper-filelock: No way to do a correct mutex locking with event-driven blocking acquire() method.
320
+ * redislock: Very bad performance on high-load (when multiple locks on the same key `wait`, since it loops)
321
+ * mongodb lock: even worse performance than redis. Jesus.
322
+ */
323
+ var ProcessLock = class {
324
+ constructor(id) {
325
+ this.id = id;
326
+ this.holding = false;
327
+ }
328
+ async acquire(ttl = 0, timeout = 0) {
329
+ if (this.holding) throw new Error("Lock already acquired");
330
+ return Promise.Ω = [["$"]], new Promise(__assignType$4((resolve, reject) => {
331
+ if (LOCKS[this.id]) {
332
+ let timeoutId;
333
+ const ourTake = () => {
334
+ LOCKS[this.id].time = Date.now() / 1e3;
335
+ clearTimeout(timeoutId);
336
+ this.holding = true;
337
+ resolve();
338
+ if (ttl) this.ttlTimeout = setTimeout(() => {
339
+ this.unlock();
340
+ }, ttl * 1e3);
341
+ };
342
+ if (timeout > 0) timeoutId = setTimeout(() => {
343
+ if (LOCKS[this.id]) arrayRemoveItem(LOCKS[this.id].queue, ourTake);
344
+ reject("Lock timed out " + this.id);
345
+ }, timeout * 1e3);
346
+ LOCKS[this.id].queue.push(ourTake);
347
+ } else {
348
+ LOCKS[this.id] = {
349
+ time: Date.now() / 1e3,
350
+ queue: []
351
+ };
352
+ this.holding = true;
353
+ resolve();
354
+ if (ttl) this.ttlTimeout = setTimeout(() => {
355
+ this.unlock();
356
+ }, ttl * 1e3);
357
+ }
358
+ }, [
359
+ "resolve",
360
+ "reject",
361
+ "",
362
+ "P\"2!\"2\"\"/#"
363
+ ]));
364
+ }
365
+ isLocked() {
366
+ return this.holding;
367
+ }
368
+ tryLock(ttl = 0) {
369
+ this.holding = false;
370
+ if (!LOCKS[this.id]) {
371
+ LOCKS[this.id] = {
372
+ time: Date.now() / 1e3,
373
+ queue: []
374
+ };
375
+ this.holding = true;
376
+ if (ttl) this.ttlTimeout = setTimeout(() => {
377
+ this.unlock();
378
+ }, ttl * 1e3);
379
+ }
380
+ return this.holding;
381
+ }
382
+ unlock() {
383
+ clearTimeout(this.ttlTimeout);
384
+ if (!this.holding) return;
385
+ this.holding = false;
386
+ if (LOCKS[this.id].queue.length) LOCKS[this.id].queue.shift()();
387
+ else delete LOCKS[this.id];
388
+ }
389
+ };
390
+ ProcessLock.__type = [
391
+ "holding",
392
+ function() {
393
+ return false;
394
+ },
395
+ "ttlTimeout",
396
+ "id",
397
+ "constructor",
398
+ "ttl",
399
+ () => 0,
400
+ "timeout",
401
+ () => 0,
402
+ "acquire",
403
+ "isLocked",
404
+ () => 0,
405
+ "tryLock",
406
+ "unlock",
407
+ "ProcessLock",
408
+ ")3!;>\"\"3#<P&2$:9\"0%P'2&>''2(>)\"0*P\"0+P'2&>,\"0-P\"0.5w/"
409
+ ];
410
+ var ProcessLocker = class {
411
+ /**
412
+ *
413
+ * @param id
414
+ * @param ttl optional defines when the times automatically unlocks.
415
+ * @param timeout if after `timeout` seconds the lock isn't acquired, it throws an error.
416
+ */
417
+ async acquireLock(id, ttl = 0, timeout = 0) {
418
+ const lock = new ProcessLock(id);
419
+ await lock.acquire(ttl, timeout);
420
+ return lock;
421
+ }
422
+ async tryLock(id, ttl = 0) {
423
+ const lock = new ProcessLock(id);
424
+ if (lock.tryLock(ttl)) return lock;
425
+ }
426
+ isLocked(id) {
427
+ return !!LOCKS[id];
428
+ }
429
+ };
430
+ ProcessLocker.__type = [
431
+ "id",
432
+ "ttl",
433
+ () => 0,
434
+ "timeout",
435
+ () => 0,
436
+ () => ProcessLock,
437
+ "acquireLock",
438
+ () => 0,
439
+ () => ProcessLock,
440
+ "tryLock",
441
+ "isLocked",
442
+ "ProcessLocker",
443
+ "P&2!'2\">#'2$>%P7&`0'P&2!'2\">(PP7)-J`0*P&2!)0+5w,"
444
+ ];
445
+ var Mutex = class {
446
+ unlock() {
447
+ if (this.resolver) this.resolver();
448
+ this.promise = void 0;
449
+ }
450
+ async lock() {
451
+ while (this.promise) await this.promise;
452
+ this.promise = new Promise(__assignType$4((resolver) => {
453
+ this.resolver = resolver;
454
+ }, [
455
+ "resolver",
456
+ "",
457
+ "P\"2!\"/\""
458
+ ]));
459
+ }
460
+ };
461
+ Mutex.__type = [
462
+ "promise",
463
+ () => Function,
464
+ "resolver",
465
+ "unlock",
466
+ "lock",
467
+ "Mutex",
468
+ "$`3!8<Pu\"3#8<P$0$P$`0%5w&"
469
+ ];
470
+
471
+ //#endregion
472
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/network.js
473
+ var ParsedHost = class {
474
+ constructor() {
475
+ this.host = "127.0.0.1";
476
+ this.port = 0;
477
+ this.unixSocket = "";
478
+ }
479
+ get isUnixSocket() {
480
+ return this.unixSocket !== "";
481
+ }
482
+ get isHostname() {
483
+ return this.unixSocket === "";
484
+ }
485
+ get hostWithIp() {
486
+ return this.host + (this.port ? (this.host && ":") + this.port : "");
487
+ }
488
+ toString() {
489
+ return this.isUnixSocket ? this.unixSocket : this.hostWithIp;
490
+ }
491
+ getWebSocketUrl(secure = false) {
492
+ const protocol = secure ? "wss" : "ws";
493
+ if (this.isUnixSocket) return `${protocol}+unix://${this.unixSocket}`;
494
+ return `${protocol}://${this.hostWithIp}`;
495
+ }
496
+ getHttpUrl(secure = false) {
497
+ if (this.isUnixSocket) return `file://${this.unixSocket}`;
498
+ return `${secure ? "https" : "http"}://${this.hostWithIp}`;
499
+ }
500
+ };
501
+ ParsedHost.__type = [
502
+ "host",
503
+ function() {
504
+ return "127.0.0.1";
505
+ },
506
+ "port",
507
+ function() {
508
+ return 0;
509
+ },
510
+ "unixSocket",
511
+ function() {
512
+ return "";
513
+ },
514
+ "toString",
515
+ "secure",
516
+ () => false,
517
+ "getWebSocketUrl",
518
+ () => false,
519
+ "getHttpUrl",
520
+ "ParsedHost",
521
+ "&3!>\"'3#>$&3%>&!!!P&0'P)2(>)\"0*P)2(>+\"0,5w-"
522
+ ];
523
+ function parseHost(hostWithIpOrUnixPath) {
524
+ const parsedHost = new ParsedHost();
525
+ if (hostWithIpOrUnixPath.includes("/") || hostWithIpOrUnixPath.includes("\\") || hostWithIpOrUnixPath.endsWith(".sock")) parsedHost.unixSocket = hostWithIpOrUnixPath;
526
+ else if (hostWithIpOrUnixPath.includes(":")) {
527
+ const [host, port] = hostWithIpOrUnixPath.split(":");
528
+ if (host) parsedHost.host = host;
529
+ if (port) parsedHost.port = parseInt(port, 10);
530
+ } else if (hostWithIpOrUnixPath) parsedHost.host = hostWithIpOrUnixPath;
531
+ return parsedHost;
532
+ }
533
+ parseHost.__type = [
534
+ "hostWithIpOrUnixPath",
535
+ () => ParsedHost,
536
+ "parseHost",
537
+ "P&2!P7\"/#"
538
+ ];
539
+
540
+ //#endregion
541
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/emitter.js
542
+ const __ΩAsyncSubscriber = [
543
+ "T",
544
+ "event",
545
+ "",
546
+ "AsyncSubscriber",
547
+ "b!Pe\"!2\"P$`$J/#w$y"
548
+ ];
549
+ const __ΩSubscriber = [
550
+ "T",
551
+ "event",
552
+ "",
553
+ "Subscriber",
554
+ "b!Pe\"!2\"P$`$J/#w$y"
555
+ ];
556
+ const __ΩAsyncEventSubscription = [
557
+ "",
558
+ "unsubscribe",
559
+ "AsyncEventSubscription",
560
+ "PP$/!4\"Mw#y"
561
+ ];
562
+ const __ΩEventSubscription = [
563
+ "",
564
+ "unsubscribe",
565
+ "EventSubscription",
566
+ "PP$/!4\"Mw#y"
567
+ ];
568
+ let asyncId = 0;
569
+ var EmitterEvent = class {
570
+ constructor() {
571
+ this.id = asyncId++;
572
+ this.stopped = false;
573
+ this.propagationStopped = false;
574
+ }
575
+ /**
576
+ * Stop propagating the event to subsequent event listeners.
577
+ */
578
+ stopPropagation() {
579
+ this.propagationStopped = true;
580
+ }
581
+ /**
582
+ * Signal the emitter that you want to abort.
583
+ * Subsequent event listeners will still be called.
584
+ */
585
+ stop() {
586
+ this.stopped = true;
587
+ }
588
+ };
589
+ EmitterEvent.__type = [
590
+ "id",
591
+ function() {
592
+ return asyncId++;
593
+ },
594
+ "stopped",
595
+ function() {
596
+ return false;
597
+ },
598
+ "propagationStopped",
599
+ function() {
600
+ return false;
601
+ },
602
+ "stopPropagation",
603
+ "stop",
604
+ "EmitterEvent",
605
+ "!3!9>\")3#>$)3%>&P\"0'P\"0(5w)"
606
+ ];
607
+ var EventEmitter = class {
608
+ constructor(parent) {
609
+ this.parent = parent;
610
+ this.subscribers = [];
611
+ }
612
+ subscribe(callback) {
613
+ this.subscribers.push(callback);
614
+ return { unsubscribe: () => {
615
+ arrayRemoveItem(this.subscribers, callback);
616
+ } };
617
+ }
618
+ emit(event) {
619
+ if (this.parent) this.parent.emit(event);
620
+ if (event.propagationStopped) return;
621
+ for (const subscriber of this.subscribers) {
622
+ subscriber(event);
623
+ if (event.propagationStopped) return;
624
+ }
625
+ }
626
+ hasSubscriptions() {
627
+ return this.subscribers.length > 0;
628
+ }
629
+ };
630
+ EventEmitter.__type = [
631
+ "T",
632
+ () => __ΩSubscriber,
633
+ "subscribers",
634
+ function() {
635
+ return [];
636
+ },
637
+ () => EventEmitter,
638
+ "parent",
639
+ "constructor",
640
+ () => __ΩSubscriber,
641
+ "callback",
642
+ () => __ΩEventSubscription,
643
+ "subscribe",
644
+ "event",
645
+ "emit",
646
+ "hasSubscriptions",
647
+ "EventEmitter",
648
+ "b!e!!o\"\"F3#<>$PP\"7%2&8<\"0'Pe\"!o(\"2)n*0+Pe\"!2,$0-P)0.5w/"
649
+ ];
650
+ var AsyncEventEmitter = class {
651
+ constructor(parent) {
652
+ this.parent = parent;
653
+ this.subscribers = [];
654
+ }
655
+ subscribe(callback) {
656
+ this.subscribers.push(callback);
657
+ return { unsubscribe: () => {
658
+ arrayRemoveItem(this.subscribers, callback);
659
+ } };
660
+ }
661
+ async emit(event) {
662
+ if (this.parent) await this.parent.emit(event);
663
+ if (event.propagationStopped) return;
664
+ for (const subscriber of this.subscribers) {
665
+ await subscriber(event);
666
+ if (event.propagationStopped) return;
667
+ }
668
+ }
669
+ hasSubscriptions() {
670
+ return this.subscribers.length > 0;
671
+ }
672
+ };
673
+ AsyncEventEmitter.__type = [
674
+ "T",
675
+ () => __ΩAsyncSubscriber,
676
+ "subscribers",
677
+ function() {
678
+ return [];
679
+ },
680
+ () => AsyncEventEmitter,
681
+ "parent",
682
+ "constructor",
683
+ () => __ΩAsyncSubscriber,
684
+ "callback",
685
+ () => __ΩAsyncEventSubscription,
686
+ "subscribe",
687
+ "event",
688
+ "emit",
689
+ "hasSubscriptions",
690
+ "AsyncEventEmitter",
691
+ "b!e!!o\"\"F3#<>$PP\"7%2&8<\"0'Pe\"!o(\"2)n*0+Pe\"!2,$`0-P)0.5w/"
692
+ ];
693
+
694
+ //#endregion
695
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/reactive.js
696
+ function __assignType$3(fn, args) {
697
+ fn.__type = args;
698
+ return fn;
699
+ }
700
+ const nextTick = typeof requestAnimationFrame !== "undefined" ? __assignType$3((cb) => requestAnimationFrame(cb), [
701
+ "",
702
+ "cb",
703
+ "PP$/!2\"\"/!"
704
+ ]) : __assignType$3((cb) => setTimeout(cb), [
705
+ "",
706
+ "cb",
707
+ "PP$/!2\"\"/!"
708
+ ]);
709
+ const clearTick = typeof requestAnimationFrame !== "undefined" ? __assignType$3((id) => cancelAnimationFrame(id), [
710
+ "id",
711
+ "",
712
+ "P\"2!\"/\""
713
+ ]) : __assignType$3((id) => clearTick(id), [
714
+ "id",
715
+ "",
716
+ "P\"2!\"/\""
717
+ ]);
718
+ /**
719
+ * Wraps a function and calls it only `cps` times per frame.
720
+ *
721
+ * This is handy to throttle all kind of rapid calls, like mouse move events or other kind of events.
722
+ *
723
+ * @example
724
+ * ```typescript
725
+ * function expensiveFunction() {
726
+ * //...
727
+ * }
728
+ *
729
+ * const throttled = throttleTime(expensiveFunction, 5); //5 calls per second max
730
+ *
731
+ * throttled();
732
+ * throttled();
733
+ * throttled();
734
+ * //throttled will here only be called once
735
+ * ```
736
+ */
737
+ function throttleTime(call, cps = 5) {
738
+ let last = Date.now();
739
+ let dirty = false;
740
+ let lastArgs = [];
741
+ let execution = false;
742
+ function tick() {
743
+ if (!execution && Date.now() - last > 1e3 / cps) {
744
+ execution = true;
745
+ call(...lastArgs);
746
+ dirty = false;
747
+ last = Date.now();
748
+ execution = false;
749
+ }
750
+ if (dirty) nextTick(tick);
751
+ }
752
+ tick.__type = ["tick", "P\"/!"];
753
+ return __assignType$3((...args) => {
754
+ dirty = true;
755
+ lastArgs = args;
756
+ tick();
757
+ }, [
758
+ "args",
759
+ "",
760
+ "P\"@2!\"/\""
761
+ ]);
762
+ }
763
+ throttleTime.__type = [
764
+ () => Function,
765
+ "call",
766
+ "cps",
767
+ "args",
768
+ "",
769
+ "throttleTime",
770
+ "PPu!2\"\"2#P\"@2$$/%/&"
771
+ ];
772
+ /**
773
+ * This functions returns a stack that is filled as long as the gate is not activated.
774
+ * Once activated all recorded calls go to given callback and subsequent calls go directly to given callback.
775
+ */
776
+ function bufferedGate(callback) {
777
+ const q = [];
778
+ let activated = false;
779
+ const throttled = throttleTime(async () => {
780
+ if (q.length === 0) return;
781
+ for (const t of q) {
782
+ const result = callback(t);
783
+ if (result instanceof Promise) await result;
784
+ }
785
+ q.splice(0, q.length);
786
+ });
787
+ return {
788
+ activate: () => {
789
+ activated = true;
790
+ throttled();
791
+ },
792
+ call: __assignType$3((i) => {
793
+ q.push(i);
794
+ if (activated) throttled();
795
+ }, [
796
+ () => callback,
797
+ "arg",
798
+ "",
799
+ "i",
800
+ "PPdi!Ph\"!2\"\"/#qe!!!j2$\"/#"
801
+ ])
802
+ };
803
+ }
804
+ bufferedGate.__type = [
805
+ "arg",
806
+ "",
807
+ "callback",
808
+ "bufferedGate",
809
+ "PP\"2!\"/\"2#\"/$"
810
+ ];
811
+
812
+ //#endregion
813
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/reflection.js
814
+ const COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;
815
+ const DEFAULT_PARAMS = /=[^,]+/gm;
816
+ const FAT_ARROWS = /=>.*$/gm;
817
+ function extractParameters(fn) {
818
+ fn = typeof fn === "string" ? fn : fn.toString();
819
+ fn = removeStrings(fn);
820
+ if (fn.startsWith("class")) {
821
+ const start = fn.match(/* @__PURE__ */ new RegExp("[ \n{]constructor\\("));
822
+ if (!start) return [];
823
+ fn = fn.substr((start.index || 0) + start[0].length);
824
+ fn = fn.replace(COMMENTS, "").replace(FAT_ARROWS, "").replace(DEFAULT_PARAMS, "");
825
+ return fn.slice(0, fn.indexOf("{")).match(/([^\(\){\s,]+)/g) || [];
826
+ } else {
827
+ fn = fn.replace(COMMENTS, "").replace(FAT_ARROWS, "").replace(DEFAULT_PARAMS, "");
828
+ return fn.slice(fn.indexOf("(") + 1, fn.indexOf("{")).match(/([^\(\)\{\}\s,]+)/g) || [];
829
+ }
830
+ }
831
+ extractParameters.__type = [
832
+ () => Function,
833
+ () => __ΩClassType,
834
+ "fn",
835
+ "extractParameters",
836
+ "PP&Pu!n\"J2#&F/$"
837
+ ];
838
+ function extractMethodBody(classCode, name) {
839
+ let methodCode = "";
840
+ classCode = removeStrings(classCode);
841
+ const start = classCode.match(new RegExp("[ \n]" + name + "\\("));
842
+ if (!start) return "";
843
+ classCode = classCode.substr((start.index || 0) + start[0].length);
844
+ let blockDepth = 1;
845
+ classCode = classCode.substr(classCode.indexOf("{") + 1);
846
+ for (let i = 0; i < classCode.length; i++) {
847
+ const char = classCode[i];
848
+ if (char === "{") blockDepth++;
849
+ if (char === "}") blockDepth--;
850
+ if (blockDepth === 0) return methodCode;
851
+ if (char === "\n" || char === " " || char === " ") continue;
852
+ methodCode += char;
853
+ }
854
+ return methodCode;
855
+ }
856
+ extractMethodBody.__type = [
857
+ "classCode",
858
+ "name",
859
+ "extractMethodBody",
860
+ "P&2!&2\"&/#"
861
+ ];
862
+ function removeStrings(code) {
863
+ let result = "";
864
+ let inString = false;
865
+ for (let i = 0; i < code.length; i++) {
866
+ const char = code[i];
867
+ if (inString && char === "\\") {
868
+ i++;
869
+ continue;
870
+ }
871
+ if (char === "\"") {
872
+ if (inString === "\"") {
873
+ inString = false;
874
+ continue;
875
+ }
876
+ if (!inString) {
877
+ inString = "\"";
878
+ continue;
879
+ }
880
+ }
881
+ if (char === "'") {
882
+ if (inString === "'") {
883
+ inString = false;
884
+ continue;
885
+ }
886
+ if (!inString) {
887
+ inString = "'";
888
+ continue;
889
+ }
890
+ }
891
+ if (!inString) result += char;
892
+ }
893
+ return result;
894
+ }
895
+ removeStrings.__type = [
896
+ "code",
897
+ "removeStrings",
898
+ "P&2!\"/\""
899
+ ];
900
+
901
+ //#endregion
902
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/url.js
903
+ function __assignType$2(fn, args) {
904
+ fn.__type = args;
905
+ return fn;
906
+ }
907
+ function removeSlash(v) {
908
+ return v.replace(/(^\/+)|(\/+$)/g, "");
909
+ }
910
+ removeSlash.__type = [
911
+ "v",
912
+ "removeSlash",
913
+ "P&2!&/\""
914
+ ];
915
+ function urlJoin(...path) {
916
+ const leadingSlash = path[0] && path[0] !== "/" && path[0][0] === "/";
917
+ const last = path[path.length - 1];
918
+ const trailingSlash = last && last !== "/" && last[last.length - 1] === "/";
919
+ return (leadingSlash ? "/" : "") + path.filter(__assignType$2((v) => !!v, [
920
+ "v",
921
+ "",
922
+ "P\"2!\"/\""
923
+ ])).map(__assignType$2((v) => v === "/" ? "" : removeSlash(v.trim()), [
924
+ "v",
925
+ "",
926
+ "P\"2!\"/\""
927
+ ])).join("/") + (trailingSlash ? "/" : "");
928
+ }
929
+ urlJoin.__type = [
930
+ "path",
931
+ "urlJoin",
932
+ "P&@2!&/\""
933
+ ];
934
+
935
+ //#endregion
936
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/types.js
937
+ const __ΩTypeAnnotation = [
938
+ "T",
939
+ "Options",
940
+ "TypeAnnotation",
941
+ "b!!c\"#w#y"
942
+ ];
943
+ const __ΩInjectMeta = [
944
+ "T",
945
+ () => __ΩTypeAnnotation,
946
+ "inject",
947
+ "InjectMeta",
948
+ "!c!.#e!!o\"#w$y"
949
+ ];
950
+ const __ΩInject = [
951
+ "Type",
952
+ "Token",
953
+ () => __ΩInjectMeta,
954
+ "Inject",
955
+ "b!!c\"Pe\"!e\"\"o#\"Kw$y"
956
+ ];
957
+
958
+ //#endregion
959
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/buffer.js
960
+ function __assignType$1(fn, args) {
961
+ fn.__type = args;
962
+ return fn;
963
+ }
964
+ /**
965
+ * Create a buffer of the given size (uninitialized, so it may contain random data).
966
+ *
967
+ * Note that the result is either Uin8Array or Buffer, depending on the environment.
968
+ * Buffer from NodeJS works slightly different than Uint8Array.
969
+ */
970
+ const createBuffer = "undefined" !== typeof Buffer && "function" === typeof Buffer.allocUnsafe ? Buffer.allocUnsafe : __assignType$1((size) => new Uint8Array(size), [
971
+ "size",
972
+ "",
973
+ "P\"2!\"/\""
974
+ ]);
975
+ /**
976
+ * Concat multiple buffers into one.
977
+ */
978
+ function bufferConcat(chunks, length) {
979
+ if (void 0 === length) {
980
+ length = 0;
981
+ for (const chunk of chunks) length += chunk.length;
982
+ }
983
+ const result = createBuffer(length);
984
+ let offset = 0;
985
+ for (const chunk of chunks) {
986
+ result.set(chunk, offset);
987
+ offset += chunk.length;
988
+ }
989
+ return result;
990
+ }
991
+ bufferConcat.__type = [
992
+ "chunks",
993
+ "length",
994
+ "bufferConcat",
995
+ "PWF2!'2\"8W/#"
996
+ ];
997
+ const textEncoder = new TextDecoder();
998
+ const uint8ArrayToUtf8 = "undefined" !== typeof Buffer ? __assignType$1((buffer) => Buffer.from(buffer).toString("utf8"), [
999
+ "buffer",
1000
+ "",
1001
+ "PW2!\"/\""
1002
+ ]) : __assignType$1((buffer) => textEncoder.decode(buffer), [
1003
+ "buffer",
1004
+ "",
1005
+ "PW2!\"/\""
1006
+ ]);
1007
+ /**
1008
+ * Convert a buffer to a string.
1009
+ */
1010
+ function bufferToString(buffer) {
1011
+ if ("string" === typeof buffer) return buffer;
1012
+ return uint8ArrayToUtf8(buffer);
1013
+ }
1014
+ bufferToString.__type = [
1015
+ "buffer",
1016
+ "bufferToString",
1017
+ "PP&WJ2!&/\""
1018
+ ];
1019
+ function nativeBase64ToUint8Array(base64) {
1020
+ const raw = atob(base64);
1021
+ const rawLength = raw.length;
1022
+ const array = createBuffer(rawLength);
1023
+ for (let i = 0; i < rawLength; i++) array[i] = raw.charCodeAt(i);
1024
+ return array;
1025
+ }
1026
+ nativeBase64ToUint8Array.__type = [
1027
+ "base64",
1028
+ "nativeBase64ToUint8Array",
1029
+ "P&2!W/\""
1030
+ ];
1031
+ /**
1032
+ * Converts a base64 string to a Uint8Array.
1033
+ */
1034
+ const base64ToUint8Array = "undefined" === typeof Buffer ? nativeBase64ToUint8Array : __assignType$1((base64) => Buffer.from(base64, "base64"), [
1035
+ "base64",
1036
+ "",
1037
+ "P&2!\"/\""
1038
+ ]);
1039
+
1040
+ //#endregion
1041
+ //#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/path.js
1042
+ function __assignType(fn, args) {
1043
+ fn.__type = args;
1044
+ return fn;
1045
+ }
1046
+ /**
1047
+ * Normalizes the given path.
1048
+ * Removes duplicate slashes, removes trailing slashes, adds a leading slash.
1049
+ */
1050
+ function pathNormalize(path) {
1051
+ path = path[0] !== "/" ? "/" + path : path;
1052
+ path = path.length > 1 && path[path.length - 1] === "/" ? path.slice(0, -1) : path;
1053
+ return path.replace(/\/+/g, "/");
1054
+ }
1055
+ pathNormalize.__type = [
1056
+ "path",
1057
+ "pathNormalize",
1058
+ "P&2!&/\""
1059
+ ];
1060
+ /**
1061
+ * Returns the directory (dirname) of the given path.
1062
+ */
1063
+ function pathDirectory(path) {
1064
+ if (path === "/") return "/";
1065
+ const lastSlash = path.lastIndexOf("/");
1066
+ return lastSlash <= 0 ? "/" : path.slice(0, lastSlash);
1067
+ }
1068
+ pathDirectory.__type = [
1069
+ "path",
1070
+ "pathDirectory",
1071
+ "P&2!&/\""
1072
+ ];
1073
+ /**
1074
+ * Returns the basename of the given path.
1075
+ */
1076
+ function pathBasename(path) {
1077
+ const lastSlash = path.lastIndexOf("/");
1078
+ return lastSlash === -1 ? path : path.slice(lastSlash + 1);
1079
+ }
1080
+ pathBasename.__type = [
1081
+ "path",
1082
+ "pathBasename",
1083
+ "P&2!&/\""
1084
+ ];
1085
+ /**
1086
+ * Returns the extension of the given path.
1087
+ */
1088
+ function pathExtension(path) {
1089
+ const basename = pathBasename(path);
1090
+ const lastDot = basename.lastIndexOf(".");
1091
+ return lastDot === -1 ? "" : basename.slice(lastDot + 1);
1092
+ }
1093
+ pathExtension.__type = [
1094
+ "path",
1095
+ "pathExtension",
1096
+ "P&2!&/\""
1097
+ ];
1098
+ function pathJoin(...paths) {
1099
+ return "/" + paths.map(__assignType((v) => pathNormalize(v).slice(1), [
1100
+ "v",
1101
+ "",
1102
+ "P\"2!\"/\""
1103
+ ])).filter(__assignType((v) => !!v, [
1104
+ "v",
1105
+ "",
1106
+ "P\"2!\"/\""
1107
+ ])).join("/");
1108
+ }
1109
+ pathJoin.__type = [
1110
+ "paths",
1111
+ "pathJoin",
1112
+ "P&@2!&/\""
1113
+ ];
1114
+
1115
+ //#endregion
1116
+ export { AsyncEventEmitter, AsyncFunction, CompilerContext, CustomError, EmitterEvent, EventEmitter, Mutex, ParsedHost, ProcessLock, ProcessLocker, Timer, __ΩAbstractClassType, __ΩAsyncEventSubscription, __ΩClassType, __ΩCustomError, __ΩEventSubscription, __ΩExtractClassType, __ΩInject, __ΩInjectMeta, __ΩTypeAnnotation, appendObject, applyDefaults, arrayClear, arrayHasItem, arrayMoveItem, arrayRemoveItem, assertDefined, assertInstanceOf, asyncOperation, average, base64ToUint8Array, bufferConcat, bufferToString, bufferedGate, capitalize, changeClass, clearTick, collectForMicrotask, copy, createBuffer, createDynamicClass, createStack, deletePathValue, each, eachKey, eachPair, empty, ensureError, escapeRegExp, extractMethodBody, extractParameters, first, firstKey, fixAsyncOperation, formatError, forwardTypeArguments, getClassName, getClassPropertyName, getClassTypeFromInstance, getCurrentFileName, getEnumKeyLabelMap, getEnumLabel, getEnumLabels, getEnumValues, getInheritanceChain, getObjectKeysSize, getParentClass, getPathValue, getValidEnumValue, hasProperty, humanBytes, identifyType, inDebugMode, indent, indexOf, isArray, isAsyncFunction, isClass, isClassInstance, isConstructable, isFunction, isGlobalClass, isInteger, isIterable, isNull, isNumber, isNumeric, isObject, isObjectLiteral, isPlainObject, isPromise, isPrototypeOfBase, isSet, isString, isUndefined, isValidEnumValue, iterableSize, last, lastKey, log, mergePromiseStack, mergeStack, nativeBase64ToUint8Array, nextTick, parseHost, pathBasename, pathDirectory, pathExtension, pathJoin, pathNormalize, prependObjectKeys, prettyPrintObject, range, rangeArray, removeStrings, setPathValue, singleStack, size, sleep, stack, stringifyValueWithType, throttleTime, time, toFastProperties, uint8ArrayToUtf8, urlJoin, zip };