@typeix/di 8.1.2 → 8.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AfterConstruct = void 0;
4
4
  const metadata_1 = require("@typeix/metadata");
5
5
  function AfterConstruct() {
6
- return metadata_1.createMethodDecorator(AfterConstruct, {});
6
+ return (0, metadata_1.createMethodDecorator)(AfterConstruct, {});
7
7
  }
8
8
  exports.AfterConstruct = AfterConstruct;
9
9
  //# sourceMappingURL=after-construct.js.map
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AsyncInterceptor = void 0;
4
4
  const metadata_1 = require("@typeix/metadata");
5
5
  function AsyncInterceptor() {
6
- return metadata_1.createMethodDecorator(AsyncInterceptor, {});
6
+ return (0, metadata_1.createMethodDecorator)(AsyncInterceptor, {});
7
7
  }
8
8
  exports.AsyncInterceptor = AsyncInterceptor;
9
9
  //# sourceMappingURL=async-interceptor.js.map
@@ -4,7 +4,7 @@ exports.CreateProvider = void 0;
4
4
  const metadata_1 = require("@typeix/metadata");
5
5
  const provider_1 = require("../helpers/provider");
6
6
  function CreateProvider(token) {
7
- return metadata_1.createParameterAndPropertyDecorator(CreateProvider, { token: provider_1.verifyProvider(token) });
7
+ return (0, metadata_1.createParameterAndPropertyDecorator)(CreateProvider, { token: (0, provider_1.verifyProvider)(token) });
8
8
  }
9
9
  exports.CreateProvider = CreateProvider;
10
10
  //# sourceMappingURL=create-provider.js.map
@@ -20,26 +20,26 @@ describe("Inject", () => {
20
20
  let DService = class DService {
21
21
  };
22
22
  DService = __decorate([
23
- injectable_1.Injectable()
23
+ (0, injectable_1.Injectable)()
24
24
  ], DService);
25
25
  let CService = class CService {
26
26
  };
27
27
  CService = __decorate([
28
- injectable_1.Injectable()
28
+ (0, injectable_1.Injectable)()
29
29
  ], CService);
30
30
  let RootService = class RootService {
31
31
  };
32
32
  __decorate([
33
- inject_1.Inject(DService),
33
+ (0, inject_1.Inject)(DService),
34
34
  __metadata("design:type", DService)
35
35
  ], RootService.prototype, "info", void 0);
36
36
  RootService = __decorate([
37
- injectable_1.Injectable()
37
+ (0, injectable_1.Injectable)()
38
38
  ], RootService);
39
39
  let BService = class BService extends RootService {
40
40
  };
41
41
  BService = __decorate([
42
- injectable_1.Injectable()
42
+ (0, injectable_1.Injectable)()
43
43
  ], BService);
44
44
  let AService = class AService extends RootService {
45
45
  constructor(bService, cService) {
@@ -47,14 +47,14 @@ describe("Inject", () => {
47
47
  }
48
48
  };
49
49
  __decorate([
50
- inject_1.Inject(CService),
50
+ (0, inject_1.Inject)(CService),
51
51
  __metadata("design:type", CService)
52
52
  ], AService.prototype, "info", void 0);
53
53
  AService = __decorate([
54
- injectable_1.Injectable(),
54
+ (0, injectable_1.Injectable)(),
55
55
  __metadata("design:paramtypes", [BService, CService])
56
56
  ], AService);
57
- let aService = metadata_1.getAllMetadataForTarget(AService);
57
+ let aService = (0, metadata_1.getAllMetadataForTarget)(AService);
58
58
  expect(aService).toStrictEqual([
59
59
  {
60
60
  "args": [
@@ -72,7 +72,7 @@ describe("Inject", () => {
72
72
  BService,
73
73
  CService
74
74
  ],
75
- "metadataKey": metadata_1.getDecoratorId(injectable_1.Injectable),
75
+ "metadataKey": (0, metadata_1.getDecoratorId)(injectable_1.Injectable),
76
76
  "propertyKey": "constructor",
77
77
  "type": "constructor"
78
78
  },
@@ -89,18 +89,18 @@ describe("Inject", () => {
89
89
  "decorator": inject_1.Inject,
90
90
  "decoratorType": "mixed",
91
91
  "designType": CService,
92
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject),
92
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject),
93
93
  "propertyKey": "info",
94
94
  "type": "property"
95
95
  }
96
96
  ]);
97
- let bService = metadata_1.getAllMetadataForTarget(BService);
97
+ let bService = (0, metadata_1.getAllMetadataForTarget)(BService);
98
98
  expect(bService).toStrictEqual([
99
99
  {
100
100
  "args": {},
101
101
  "decorator": injectable_1.Injectable,
102
102
  "decoratorType": "constructor",
103
- "metadataKey": metadata_1.getDecoratorId(injectable_1.Injectable),
103
+ "metadataKey": (0, metadata_1.getDecoratorId)(injectable_1.Injectable),
104
104
  "propertyKey": "constructor",
105
105
  "type": "constructor"
106
106
  },
@@ -117,7 +117,7 @@ describe("Inject", () => {
117
117
  "decorator": inject_1.Inject,
118
118
  "decoratorType": "mixed",
119
119
  "designType": DService,
120
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject),
120
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject),
121
121
  "propertyKey": "info",
122
122
  "type": "property"
123
123
  }
@@ -127,38 +127,38 @@ describe("Inject", () => {
127
127
  let AService = class AService {
128
128
  };
129
129
  AService = __decorate([
130
- injectable_1.Injectable()
130
+ (0, injectable_1.Injectable)()
131
131
  ], AService);
132
132
  let CService = class CService {
133
133
  };
134
134
  CService = __decorate([
135
- injectable_1.Injectable()
135
+ (0, injectable_1.Injectable)()
136
136
  ], CService);
137
137
  let RootService = class RootService {
138
138
  };
139
139
  __decorate([
140
- inject_1.Inject(CService),
140
+ (0, inject_1.Inject)(CService),
141
141
  __metadata("design:type", CService)
142
142
  ], RootService.prototype, "cService", void 0);
143
143
  RootService = __decorate([
144
- injectable_1.Injectable()
144
+ (0, injectable_1.Injectable)()
145
145
  ], RootService);
146
146
  let BService = class BService extends RootService {
147
147
  };
148
148
  __decorate([
149
- inject_1.Inject(AService),
149
+ (0, inject_1.Inject)(AService),
150
150
  __metadata("design:type", AService)
151
151
  ], BService.prototype, "aService", void 0);
152
152
  BService = __decorate([
153
- injectable_1.Injectable()
153
+ (0, injectable_1.Injectable)()
154
154
  ], BService);
155
- let rService = metadata_1.getAllMetadataForTarget(RootService);
155
+ let rService = (0, metadata_1.getAllMetadataForTarget)(RootService);
156
156
  expect(rService).toStrictEqual([
157
157
  {
158
158
  "args": {},
159
159
  "decorator": injectable_1.Injectable,
160
160
  "decoratorType": "constructor",
161
- "metadataKey": metadata_1.getDecoratorId(injectable_1.Injectable),
161
+ "metadataKey": (0, metadata_1.getDecoratorId)(injectable_1.Injectable),
162
162
  "propertyKey": "constructor",
163
163
  "type": "constructor"
164
164
  },
@@ -175,18 +175,18 @@ describe("Inject", () => {
175
175
  "decorator": inject_1.Inject,
176
176
  "decoratorType": "mixed",
177
177
  "designType": CService,
178
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject),
178
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject),
179
179
  "propertyKey": "cService",
180
180
  "type": "property"
181
181
  }
182
182
  ]);
183
- let bService = metadata_1.getAllMetadataForTarget(BService);
183
+ let bService = (0, metadata_1.getAllMetadataForTarget)(BService);
184
184
  expect(bService).toStrictEqual([
185
185
  {
186
186
  "args": {},
187
187
  "decorator": injectable_1.Injectable,
188
188
  "decoratorType": "constructor",
189
- "metadataKey": metadata_1.getDecoratorId(injectable_1.Injectable),
189
+ "metadataKey": (0, metadata_1.getDecoratorId)(injectable_1.Injectable),
190
190
  "propertyKey": "constructor",
191
191
  "type": "constructor"
192
192
  },
@@ -203,7 +203,7 @@ describe("Inject", () => {
203
203
  "decorator": inject_1.Inject,
204
204
  "decoratorType": "mixed",
205
205
  "designType": AService,
206
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject),
206
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject),
207
207
  "propertyKey": "aService",
208
208
  "type": "property"
209
209
  },
@@ -220,7 +220,7 @@ describe("Inject", () => {
220
220
  "decorator": inject_1.Inject,
221
221
  "decoratorType": "mixed",
222
222
  "designType": CService,
223
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject),
223
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject),
224
224
  "propertyKey": "cService",
225
225
  "type": "property"
226
226
  }
@@ -230,16 +230,16 @@ describe("Inject", () => {
230
230
  let CService = class CService {
231
231
  };
232
232
  CService = __decorate([
233
- injectable_1.Injectable()
233
+ (0, injectable_1.Injectable)()
234
234
  ], CService);
235
235
  let RootService = class RootService {
236
236
  };
237
237
  __decorate([
238
- inject_1.Inject(CService),
238
+ (0, inject_1.Inject)(CService),
239
239
  __metadata("design:type", CService)
240
240
  ], RootService.prototype, "info", void 0);
241
241
  RootService = __decorate([
242
- injectable_1.Injectable()
242
+ (0, injectable_1.Injectable)()
243
243
  ], RootService);
244
244
  let BService = class BService extends RootService {
245
245
  constructor(cService) {
@@ -247,11 +247,11 @@ describe("Inject", () => {
247
247
  }
248
248
  };
249
249
  __decorate([
250
- inject_1.Inject(CService),
250
+ (0, inject_1.Inject)(CService),
251
251
  __metadata("design:type", CService)
252
252
  ], BService.prototype, "info", void 0);
253
253
  BService = __decorate([
254
- injectable_1.Injectable(),
254
+ (0, injectable_1.Injectable)(),
255
255
  __metadata("design:paramtypes", [CService])
256
256
  ], BService);
257
257
  let AService = class AService extends RootService {
@@ -260,14 +260,14 @@ describe("Inject", () => {
260
260
  }
261
261
  };
262
262
  __decorate([
263
- inject_1.Inject(BService),
263
+ (0, inject_1.Inject)(BService),
264
264
  __metadata("design:type", BService)
265
265
  ], AService.prototype, "info", void 0);
266
266
  AService = __decorate([
267
- injectable_1.Injectable(),
267
+ (0, injectable_1.Injectable)(),
268
268
  __metadata("design:paramtypes", [BService, CService])
269
269
  ], AService);
270
- let aService = metadata_1.getAllMetadataForTarget(AService);
270
+ let aService = (0, metadata_1.getAllMetadataForTarget)(AService);
271
271
  expect(aService).toStrictEqual([
272
272
  {
273
273
  "args": [
@@ -285,7 +285,7 @@ describe("Inject", () => {
285
285
  BService,
286
286
  CService
287
287
  ],
288
- "metadataKey": metadata_1.getDecoratorId(injectable_1.Injectable),
288
+ "metadataKey": (0, metadata_1.getDecoratorId)(injectable_1.Injectable),
289
289
  "propertyKey": "constructor",
290
290
  "type": "constructor"
291
291
  },
@@ -302,12 +302,12 @@ describe("Inject", () => {
302
302
  "decorator": inject_1.Inject,
303
303
  "decoratorType": "mixed",
304
304
  "designType": BService,
305
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject),
305
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject),
306
306
  "propertyKey": "info",
307
307
  "type": "property"
308
308
  }
309
309
  ]);
310
- let bService = metadata_1.getAllMetadataForTarget(BService);
310
+ let bService = (0, metadata_1.getAllMetadataForTarget)(BService);
311
311
  expect(bService).toStrictEqual([
312
312
  {
313
313
  "args": [
@@ -323,7 +323,7 @@ describe("Inject", () => {
323
323
  "designParam": [
324
324
  CService
325
325
  ],
326
- "metadataKey": metadata_1.getDecoratorId(injectable_1.Injectable),
326
+ "metadataKey": (0, metadata_1.getDecoratorId)(injectable_1.Injectable),
327
327
  "propertyKey": "constructor",
328
328
  "type": "constructor"
329
329
  },
@@ -340,7 +340,7 @@ describe("Inject", () => {
340
340
  "decorator": inject_1.Inject,
341
341
  "decoratorType": "mixed",
342
342
  "designType": CService,
343
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject),
343
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject),
344
344
  "propertyKey": "info",
345
345
  "type": "property"
346
346
  }
@@ -350,12 +350,12 @@ describe("Inject", () => {
350
350
  let CService = class CService {
351
351
  };
352
352
  CService = __decorate([
353
- injectable_1.Injectable()
353
+ (0, injectable_1.Injectable)()
354
354
  ], CService);
355
355
  let BService = class BService {
356
356
  };
357
357
  BService = __decorate([
358
- injectable_1.Injectable()
358
+ (0, injectable_1.Injectable)()
359
359
  ], BService);
360
360
  let AService = class AService {
361
361
  constructor(bService, cService) {
@@ -365,17 +365,18 @@ describe("Inject", () => {
365
365
  }
366
366
  };
367
367
  __decorate([
368
- __param(1, inject_1.Inject("value")), __param(2, inject_1.Inject("value")),
368
+ __param(1, (0, inject_1.Inject)("value")),
369
+ __param(2, (0, inject_1.Inject)("value")),
369
370
  __metadata("design:type", Function),
370
371
  __metadata("design:paramtypes", [AService, String, String]),
371
372
  __metadata("design:returntype", String)
372
373
  ], AService.prototype, "name", null);
373
374
  AService = __decorate([
374
- injectable_1.Injectable(),
375
- __param(0, inject_1.Inject(BService)),
375
+ (0, injectable_1.Injectable)(),
376
+ __param(0, (0, inject_1.Inject)(BService)),
376
377
  __metadata("design:paramtypes", [BService, CService])
377
378
  ], AService);
378
- let aService = metadata_1.getAllMetadataForTarget(AService);
379
+ let aService = (0, metadata_1.getAllMetadataForTarget)(AService);
379
380
  expect(aService).toStrictEqual([
380
381
  {
381
382
  "args": [
@@ -396,7 +397,7 @@ describe("Inject", () => {
396
397
  BService,
397
398
  CService
398
399
  ],
399
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject, 0),
400
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject, 0),
400
401
  "paramIndex": 0,
401
402
  "propertyKey": "constructor",
402
403
  "type": "parameter"
@@ -409,7 +410,7 @@ describe("Inject", () => {
409
410
  BService,
410
411
  CService
411
412
  ],
412
- "metadataKey": metadata_1.getDecoratorId(injectable_1.Injectable),
413
+ "metadataKey": (0, metadata_1.getDecoratorId)(injectable_1.Injectable),
413
414
  "propertyKey": "constructor",
414
415
  "type": "constructor"
415
416
  },
@@ -446,7 +447,7 @@ describe("Inject", () => {
446
447
  ],
447
448
  "designReturn": String,
448
449
  "designType": Function,
449
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject, 2),
450
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject, 2),
450
451
  "paramIndex": 2,
451
452
  "propertyKey": "name",
452
453
  "type": "parameter"
@@ -465,7 +466,7 @@ describe("Inject", () => {
465
466
  ],
466
467
  "designReturn": String,
467
468
  "designType": Function,
468
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject, 1),
469
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject, 1),
469
470
  "paramIndex": 1,
470
471
  "propertyKey": "name",
471
472
  "type": "parameter"
@@ -476,38 +477,38 @@ describe("Inject", () => {
476
477
  let AService = class AService {
477
478
  };
478
479
  AService = __decorate([
479
- injectable_1.Injectable()
480
+ (0, injectable_1.Injectable)()
480
481
  ], AService);
481
482
  let CService = class CService {
482
483
  };
483
484
  CService = __decorate([
484
- injectable_1.Injectable()
485
+ (0, injectable_1.Injectable)()
485
486
  ], CService);
486
487
  let RootService = class RootService {
487
488
  };
488
489
  __decorate([
489
- inject_1.Inject(CService),
490
+ (0, inject_1.Inject)(CService),
490
491
  __metadata("design:type", CService)
491
492
  ], RootService.prototype, "cService", void 0);
492
493
  RootService = __decorate([
493
- injectable_1.Injectable()
494
+ (0, injectable_1.Injectable)()
494
495
  ], RootService);
495
496
  let BService = class BService extends RootService {
496
497
  };
497
498
  __decorate([
498
- inject_1.Inject(AService),
499
+ (0, inject_1.Inject)(AService),
499
500
  __metadata("design:type", AService)
500
501
  ], BService.prototype, "aService", void 0);
501
502
  BService = __decorate([
502
- injectable_1.Injectable()
503
+ (0, injectable_1.Injectable)()
503
504
  ], BService);
504
- let bService = metadata_1.getAllMetadataForTarget(BService);
505
+ let bService = (0, metadata_1.getAllMetadataForTarget)(BService);
505
506
  expect(bService).toStrictEqual([
506
507
  {
507
508
  "args": {},
508
509
  "decorator": injectable_1.Injectable,
509
510
  "decoratorType": "constructor",
510
- "metadataKey": metadata_1.getDecoratorId(injectable_1.Injectable),
511
+ "metadataKey": (0, metadata_1.getDecoratorId)(injectable_1.Injectable),
511
512
  "propertyKey": "constructor",
512
513
  "type": "constructor"
513
514
  },
@@ -524,7 +525,7 @@ describe("Inject", () => {
524
525
  "decorator": inject_1.Inject,
525
526
  "decoratorType": "mixed",
526
527
  "designType": AService,
527
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject),
528
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject),
528
529
  "propertyKey": "aService",
529
530
  "type": "property"
530
531
  },
@@ -541,7 +542,7 @@ describe("Inject", () => {
541
542
  "decorator": inject_1.Inject,
542
543
  "decoratorType": "mixed",
543
544
  "designType": CService,
544
- "metadataKey": metadata_1.getDecoratorId(inject_1.Inject),
545
+ "metadataKey": (0, metadata_1.getDecoratorId)(inject_1.Inject),
545
546
  "propertyKey": "cService",
546
547
  "type": "property"
547
548
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Inject = void 0;
4
4
  const metadata_1 = require("@typeix/metadata");
5
5
  function Inject(token, isMutable = false) {
6
- return metadata_1.createParameterAndPropertyDecorator(Inject, { token, isMutable });
6
+ return (0, metadata_1.createParameterAndPropertyDecorator)(Inject, { token, isMutable });
7
7
  }
8
8
  exports.Inject = Inject;
9
9
  //# sourceMappingURL=inject.js.map
@@ -16,7 +16,7 @@ describe("Injectable", () => {
16
16
  let AService = class AService {
17
17
  };
18
18
  AService = __decorate([
19
- injectable_1.Injectable()
19
+ (0, injectable_1.Injectable)()
20
20
  ], AService);
21
21
  let BService = class BService {
22
22
  constructor(serviceA) {
@@ -24,7 +24,7 @@ describe("Injectable", () => {
24
24
  }
25
25
  };
26
26
  BService = __decorate([
27
- injectable_1.Injectable(),
27
+ (0, injectable_1.Injectable)(),
28
28
  __metadata("design:paramtypes", [AService])
29
29
  ], BService);
30
30
  let CService = class CService {
@@ -33,12 +33,12 @@ describe("Injectable", () => {
33
33
  }
34
34
  };
35
35
  CService = __decorate([
36
- injectable_1.Injectable(),
36
+ (0, injectable_1.Injectable)(),
37
37
  __metadata("design:paramtypes", [BService])
38
38
  ], CService);
39
- let aParams = metadata_1.getAllMetadataForTarget(AService);
40
- let bParams = metadata_1.getAllMetadataForTarget(BService).pop().designParam;
41
- let cParams = metadata_1.getAllMetadataForTarget(CService).pop().designParam;
39
+ let aParams = (0, metadata_1.getAllMetadataForTarget)(AService);
40
+ let bParams = (0, metadata_1.getAllMetadataForTarget)(BService).pop().designParam;
41
+ let cParams = (0, metadata_1.getAllMetadataForTarget)(CService).pop().designParam;
42
42
  expect(aParams.length).toBe(1);
43
43
  expect(aParams.pop().decorator).toBe(injectable_1.Injectable);
44
44
  expect(bParams).toStrictEqual([AService]);
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Injectable = void 0;
4
4
  const metadata_1 = require("@typeix/metadata");
5
5
  function Injectable() {
6
- return metadata_1.createClassDecorator(Injectable);
6
+ return (0, metadata_1.createClassDecorator)(Injectable);
7
7
  }
8
8
  exports.Injectable = Injectable;
9
9
  //# sourceMappingURL=injectable.js.map
@@ -8,12 +8,12 @@ const injector_1 = require("../injector");
8
8
  const decorators_1 = require("../decorators");
9
9
  function createMethodInterceptor(decorator, Class, args) {
10
10
  injector_1.SyncInjector.__interceptors__.add(decorator);
11
- return metadata_1.createMethodDecorator(decorator, { Class, args });
11
+ return (0, metadata_1.createMethodDecorator)(decorator, { Class, args });
12
12
  }
13
13
  exports.createMethodInterceptor = createMethodInterceptor;
14
14
  function createInterceptorHandler(interceptors, interceptor, metadata, provider, instance) {
15
15
  const propertyKey = metadata.propertyKey;
16
- const isAsync = metadata_1.hasDecorator(decorators_1.AsyncInterceptor, provider.useClass.prototype, metadata.propertyKey);
16
+ const isAsync = (0, metadata_1.hasDecorator)(decorators_1.AsyncInterceptor, provider.useClass.prototype, metadata.propertyKey);
17
17
  const interceptorHandler = {
18
18
  handler: interceptor,
19
19
  args: metadata.args.args
@@ -33,11 +33,11 @@ function createInterceptorHandler(interceptors, interceptor, metadata, provider,
33
33
  }
34
34
  function createInterceptorHandlers(provider, injector) {
35
35
  const metadata = injector_1.SyncInjector.getAllMetadataForTarget(provider);
36
- const values = metadata.filter(item => { var _a; return injector_1.SyncInjector.__interceptors__.has(item.decorator) && item.type === "method" && utils_1.isClass((_a = item.args) === null || _a === void 0 ? void 0 : _a.Class); });
36
+ const values = metadata.filter(item => { var _a; return injector_1.SyncInjector.__interceptors__.has(item.decorator) && item.type === "method" && (0, utils_1.isClass)((_a = item.args) === null || _a === void 0 ? void 0 : _a.Class); });
37
37
  const instance = injector.get(provider.provide);
38
38
  const interceptors = new Map();
39
39
  for (const item of values) {
40
- const handlerProvider = provider_1.verifyProvider(item.args.Class);
40
+ const handlerProvider = (0, provider_1.verifyProvider)(item.args.Class);
41
41
  const interceptor = injector.createAndResolve(handlerProvider, injector_1.SyncInjector.getProviders(handlerProvider));
42
42
  createInterceptorHandler(interceptors, interceptor, item, provider, instance);
43
43
  }
@@ -46,11 +46,11 @@ function createInterceptorHandlers(provider, injector) {
46
46
  exports.createInterceptorHandlers = createInterceptorHandlers;
47
47
  async function createInterceptorHandlersAsync(provider, injector) {
48
48
  const metadata = injector_1.SyncInjector.getAllMetadataForTarget(provider);
49
- const values = metadata.filter(item => { var _a; return injector_1.SyncInjector.__interceptors__.has(item.decorator) && item.type === "method" && utils_1.isClass((_a = item.args) === null || _a === void 0 ? void 0 : _a.Class); });
49
+ const values = metadata.filter(item => { var _a; return injector_1.SyncInjector.__interceptors__.has(item.decorator) && item.type === "method" && (0, utils_1.isClass)((_a = item.args) === null || _a === void 0 ? void 0 : _a.Class); });
50
50
  const instance = injector.get(provider.provide);
51
51
  const interceptors = new Map();
52
52
  for (const item of values) {
53
- const handlerProvider = provider_1.verifyProvider(item.args.Class);
53
+ const handlerProvider = (0, provider_1.verifyProvider)(item.args.Class);
54
54
  const interceptor = await injector.createAndResolve(handlerProvider, injector_1.SyncInjector.getProviders(handlerProvider));
55
55
  createInterceptorHandler(interceptors, interceptor, item, provider, instance);
56
56
  }
@@ -93,7 +93,7 @@ class Executor {
93
93
  this.args = args;
94
94
  }
95
95
  invoke() {
96
- if (utils_1.isUndefined(this.result)) {
96
+ if ((0, utils_1.isUndefined)(this.result)) {
97
97
  this.result = this.handler(...this.args);
98
98
  }
99
99
  return this.result;
@@ -13,23 +13,23 @@ describe("provider", () => {
13
13
  let A = class A {
14
14
  };
15
15
  A = __decorate([
16
- injectable_1.Injectable()
16
+ (0, injectable_1.Injectable)()
17
17
  ], A);
18
18
  let B = class B {
19
19
  };
20
20
  B = __decorate([
21
- injectable_1.Injectable()
21
+ (0, injectable_1.Injectable)()
22
22
  ], B);
23
23
  let C = class C {
24
24
  };
25
25
  C = __decorate([
26
- injectable_1.Injectable()
26
+ (0, injectable_1.Injectable)()
27
27
  ], C);
28
- expect(provider_1.shiftLeft([{ provide: B, useClass: C }], provider_1.verifyProviders([A, B]))).toEqual([
28
+ expect((0, provider_1.shiftLeft)([{ provide: B, useClass: C }], (0, provider_1.verifyProviders)([A, B]))).toEqual([
29
29
  { provide: B, useClass: C },
30
30
  { provide: A, useClass: A }
31
31
  ]);
32
- expect(provider_1.shiftRight([{ provide: B, useClass: C }], provider_1.verifyProviders([A, B]))).toEqual([
32
+ expect((0, provider_1.shiftRight)([{ provide: B, useClass: C }], (0, provider_1.verifyProviders)([A, B]))).toEqual([
33
33
  { provide: A, useClass: A },
34
34
  { provide: B, useClass: C }
35
35
  ]);
@@ -38,23 +38,23 @@ describe("provider", () => {
38
38
  let A = class A {
39
39
  };
40
40
  A = __decorate([
41
- injectable_1.Injectable()
41
+ (0, injectable_1.Injectable)()
42
42
  ], A);
43
43
  let B = class B {
44
44
  };
45
45
  B = __decorate([
46
- injectable_1.Injectable()
46
+ (0, injectable_1.Injectable)()
47
47
  ], B);
48
48
  let C = class C {
49
49
  };
50
50
  C = __decorate([
51
- injectable_1.Injectable()
51
+ (0, injectable_1.Injectable)()
52
52
  ], C);
53
- expect(provider_1.getProviderName(injectable_1.Injectable)).toEqual("Injectable");
54
- expect(provider_1.getProviderName("Injectable")).toEqual("Injectable");
55
- expect(provider_1.getProviderName({ provide: injectable_1.Injectable, useValue: "Injectable" })).toEqual("Injectable");
56
- expect(provider_1.getProviderName(function () { })).toEqual("Function");
57
- expect(provider_1.getProviderName(undefined)).toBe(null);
53
+ expect((0, provider_1.getProviderName)(injectable_1.Injectable)).toEqual("Injectable");
54
+ expect((0, provider_1.getProviderName)("Injectable")).toEqual("Injectable");
55
+ expect((0, provider_1.getProviderName)({ provide: injectable_1.Injectable, useValue: "Injectable" })).toEqual("Injectable");
56
+ expect((0, provider_1.getProviderName)(function () { })).toEqual("Function");
57
+ expect((0, provider_1.getProviderName)(undefined)).toBe(null);
58
58
  });
59
59
  test("ProviderList", async () => {
60
60
  let k1 = "method";
@@ -72,8 +72,8 @@ describe("provider", () => {
72
72
  expect(list.get(k2)).toBe(3);
73
73
  expect(() => {
74
74
  list.set(k2, 4);
75
- }).toThrow(`${provider_1.getProviderName(k2)} is already defined in injector, value: 4`);
76
- expect(provider_1.verifyProviders(null)).toEqual([]);
75
+ }).toThrow(`${(0, provider_1.getProviderName)(k2)} is already defined in injector, value: 4`);
76
+ expect((0, provider_1.verifyProviders)(null)).toEqual([]);
77
77
  });
78
78
  });
79
79
  //# sourceMappingURL=provider-spec.js.map