@orion-js/services 4.0.0-alpha.3 → 4.0.0-next.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 +479 -932
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +4 -11
- package/dist/index.js +461 -917
- package/dist/index.js.map +1 -0
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -1,567 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
1
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
7
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
8
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
9
|
-
for (let key of __getOwnPropNames(mod))
|
|
10
|
-
if (!__hasOwnProp.call(to, key))
|
|
11
|
-
__defProp(to, key, {
|
|
12
|
-
get: () => mod[key],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
18
|
-
|
|
19
|
-
// ../../node_modules/typedi/cjs/token.class.js
|
|
20
|
-
var require_token_class = __commonJS((exports) => {
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.Token = undefined;
|
|
23
|
-
|
|
24
|
-
class Token {
|
|
25
|
-
constructor(name) {
|
|
26
|
-
this.name = name;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.Token = Token;
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// ../../node_modules/typedi/cjs/error/service-not-found.error.js
|
|
33
|
-
var require_service_not_found_error = __commonJS((exports) => {
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.ServiceNotFoundError = undefined;
|
|
36
|
-
var token_class_1 = require_token_class();
|
|
37
|
-
|
|
38
|
-
class ServiceNotFoundError extends Error {
|
|
39
|
-
constructor(identifier) {
|
|
40
|
-
var _a, _b;
|
|
41
|
-
super();
|
|
42
|
-
this.name = "ServiceNotFoundError";
|
|
43
|
-
this.normalizedIdentifier = "<UNKNOWN_IDENTIFIER>";
|
|
44
|
-
if (typeof identifier === "string") {
|
|
45
|
-
this.normalizedIdentifier = identifier;
|
|
46
|
-
} else if (identifier instanceof token_class_1.Token) {
|
|
47
|
-
this.normalizedIdentifier = `Token<${identifier.name || "UNSET_NAME"}>`;
|
|
48
|
-
} else if (identifier && (identifier.name || ((_a = identifier.prototype) === null || _a === undefined ? undefined : _a.name))) {
|
|
49
|
-
this.normalizedIdentifier = `MaybeConstructable<${identifier.name}>` || `MaybeConstructable<${(_b = identifier.prototype) === null || _b === undefined ? undefined : _b.name}>`;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
get message() {
|
|
53
|
-
return `Service with "${this.normalizedIdentifier}" identifier was not found in the container. ` + `Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator.`;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.ServiceNotFoundError = ServiceNotFoundError;
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// ../../node_modules/typedi/cjs/error/cannot-instantiate-value.error.js
|
|
60
|
-
var require_cannot_instantiate_value_error = __commonJS((exports) => {
|
|
61
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
exports.CannotInstantiateValueError = undefined;
|
|
63
|
-
var token_class_1 = require_token_class();
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
64
3
|
|
|
65
|
-
|
|
66
|
-
constructor(identifier) {
|
|
67
|
-
var _a, _b;
|
|
68
|
-
super();
|
|
69
|
-
this.name = "CannotInstantiateValueError";
|
|
70
|
-
this.normalizedIdentifier = "<UNKNOWN_IDENTIFIER>";
|
|
71
|
-
if (typeof identifier === "string") {
|
|
72
|
-
this.normalizedIdentifier = identifier;
|
|
73
|
-
} else if (identifier instanceof token_class_1.Token) {
|
|
74
|
-
this.normalizedIdentifier = `Token<${identifier.name || "UNSET_NAME"}>`;
|
|
75
|
-
} else if (identifier && (identifier.name || ((_a = identifier.prototype) === null || _a === undefined ? undefined : _a.name))) {
|
|
76
|
-
this.normalizedIdentifier = `MaybeConstructable<${identifier.name}>` || `MaybeConstructable<${(_b = identifier.prototype) === null || _b === undefined ? undefined : _b.name}>`;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
get message() {
|
|
80
|
-
return `Cannot instantiate the requested value for the "${this.normalizedIdentifier}" identifier. ` + `The related metadata doesn't contain a factory or a type to instantiate.`;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.CannotInstantiateValueError = CannotInstantiateValueError;
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
// ../../node_modules/typedi/cjs/empty.const.js
|
|
87
|
-
var require_empty_const = __commonJS((exports) => {
|
|
88
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
89
|
-
exports.EMPTY_VALUE = undefined;
|
|
90
|
-
exports.EMPTY_VALUE = Symbol("EMPTY_VALUE");
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// ../../node_modules/typedi/cjs/container-instance.class.js
|
|
94
|
-
var require_container_instance_class = __commonJS((exports) => {
|
|
95
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
96
|
-
exports.ContainerInstance = undefined;
|
|
97
|
-
var container_class_1 = require_container_class();
|
|
98
|
-
var service_not_found_error_1 = require_service_not_found_error();
|
|
99
|
-
var cannot_instantiate_value_error_1 = require_cannot_instantiate_value_error();
|
|
100
|
-
var token_class_1 = require_token_class();
|
|
101
|
-
var empty_const_1 = require_empty_const();
|
|
102
|
-
|
|
103
|
-
class ContainerInstance {
|
|
104
|
-
constructor(id) {
|
|
105
|
-
this.services = [];
|
|
106
|
-
this.id = id;
|
|
107
|
-
}
|
|
108
|
-
has(identifier) {
|
|
109
|
-
return !!this.findService(identifier);
|
|
110
|
-
}
|
|
111
|
-
get(identifier) {
|
|
112
|
-
const globalContainer = container_class_1.Container.of(undefined);
|
|
113
|
-
const globalService = globalContainer.findService(identifier);
|
|
114
|
-
const scopedService = this.findService(identifier);
|
|
115
|
-
if (globalService && globalService.global === true)
|
|
116
|
-
return this.getServiceValue(globalService);
|
|
117
|
-
if (scopedService)
|
|
118
|
-
return this.getServiceValue(scopedService);
|
|
119
|
-
if (globalService && this !== globalContainer) {
|
|
120
|
-
const clonedService = { ...globalService };
|
|
121
|
-
clonedService.value = empty_const_1.EMPTY_VALUE;
|
|
122
|
-
this.set(clonedService);
|
|
123
|
-
const value = this.getServiceValue(clonedService);
|
|
124
|
-
this.set({ ...clonedService, value });
|
|
125
|
-
return value;
|
|
126
|
-
}
|
|
127
|
-
if (globalService)
|
|
128
|
-
return this.getServiceValue(globalService);
|
|
129
|
-
throw new service_not_found_error_1.ServiceNotFoundError(identifier);
|
|
130
|
-
}
|
|
131
|
-
getMany(identifier) {
|
|
132
|
-
return this.findAllServices(identifier).map((service) => this.getServiceValue(service));
|
|
133
|
-
}
|
|
134
|
-
set(identifierOrServiceMetadata, value) {
|
|
135
|
-
if (identifierOrServiceMetadata instanceof Array) {
|
|
136
|
-
identifierOrServiceMetadata.forEach((data) => this.set(data));
|
|
137
|
-
return this;
|
|
138
|
-
}
|
|
139
|
-
if (typeof identifierOrServiceMetadata === "string" || identifierOrServiceMetadata instanceof token_class_1.Token) {
|
|
140
|
-
return this.set({
|
|
141
|
-
id: identifierOrServiceMetadata,
|
|
142
|
-
type: null,
|
|
143
|
-
value,
|
|
144
|
-
factory: undefined,
|
|
145
|
-
global: false,
|
|
146
|
-
multiple: false,
|
|
147
|
-
eager: false,
|
|
148
|
-
transient: false
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
if (typeof identifierOrServiceMetadata === "function") {
|
|
152
|
-
return this.set({
|
|
153
|
-
id: identifierOrServiceMetadata,
|
|
154
|
-
type: identifierOrServiceMetadata,
|
|
155
|
-
value,
|
|
156
|
-
factory: undefined,
|
|
157
|
-
global: false,
|
|
158
|
-
multiple: false,
|
|
159
|
-
eager: false,
|
|
160
|
-
transient: false
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
const newService = {
|
|
164
|
-
id: new token_class_1.Token("UNREACHABLE"),
|
|
165
|
-
type: null,
|
|
166
|
-
factory: undefined,
|
|
167
|
-
value: empty_const_1.EMPTY_VALUE,
|
|
168
|
-
global: false,
|
|
169
|
-
multiple: false,
|
|
170
|
-
eager: false,
|
|
171
|
-
transient: false,
|
|
172
|
-
...identifierOrServiceMetadata
|
|
173
|
-
};
|
|
174
|
-
const service = this.findService(newService.id);
|
|
175
|
-
if (service && service.multiple !== true) {
|
|
176
|
-
Object.assign(service, newService);
|
|
177
|
-
} else {
|
|
178
|
-
this.services.push(newService);
|
|
179
|
-
}
|
|
180
|
-
if (newService.eager) {
|
|
181
|
-
this.get(newService.id);
|
|
182
|
-
}
|
|
183
|
-
return this;
|
|
184
|
-
}
|
|
185
|
-
remove(identifierOrIdentifierArray) {
|
|
186
|
-
if (Array.isArray(identifierOrIdentifierArray)) {
|
|
187
|
-
identifierOrIdentifierArray.forEach((id) => this.remove(id));
|
|
188
|
-
} else {
|
|
189
|
-
this.services = this.services.filter((service) => {
|
|
190
|
-
if (service.id === identifierOrIdentifierArray) {
|
|
191
|
-
this.destroyServiceInstance(service);
|
|
192
|
-
return false;
|
|
193
|
-
}
|
|
194
|
-
return true;
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
return this;
|
|
198
|
-
}
|
|
199
|
-
reset(options = { strategy: "resetValue" }) {
|
|
200
|
-
switch (options.strategy) {
|
|
201
|
-
case "resetValue":
|
|
202
|
-
this.services.forEach((service) => this.destroyServiceInstance(service));
|
|
203
|
-
break;
|
|
204
|
-
case "resetServices":
|
|
205
|
-
this.services.forEach((service) => this.destroyServiceInstance(service));
|
|
206
|
-
this.services = [];
|
|
207
|
-
break;
|
|
208
|
-
default:
|
|
209
|
-
throw new Error("Received invalid reset strategy.");
|
|
210
|
-
}
|
|
211
|
-
return this;
|
|
212
|
-
}
|
|
213
|
-
findAllServices(identifier) {
|
|
214
|
-
return this.services.filter((service) => service.id === identifier);
|
|
215
|
-
}
|
|
216
|
-
findService(identifier) {
|
|
217
|
-
return this.services.find((service) => service.id === identifier);
|
|
218
|
-
}
|
|
219
|
-
getServiceValue(serviceMetadata) {
|
|
220
|
-
var _a;
|
|
221
|
-
let value = empty_const_1.EMPTY_VALUE;
|
|
222
|
-
if (serviceMetadata.value !== empty_const_1.EMPTY_VALUE) {
|
|
223
|
-
return serviceMetadata.value;
|
|
224
|
-
}
|
|
225
|
-
if (!serviceMetadata.factory && !serviceMetadata.type) {
|
|
226
|
-
throw new cannot_instantiate_value_error_1.CannotInstantiateValueError(serviceMetadata.id);
|
|
227
|
-
}
|
|
228
|
-
if (serviceMetadata.factory) {
|
|
229
|
-
if (serviceMetadata.factory instanceof Array) {
|
|
230
|
-
let factoryInstance;
|
|
231
|
-
try {
|
|
232
|
-
factoryInstance = this.get(serviceMetadata.factory[0]);
|
|
233
|
-
} catch (error) {
|
|
234
|
-
if (error instanceof service_not_found_error_1.ServiceNotFoundError) {
|
|
235
|
-
factoryInstance = new serviceMetadata.factory[0];
|
|
236
|
-
} else {
|
|
237
|
-
throw error;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
value = factoryInstance[serviceMetadata.factory[1]](this, serviceMetadata.id);
|
|
241
|
-
} else {
|
|
242
|
-
value = serviceMetadata.factory(this, serviceMetadata.id);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
if (!serviceMetadata.factory && serviceMetadata.type) {
|
|
246
|
-
const constructableTargetType = serviceMetadata.type;
|
|
247
|
-
const paramTypes = ((_a = Reflect) === null || _a === undefined ? undefined : _a.getMetadata("design:paramtypes", constructableTargetType)) || [];
|
|
248
|
-
const params = this.initializeParams(constructableTargetType, paramTypes);
|
|
249
|
-
params.push(this);
|
|
250
|
-
value = new constructableTargetType(...params);
|
|
251
|
-
}
|
|
252
|
-
if (!serviceMetadata.transient && value !== empty_const_1.EMPTY_VALUE) {
|
|
253
|
-
serviceMetadata.value = value;
|
|
254
|
-
}
|
|
255
|
-
if (value === empty_const_1.EMPTY_VALUE) {
|
|
256
|
-
throw new cannot_instantiate_value_error_1.CannotInstantiateValueError(serviceMetadata.id);
|
|
257
|
-
}
|
|
258
|
-
if (serviceMetadata.type) {
|
|
259
|
-
this.applyPropertyHandlers(serviceMetadata.type, value);
|
|
260
|
-
}
|
|
261
|
-
return value;
|
|
262
|
-
}
|
|
263
|
-
initializeParams(target, paramTypes) {
|
|
264
|
-
return paramTypes.map((paramType, index) => {
|
|
265
|
-
const paramHandler = container_class_1.Container.handlers.find((handler) => {
|
|
266
|
-
return (handler.object === target || handler.object === Object.getPrototypeOf(target)) && handler.index === index;
|
|
267
|
-
});
|
|
268
|
-
if (paramHandler)
|
|
269
|
-
return paramHandler.value(this);
|
|
270
|
-
if (paramType && paramType.name && !this.isPrimitiveParamType(paramType.name)) {
|
|
271
|
-
return this.get(paramType);
|
|
272
|
-
}
|
|
273
|
-
return;
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
isPrimitiveParamType(paramTypeName) {
|
|
277
|
-
return ["string", "boolean", "number", "object"].includes(paramTypeName.toLowerCase());
|
|
278
|
-
}
|
|
279
|
-
applyPropertyHandlers(target, instance) {
|
|
280
|
-
container_class_1.Container.handlers.forEach((handler) => {
|
|
281
|
-
if (typeof handler.index === "number")
|
|
282
|
-
return;
|
|
283
|
-
if (handler.object.constructor !== target && !(target.prototype instanceof handler.object.constructor))
|
|
284
|
-
return;
|
|
285
|
-
if (handler.propertyName) {
|
|
286
|
-
instance[handler.propertyName] = handler.value(this);
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
destroyServiceInstance(serviceMetadata, force = false) {
|
|
291
|
-
const shouldResetValue = force || !!serviceMetadata.type || !!serviceMetadata.factory;
|
|
292
|
-
if (shouldResetValue) {
|
|
293
|
-
if (typeof (serviceMetadata === null || serviceMetadata === undefined ? undefined : serviceMetadata.value)["destroy"] === "function") {
|
|
294
|
-
try {
|
|
295
|
-
serviceMetadata.value.destroy();
|
|
296
|
-
} catch (error) {
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
serviceMetadata.value = empty_const_1.EMPTY_VALUE;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
exports.ContainerInstance = ContainerInstance;
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
// ../../node_modules/typedi/cjs/container.class.js
|
|
307
|
-
var require_container_class = __commonJS((exports) => {
|
|
308
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
309
|
-
exports.Container = undefined;
|
|
310
|
-
var container_instance_class_1 = require_container_instance_class();
|
|
311
|
-
|
|
312
|
-
class Container {
|
|
313
|
-
static of(containerId = "default") {
|
|
314
|
-
if (containerId === "default")
|
|
315
|
-
return this.globalInstance;
|
|
316
|
-
let container = this.instances.find((instance) => instance.id === containerId);
|
|
317
|
-
if (!container) {
|
|
318
|
-
container = new container_instance_class_1.ContainerInstance(containerId);
|
|
319
|
-
this.instances.push(container);
|
|
320
|
-
}
|
|
321
|
-
return container;
|
|
322
|
-
}
|
|
323
|
-
static has(identifier) {
|
|
324
|
-
return this.globalInstance.has(identifier);
|
|
325
|
-
}
|
|
326
|
-
static get(identifier) {
|
|
327
|
-
return this.globalInstance.get(identifier);
|
|
328
|
-
}
|
|
329
|
-
static getMany(id) {
|
|
330
|
-
return this.globalInstance.getMany(id);
|
|
331
|
-
}
|
|
332
|
-
static set(identifierOrServiceMetadata, value) {
|
|
333
|
-
this.globalInstance.set(identifierOrServiceMetadata, value);
|
|
334
|
-
return this;
|
|
335
|
-
}
|
|
336
|
-
static remove(identifierOrIdentifierArray) {
|
|
337
|
-
this.globalInstance.remove(identifierOrIdentifierArray);
|
|
338
|
-
return this;
|
|
339
|
-
}
|
|
340
|
-
static reset(containerId = "default") {
|
|
341
|
-
if (containerId == "default") {
|
|
342
|
-
this.globalInstance.reset();
|
|
343
|
-
this.instances.forEach((instance) => instance.reset());
|
|
344
|
-
} else {
|
|
345
|
-
const instance = this.instances.find((instance2) => instance2.id === containerId);
|
|
346
|
-
if (instance) {
|
|
347
|
-
instance.reset();
|
|
348
|
-
this.instances.splice(this.instances.indexOf(instance), 1);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
return this;
|
|
352
|
-
}
|
|
353
|
-
static registerHandler(handler) {
|
|
354
|
-
this.handlers.push(handler);
|
|
355
|
-
return this;
|
|
356
|
-
}
|
|
357
|
-
static import(services) {
|
|
358
|
-
return this;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
exports.Container = Container;
|
|
362
|
-
Container.handlers = [];
|
|
363
|
-
Container.globalInstance = new container_instance_class_1.ContainerInstance("default");
|
|
364
|
-
Container.instances = [];
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
// ../../node_modules/typedi/cjs/error/cannot-inject-value.error.js
|
|
368
|
-
var require_cannot_inject_value_error = __commonJS((exports) => {
|
|
369
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
370
|
-
exports.CannotInjectValueError = undefined;
|
|
371
|
-
|
|
372
|
-
class CannotInjectValueError extends Error {
|
|
373
|
-
constructor(target, propertyName) {
|
|
374
|
-
super();
|
|
375
|
-
this.target = target;
|
|
376
|
-
this.propertyName = propertyName;
|
|
377
|
-
this.name = "CannotInjectValueError";
|
|
378
|
-
}
|
|
379
|
-
get message() {
|
|
380
|
-
return `Cannot inject value into "${this.target.constructor.name}.${this.propertyName}". ` + `Please make sure you setup reflect-metadata properly and you don't use interfaces without service tokens as injection value.`;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
exports.CannotInjectValueError = CannotInjectValueError;
|
|
384
|
-
});
|
|
385
|
-
|
|
386
|
-
// ../../node_modules/typedi/cjs/utils/resolve-to-type-wrapper.util.js
|
|
387
|
-
var require_resolve_to_type_wrapper_util = __commonJS((exports) => {
|
|
388
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
389
|
-
exports.resolveToTypeWrapper = undefined;
|
|
390
|
-
var token_class_1 = require_token_class();
|
|
391
|
-
function resolveToTypeWrapper(typeOrIdentifier, target, propertyName, index) {
|
|
392
|
-
let typeWrapper;
|
|
393
|
-
if (typeOrIdentifier && typeof typeOrIdentifier === "string" || typeOrIdentifier instanceof token_class_1.Token) {
|
|
394
|
-
typeWrapper = { eagerType: typeOrIdentifier, lazyType: () => typeOrIdentifier };
|
|
395
|
-
}
|
|
396
|
-
if (typeOrIdentifier && typeof typeOrIdentifier === "function") {
|
|
397
|
-
typeWrapper = { eagerType: null, lazyType: () => typeOrIdentifier() };
|
|
398
|
-
}
|
|
399
|
-
if (!typeOrIdentifier && propertyName) {
|
|
400
|
-
const identifier = Reflect.getMetadata("design:type", target, propertyName);
|
|
401
|
-
typeWrapper = { eagerType: identifier, lazyType: () => identifier };
|
|
402
|
-
}
|
|
403
|
-
if (!typeOrIdentifier && typeof index == "number" && Number.isInteger(index)) {
|
|
404
|
-
const paramTypes = Reflect.getMetadata("design:paramtypes", target, propertyName);
|
|
405
|
-
const identifier = paramTypes === null || paramTypes === undefined ? undefined : paramTypes[index];
|
|
406
|
-
typeWrapper = { eagerType: identifier, lazyType: () => identifier };
|
|
407
|
-
}
|
|
408
|
-
return typeWrapper;
|
|
409
|
-
}
|
|
410
|
-
exports.resolveToTypeWrapper = resolveToTypeWrapper;
|
|
411
|
-
});
|
|
412
|
-
|
|
413
|
-
// ../../node_modules/typedi/cjs/decorators/inject-many.decorator.js
|
|
414
|
-
var require_inject_many_decorator = __commonJS((exports) => {
|
|
415
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
416
|
-
exports.InjectMany = undefined;
|
|
417
|
-
var container_class_1 = require_container_class();
|
|
418
|
-
var cannot_inject_value_error_1 = require_cannot_inject_value_error();
|
|
419
|
-
var resolve_to_type_wrapper_util_1 = require_resolve_to_type_wrapper_util();
|
|
420
|
-
function InjectMany(typeOrIdentifier) {
|
|
421
|
-
return function(target, propertyName, index) {
|
|
422
|
-
const typeWrapper = resolve_to_type_wrapper_util_1.resolveToTypeWrapper(typeOrIdentifier, target, propertyName, index);
|
|
423
|
-
if (typeWrapper === undefined || typeWrapper.eagerType === undefined || typeWrapper.eagerType === Object) {
|
|
424
|
-
throw new cannot_inject_value_error_1.CannotInjectValueError(target, propertyName);
|
|
425
|
-
}
|
|
426
|
-
container_class_1.Container.registerHandler({
|
|
427
|
-
object: target,
|
|
428
|
-
propertyName,
|
|
429
|
-
index,
|
|
430
|
-
value: (containerInstance) => {
|
|
431
|
-
const evaluatedLazyType = typeWrapper.lazyType();
|
|
432
|
-
if (evaluatedLazyType === undefined || evaluatedLazyType === Object) {
|
|
433
|
-
throw new cannot_inject_value_error_1.CannotInjectValueError(target, propertyName);
|
|
434
|
-
}
|
|
435
|
-
return containerInstance.getMany(evaluatedLazyType);
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
exports.InjectMany = InjectMany;
|
|
441
|
-
});
|
|
442
|
-
|
|
443
|
-
// ../../node_modules/typedi/cjs/decorators/inject.decorator.js
|
|
444
|
-
var require_inject_decorator = __commonJS((exports) => {
|
|
445
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
446
|
-
exports.Inject = undefined;
|
|
447
|
-
var container_class_1 = require_container_class();
|
|
448
|
-
var cannot_inject_value_error_1 = require_cannot_inject_value_error();
|
|
449
|
-
var resolve_to_type_wrapper_util_1 = require_resolve_to_type_wrapper_util();
|
|
450
|
-
function Inject(typeOrIdentifier) {
|
|
451
|
-
return function(target, propertyName, index) {
|
|
452
|
-
const typeWrapper = resolve_to_type_wrapper_util_1.resolveToTypeWrapper(typeOrIdentifier, target, propertyName, index);
|
|
453
|
-
if (typeWrapper === undefined || typeWrapper.eagerType === undefined || typeWrapper.eagerType === Object) {
|
|
454
|
-
throw new cannot_inject_value_error_1.CannotInjectValueError(target, propertyName);
|
|
455
|
-
}
|
|
456
|
-
container_class_1.Container.registerHandler({
|
|
457
|
-
object: target,
|
|
458
|
-
propertyName,
|
|
459
|
-
index,
|
|
460
|
-
value: (containerInstance) => {
|
|
461
|
-
const evaluatedLazyType = typeWrapper.lazyType();
|
|
462
|
-
if (evaluatedLazyType === undefined || evaluatedLazyType === Object) {
|
|
463
|
-
throw new cannot_inject_value_error_1.CannotInjectValueError(target, propertyName);
|
|
464
|
-
}
|
|
465
|
-
return containerInstance.get(evaluatedLazyType);
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
exports.Inject = Inject;
|
|
471
|
-
});
|
|
472
|
-
|
|
473
|
-
// ../../node_modules/typedi/cjs/decorators/service.decorator.js
|
|
474
|
-
var require_service_decorator = __commonJS((exports) => {
|
|
475
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
476
|
-
exports.Service = undefined;
|
|
477
|
-
var container_class_1 = require_container_class();
|
|
478
|
-
var token_class_1 = require_token_class();
|
|
479
|
-
var empty_const_1 = require_empty_const();
|
|
480
|
-
function Service(optionsOrServiceIdentifier) {
|
|
481
|
-
return (targetConstructor) => {
|
|
482
|
-
const serviceMetadata = {
|
|
483
|
-
id: targetConstructor,
|
|
484
|
-
type: targetConstructor,
|
|
485
|
-
factory: undefined,
|
|
486
|
-
multiple: false,
|
|
487
|
-
global: false,
|
|
488
|
-
eager: false,
|
|
489
|
-
transient: false,
|
|
490
|
-
value: empty_const_1.EMPTY_VALUE
|
|
491
|
-
};
|
|
492
|
-
if (optionsOrServiceIdentifier instanceof token_class_1.Token || typeof optionsOrServiceIdentifier === "string") {
|
|
493
|
-
serviceMetadata.id = optionsOrServiceIdentifier;
|
|
494
|
-
} else if (optionsOrServiceIdentifier) {
|
|
495
|
-
serviceMetadata.id = optionsOrServiceIdentifier.id || targetConstructor;
|
|
496
|
-
serviceMetadata.factory = optionsOrServiceIdentifier.factory || undefined;
|
|
497
|
-
serviceMetadata.multiple = optionsOrServiceIdentifier.multiple || false;
|
|
498
|
-
serviceMetadata.global = optionsOrServiceIdentifier.global || false;
|
|
499
|
-
serviceMetadata.eager = optionsOrServiceIdentifier.eager || false;
|
|
500
|
-
serviceMetadata.transient = optionsOrServiceIdentifier.transient || false;
|
|
501
|
-
}
|
|
502
|
-
container_class_1.Container.set(serviceMetadata);
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
exports.Service = Service;
|
|
506
|
-
});
|
|
507
|
-
|
|
508
|
-
// ../../node_modules/typedi/cjs/index.js
|
|
509
|
-
var require_cjs = __commonJS((exports) => {
|
|
510
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
511
|
-
if (k2 === undefined)
|
|
512
|
-
k2 = k;
|
|
513
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
514
|
-
return m[k];
|
|
515
|
-
} });
|
|
516
|
-
} : function(o, m, k, k2) {
|
|
517
|
-
if (k2 === undefined)
|
|
518
|
-
k2 = k;
|
|
519
|
-
o[k2] = m[k];
|
|
520
|
-
});
|
|
521
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
522
|
-
for (var p in m)
|
|
523
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
524
|
-
__createBinding(exports2, m, p);
|
|
525
|
-
};
|
|
526
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
527
|
-
exports.Token = exports.Container = exports.ContainerInstance = undefined;
|
|
528
|
-
var container_class_1 = require_container_class();
|
|
529
|
-
__exportStar(require_inject_many_decorator(), exports);
|
|
530
|
-
__exportStar(require_inject_decorator(), exports);
|
|
531
|
-
__exportStar(require_service_decorator(), exports);
|
|
532
|
-
__exportStar(require_cannot_inject_value_error(), exports);
|
|
533
|
-
__exportStar(require_cannot_instantiate_value_error(), exports);
|
|
534
|
-
__exportStar(require_service_not_found_error(), exports);
|
|
535
|
-
var container_instance_class_1 = require_container_instance_class();
|
|
536
|
-
Object.defineProperty(exports, "ContainerInstance", { enumerable: true, get: function() {
|
|
537
|
-
return container_instance_class_1.ContainerInstance;
|
|
538
|
-
} });
|
|
539
|
-
var container_class_2 = require_container_class();
|
|
540
|
-
Object.defineProperty(exports, "Container", { enumerable: true, get: function() {
|
|
541
|
-
return container_class_2.Container;
|
|
542
|
-
} });
|
|
543
|
-
var token_class_1 = require_token_class();
|
|
544
|
-
Object.defineProperty(exports, "Token", { enumerable: true, get: function() {
|
|
545
|
-
return token_class_1.Token;
|
|
546
|
-
} });
|
|
547
|
-
exports.default = container_class_1.Container;
|
|
548
|
-
});
|
|
549
|
-
|
|
550
|
-
// ../../node_modules/reflect-metadata/Reflect.js
|
|
551
|
-
/*! *****************************************************************************
|
|
552
|
-
Copyright (C) Microsoft. All rights reserved.
|
|
553
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
554
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
555
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
556
|
-
|
|
557
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
558
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
559
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
560
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
561
|
-
|
|
562
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
563
|
-
and limitations under the License.
|
|
564
|
-
***************************************************************************** */
|
|
4
|
+
// node_modules/.pnpm/reflect-metadata@0.1.14/node_modules/reflect-metadata/Reflect.js
|
|
565
5
|
var Reflect2;
|
|
566
6
|
(function(Reflect3) {
|
|
567
7
|
(function(factory) {
|
|
@@ -576,25 +16,34 @@ var Reflect2;
|
|
|
576
16
|
function makeExporter(target, previous) {
|
|
577
17
|
return function(key, value) {
|
|
578
18
|
if (typeof target[key] !== "function") {
|
|
579
|
-
Object.defineProperty(target, key, {
|
|
19
|
+
Object.defineProperty(target, key, {
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value
|
|
23
|
+
});
|
|
580
24
|
}
|
|
581
|
-
if (previous)
|
|
582
|
-
previous(key, value);
|
|
25
|
+
if (previous) previous(key, value);
|
|
583
26
|
};
|
|
584
27
|
}
|
|
28
|
+
__name(makeExporter, "makeExporter");
|
|
585
29
|
})(function(exporter) {
|
|
586
30
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
587
31
|
var supportsSymbol = typeof Symbol === "function";
|
|
588
32
|
var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
|
|
589
33
|
var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
|
|
590
34
|
var supportsCreate = typeof Object.create === "function";
|
|
591
|
-
var supportsProto = {
|
|
35
|
+
var supportsProto = {
|
|
36
|
+
__proto__: []
|
|
37
|
+
} instanceof Array;
|
|
592
38
|
var downLevel = !supportsCreate && !supportsProto;
|
|
593
39
|
var HashMap = {
|
|
40
|
+
// create an object in dictionary mode (a.k.a. "slow" mode in v8)
|
|
594
41
|
create: supportsCreate ? function() {
|
|
595
|
-
return MakeDictionary(Object.create(null));
|
|
42
|
+
return MakeDictionary(/* @__PURE__ */ Object.create(null));
|
|
596
43
|
} : supportsProto ? function() {
|
|
597
|
-
return MakeDictionary({
|
|
44
|
+
return MakeDictionary({
|
|
45
|
+
__proto__: null
|
|
46
|
+
});
|
|
598
47
|
} : function() {
|
|
599
48
|
return MakeDictionary({});
|
|
600
49
|
},
|
|
@@ -604,213 +53,211 @@ var Reflect2;
|
|
|
604
53
|
return key in map;
|
|
605
54
|
},
|
|
606
55
|
get: downLevel ? function(map, key) {
|
|
607
|
-
return hasOwn.call(map, key) ? map[key] :
|
|
56
|
+
return hasOwn.call(map, key) ? map[key] : void 0;
|
|
608
57
|
} : function(map, key) {
|
|
609
58
|
return map[key];
|
|
610
59
|
}
|
|
611
60
|
};
|
|
612
61
|
var functionPrototype = Object.getPrototypeOf(Function);
|
|
613
|
-
var usePolyfill = typeof process === "object" && process
|
|
62
|
+
var usePolyfill = typeof process === "object" && process["env"] && process["env"]["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
|
|
614
63
|
var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
|
|
615
64
|
var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
|
|
616
65
|
var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
|
|
617
|
-
var Metadata = new _WeakMap;
|
|
66
|
+
var Metadata = new _WeakMap();
|
|
618
67
|
function decorate(decorators, target, propertyKey, attributes) {
|
|
619
68
|
if (!IsUndefined(propertyKey)) {
|
|
620
|
-
if (!IsArray(decorators))
|
|
621
|
-
|
|
622
|
-
if (!IsObject(
|
|
623
|
-
|
|
624
|
-
if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
|
|
625
|
-
throw new TypeError;
|
|
626
|
-
if (IsNull(attributes))
|
|
627
|
-
attributes = undefined;
|
|
69
|
+
if (!IsArray(decorators)) throw new TypeError();
|
|
70
|
+
if (!IsObject(target)) throw new TypeError();
|
|
71
|
+
if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes)) throw new TypeError();
|
|
72
|
+
if (IsNull(attributes)) attributes = void 0;
|
|
628
73
|
propertyKey = ToPropertyKey(propertyKey);
|
|
629
74
|
return DecorateProperty(decorators, target, propertyKey, attributes);
|
|
630
75
|
} else {
|
|
631
|
-
if (!IsArray(decorators))
|
|
632
|
-
|
|
633
|
-
if (!IsConstructor(target))
|
|
634
|
-
throw new TypeError;
|
|
76
|
+
if (!IsArray(decorators)) throw new TypeError();
|
|
77
|
+
if (!IsConstructor(target)) throw new TypeError();
|
|
635
78
|
return DecorateConstructor(decorators, target);
|
|
636
79
|
}
|
|
637
80
|
}
|
|
81
|
+
__name(decorate, "decorate");
|
|
638
82
|
exporter("decorate", decorate);
|
|
639
83
|
function metadata(metadataKey, metadataValue) {
|
|
640
84
|
function decorator(target, propertyKey) {
|
|
641
|
-
if (!IsObject(target))
|
|
642
|
-
|
|
643
|
-
if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
|
|
644
|
-
throw new TypeError;
|
|
85
|
+
if (!IsObject(target)) throw new TypeError();
|
|
86
|
+
if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey)) throw new TypeError();
|
|
645
87
|
OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
646
88
|
}
|
|
89
|
+
__name(decorator, "decorator");
|
|
647
90
|
return decorator;
|
|
648
91
|
}
|
|
92
|
+
__name(metadata, "metadata");
|
|
649
93
|
exporter("metadata", metadata);
|
|
650
94
|
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
651
|
-
if (!IsObject(target))
|
|
652
|
-
|
|
653
|
-
if (!IsUndefined(propertyKey))
|
|
654
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
95
|
+
if (!IsObject(target)) throw new TypeError();
|
|
96
|
+
if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
|
|
655
97
|
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
656
98
|
}
|
|
99
|
+
__name(defineMetadata, "defineMetadata");
|
|
657
100
|
exporter("defineMetadata", defineMetadata);
|
|
658
101
|
function hasMetadata(metadataKey, target, propertyKey) {
|
|
659
|
-
if (!IsObject(target))
|
|
660
|
-
|
|
661
|
-
if (!IsUndefined(propertyKey))
|
|
662
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
102
|
+
if (!IsObject(target)) throw new TypeError();
|
|
103
|
+
if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
|
|
663
104
|
return OrdinaryHasMetadata(metadataKey, target, propertyKey);
|
|
664
105
|
}
|
|
106
|
+
__name(hasMetadata, "hasMetadata");
|
|
665
107
|
exporter("hasMetadata", hasMetadata);
|
|
666
108
|
function hasOwnMetadata(metadataKey, target, propertyKey) {
|
|
667
|
-
if (!IsObject(target))
|
|
668
|
-
|
|
669
|
-
if (!IsUndefined(propertyKey))
|
|
670
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
109
|
+
if (!IsObject(target)) throw new TypeError();
|
|
110
|
+
if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
|
|
671
111
|
return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
|
|
672
112
|
}
|
|
113
|
+
__name(hasOwnMetadata, "hasOwnMetadata");
|
|
673
114
|
exporter("hasOwnMetadata", hasOwnMetadata);
|
|
674
115
|
function getMetadata(metadataKey, target, propertyKey) {
|
|
675
|
-
if (!IsObject(target))
|
|
676
|
-
|
|
677
|
-
if (!IsUndefined(propertyKey))
|
|
678
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
116
|
+
if (!IsObject(target)) throw new TypeError();
|
|
117
|
+
if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
|
|
679
118
|
return OrdinaryGetMetadata(metadataKey, target, propertyKey);
|
|
680
119
|
}
|
|
120
|
+
__name(getMetadata, "getMetadata");
|
|
681
121
|
exporter("getMetadata", getMetadata);
|
|
682
122
|
function getOwnMetadata(metadataKey, target, propertyKey) {
|
|
683
|
-
if (!IsObject(target))
|
|
684
|
-
|
|
685
|
-
if (!IsUndefined(propertyKey))
|
|
686
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
123
|
+
if (!IsObject(target)) throw new TypeError();
|
|
124
|
+
if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
|
|
687
125
|
return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
|
|
688
126
|
}
|
|
127
|
+
__name(getOwnMetadata, "getOwnMetadata");
|
|
689
128
|
exporter("getOwnMetadata", getOwnMetadata);
|
|
690
129
|
function getMetadataKeys(target, propertyKey) {
|
|
691
|
-
if (!IsObject(target))
|
|
692
|
-
|
|
693
|
-
if (!IsUndefined(propertyKey))
|
|
694
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
130
|
+
if (!IsObject(target)) throw new TypeError();
|
|
131
|
+
if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
|
|
695
132
|
return OrdinaryMetadataKeys(target, propertyKey);
|
|
696
133
|
}
|
|
134
|
+
__name(getMetadataKeys, "getMetadataKeys");
|
|
697
135
|
exporter("getMetadataKeys", getMetadataKeys);
|
|
698
136
|
function getOwnMetadataKeys(target, propertyKey) {
|
|
699
|
-
if (!IsObject(target))
|
|
700
|
-
|
|
701
|
-
if (!IsUndefined(propertyKey))
|
|
702
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
137
|
+
if (!IsObject(target)) throw new TypeError();
|
|
138
|
+
if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
|
|
703
139
|
return OrdinaryOwnMetadataKeys(target, propertyKey);
|
|
704
140
|
}
|
|
141
|
+
__name(getOwnMetadataKeys, "getOwnMetadataKeys");
|
|
705
142
|
exporter("getOwnMetadataKeys", getOwnMetadataKeys);
|
|
706
143
|
function deleteMetadata(metadataKey, target, propertyKey) {
|
|
707
|
-
if (!IsObject(target))
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
if (metadataMap.
|
|
717
|
-
|
|
144
|
+
if (!IsObject(target)) throw new TypeError();
|
|
145
|
+
if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);
|
|
146
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
147
|
+
target,
|
|
148
|
+
propertyKey,
|
|
149
|
+
/*Create*/
|
|
150
|
+
false
|
|
151
|
+
);
|
|
152
|
+
if (IsUndefined(metadataMap)) return false;
|
|
153
|
+
if (!metadataMap.delete(metadataKey)) return false;
|
|
154
|
+
if (metadataMap.size > 0) return true;
|
|
718
155
|
var targetMetadata = Metadata.get(target);
|
|
719
156
|
targetMetadata.delete(propertyKey);
|
|
720
|
-
if (targetMetadata.size > 0)
|
|
721
|
-
return true;
|
|
157
|
+
if (targetMetadata.size > 0) return true;
|
|
722
158
|
Metadata.delete(target);
|
|
723
159
|
return true;
|
|
724
160
|
}
|
|
161
|
+
__name(deleteMetadata, "deleteMetadata");
|
|
725
162
|
exporter("deleteMetadata", deleteMetadata);
|
|
726
163
|
function DecorateConstructor(decorators, target) {
|
|
727
|
-
for (var i = decorators.length - 1;i >= 0; --i) {
|
|
164
|
+
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
728
165
|
var decorator = decorators[i];
|
|
729
166
|
var decorated = decorator(target);
|
|
730
167
|
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
731
|
-
if (!IsConstructor(decorated))
|
|
732
|
-
throw new TypeError;
|
|
168
|
+
if (!IsConstructor(decorated)) throw new TypeError();
|
|
733
169
|
target = decorated;
|
|
734
170
|
}
|
|
735
171
|
}
|
|
736
172
|
return target;
|
|
737
173
|
}
|
|
174
|
+
__name(DecorateConstructor, "DecorateConstructor");
|
|
738
175
|
function DecorateProperty(decorators, target, propertyKey, descriptor) {
|
|
739
|
-
for (var i = decorators.length - 1;i >= 0; --i) {
|
|
176
|
+
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
740
177
|
var decorator = decorators[i];
|
|
741
178
|
var decorated = decorator(target, propertyKey, descriptor);
|
|
742
179
|
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
743
|
-
if (!IsObject(decorated))
|
|
744
|
-
throw new TypeError;
|
|
180
|
+
if (!IsObject(decorated)) throw new TypeError();
|
|
745
181
|
descriptor = decorated;
|
|
746
182
|
}
|
|
747
183
|
}
|
|
748
184
|
return descriptor;
|
|
749
185
|
}
|
|
186
|
+
__name(DecorateProperty, "DecorateProperty");
|
|
750
187
|
function GetOrCreateMetadataMap(O, P, Create) {
|
|
751
188
|
var targetMetadata = Metadata.get(O);
|
|
752
189
|
if (IsUndefined(targetMetadata)) {
|
|
753
|
-
if (!Create)
|
|
754
|
-
|
|
755
|
-
targetMetadata = new _Map;
|
|
190
|
+
if (!Create) return void 0;
|
|
191
|
+
targetMetadata = new _Map();
|
|
756
192
|
Metadata.set(O, targetMetadata);
|
|
757
193
|
}
|
|
758
194
|
var metadataMap = targetMetadata.get(P);
|
|
759
195
|
if (IsUndefined(metadataMap)) {
|
|
760
|
-
if (!Create)
|
|
761
|
-
|
|
762
|
-
metadataMap = new _Map;
|
|
196
|
+
if (!Create) return void 0;
|
|
197
|
+
metadataMap = new _Map();
|
|
763
198
|
targetMetadata.set(P, metadataMap);
|
|
764
199
|
}
|
|
765
200
|
return metadataMap;
|
|
766
201
|
}
|
|
202
|
+
__name(GetOrCreateMetadataMap, "GetOrCreateMetadataMap");
|
|
767
203
|
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
768
204
|
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
769
|
-
if (hasOwn2)
|
|
770
|
-
return true;
|
|
205
|
+
if (hasOwn2) return true;
|
|
771
206
|
var parent = OrdinaryGetPrototypeOf(O);
|
|
772
|
-
if (!IsNull(parent))
|
|
773
|
-
return OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
207
|
+
if (!IsNull(parent)) return OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
774
208
|
return false;
|
|
775
209
|
}
|
|
210
|
+
__name(OrdinaryHasMetadata, "OrdinaryHasMetadata");
|
|
776
211
|
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
777
|
-
var metadataMap = GetOrCreateMetadataMap(
|
|
778
|
-
|
|
779
|
-
|
|
212
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
213
|
+
O,
|
|
214
|
+
P,
|
|
215
|
+
/*Create*/
|
|
216
|
+
false
|
|
217
|
+
);
|
|
218
|
+
if (IsUndefined(metadataMap)) return false;
|
|
780
219
|
return ToBoolean(metadataMap.has(MetadataKey));
|
|
781
220
|
}
|
|
221
|
+
__name(OrdinaryHasOwnMetadata, "OrdinaryHasOwnMetadata");
|
|
782
222
|
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
783
223
|
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
784
|
-
if (hasOwn2)
|
|
785
|
-
return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
224
|
+
if (hasOwn2) return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
786
225
|
var parent = OrdinaryGetPrototypeOf(O);
|
|
787
|
-
if (!IsNull(parent))
|
|
788
|
-
|
|
789
|
-
return;
|
|
226
|
+
if (!IsNull(parent)) return OrdinaryGetMetadata(MetadataKey, parent, P);
|
|
227
|
+
return void 0;
|
|
790
228
|
}
|
|
229
|
+
__name(OrdinaryGetMetadata, "OrdinaryGetMetadata");
|
|
791
230
|
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
792
|
-
var metadataMap = GetOrCreateMetadataMap(
|
|
793
|
-
|
|
794
|
-
|
|
231
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
232
|
+
O,
|
|
233
|
+
P,
|
|
234
|
+
/*Create*/
|
|
235
|
+
false
|
|
236
|
+
);
|
|
237
|
+
if (IsUndefined(metadataMap)) return void 0;
|
|
795
238
|
return metadataMap.get(MetadataKey);
|
|
796
239
|
}
|
|
240
|
+
__name(OrdinaryGetOwnMetadata, "OrdinaryGetOwnMetadata");
|
|
797
241
|
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
798
|
-
var metadataMap = GetOrCreateMetadataMap(
|
|
242
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
243
|
+
O,
|
|
244
|
+
P,
|
|
245
|
+
/*Create*/
|
|
246
|
+
true
|
|
247
|
+
);
|
|
799
248
|
metadataMap.set(MetadataKey, MetadataValue);
|
|
800
249
|
}
|
|
250
|
+
__name(OrdinaryDefineOwnMetadata, "OrdinaryDefineOwnMetadata");
|
|
801
251
|
function OrdinaryMetadataKeys(O, P) {
|
|
802
252
|
var ownKeys = OrdinaryOwnMetadataKeys(O, P);
|
|
803
253
|
var parent = OrdinaryGetPrototypeOf(O);
|
|
804
|
-
if (parent === null)
|
|
805
|
-
return ownKeys;
|
|
254
|
+
if (parent === null) return ownKeys;
|
|
806
255
|
var parentKeys = OrdinaryMetadataKeys(parent, P);
|
|
807
|
-
if (parentKeys.length <= 0)
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
return parentKeys;
|
|
811
|
-
var set = new _Set;
|
|
256
|
+
if (parentKeys.length <= 0) return ownKeys;
|
|
257
|
+
if (ownKeys.length <= 0) return parentKeys;
|
|
258
|
+
var set = new _Set();
|
|
812
259
|
var keys = [];
|
|
813
|
-
for (var _i = 0, ownKeys_1 = ownKeys;_i < ownKeys_1.length; _i++) {
|
|
260
|
+
for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {
|
|
814
261
|
var key = ownKeys_1[_i];
|
|
815
262
|
var hasKey = set.has(key);
|
|
816
263
|
if (!hasKey) {
|
|
@@ -818,7 +265,7 @@ var Reflect2;
|
|
|
818
265
|
keys.push(key);
|
|
819
266
|
}
|
|
820
267
|
}
|
|
821
|
-
for (var _a = 0, parentKeys_1 = parentKeys;_a < parentKeys_1.length; _a++) {
|
|
268
|
+
for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {
|
|
822
269
|
var key = parentKeys_1[_a];
|
|
823
270
|
var hasKey = set.has(key);
|
|
824
271
|
if (!hasKey) {
|
|
@@ -828,11 +275,16 @@ var Reflect2;
|
|
|
828
275
|
}
|
|
829
276
|
return keys;
|
|
830
277
|
}
|
|
278
|
+
__name(OrdinaryMetadataKeys, "OrdinaryMetadataKeys");
|
|
831
279
|
function OrdinaryOwnMetadataKeys(O, P) {
|
|
832
280
|
var keys = [];
|
|
833
|
-
var metadataMap = GetOrCreateMetadataMap(
|
|
834
|
-
|
|
835
|
-
|
|
281
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
282
|
+
O,
|
|
283
|
+
P,
|
|
284
|
+
/*Create*/
|
|
285
|
+
false
|
|
286
|
+
);
|
|
287
|
+
if (IsUndefined(metadataMap)) return keys;
|
|
836
288
|
var keysObj = metadataMap.keys();
|
|
837
289
|
var iterator = GetIterator(keysObj);
|
|
838
290
|
var k = 0;
|
|
@@ -855,9 +307,9 @@ var Reflect2;
|
|
|
855
307
|
k++;
|
|
856
308
|
}
|
|
857
309
|
}
|
|
310
|
+
__name(OrdinaryOwnMetadataKeys, "OrdinaryOwnMetadataKeys");
|
|
858
311
|
function Type(x) {
|
|
859
|
-
if (x === null)
|
|
860
|
-
return 1;
|
|
312
|
+
if (x === null) return 1;
|
|
861
313
|
switch (typeof x) {
|
|
862
314
|
case "undefined":
|
|
863
315
|
return 0;
|
|
@@ -875,18 +327,23 @@ var Reflect2;
|
|
|
875
327
|
return 6;
|
|
876
328
|
}
|
|
877
329
|
}
|
|
330
|
+
__name(Type, "Type");
|
|
878
331
|
function IsUndefined(x) {
|
|
879
|
-
return x ===
|
|
332
|
+
return x === void 0;
|
|
880
333
|
}
|
|
334
|
+
__name(IsUndefined, "IsUndefined");
|
|
881
335
|
function IsNull(x) {
|
|
882
336
|
return x === null;
|
|
883
337
|
}
|
|
338
|
+
__name(IsNull, "IsNull");
|
|
884
339
|
function IsSymbol(x) {
|
|
885
340
|
return typeof x === "symbol";
|
|
886
341
|
}
|
|
342
|
+
__name(IsSymbol, "IsSymbol");
|
|
887
343
|
function IsObject(x) {
|
|
888
344
|
return typeof x === "object" ? x !== null : typeof x === "function";
|
|
889
345
|
}
|
|
346
|
+
__name(IsObject, "IsObject");
|
|
890
347
|
function ToPrimitive(input, PreferredType) {
|
|
891
348
|
switch (Type(input)) {
|
|
892
349
|
case 0:
|
|
@@ -904,65 +361,71 @@ var Reflect2;
|
|
|
904
361
|
}
|
|
905
362
|
var hint = PreferredType === 3 ? "string" : PreferredType === 5 ? "number" : "default";
|
|
906
363
|
var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
907
|
-
if (exoticToPrim !==
|
|
364
|
+
if (exoticToPrim !== void 0) {
|
|
908
365
|
var result = exoticToPrim.call(input, hint);
|
|
909
|
-
if (IsObject(result))
|
|
910
|
-
throw new TypeError;
|
|
366
|
+
if (IsObject(result)) throw new TypeError();
|
|
911
367
|
return result;
|
|
912
368
|
}
|
|
913
369
|
return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
|
|
914
370
|
}
|
|
371
|
+
__name(ToPrimitive, "ToPrimitive");
|
|
915
372
|
function OrdinaryToPrimitive(O, hint) {
|
|
916
373
|
if (hint === "string") {
|
|
917
374
|
var toString_1 = O.toString;
|
|
918
375
|
if (IsCallable(toString_1)) {
|
|
919
376
|
var result = toString_1.call(O);
|
|
920
|
-
if (!IsObject(result))
|
|
921
|
-
return result;
|
|
377
|
+
if (!IsObject(result)) return result;
|
|
922
378
|
}
|
|
923
379
|
var valueOf = O.valueOf;
|
|
924
380
|
if (IsCallable(valueOf)) {
|
|
925
381
|
var result = valueOf.call(O);
|
|
926
|
-
if (!IsObject(result))
|
|
927
|
-
return result;
|
|
382
|
+
if (!IsObject(result)) return result;
|
|
928
383
|
}
|
|
929
384
|
} else {
|
|
930
385
|
var valueOf = O.valueOf;
|
|
931
386
|
if (IsCallable(valueOf)) {
|
|
932
387
|
var result = valueOf.call(O);
|
|
933
|
-
if (!IsObject(result))
|
|
934
|
-
return result;
|
|
388
|
+
if (!IsObject(result)) return result;
|
|
935
389
|
}
|
|
936
390
|
var toString_2 = O.toString;
|
|
937
391
|
if (IsCallable(toString_2)) {
|
|
938
392
|
var result = toString_2.call(O);
|
|
939
|
-
if (!IsObject(result))
|
|
940
|
-
return result;
|
|
393
|
+
if (!IsObject(result)) return result;
|
|
941
394
|
}
|
|
942
395
|
}
|
|
943
|
-
throw new TypeError;
|
|
396
|
+
throw new TypeError();
|
|
944
397
|
}
|
|
398
|
+
__name(OrdinaryToPrimitive, "OrdinaryToPrimitive");
|
|
945
399
|
function ToBoolean(argument) {
|
|
946
400
|
return !!argument;
|
|
947
401
|
}
|
|
402
|
+
__name(ToBoolean, "ToBoolean");
|
|
948
403
|
function ToString(argument) {
|
|
949
404
|
return "" + argument;
|
|
950
405
|
}
|
|
406
|
+
__name(ToString, "ToString");
|
|
951
407
|
function ToPropertyKey(argument) {
|
|
952
|
-
var key = ToPrimitive(
|
|
953
|
-
|
|
954
|
-
|
|
408
|
+
var key = ToPrimitive(
|
|
409
|
+
argument,
|
|
410
|
+
3
|
|
411
|
+
/* String */
|
|
412
|
+
);
|
|
413
|
+
if (IsSymbol(key)) return key;
|
|
955
414
|
return ToString(key);
|
|
956
415
|
}
|
|
416
|
+
__name(ToPropertyKey, "ToPropertyKey");
|
|
957
417
|
function IsArray(argument) {
|
|
958
418
|
return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]";
|
|
959
419
|
}
|
|
420
|
+
__name(IsArray, "IsArray");
|
|
960
421
|
function IsCallable(argument) {
|
|
961
422
|
return typeof argument === "function";
|
|
962
423
|
}
|
|
424
|
+
__name(IsCallable, "IsCallable");
|
|
963
425
|
function IsConstructor(argument) {
|
|
964
426
|
return typeof argument === "function";
|
|
965
427
|
}
|
|
428
|
+
__name(IsConstructor, "IsConstructor");
|
|
966
429
|
function IsPropertyKey(argument) {
|
|
967
430
|
switch (Type(argument)) {
|
|
968
431
|
case 3:
|
|
@@ -973,261 +436,323 @@ var Reflect2;
|
|
|
973
436
|
return false;
|
|
974
437
|
}
|
|
975
438
|
}
|
|
439
|
+
__name(IsPropertyKey, "IsPropertyKey");
|
|
976
440
|
function GetMethod(V, P) {
|
|
977
441
|
var func = V[P];
|
|
978
|
-
if (func ===
|
|
979
|
-
|
|
980
|
-
if (!IsCallable(func))
|
|
981
|
-
throw new TypeError;
|
|
442
|
+
if (func === void 0 || func === null) return void 0;
|
|
443
|
+
if (!IsCallable(func)) throw new TypeError();
|
|
982
444
|
return func;
|
|
983
445
|
}
|
|
446
|
+
__name(GetMethod, "GetMethod");
|
|
984
447
|
function GetIterator(obj) {
|
|
985
448
|
var method = GetMethod(obj, iteratorSymbol);
|
|
986
|
-
if (!IsCallable(method))
|
|
987
|
-
throw new TypeError;
|
|
449
|
+
if (!IsCallable(method)) throw new TypeError();
|
|
988
450
|
var iterator = method.call(obj);
|
|
989
|
-
if (!IsObject(iterator))
|
|
990
|
-
throw new TypeError;
|
|
451
|
+
if (!IsObject(iterator)) throw new TypeError();
|
|
991
452
|
return iterator;
|
|
992
453
|
}
|
|
454
|
+
__name(GetIterator, "GetIterator");
|
|
993
455
|
function IteratorValue(iterResult) {
|
|
994
456
|
return iterResult.value;
|
|
995
457
|
}
|
|
458
|
+
__name(IteratorValue, "IteratorValue");
|
|
996
459
|
function IteratorStep(iterator) {
|
|
997
460
|
var result = iterator.next();
|
|
998
461
|
return result.done ? false : result;
|
|
999
462
|
}
|
|
463
|
+
__name(IteratorStep, "IteratorStep");
|
|
1000
464
|
function IteratorClose(iterator) {
|
|
1001
465
|
var f = iterator["return"];
|
|
1002
|
-
if (f)
|
|
1003
|
-
f.call(iterator);
|
|
466
|
+
if (f) f.call(iterator);
|
|
1004
467
|
}
|
|
468
|
+
__name(IteratorClose, "IteratorClose");
|
|
1005
469
|
function OrdinaryGetPrototypeOf(O) {
|
|
1006
470
|
var proto = Object.getPrototypeOf(O);
|
|
1007
|
-
if (typeof O !== "function" || O === functionPrototype)
|
|
1008
|
-
|
|
1009
|
-
if (proto !== functionPrototype)
|
|
1010
|
-
return proto;
|
|
471
|
+
if (typeof O !== "function" || O === functionPrototype) return proto;
|
|
472
|
+
if (proto !== functionPrototype) return proto;
|
|
1011
473
|
var prototype = O.prototype;
|
|
1012
474
|
var prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
1013
|
-
if (prototypeProto == null || prototypeProto === Object.prototype)
|
|
1014
|
-
return proto;
|
|
475
|
+
if (prototypeProto == null || prototypeProto === Object.prototype) return proto;
|
|
1015
476
|
var constructor = prototypeProto.constructor;
|
|
1016
|
-
if (typeof constructor !== "function")
|
|
1017
|
-
|
|
1018
|
-
if (constructor === O)
|
|
1019
|
-
return proto;
|
|
477
|
+
if (typeof constructor !== "function") return proto;
|
|
478
|
+
if (constructor === O) return proto;
|
|
1020
479
|
return constructor;
|
|
1021
480
|
}
|
|
481
|
+
__name(OrdinaryGetPrototypeOf, "OrdinaryGetPrototypeOf");
|
|
1022
482
|
function CreateMapPolyfill() {
|
|
1023
483
|
var cacheSentinel = {};
|
|
1024
484
|
var arraySentinel = [];
|
|
1025
|
-
var MapIterator =
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
485
|
+
var MapIterator = (
|
|
486
|
+
/** @class */
|
|
487
|
+
function() {
|
|
488
|
+
function MapIterator2(keys, values, selector) {
|
|
489
|
+
this._index = 0;
|
|
490
|
+
this._keys = keys;
|
|
491
|
+
this._values = values;
|
|
492
|
+
this._selector = selector;
|
|
493
|
+
}
|
|
494
|
+
__name(MapIterator2, "MapIterator");
|
|
495
|
+
MapIterator2.prototype["@@iterator"] = function() {
|
|
496
|
+
return this;
|
|
497
|
+
};
|
|
498
|
+
MapIterator2.prototype[iteratorSymbol] = function() {
|
|
499
|
+
return this;
|
|
500
|
+
};
|
|
501
|
+
MapIterator2.prototype.next = function() {
|
|
502
|
+
var index = this._index;
|
|
503
|
+
if (index >= 0 && index < this._keys.length) {
|
|
504
|
+
var result = this._selector(this._keys[index], this._values[index]);
|
|
505
|
+
if (index + 1 >= this._keys.length) {
|
|
506
|
+
this._index = -1;
|
|
507
|
+
this._keys = arraySentinel;
|
|
508
|
+
this._values = arraySentinel;
|
|
509
|
+
} else {
|
|
510
|
+
this._index++;
|
|
511
|
+
}
|
|
512
|
+
return {
|
|
513
|
+
value: result,
|
|
514
|
+
done: false
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
return {
|
|
518
|
+
value: void 0,
|
|
519
|
+
done: true
|
|
520
|
+
};
|
|
521
|
+
};
|
|
522
|
+
MapIterator2.prototype.throw = function(error) {
|
|
523
|
+
if (this._index >= 0) {
|
|
1043
524
|
this._index = -1;
|
|
1044
525
|
this._keys = arraySentinel;
|
|
1045
526
|
this._values = arraySentinel;
|
|
1046
|
-
} else {
|
|
1047
|
-
this._index++;
|
|
1048
527
|
}
|
|
1049
|
-
|
|
1050
|
-
}
|
|
1051
|
-
return
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
528
|
+
throw error;
|
|
529
|
+
};
|
|
530
|
+
MapIterator2.prototype.return = function(value) {
|
|
531
|
+
if (this._index >= 0) {
|
|
532
|
+
this._index = -1;
|
|
533
|
+
this._keys = arraySentinel;
|
|
534
|
+
this._values = arraySentinel;
|
|
535
|
+
}
|
|
536
|
+
return {
|
|
537
|
+
value,
|
|
538
|
+
done: true
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
return MapIterator2;
|
|
542
|
+
}()
|
|
543
|
+
);
|
|
544
|
+
return (
|
|
545
|
+
/** @class */
|
|
546
|
+
function() {
|
|
547
|
+
function Map1() {
|
|
548
|
+
this._keys = [];
|
|
549
|
+
this._values = [];
|
|
550
|
+
this._cacheKey = cacheSentinel;
|
|
551
|
+
this._cacheIndex = -2;
|
|
1066
552
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
var
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
553
|
+
__name(Map1, "Map1");
|
|
554
|
+
Object.defineProperty(Map1.prototype, "size", {
|
|
555
|
+
get: /* @__PURE__ */ __name(function() {
|
|
556
|
+
return this._keys.length;
|
|
557
|
+
}, "get"),
|
|
558
|
+
enumerable: true,
|
|
559
|
+
configurable: true
|
|
560
|
+
});
|
|
561
|
+
Map1.prototype.has = function(key) {
|
|
562
|
+
return this._find(
|
|
563
|
+
key,
|
|
564
|
+
/*insert*/
|
|
565
|
+
false
|
|
566
|
+
) >= 0;
|
|
567
|
+
};
|
|
568
|
+
Map1.prototype.get = function(key) {
|
|
569
|
+
var index = this._find(
|
|
570
|
+
key,
|
|
571
|
+
/*insert*/
|
|
572
|
+
false
|
|
573
|
+
);
|
|
574
|
+
return index >= 0 ? this._values[index] : void 0;
|
|
575
|
+
};
|
|
576
|
+
Map1.prototype.set = function(key, value) {
|
|
577
|
+
var index = this._find(
|
|
578
|
+
key,
|
|
579
|
+
/*insert*/
|
|
580
|
+
true
|
|
581
|
+
);
|
|
582
|
+
this._values[index] = value;
|
|
583
|
+
return this;
|
|
584
|
+
};
|
|
585
|
+
Map1.prototype.delete = function(key) {
|
|
586
|
+
var index = this._find(
|
|
587
|
+
key,
|
|
588
|
+
/*insert*/
|
|
589
|
+
false
|
|
590
|
+
);
|
|
591
|
+
if (index >= 0) {
|
|
592
|
+
var size = this._keys.length;
|
|
593
|
+
for (var i = index + 1; i < size; i++) {
|
|
594
|
+
this._keys[i - 1] = this._keys[i];
|
|
595
|
+
this._values[i - 1] = this._values[i];
|
|
596
|
+
}
|
|
597
|
+
this._keys.length--;
|
|
598
|
+
this._values.length--;
|
|
599
|
+
if (key === this._cacheKey) {
|
|
600
|
+
this._cacheKey = cacheSentinel;
|
|
601
|
+
this._cacheIndex = -2;
|
|
602
|
+
}
|
|
603
|
+
return true;
|
|
1104
604
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
605
|
+
return false;
|
|
606
|
+
};
|
|
607
|
+
Map1.prototype.clear = function() {
|
|
608
|
+
this._keys.length = 0;
|
|
609
|
+
this._values.length = 0;
|
|
610
|
+
this._cacheKey = cacheSentinel;
|
|
611
|
+
this._cacheIndex = -2;
|
|
612
|
+
};
|
|
613
|
+
Map1.prototype.keys = function() {
|
|
614
|
+
return new MapIterator(this._keys, this._values, getKey);
|
|
615
|
+
};
|
|
616
|
+
Map1.prototype.values = function() {
|
|
617
|
+
return new MapIterator(this._keys, this._values, getValue);
|
|
618
|
+
};
|
|
619
|
+
Map1.prototype.entries = function() {
|
|
620
|
+
return new MapIterator(this._keys, this._values, getEntry);
|
|
621
|
+
};
|
|
622
|
+
Map1.prototype["@@iterator"] = function() {
|
|
623
|
+
return this.entries();
|
|
624
|
+
};
|
|
625
|
+
Map1.prototype[iteratorSymbol] = function() {
|
|
626
|
+
return this.entries();
|
|
627
|
+
};
|
|
628
|
+
Map1.prototype._find = function(key, insert) {
|
|
629
|
+
if (this._cacheKey !== key) {
|
|
630
|
+
this._cacheIndex = this._keys.indexOf(this._cacheKey = key);
|
|
1110
631
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
Map2.prototype.keys = function() {
|
|
1122
|
-
return new MapIterator(this._keys, this._values, getKey);
|
|
1123
|
-
};
|
|
1124
|
-
Map2.prototype.values = function() {
|
|
1125
|
-
return new MapIterator(this._keys, this._values, getValue);
|
|
1126
|
-
};
|
|
1127
|
-
Map2.prototype.entries = function() {
|
|
1128
|
-
return new MapIterator(this._keys, this._values, getEntry);
|
|
1129
|
-
};
|
|
1130
|
-
Map2.prototype["@@iterator"] = function() {
|
|
1131
|
-
return this.entries();
|
|
1132
|
-
};
|
|
1133
|
-
Map2.prototype[iteratorSymbol] = function() {
|
|
1134
|
-
return this.entries();
|
|
1135
|
-
};
|
|
1136
|
-
Map2.prototype._find = function(key, insert) {
|
|
1137
|
-
if (this._cacheKey !== key) {
|
|
1138
|
-
this._cacheIndex = this._keys.indexOf(this._cacheKey = key);
|
|
1139
|
-
}
|
|
1140
|
-
if (this._cacheIndex < 0 && insert) {
|
|
1141
|
-
this._cacheIndex = this._keys.length;
|
|
1142
|
-
this._keys.push(key);
|
|
1143
|
-
this._values.push(undefined);
|
|
1144
|
-
}
|
|
1145
|
-
return this._cacheIndex;
|
|
1146
|
-
};
|
|
1147
|
-
return Map2;
|
|
1148
|
-
}();
|
|
632
|
+
if (this._cacheIndex < 0 && insert) {
|
|
633
|
+
this._cacheIndex = this._keys.length;
|
|
634
|
+
this._keys.push(key);
|
|
635
|
+
this._values.push(void 0);
|
|
636
|
+
}
|
|
637
|
+
return this._cacheIndex;
|
|
638
|
+
};
|
|
639
|
+
return Map1;
|
|
640
|
+
}()
|
|
641
|
+
);
|
|
1149
642
|
function getKey(key, _) {
|
|
1150
643
|
return key;
|
|
1151
644
|
}
|
|
645
|
+
__name(getKey, "getKey");
|
|
1152
646
|
function getValue(_, value) {
|
|
1153
647
|
return value;
|
|
1154
648
|
}
|
|
649
|
+
__name(getValue, "getValue");
|
|
1155
650
|
function getEntry(key, value) {
|
|
1156
|
-
return [
|
|
651
|
+
return [
|
|
652
|
+
key,
|
|
653
|
+
value
|
|
654
|
+
];
|
|
1157
655
|
}
|
|
656
|
+
__name(getEntry, "getEntry");
|
|
1158
657
|
}
|
|
658
|
+
__name(CreateMapPolyfill, "CreateMapPolyfill");
|
|
1159
659
|
function CreateSetPolyfill() {
|
|
1160
|
-
return
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
660
|
+
return (
|
|
661
|
+
/** @class */
|
|
662
|
+
function() {
|
|
663
|
+
function Set1() {
|
|
664
|
+
this._map = new _Map();
|
|
665
|
+
}
|
|
666
|
+
__name(Set1, "Set1");
|
|
667
|
+
Object.defineProperty(Set1.prototype, "size", {
|
|
668
|
+
get: /* @__PURE__ */ __name(function() {
|
|
669
|
+
return this._map.size;
|
|
670
|
+
}, "get"),
|
|
671
|
+
enumerable: true,
|
|
672
|
+
configurable: true
|
|
673
|
+
});
|
|
674
|
+
Set1.prototype.has = function(value) {
|
|
675
|
+
return this._map.has(value);
|
|
676
|
+
};
|
|
677
|
+
Set1.prototype.add = function(value) {
|
|
678
|
+
return this._map.set(value, value), this;
|
|
679
|
+
};
|
|
680
|
+
Set1.prototype.delete = function(value) {
|
|
681
|
+
return this._map.delete(value);
|
|
682
|
+
};
|
|
683
|
+
Set1.prototype.clear = function() {
|
|
684
|
+
this._map.clear();
|
|
685
|
+
};
|
|
686
|
+
Set1.prototype.keys = function() {
|
|
687
|
+
return this._map.keys();
|
|
688
|
+
};
|
|
689
|
+
Set1.prototype.values = function() {
|
|
690
|
+
return this._map.values();
|
|
691
|
+
};
|
|
692
|
+
Set1.prototype.entries = function() {
|
|
693
|
+
return this._map.entries();
|
|
694
|
+
};
|
|
695
|
+
Set1.prototype["@@iterator"] = function() {
|
|
696
|
+
return this.keys();
|
|
697
|
+
};
|
|
698
|
+
Set1.prototype[iteratorSymbol] = function() {
|
|
699
|
+
return this.keys();
|
|
700
|
+
};
|
|
701
|
+
return Set1;
|
|
702
|
+
}()
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
__name(CreateSetPolyfill, "CreateSetPolyfill");
|
|
1201
706
|
function CreateWeakMapPolyfill() {
|
|
1202
707
|
var UUID_SIZE = 16;
|
|
1203
708
|
var keys = HashMap.create();
|
|
1204
709
|
var rootKey = CreateUniqueKey();
|
|
1205
|
-
return
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
710
|
+
return (
|
|
711
|
+
/** @class */
|
|
712
|
+
function() {
|
|
713
|
+
function WeakMap1() {
|
|
714
|
+
this._key = CreateUniqueKey();
|
|
715
|
+
}
|
|
716
|
+
__name(WeakMap1, "WeakMap1");
|
|
717
|
+
WeakMap1.prototype.has = function(target) {
|
|
718
|
+
var table = GetOrCreateWeakMapTable(
|
|
719
|
+
target,
|
|
720
|
+
/*create*/
|
|
721
|
+
false
|
|
722
|
+
);
|
|
723
|
+
return table !== void 0 ? HashMap.has(table, this._key) : false;
|
|
724
|
+
};
|
|
725
|
+
WeakMap1.prototype.get = function(target) {
|
|
726
|
+
var table = GetOrCreateWeakMapTable(
|
|
727
|
+
target,
|
|
728
|
+
/*create*/
|
|
729
|
+
false
|
|
730
|
+
);
|
|
731
|
+
return table !== void 0 ? HashMap.get(table, this._key) : void 0;
|
|
732
|
+
};
|
|
733
|
+
WeakMap1.prototype.set = function(target, value) {
|
|
734
|
+
var table = GetOrCreateWeakMapTable(
|
|
735
|
+
target,
|
|
736
|
+
/*create*/
|
|
737
|
+
true
|
|
738
|
+
);
|
|
739
|
+
table[this._key] = value;
|
|
740
|
+
return this;
|
|
741
|
+
};
|
|
742
|
+
WeakMap1.prototype.delete = function(target) {
|
|
743
|
+
var table = GetOrCreateWeakMapTable(
|
|
744
|
+
target,
|
|
745
|
+
/*create*/
|
|
746
|
+
false
|
|
747
|
+
);
|
|
748
|
+
return table !== void 0 ? delete table[this._key] : false;
|
|
749
|
+
};
|
|
750
|
+
WeakMap1.prototype.clear = function() {
|
|
751
|
+
this._key = CreateUniqueKey();
|
|
752
|
+
};
|
|
753
|
+
return WeakMap1;
|
|
754
|
+
}()
|
|
755
|
+
);
|
|
1231
756
|
function CreateUniqueKey() {
|
|
1232
757
|
var key;
|
|
1233
758
|
do
|
|
@@ -1236,66 +761,85 @@ var Reflect2;
|
|
|
1236
761
|
keys[key] = true;
|
|
1237
762
|
return key;
|
|
1238
763
|
}
|
|
764
|
+
__name(CreateUniqueKey, "CreateUniqueKey");
|
|
1239
765
|
function GetOrCreateWeakMapTable(target, create) {
|
|
1240
766
|
if (!hasOwn.call(target, rootKey)) {
|
|
1241
|
-
if (!create)
|
|
1242
|
-
|
|
1243
|
-
|
|
767
|
+
if (!create) return void 0;
|
|
768
|
+
Object.defineProperty(target, rootKey, {
|
|
769
|
+
value: HashMap.create()
|
|
770
|
+
});
|
|
1244
771
|
}
|
|
1245
772
|
return target[rootKey];
|
|
1246
773
|
}
|
|
774
|
+
__name(GetOrCreateWeakMapTable, "GetOrCreateWeakMapTable");
|
|
1247
775
|
function FillRandomBytes(buffer, size) {
|
|
1248
|
-
for (var i = 0;i < size; ++i)
|
|
1249
|
-
buffer[i] = Math.random() * 255 | 0;
|
|
776
|
+
for (var i = 0; i < size; ++i) buffer[i] = Math.random() * 255 | 0;
|
|
1250
777
|
return buffer;
|
|
1251
778
|
}
|
|
779
|
+
__name(FillRandomBytes, "FillRandomBytes");
|
|
1252
780
|
function GenRandomBytes(size) {
|
|
1253
781
|
if (typeof Uint8Array === "function") {
|
|
1254
|
-
if (typeof crypto !== "undefined")
|
|
1255
|
-
|
|
1256
|
-
if (typeof msCrypto !== "undefined")
|
|
1257
|
-
return msCrypto.getRandomValues(new Uint8Array(size));
|
|
782
|
+
if (typeof crypto !== "undefined") return crypto.getRandomValues(new Uint8Array(size));
|
|
783
|
+
if (typeof msCrypto !== "undefined") return msCrypto.getRandomValues(new Uint8Array(size));
|
|
1258
784
|
return FillRandomBytes(new Uint8Array(size), size);
|
|
1259
785
|
}
|
|
1260
786
|
return FillRandomBytes(new Array(size), size);
|
|
1261
787
|
}
|
|
788
|
+
__name(GenRandomBytes, "GenRandomBytes");
|
|
1262
789
|
function CreateUUID() {
|
|
1263
790
|
var data = GenRandomBytes(UUID_SIZE);
|
|
1264
791
|
data[6] = data[6] & 79 | 64;
|
|
1265
792
|
data[8] = data[8] & 191 | 128;
|
|
1266
793
|
var result = "";
|
|
1267
|
-
for (var offset = 0;offset < UUID_SIZE; ++offset) {
|
|
794
|
+
for (var offset = 0; offset < UUID_SIZE; ++offset) {
|
|
1268
795
|
var byte = data[offset];
|
|
1269
|
-
if (offset === 4 || offset === 6 || offset === 8)
|
|
1270
|
-
|
|
1271
|
-
if (byte < 16)
|
|
1272
|
-
result += "0";
|
|
796
|
+
if (offset === 4 || offset === 6 || offset === 8) result += "-";
|
|
797
|
+
if (byte < 16) result += "0";
|
|
1273
798
|
result += byte.toString(16).toLowerCase();
|
|
1274
799
|
}
|
|
1275
800
|
return result;
|
|
1276
801
|
}
|
|
802
|
+
__name(CreateUUID, "CreateUUID");
|
|
1277
803
|
}
|
|
804
|
+
__name(CreateWeakMapPolyfill, "CreateWeakMapPolyfill");
|
|
1278
805
|
function MakeDictionary(obj) {
|
|
1279
|
-
obj.__ =
|
|
806
|
+
obj.__ = void 0;
|
|
1280
807
|
delete obj.__;
|
|
1281
808
|
return obj;
|
|
1282
809
|
}
|
|
810
|
+
__name(MakeDictionary, "MakeDictionary");
|
|
1283
811
|
});
|
|
1284
812
|
})(Reflect2 || (Reflect2 = {}));
|
|
1285
813
|
|
|
1286
814
|
// src/typedi.ts
|
|
1287
|
-
|
|
1288
|
-
|
|
815
|
+
import { Container } from "typedi";
|
|
816
|
+
import { Service, Inject, Container as Container2 } from "typedi";
|
|
1289
817
|
function getInstance(service) {
|
|
1290
|
-
return
|
|
818
|
+
return Container.get(service);
|
|
1291
819
|
}
|
|
1292
|
-
|
|
1293
|
-
var export_Inject = import_typedi2.Inject;
|
|
1294
|
-
var export_Container = import_typedi2.Container;
|
|
1295
|
-
|
|
820
|
+
__name(getInstance, "getInstance");
|
|
1296
821
|
export {
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
822
|
+
Container2 as Container,
|
|
823
|
+
Inject,
|
|
824
|
+
Service,
|
|
825
|
+
getInstance
|
|
1301
826
|
};
|
|
827
|
+
/*! Bundled license information:
|
|
828
|
+
|
|
829
|
+
reflect-metadata/Reflect.js:
|
|
830
|
+
(*! *****************************************************************************
|
|
831
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
832
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
833
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
834
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
835
|
+
|
|
836
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
837
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
838
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
839
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
840
|
+
|
|
841
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
842
|
+
and limitations under the License.
|
|
843
|
+
***************************************************************************** *)
|
|
844
|
+
*/
|
|
845
|
+
//# sourceMappingURL=index.js.map
|