@h3ravel/config 1.4.0 → 1.4.2

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/dist/index.cjs CHANGED
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
8
  var __copyProps = (to, from, except, desc) => {
12
9
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
10
  key = keys[i];
@@ -24,6 +21,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
21
  }) : target, mod));
25
22
 
26
23
  //#endregion
24
+ let __h3ravel_core = require("@h3ravel/core");
25
+ __h3ravel_core = __toESM(__h3ravel_core);
27
26
  let __h3ravel_support = require("@h3ravel/support");
28
27
  __h3ravel_support = __toESM(__h3ravel_support);
29
28
  let node_path = require("node:path");
@@ -32,13 +31,6 @@ let node_fs_promises = require("node:fs/promises");
32
31
  node_fs_promises = __toESM(node_fs_promises);
33
32
  let __h3ravel_shared = require("@h3ravel/shared");
34
33
  __h3ravel_shared = __toESM(__h3ravel_shared);
35
- require("node:os");
36
- require("node:net");
37
- let node_util = require("node:util");
38
- node_util = __toESM(node_util);
39
- require("node:child_process");
40
- require("dotenv");
41
- require("edge.js");
42
34
 
43
35
  //#region src/ConfigRepository.ts
44
36
  var ConfigRepository = class {
@@ -59,6 +51,8 @@ var ConfigRepository = class {
59
51
  async load() {
60
52
  if (!this.loaded) {
61
53
  const configPath = this.app.getPath("config");
54
+ globalThis.env = this.app.make("env");
55
+ __h3ravel_core.Registerer.register(this.app);
62
56
  const files = (await (0, node_fs_promises.readdir)(configPath)).filter((e) => {
63
57
  return !e.includes(".d.ts") && !e.includes(".d.cts") && !e.includes(".map");
64
58
  });
@@ -88,1334 +82,6 @@ var EnvLoader = class {
88
82
  //#region src/Helpers.ts
89
83
  var Helpers = class {};
90
84
 
91
- //#endregion
92
- //#region ../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js
93
- var require_Reflect = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js": (() => {
94
- /*! *****************************************************************************
95
- Copyright (C) Microsoft. All rights reserved.
96
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
97
- this file except in compliance with the License. You may obtain a copy of the
98
- License at http://www.apache.org/licenses/LICENSE-2.0
99
-
100
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
101
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
102
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
103
- MERCHANTABLITY OR NON-INFRINGEMENT.
104
-
105
- See the Apache Version 2.0 License for specific language governing permissions
106
- and limitations under the License.
107
- ***************************************************************************** */
108
- var Reflect$1;
109
- (function(Reflect$2) {
110
- (function(factory) {
111
- var root = typeof globalThis === "object" ? globalThis : typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : sloppyModeThis();
112
- var exporter = makeExporter(Reflect$2);
113
- if (typeof root.Reflect !== "undefined") exporter = makeExporter(root.Reflect, exporter);
114
- factory(exporter, root);
115
- if (typeof root.Reflect === "undefined") root.Reflect = Reflect$2;
116
- function makeExporter(target, previous) {
117
- return function(key, value) {
118
- Object.defineProperty(target, key, {
119
- configurable: true,
120
- writable: true,
121
- value
122
- });
123
- if (previous) previous(key, value);
124
- };
125
- }
126
- function functionThis() {
127
- try {
128
- return Function("return this;")();
129
- } catch (_) {}
130
- }
131
- function indirectEvalThis() {
132
- try {
133
- return (0, eval)("(function() { return this; })()");
134
- } catch (_) {}
135
- }
136
- function sloppyModeThis() {
137
- return functionThis() || indirectEvalThis();
138
- }
139
- })(function(exporter, root) {
140
- var hasOwn = Object.prototype.hasOwnProperty;
141
- var supportsSymbol = typeof Symbol === "function";
142
- var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
143
- var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
144
- var supportsCreate = typeof Object.create === "function";
145
- var supportsProto = { __proto__: [] } instanceof Array;
146
- var downLevel = !supportsCreate && !supportsProto;
147
- var HashMap = {
148
- create: supportsCreate ? function() {
149
- return MakeDictionary(Object.create(null));
150
- } : supportsProto ? function() {
151
- return MakeDictionary({ __proto__: null });
152
- } : function() {
153
- return MakeDictionary({});
154
- },
155
- has: downLevel ? function(map, key) {
156
- return hasOwn.call(map, key);
157
- } : function(map, key) {
158
- return key in map;
159
- },
160
- get: downLevel ? function(map, key) {
161
- return hasOwn.call(map, key) ? map[key] : void 0;
162
- } : function(map, key) {
163
- return map[key];
164
- }
165
- };
166
- var functionPrototype = Object.getPrototypeOf(Function);
167
- var _Map = typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
168
- var _Set = typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
169
- var _WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
170
- var registrySymbol = supportsSymbol ? Symbol.for("@reflect-metadata:registry") : void 0;
171
- var metadataRegistry = GetOrCreateMetadataRegistry();
172
- var metadataProvider = CreateMetadataProvider(metadataRegistry);
173
- /**
174
- * Applies a set of decorators to a property of a target object.
175
- * @param decorators An array of decorators.
176
- * @param target The target object.
177
- * @param propertyKey (Optional) The property key to decorate.
178
- * @param attributes (Optional) The property descriptor for the target key.
179
- * @remarks Decorators are applied in reverse order.
180
- * @example
181
- *
182
- * class Example {
183
- * // property declarations are not part of ES6, though they are valid in TypeScript:
184
- * // static staticProperty;
185
- * // property;
186
- *
187
- * constructor(p) { }
188
- * static staticMethod(p) { }
189
- * method(p) { }
190
- * }
191
- *
192
- * // constructor
193
- * Example = Reflect.decorate(decoratorsArray, Example);
194
- *
195
- * // property (on constructor)
196
- * Reflect.decorate(decoratorsArray, Example, "staticProperty");
197
- *
198
- * // property (on prototype)
199
- * Reflect.decorate(decoratorsArray, Example.prototype, "property");
200
- *
201
- * // method (on constructor)
202
- * Object.defineProperty(Example, "staticMethod",
203
- * Reflect.decorate(decoratorsArray, Example, "staticMethod",
204
- * Object.getOwnPropertyDescriptor(Example, "staticMethod")));
205
- *
206
- * // method (on prototype)
207
- * Object.defineProperty(Example.prototype, "method",
208
- * Reflect.decorate(decoratorsArray, Example.prototype, "method",
209
- * Object.getOwnPropertyDescriptor(Example.prototype, "method")));
210
- *
211
- */
212
- function decorate(decorators, target, propertyKey, attributes) {
213
- if (!IsUndefined(propertyKey)) {
214
- if (!IsArray(decorators)) throw new TypeError();
215
- if (!IsObject(target)) throw new TypeError();
216
- if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes)) throw new TypeError();
217
- if (IsNull(attributes)) attributes = void 0;
218
- propertyKey = ToPropertyKey(propertyKey);
219
- return DecorateProperty(decorators, target, propertyKey, attributes);
220
- } else {
221
- if (!IsArray(decorators)) throw new TypeError();
222
- if (!IsConstructor(target)) throw new TypeError();
223
- return DecorateConstructor(decorators, target);
224
- }
225
- }
226
- exporter("decorate", decorate);
227
- /**
228
- * A default metadata decorator factory that can be used on a class, class member, or parameter.
229
- * @param metadataKey The key for the metadata entry.
230
- * @param metadataValue The value for the metadata entry.
231
- * @returns A decorator function.
232
- * @remarks
233
- * If `metadataKey` is already defined for the target and target key, the
234
- * metadataValue for that key will be overwritten.
235
- * @example
236
- *
237
- * // constructor
238
- * @Reflect.metadata(key, value)
239
- * class Example {
240
- * }
241
- *
242
- * // property (on constructor, TypeScript only)
243
- * class Example {
244
- * @Reflect.metadata(key, value)
245
- * static staticProperty;
246
- * }
247
- *
248
- * // property (on prototype, TypeScript only)
249
- * class Example {
250
- * @Reflect.metadata(key, value)
251
- * property;
252
- * }
253
- *
254
- * // method (on constructor)
255
- * class Example {
256
- * @Reflect.metadata(key, value)
257
- * static staticMethod() { }
258
- * }
259
- *
260
- * // method (on prototype)
261
- * class Example {
262
- * @Reflect.metadata(key, value)
263
- * method() { }
264
- * }
265
- *
266
- */
267
- function metadata(metadataKey, metadataValue) {
268
- function decorator(target, propertyKey) {
269
- if (!IsObject(target)) throw new TypeError();
270
- if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey)) throw new TypeError();
271
- OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
272
- }
273
- return decorator;
274
- }
275
- exporter("metadata", metadata);
276
- /**
277
- * Define a unique metadata entry on the target.
278
- * @param metadataKey A key used to store and retrieve metadata.
279
- * @param metadataValue A value that contains attached metadata.
280
- * @param target The target object on which to define metadata.
281
- * @param propertyKey (Optional) The property key for the target.
282
- * @example
283
- *
284
- * class Example {
285
- * // property declarations are not part of ES6, though they are valid in TypeScript:
286
- * // static staticProperty;
287
- * // property;
288
- *
289
- * constructor(p) { }
290
- * static staticMethod(p) { }
291
- * method(p) { }
292
- * }
293
- *
294
- * // constructor
295
- * Reflect.defineMetadata("custom:annotation", options, Example);
296
- *
297
- * // property (on constructor)
298
- * Reflect.defineMetadata("custom:annotation", options, Example, "staticProperty");
299
- *
300
- * // property (on prototype)
301
- * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "property");
302
- *
303
- * // method (on constructor)
304
- * Reflect.defineMetadata("custom:annotation", options, Example, "staticMethod");
305
- *
306
- * // method (on prototype)
307
- * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "method");
308
- *
309
- * // decorator factory as metadata-producing annotation.
310
- * function MyAnnotation(options): Decorator {
311
- * return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key);
312
- * }
313
- *
314
- */
315
- function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
316
- if (!IsObject(target)) throw new TypeError();
317
- if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
318
- return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
319
- }
320
- exporter("defineMetadata", defineMetadata);
321
- /**
322
- * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
323
- * @param metadataKey A key used to store and retrieve metadata.
324
- * @param target The target object on which the metadata is defined.
325
- * @param propertyKey (Optional) The property key for the target.
326
- * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
327
- * @example
328
- *
329
- * class Example {
330
- * // property declarations are not part of ES6, though they are valid in TypeScript:
331
- * // static staticProperty;
332
- * // property;
333
- *
334
- * constructor(p) { }
335
- * static staticMethod(p) { }
336
- * method(p) { }
337
- * }
338
- *
339
- * // constructor
340
- * result = Reflect.hasMetadata("custom:annotation", Example);
341
- *
342
- * // property (on constructor)
343
- * result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty");
344
- *
345
- * // property (on prototype)
346
- * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property");
347
- *
348
- * // method (on constructor)
349
- * result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod");
350
- *
351
- * // method (on prototype)
352
- * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method");
353
- *
354
- */
355
- function hasMetadata(metadataKey, target, propertyKey) {
356
- if (!IsObject(target)) throw new TypeError();
357
- if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
358
- return OrdinaryHasMetadata(metadataKey, target, propertyKey);
359
- }
360
- exporter("hasMetadata", hasMetadata);
361
- /**
362
- * Gets a value indicating whether the target object has the provided metadata key defined.
363
- * @param metadataKey A key used to store and retrieve metadata.
364
- * @param target The target object on which the metadata is defined.
365
- * @param propertyKey (Optional) The property key for the target.
366
- * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
367
- * @example
368
- *
369
- * class Example {
370
- * // property declarations are not part of ES6, though they are valid in TypeScript:
371
- * // static staticProperty;
372
- * // property;
373
- *
374
- * constructor(p) { }
375
- * static staticMethod(p) { }
376
- * method(p) { }
377
- * }
378
- *
379
- * // constructor
380
- * result = Reflect.hasOwnMetadata("custom:annotation", Example);
381
- *
382
- * // property (on constructor)
383
- * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty");
384
- *
385
- * // property (on prototype)
386
- * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property");
387
- *
388
- * // method (on constructor)
389
- * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod");
390
- *
391
- * // method (on prototype)
392
- * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method");
393
- *
394
- */
395
- function hasOwnMetadata(metadataKey, target, propertyKey) {
396
- if (!IsObject(target)) throw new TypeError();
397
- if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
398
- return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
399
- }
400
- exporter("hasOwnMetadata", hasOwnMetadata);
401
- /**
402
- * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
403
- * @param metadataKey A key used to store and retrieve metadata.
404
- * @param target The target object on which the metadata is defined.
405
- * @param propertyKey (Optional) The property key for the target.
406
- * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
407
- * @example
408
- *
409
- * class Example {
410
- * // property declarations are not part of ES6, though they are valid in TypeScript:
411
- * // static staticProperty;
412
- * // property;
413
- *
414
- * constructor(p) { }
415
- * static staticMethod(p) { }
416
- * method(p) { }
417
- * }
418
- *
419
- * // constructor
420
- * result = Reflect.getMetadata("custom:annotation", Example);
421
- *
422
- * // property (on constructor)
423
- * result = Reflect.getMetadata("custom:annotation", Example, "staticProperty");
424
- *
425
- * // property (on prototype)
426
- * result = Reflect.getMetadata("custom:annotation", Example.prototype, "property");
427
- *
428
- * // method (on constructor)
429
- * result = Reflect.getMetadata("custom:annotation", Example, "staticMethod");
430
- *
431
- * // method (on prototype)
432
- * result = Reflect.getMetadata("custom:annotation", Example.prototype, "method");
433
- *
434
- */
435
- function getMetadata(metadataKey, target, propertyKey) {
436
- if (!IsObject(target)) throw new TypeError();
437
- if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
438
- return OrdinaryGetMetadata(metadataKey, target, propertyKey);
439
- }
440
- exporter("getMetadata", getMetadata);
441
- /**
442
- * Gets the metadata value for the provided metadata key on the target object.
443
- * @param metadataKey A key used to store and retrieve metadata.
444
- * @param target The target object on which the metadata is defined.
445
- * @param propertyKey (Optional) The property key for the target.
446
- * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
447
- * @example
448
- *
449
- * class Example {
450
- * // property declarations are not part of ES6, though they are valid in TypeScript:
451
- * // static staticProperty;
452
- * // property;
453
- *
454
- * constructor(p) { }
455
- * static staticMethod(p) { }
456
- * method(p) { }
457
- * }
458
- *
459
- * // constructor
460
- * result = Reflect.getOwnMetadata("custom:annotation", Example);
461
- *
462
- * // property (on constructor)
463
- * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty");
464
- *
465
- * // property (on prototype)
466
- * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property");
467
- *
468
- * // method (on constructor)
469
- * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod");
470
- *
471
- * // method (on prototype)
472
- * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method");
473
- *
474
- */
475
- function getOwnMetadata(metadataKey, target, propertyKey) {
476
- if (!IsObject(target)) throw new TypeError();
477
- if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
478
- return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
479
- }
480
- exporter("getOwnMetadata", getOwnMetadata);
481
- /**
482
- * Gets the metadata keys defined on the target object or its prototype chain.
483
- * @param target The target object on which the metadata is defined.
484
- * @param propertyKey (Optional) The property key for the target.
485
- * @returns An array of unique metadata keys.
486
- * @example
487
- *
488
- * class Example {
489
- * // property declarations are not part of ES6, though they are valid in TypeScript:
490
- * // static staticProperty;
491
- * // property;
492
- *
493
- * constructor(p) { }
494
- * static staticMethod(p) { }
495
- * method(p) { }
496
- * }
497
- *
498
- * // constructor
499
- * result = Reflect.getMetadataKeys(Example);
500
- *
501
- * // property (on constructor)
502
- * result = Reflect.getMetadataKeys(Example, "staticProperty");
503
- *
504
- * // property (on prototype)
505
- * result = Reflect.getMetadataKeys(Example.prototype, "property");
506
- *
507
- * // method (on constructor)
508
- * result = Reflect.getMetadataKeys(Example, "staticMethod");
509
- *
510
- * // method (on prototype)
511
- * result = Reflect.getMetadataKeys(Example.prototype, "method");
512
- *
513
- */
514
- function getMetadataKeys(target, propertyKey) {
515
- if (!IsObject(target)) throw new TypeError();
516
- if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
517
- return OrdinaryMetadataKeys(target, propertyKey);
518
- }
519
- exporter("getMetadataKeys", getMetadataKeys);
520
- /**
521
- * Gets the unique metadata keys defined on the target object.
522
- * @param target The target object on which the metadata is defined.
523
- * @param propertyKey (Optional) The property key for the target.
524
- * @returns An array of unique metadata keys.
525
- * @example
526
- *
527
- * class Example {
528
- * // property declarations are not part of ES6, though they are valid in TypeScript:
529
- * // static staticProperty;
530
- * // property;
531
- *
532
- * constructor(p) { }
533
- * static staticMethod(p) { }
534
- * method(p) { }
535
- * }
536
- *
537
- * // constructor
538
- * result = Reflect.getOwnMetadataKeys(Example);
539
- *
540
- * // property (on constructor)
541
- * result = Reflect.getOwnMetadataKeys(Example, "staticProperty");
542
- *
543
- * // property (on prototype)
544
- * result = Reflect.getOwnMetadataKeys(Example.prototype, "property");
545
- *
546
- * // method (on constructor)
547
- * result = Reflect.getOwnMetadataKeys(Example, "staticMethod");
548
- *
549
- * // method (on prototype)
550
- * result = Reflect.getOwnMetadataKeys(Example.prototype, "method");
551
- *
552
- */
553
- function getOwnMetadataKeys(target, propertyKey) {
554
- if (!IsObject(target)) throw new TypeError();
555
- if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
556
- return OrdinaryOwnMetadataKeys(target, propertyKey);
557
- }
558
- exporter("getOwnMetadataKeys", getOwnMetadataKeys);
559
- /**
560
- * Deletes the metadata entry from the target object with the provided key.
561
- * @param metadataKey A key used to store and retrieve metadata.
562
- * @param target The target object on which the metadata is defined.
563
- * @param propertyKey (Optional) The property key for the target.
564
- * @returns `true` if the metadata entry was found and deleted; otherwise, false.
565
- * @example
566
- *
567
- * class Example {
568
- * // property declarations are not part of ES6, though they are valid in TypeScript:
569
- * // static staticProperty;
570
- * // property;
571
- *
572
- * constructor(p) { }
573
- * static staticMethod(p) { }
574
- * method(p) { }
575
- * }
576
- *
577
- * // constructor
578
- * result = Reflect.deleteMetadata("custom:annotation", Example);
579
- *
580
- * // property (on constructor)
581
- * result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty");
582
- *
583
- * // property (on prototype)
584
- * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property");
585
- *
586
- * // method (on constructor)
587
- * result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod");
588
- *
589
- * // method (on prototype)
590
- * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method");
591
- *
592
- */
593
- function deleteMetadata(metadataKey, target, propertyKey) {
594
- if (!IsObject(target)) throw new TypeError();
595
- if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
596
- if (!IsObject(target)) throw new TypeError();
597
- if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
598
- var provider = GetMetadataProvider(target, propertyKey, false);
599
- if (IsUndefined(provider)) return false;
600
- return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey);
601
- }
602
- exporter("deleteMetadata", deleteMetadata);
603
- function DecorateConstructor(decorators, target) {
604
- for (var i = decorators.length - 1; i >= 0; --i) {
605
- var decorator = decorators[i];
606
- var decorated = decorator(target);
607
- if (!IsUndefined(decorated) && !IsNull(decorated)) {
608
- if (!IsConstructor(decorated)) throw new TypeError();
609
- target = decorated;
610
- }
611
- }
612
- return target;
613
- }
614
- function DecorateProperty(decorators, target, propertyKey, descriptor) {
615
- for (var i = decorators.length - 1; i >= 0; --i) {
616
- var decorator = decorators[i];
617
- var decorated = decorator(target, propertyKey, descriptor);
618
- if (!IsUndefined(decorated) && !IsNull(decorated)) {
619
- if (!IsObject(decorated)) throw new TypeError();
620
- descriptor = decorated;
621
- }
622
- }
623
- return descriptor;
624
- }
625
- function OrdinaryHasMetadata(MetadataKey, O, P) {
626
- if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return true;
627
- var parent = OrdinaryGetPrototypeOf(O);
628
- if (!IsNull(parent)) return OrdinaryHasMetadata(MetadataKey, parent, P);
629
- return false;
630
- }
631
- function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
632
- var provider = GetMetadataProvider(O, P, false);
633
- if (IsUndefined(provider)) return false;
634
- return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));
635
- }
636
- function OrdinaryGetMetadata(MetadataKey, O, P) {
637
- if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return OrdinaryGetOwnMetadata(MetadataKey, O, P);
638
- var parent = OrdinaryGetPrototypeOf(O);
639
- if (!IsNull(parent)) return OrdinaryGetMetadata(MetadataKey, parent, P);
640
- }
641
- function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
642
- var provider = GetMetadataProvider(O, P, false);
643
- if (IsUndefined(provider)) return;
644
- return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P);
645
- }
646
- function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
647
- GetMetadataProvider(O, P, true).OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P);
648
- }
649
- function OrdinaryMetadataKeys(O, P) {
650
- var ownKeys = OrdinaryOwnMetadataKeys(O, P);
651
- var parent = OrdinaryGetPrototypeOf(O);
652
- if (parent === null) return ownKeys;
653
- var parentKeys = OrdinaryMetadataKeys(parent, P);
654
- if (parentKeys.length <= 0) return ownKeys;
655
- if (ownKeys.length <= 0) return parentKeys;
656
- var set = new _Set();
657
- var keys = [];
658
- for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {
659
- var key = ownKeys_1[_i];
660
- var hasKey = set.has(key);
661
- if (!hasKey) {
662
- set.add(key);
663
- keys.push(key);
664
- }
665
- }
666
- for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {
667
- var key = parentKeys_1[_a];
668
- var hasKey = set.has(key);
669
- if (!hasKey) {
670
- set.add(key);
671
- keys.push(key);
672
- }
673
- }
674
- return keys;
675
- }
676
- function OrdinaryOwnMetadataKeys(O, P) {
677
- var provider = GetMetadataProvider(O, P, false);
678
- if (!provider) return [];
679
- return provider.OrdinaryOwnMetadataKeys(O, P);
680
- }
681
- function Type(x) {
682
- if (x === null) return 1;
683
- switch (typeof x) {
684
- case "undefined": return 0;
685
- case "boolean": return 2;
686
- case "string": return 3;
687
- case "symbol": return 4;
688
- case "number": return 5;
689
- case "object": return x === null ? 1 : 6;
690
- default: return 6;
691
- }
692
- }
693
- function IsUndefined(x) {
694
- return x === void 0;
695
- }
696
- function IsNull(x) {
697
- return x === null;
698
- }
699
- function IsSymbol(x) {
700
- return typeof x === "symbol";
701
- }
702
- function IsObject(x) {
703
- return typeof x === "object" ? x !== null : typeof x === "function";
704
- }
705
- function ToPrimitive(input, PreferredType) {
706
- switch (Type(input)) {
707
- case 0: return input;
708
- case 1: return input;
709
- case 2: return input;
710
- case 3: return input;
711
- case 4: return input;
712
- case 5: return input;
713
- }
714
- var hint = PreferredType === 3 ? "string" : PreferredType === 5 ? "number" : "default";
715
- var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
716
- if (exoticToPrim !== void 0) {
717
- var result = exoticToPrim.call(input, hint);
718
- if (IsObject(result)) throw new TypeError();
719
- return result;
720
- }
721
- return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
722
- }
723
- function OrdinaryToPrimitive(O, hint) {
724
- if (hint === "string") {
725
- var toString_1 = O.toString;
726
- if (IsCallable(toString_1)) {
727
- var result = toString_1.call(O);
728
- if (!IsObject(result)) return result;
729
- }
730
- var valueOf = O.valueOf;
731
- if (IsCallable(valueOf)) {
732
- var result = valueOf.call(O);
733
- if (!IsObject(result)) return result;
734
- }
735
- } else {
736
- var valueOf = O.valueOf;
737
- if (IsCallable(valueOf)) {
738
- var result = valueOf.call(O);
739
- if (!IsObject(result)) return result;
740
- }
741
- var toString_2 = O.toString;
742
- if (IsCallable(toString_2)) {
743
- var result = toString_2.call(O);
744
- if (!IsObject(result)) return result;
745
- }
746
- }
747
- throw new TypeError();
748
- }
749
- function ToBoolean(argument) {
750
- return !!argument;
751
- }
752
- function ToString(argument) {
753
- return "" + argument;
754
- }
755
- function ToPropertyKey(argument) {
756
- var key = ToPrimitive(argument, 3);
757
- if (IsSymbol(key)) return key;
758
- return ToString(key);
759
- }
760
- function IsArray(argument) {
761
- return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]";
762
- }
763
- function IsCallable(argument) {
764
- return typeof argument === "function";
765
- }
766
- function IsConstructor(argument) {
767
- return typeof argument === "function";
768
- }
769
- function IsPropertyKey(argument) {
770
- switch (Type(argument)) {
771
- case 3: return true;
772
- case 4: return true;
773
- default: return false;
774
- }
775
- }
776
- function SameValueZero(x, y) {
777
- return x === y || x !== x && y !== y;
778
- }
779
- function GetMethod(V, P) {
780
- var func = V[P];
781
- if (func === void 0 || func === null) return void 0;
782
- if (!IsCallable(func)) throw new TypeError();
783
- return func;
784
- }
785
- function GetIterator(obj) {
786
- var method = GetMethod(obj, iteratorSymbol);
787
- if (!IsCallable(method)) throw new TypeError();
788
- var iterator = method.call(obj);
789
- if (!IsObject(iterator)) throw new TypeError();
790
- return iterator;
791
- }
792
- function IteratorValue(iterResult) {
793
- return iterResult.value;
794
- }
795
- function IteratorStep(iterator) {
796
- var result = iterator.next();
797
- return result.done ? false : result;
798
- }
799
- function IteratorClose(iterator) {
800
- var f = iterator["return"];
801
- if (f) f.call(iterator);
802
- }
803
- function OrdinaryGetPrototypeOf(O) {
804
- var proto = Object.getPrototypeOf(O);
805
- if (typeof O !== "function" || O === functionPrototype) return proto;
806
- if (proto !== functionPrototype) return proto;
807
- var prototype = O.prototype;
808
- var prototypeProto = prototype && Object.getPrototypeOf(prototype);
809
- if (prototypeProto == null || prototypeProto === Object.prototype) return proto;
810
- var constructor = prototypeProto.constructor;
811
- if (typeof constructor !== "function") return proto;
812
- if (constructor === O) return proto;
813
- return constructor;
814
- }
815
- /**
816
- * Creates a registry used to allow multiple `reflect-metadata` providers.
817
- */
818
- function CreateMetadataRegistry() {
819
- var fallback;
820
- if (!IsUndefined(registrySymbol) && typeof root.Reflect !== "undefined" && !(registrySymbol in root.Reflect) && typeof root.Reflect.defineMetadata === "function") fallback = CreateFallbackProvider(root.Reflect);
821
- var first;
822
- var second;
823
- var rest;
824
- var targetProviderMap = new _WeakMap();
825
- var registry = {
826
- registerProvider,
827
- getProvider,
828
- setProvider
829
- };
830
- return registry;
831
- function registerProvider(provider) {
832
- if (!Object.isExtensible(registry)) throw new Error("Cannot add provider to a frozen registry.");
833
- switch (true) {
834
- case fallback === provider: break;
835
- case IsUndefined(first):
836
- first = provider;
837
- break;
838
- case first === provider: break;
839
- case IsUndefined(second):
840
- second = provider;
841
- break;
842
- case second === provider: break;
843
- default:
844
- if (rest === void 0) rest = new _Set();
845
- rest.add(provider);
846
- break;
847
- }
848
- }
849
- function getProviderNoCache(O, P) {
850
- if (!IsUndefined(first)) {
851
- if (first.isProviderFor(O, P)) return first;
852
- if (!IsUndefined(second)) {
853
- if (second.isProviderFor(O, P)) return first;
854
- if (!IsUndefined(rest)) {
855
- var iterator = GetIterator(rest);
856
- while (true) {
857
- var next = IteratorStep(iterator);
858
- if (!next) return;
859
- var provider = IteratorValue(next);
860
- if (provider.isProviderFor(O, P)) {
861
- IteratorClose(iterator);
862
- return provider;
863
- }
864
- }
865
- }
866
- }
867
- }
868
- if (!IsUndefined(fallback) && fallback.isProviderFor(O, P)) return fallback;
869
- }
870
- function getProvider(O, P) {
871
- var providerMap = targetProviderMap.get(O);
872
- var provider;
873
- if (!IsUndefined(providerMap)) provider = providerMap.get(P);
874
- if (!IsUndefined(provider)) return provider;
875
- provider = getProviderNoCache(O, P);
876
- if (!IsUndefined(provider)) {
877
- if (IsUndefined(providerMap)) {
878
- providerMap = new _Map();
879
- targetProviderMap.set(O, providerMap);
880
- }
881
- providerMap.set(P, provider);
882
- }
883
- return provider;
884
- }
885
- function hasProvider(provider) {
886
- if (IsUndefined(provider)) throw new TypeError();
887
- return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider);
888
- }
889
- function setProvider(O, P, provider) {
890
- if (!hasProvider(provider)) throw new Error("Metadata provider not registered.");
891
- var existingProvider = getProvider(O, P);
892
- if (existingProvider !== provider) {
893
- if (!IsUndefined(existingProvider)) return false;
894
- var providerMap = targetProviderMap.get(O);
895
- if (IsUndefined(providerMap)) {
896
- providerMap = new _Map();
897
- targetProviderMap.set(O, providerMap);
898
- }
899
- providerMap.set(P, provider);
900
- }
901
- return true;
902
- }
903
- }
904
- /**
905
- * Gets or creates the shared registry of metadata providers.
906
- */
907
- function GetOrCreateMetadataRegistry() {
908
- var metadataRegistry$1;
909
- if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) metadataRegistry$1 = root.Reflect[registrySymbol];
910
- if (IsUndefined(metadataRegistry$1)) metadataRegistry$1 = CreateMetadataRegistry();
911
- if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) Object.defineProperty(root.Reflect, registrySymbol, {
912
- enumerable: false,
913
- configurable: false,
914
- writable: false,
915
- value: metadataRegistry$1
916
- });
917
- return metadataRegistry$1;
918
- }
919
- function CreateMetadataProvider(registry) {
920
- var metadata$1 = new _WeakMap();
921
- var provider = {
922
- isProviderFor: function(O, P) {
923
- var targetMetadata = metadata$1.get(O);
924
- if (IsUndefined(targetMetadata)) return false;
925
- return targetMetadata.has(P);
926
- },
927
- OrdinaryDefineOwnMetadata: OrdinaryDefineOwnMetadata$1,
928
- OrdinaryHasOwnMetadata: OrdinaryHasOwnMetadata$1,
929
- OrdinaryGetOwnMetadata: OrdinaryGetOwnMetadata$1,
930
- OrdinaryOwnMetadataKeys: OrdinaryOwnMetadataKeys$1,
931
- OrdinaryDeleteMetadata
932
- };
933
- metadataRegistry.registerProvider(provider);
934
- return provider;
935
- function GetOrCreateMetadataMap(O, P, Create) {
936
- var targetMetadata = metadata$1.get(O);
937
- var createdTargetMetadata = false;
938
- if (IsUndefined(targetMetadata)) {
939
- if (!Create) return void 0;
940
- targetMetadata = new _Map();
941
- metadata$1.set(O, targetMetadata);
942
- createdTargetMetadata = true;
943
- }
944
- var metadataMap = targetMetadata.get(P);
945
- if (IsUndefined(metadataMap)) {
946
- if (!Create) return void 0;
947
- metadataMap = new _Map();
948
- targetMetadata.set(P, metadataMap);
949
- if (!registry.setProvider(O, P, provider)) {
950
- targetMetadata.delete(P);
951
- if (createdTargetMetadata) metadata$1.delete(O);
952
- throw new Error("Wrong provider for target.");
953
- }
954
- }
955
- return metadataMap;
956
- }
957
- function OrdinaryHasOwnMetadata$1(MetadataKey, O, P) {
958
- var metadataMap = GetOrCreateMetadataMap(O, P, false);
959
- if (IsUndefined(metadataMap)) return false;
960
- return ToBoolean(metadataMap.has(MetadataKey));
961
- }
962
- function OrdinaryGetOwnMetadata$1(MetadataKey, O, P) {
963
- var metadataMap = GetOrCreateMetadataMap(O, P, false);
964
- if (IsUndefined(metadataMap)) return void 0;
965
- return metadataMap.get(MetadataKey);
966
- }
967
- function OrdinaryDefineOwnMetadata$1(MetadataKey, MetadataValue, O, P) {
968
- GetOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
969
- }
970
- function OrdinaryOwnMetadataKeys$1(O, P) {
971
- var keys = [];
972
- var metadataMap = GetOrCreateMetadataMap(O, P, false);
973
- if (IsUndefined(metadataMap)) return keys;
974
- var keysObj = metadataMap.keys();
975
- var iterator = GetIterator(keysObj);
976
- var k = 0;
977
- while (true) {
978
- var next = IteratorStep(iterator);
979
- if (!next) {
980
- keys.length = k;
981
- return keys;
982
- }
983
- var nextValue = IteratorValue(next);
984
- try {
985
- keys[k] = nextValue;
986
- } catch (e) {
987
- try {
988
- IteratorClose(iterator);
989
- } finally {
990
- throw e;
991
- }
992
- }
993
- k++;
994
- }
995
- }
996
- function OrdinaryDeleteMetadata(MetadataKey, O, P) {
997
- var metadataMap = GetOrCreateMetadataMap(O, P, false);
998
- if (IsUndefined(metadataMap)) return false;
999
- if (!metadataMap.delete(MetadataKey)) return false;
1000
- if (metadataMap.size === 0) {
1001
- var targetMetadata = metadata$1.get(O);
1002
- if (!IsUndefined(targetMetadata)) {
1003
- targetMetadata.delete(P);
1004
- if (targetMetadata.size === 0) metadata$1.delete(targetMetadata);
1005
- }
1006
- }
1007
- return true;
1008
- }
1009
- }
1010
- function CreateFallbackProvider(reflect) {
1011
- var defineMetadata$1 = reflect.defineMetadata, hasOwnMetadata$1 = reflect.hasOwnMetadata, getOwnMetadata$1 = reflect.getOwnMetadata, getOwnMetadataKeys$1 = reflect.getOwnMetadataKeys, deleteMetadata$1 = reflect.deleteMetadata;
1012
- var metadataOwner = new _WeakMap();
1013
- return {
1014
- isProviderFor: function(O, P) {
1015
- var metadataPropertySet = metadataOwner.get(O);
1016
- if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) return true;
1017
- if (getOwnMetadataKeys$1(O, P).length) {
1018
- if (IsUndefined(metadataPropertySet)) {
1019
- metadataPropertySet = new _Set();
1020
- metadataOwner.set(O, metadataPropertySet);
1021
- }
1022
- metadataPropertySet.add(P);
1023
- return true;
1024
- }
1025
- return false;
1026
- },
1027
- OrdinaryDefineOwnMetadata: defineMetadata$1,
1028
- OrdinaryHasOwnMetadata: hasOwnMetadata$1,
1029
- OrdinaryGetOwnMetadata: getOwnMetadata$1,
1030
- OrdinaryOwnMetadataKeys: getOwnMetadataKeys$1,
1031
- OrdinaryDeleteMetadata: deleteMetadata$1
1032
- };
1033
- }
1034
- /**
1035
- * Gets the metadata provider for an object. If the object has no metadata provider and this is for a create operation,
1036
- * then this module's metadata provider is assigned to the object.
1037
- */
1038
- function GetMetadataProvider(O, P, Create) {
1039
- var registeredProvider = metadataRegistry.getProvider(O, P);
1040
- if (!IsUndefined(registeredProvider)) return registeredProvider;
1041
- if (Create) {
1042
- if (metadataRegistry.setProvider(O, P, metadataProvider)) return metadataProvider;
1043
- throw new Error("Illegal state.");
1044
- }
1045
- }
1046
- function CreateMapPolyfill() {
1047
- var cacheSentinel = {};
1048
- var arraySentinel = [];
1049
- var MapIterator = function() {
1050
- function MapIterator$1(keys, values, selector) {
1051
- this._index = 0;
1052
- this._keys = keys;
1053
- this._values = values;
1054
- this._selector = selector;
1055
- }
1056
- MapIterator$1.prototype["@@iterator"] = function() {
1057
- return this;
1058
- };
1059
- MapIterator$1.prototype[iteratorSymbol] = function() {
1060
- return this;
1061
- };
1062
- MapIterator$1.prototype.next = function() {
1063
- var index = this._index;
1064
- if (index >= 0 && index < this._keys.length) {
1065
- var result = this._selector(this._keys[index], this._values[index]);
1066
- if (index + 1 >= this._keys.length) {
1067
- this._index = -1;
1068
- this._keys = arraySentinel;
1069
- this._values = arraySentinel;
1070
- } else this._index++;
1071
- return {
1072
- value: result,
1073
- done: false
1074
- };
1075
- }
1076
- return {
1077
- value: void 0,
1078
- done: true
1079
- };
1080
- };
1081
- MapIterator$1.prototype.throw = function(error) {
1082
- if (this._index >= 0) {
1083
- this._index = -1;
1084
- this._keys = arraySentinel;
1085
- this._values = arraySentinel;
1086
- }
1087
- throw error;
1088
- };
1089
- MapIterator$1.prototype.return = function(value) {
1090
- if (this._index >= 0) {
1091
- this._index = -1;
1092
- this._keys = arraySentinel;
1093
- this._values = arraySentinel;
1094
- }
1095
- return {
1096
- value,
1097
- done: true
1098
- };
1099
- };
1100
- return MapIterator$1;
1101
- }();
1102
- return function() {
1103
- function Map$1() {
1104
- this._keys = [];
1105
- this._values = [];
1106
- this._cacheKey = cacheSentinel;
1107
- this._cacheIndex = -2;
1108
- }
1109
- Object.defineProperty(Map$1.prototype, "size", {
1110
- get: function() {
1111
- return this._keys.length;
1112
- },
1113
- enumerable: true,
1114
- configurable: true
1115
- });
1116
- Map$1.prototype.has = function(key) {
1117
- return this._find(key, false) >= 0;
1118
- };
1119
- Map$1.prototype.get = function(key) {
1120
- var index = this._find(key, false);
1121
- return index >= 0 ? this._values[index] : void 0;
1122
- };
1123
- Map$1.prototype.set = function(key, value) {
1124
- var index = this._find(key, true);
1125
- this._values[index] = value;
1126
- return this;
1127
- };
1128
- Map$1.prototype.delete = function(key) {
1129
- var index = this._find(key, false);
1130
- if (index >= 0) {
1131
- var size = this._keys.length;
1132
- for (var i = index + 1; i < size; i++) {
1133
- this._keys[i - 1] = this._keys[i];
1134
- this._values[i - 1] = this._values[i];
1135
- }
1136
- this._keys.length--;
1137
- this._values.length--;
1138
- if (SameValueZero(key, this._cacheKey)) {
1139
- this._cacheKey = cacheSentinel;
1140
- this._cacheIndex = -2;
1141
- }
1142
- return true;
1143
- }
1144
- return false;
1145
- };
1146
- Map$1.prototype.clear = function() {
1147
- this._keys.length = 0;
1148
- this._values.length = 0;
1149
- this._cacheKey = cacheSentinel;
1150
- this._cacheIndex = -2;
1151
- };
1152
- Map$1.prototype.keys = function() {
1153
- return new MapIterator(this._keys, this._values, getKey);
1154
- };
1155
- Map$1.prototype.values = function() {
1156
- return new MapIterator(this._keys, this._values, getValue);
1157
- };
1158
- Map$1.prototype.entries = function() {
1159
- return new MapIterator(this._keys, this._values, getEntry);
1160
- };
1161
- Map$1.prototype["@@iterator"] = function() {
1162
- return this.entries();
1163
- };
1164
- Map$1.prototype[iteratorSymbol] = function() {
1165
- return this.entries();
1166
- };
1167
- Map$1.prototype._find = function(key, insert) {
1168
- if (!SameValueZero(this._cacheKey, key)) {
1169
- this._cacheIndex = -1;
1170
- for (var i = 0; i < this._keys.length; i++) if (SameValueZero(this._keys[i], key)) {
1171
- this._cacheIndex = i;
1172
- break;
1173
- }
1174
- }
1175
- if (this._cacheIndex < 0 && insert) {
1176
- this._cacheIndex = this._keys.length;
1177
- this._keys.push(key);
1178
- this._values.push(void 0);
1179
- }
1180
- return this._cacheIndex;
1181
- };
1182
- return Map$1;
1183
- }();
1184
- function getKey(key, _) {
1185
- return key;
1186
- }
1187
- function getValue(_, value) {
1188
- return value;
1189
- }
1190
- function getEntry(key, value) {
1191
- return [key, value];
1192
- }
1193
- }
1194
- function CreateSetPolyfill() {
1195
- return function() {
1196
- function Set$1() {
1197
- this._map = new _Map();
1198
- }
1199
- Object.defineProperty(Set$1.prototype, "size", {
1200
- get: function() {
1201
- return this._map.size;
1202
- },
1203
- enumerable: true,
1204
- configurable: true
1205
- });
1206
- Set$1.prototype.has = function(value) {
1207
- return this._map.has(value);
1208
- };
1209
- Set$1.prototype.add = function(value) {
1210
- return this._map.set(value, value), this;
1211
- };
1212
- Set$1.prototype.delete = function(value) {
1213
- return this._map.delete(value);
1214
- };
1215
- Set$1.prototype.clear = function() {
1216
- this._map.clear();
1217
- };
1218
- Set$1.prototype.keys = function() {
1219
- return this._map.keys();
1220
- };
1221
- Set$1.prototype.values = function() {
1222
- return this._map.keys();
1223
- };
1224
- Set$1.prototype.entries = function() {
1225
- return this._map.entries();
1226
- };
1227
- Set$1.prototype["@@iterator"] = function() {
1228
- return this.keys();
1229
- };
1230
- Set$1.prototype[iteratorSymbol] = function() {
1231
- return this.keys();
1232
- };
1233
- return Set$1;
1234
- }();
1235
- }
1236
- function CreateWeakMapPolyfill() {
1237
- var UUID_SIZE = 16;
1238
- var keys = HashMap.create();
1239
- var rootKey = CreateUniqueKey();
1240
- return function() {
1241
- function WeakMap$1() {
1242
- this._key = CreateUniqueKey();
1243
- }
1244
- WeakMap$1.prototype.has = function(target) {
1245
- var table = GetOrCreateWeakMapTable(target, false);
1246
- return table !== void 0 ? HashMap.has(table, this._key) : false;
1247
- };
1248
- WeakMap$1.prototype.get = function(target) {
1249
- var table = GetOrCreateWeakMapTable(target, false);
1250
- return table !== void 0 ? HashMap.get(table, this._key) : void 0;
1251
- };
1252
- WeakMap$1.prototype.set = function(target, value) {
1253
- var table = GetOrCreateWeakMapTable(target, true);
1254
- table[this._key] = value;
1255
- return this;
1256
- };
1257
- WeakMap$1.prototype.delete = function(target) {
1258
- var table = GetOrCreateWeakMapTable(target, false);
1259
- return table !== void 0 ? delete table[this._key] : false;
1260
- };
1261
- WeakMap$1.prototype.clear = function() {
1262
- this._key = CreateUniqueKey();
1263
- };
1264
- return WeakMap$1;
1265
- }();
1266
- function CreateUniqueKey() {
1267
- var key;
1268
- do
1269
- key = "@@WeakMap@@" + CreateUUID();
1270
- while (HashMap.has(keys, key));
1271
- keys[key] = true;
1272
- return key;
1273
- }
1274
- function GetOrCreateWeakMapTable(target, create) {
1275
- if (!hasOwn.call(target, rootKey)) {
1276
- if (!create) return void 0;
1277
- Object.defineProperty(target, rootKey, { value: HashMap.create() });
1278
- }
1279
- return target[rootKey];
1280
- }
1281
- function FillRandomBytes(buffer, size) {
1282
- for (var i = 0; i < size; ++i) buffer[i] = Math.random() * 255 | 0;
1283
- return buffer;
1284
- }
1285
- function GenRandomBytes(size) {
1286
- if (typeof Uint8Array === "function") {
1287
- var array = new Uint8Array(size);
1288
- if (typeof crypto !== "undefined") crypto.getRandomValues(array);
1289
- else if (typeof msCrypto !== "undefined") msCrypto.getRandomValues(array);
1290
- else FillRandomBytes(array, size);
1291
- return array;
1292
- }
1293
- return FillRandomBytes(new Array(size), size);
1294
- }
1295
- function CreateUUID() {
1296
- var data = GenRandomBytes(UUID_SIZE);
1297
- data[6] = data[6] & 79 | 64;
1298
- data[8] = data[8] & 191 | 128;
1299
- var result = "";
1300
- for (var offset = 0; offset < UUID_SIZE; ++offset) {
1301
- var byte = data[offset];
1302
- if (offset === 4 || offset === 6 || offset === 8) result += "-";
1303
- if (byte < 16) result += "0";
1304
- result += byte.toString(16).toLowerCase();
1305
- }
1306
- return result;
1307
- }
1308
- }
1309
- function MakeDictionary(obj) {
1310
- obj.__ = void 0;
1311
- delete obj.__;
1312
- return obj;
1313
- }
1314
- });
1315
- })(Reflect$1 || (Reflect$1 = {}));
1316
- }) });
1317
-
1318
- //#endregion
1319
- //#region ../../node_modules/.pnpm/address@2.0.3/node_modules/address/dist/esm/address.js
1320
- var import_Reflect = /* @__PURE__ */ __toESM(require_Reflect(), 1);
1321
-
1322
- //#endregion
1323
- //#region ../../node_modules/.pnpm/detect-port@2.1.0/node_modules/detect-port/dist/esm/detect-port.js
1324
- const debug$1 = (0, node_util.debuglog)("detect-port");
1325
-
1326
- //#endregion
1327
- //#region ../../node_modules/.pnpm/detect-port@2.1.0/node_modules/detect-port/dist/esm/wait-port.js
1328
- const debug = (0, node_util.debuglog)("detect-port:wait-port");
1329
-
1330
- //#endregion
1331
- //#region ../../node_modules/.pnpm/dotenv-expand@12.0.3/node_modules/dotenv-expand/lib/main.js
1332
- var require_main = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/dotenv-expand@12.0.3/node_modules/dotenv-expand/lib/main.js": ((exports, module) => {
1333
- function _resolveEscapeSequences(value) {
1334
- return value.replace(/\\\$/g, "$");
1335
- }
1336
- function expandValue(value, processEnv, runningParsed) {
1337
- const env$1 = {
1338
- ...runningParsed,
1339
- ...processEnv
1340
- };
1341
- const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
1342
- let result = value;
1343
- let match;
1344
- const seen = /* @__PURE__ */ new Set();
1345
- while ((match = regex.exec(result)) !== null) {
1346
- seen.add(result);
1347
- const [template, bracedExpression, unbracedExpression] = match;
1348
- const expression = bracedExpression || unbracedExpression;
1349
- const opMatch = expression.match(/(:\+|\+|:-|-)/);
1350
- const splitter = opMatch ? opMatch[0] : null;
1351
- const r = expression.split(splitter);
1352
- let defaultValue;
1353
- let value$1;
1354
- const key = r.shift();
1355
- if ([":+", "+"].includes(splitter)) {
1356
- defaultValue = env$1[key] ? r.join(splitter) : "";
1357
- value$1 = null;
1358
- } else {
1359
- defaultValue = r.join(splitter);
1360
- value$1 = env$1[key];
1361
- }
1362
- if (value$1) if (seen.has(value$1)) result = result.replace(template, defaultValue);
1363
- else result = result.replace(template, value$1);
1364
- else result = result.replace(template, defaultValue);
1365
- if (result === runningParsed[key]) break;
1366
- regex.lastIndex = 0;
1367
- }
1368
- return result;
1369
- }
1370
- function expand(options) {
1371
- const runningParsed = {};
1372
- let processEnv = process.env;
1373
- if (options && options.processEnv != null) processEnv = options.processEnv;
1374
- for (const key in options.parsed) {
1375
- let value = options.parsed[key];
1376
- if (processEnv[key] && processEnv[key] !== value) value = processEnv[key];
1377
- else value = expandValue(value, processEnv, runningParsed);
1378
- options.parsed[key] = _resolveEscapeSequences(value);
1379
- runningParsed[key] = _resolveEscapeSequences(value);
1380
- }
1381
- for (const processKey in options.parsed) processEnv[processKey] = options.parsed[processKey];
1382
- return options;
1383
- }
1384
- module.exports.expand = expand;
1385
- }) });
1386
-
1387
- //#endregion
1388
- //#region ../core/dist/index.js
1389
- var import_main = /* @__PURE__ */ __toESM(require_main(), 1);
1390
- var ServiceProvider = class {
1391
- /**
1392
- * Sort order
1393
- */
1394
- static order;
1395
- /**
1396
- * Sort priority
1397
- */
1398
- static priority = 0;
1399
- /**
1400
- * Indicate that this service provider only runs in console
1401
- */
1402
- static console = false;
1403
- /**
1404
- * List of registered console commands
1405
- */
1406
- registeredCommands;
1407
- app;
1408
- constructor(app) {
1409
- this.app = app;
1410
- }
1411
- /**
1412
- * An array of console commands to register.
1413
- */
1414
- commands(commands) {
1415
- this.registeredCommands = commands;
1416
- }
1417
- };
1418
-
1419
85
  //#endregion
1420
86
  //#region src/Providers/ConfigServiceProvider.ts
1421
87
  /**
@@ -1426,16 +92,16 @@ var ServiceProvider = class {
1426
92
  *
1427
93
  * Auto-Registered
1428
94
  */
1429
- var ConfigServiceProvider = class extends ServiceProvider {
95
+ var ConfigServiceProvider = class extends __h3ravel_core.ServiceProvider {
1430
96
  static priority = 998;
1431
97
  async register() {
1432
98
  /**
1433
99
  * Create singleton to load env
1434
100
  */
1435
101
  this.app.singleton("env", () => {
1436
- const env$1 = new EnvLoader(this.app).get;
1437
- globalThis.env = env$1;
1438
- return env$1;
102
+ const env = new EnvLoader(this.app).get;
103
+ globalThis.env = env;
104
+ return env;
1439
105
  });
1440
106
  /**
1441
107
  * Initialize the configuration through the repository