inversify 6.1.4 → 6.1.5-beta.0
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/CHANGELOG.md +11 -1
- package/README.md +6 -15
- package/es/container/container.d.ts +2 -0
- package/es/container/module_activation_store.d.ts +2 -2
- package/es/interfaces/interfaces.d.ts +2 -2
- package/es/inversify.d.ts +1 -0
- package/es/inversify.js +3 -2
- package/es/inversify.js.LICENSE.txt +14 -0
- package/lib/annotation/decorator_utils.js +31 -25
- package/lib/annotation/inject.js +20 -10
- package/lib/annotation/inject_base.js +6 -6
- package/lib/annotation/injectable.js +20 -10
- package/lib/annotation/multi_inject.js +20 -10
- package/lib/annotation/named.js +20 -10
- package/lib/annotation/optional.js +20 -10
- package/lib/annotation/post_construct.js +21 -11
- package/lib/annotation/pre_destroy.js +21 -11
- package/lib/annotation/property_event_decorator.js +4 -4
- package/lib/annotation/tagged.js +2 -2
- package/lib/annotation/target_name.js +21 -11
- package/lib/annotation/unmanaged.js +21 -11
- package/lib/bindings/binding.js +23 -10
- package/lib/constants/error_msgs.js +15 -29
- package/lib/constants/literal_types.js +3 -3
- package/lib/container/container.d.ts +2 -0
- package/lib/container/container.js +317 -566
- package/lib/container/container_module.js +11 -9
- package/lib/container/container_snapshot.js +10 -8
- package/lib/container/lookup.js +61 -56
- package/lib/container/module_activation_store.d.ts +2 -2
- package/lib/container/module_activation_store.js +21 -24
- package/lib/interfaces/interfaces.d.ts +2 -2
- package/lib/inversify.d.ts +1 -0
- package/lib/inversify.js +19 -8
- package/lib/planning/context.js +12 -9
- package/lib/planning/metadata.js +27 -16
- package/lib/planning/metadata_reader.js +29 -24
- package/lib/planning/plan.js +5 -4
- package/lib/planning/planner.js +62 -53
- package/lib/planning/queryable_string.js +16 -16
- package/lib/planning/reflection_utils.js +25 -17
- package/lib/planning/request.js +15 -8
- package/lib/resolution/instantiation.js +59 -119
- package/lib/resolution/resolver.js +89 -134
- package/lib/scope/scope.js +17 -62
- package/lib/syntax/binding_in_syntax.js +12 -12
- package/lib/syntax/binding_in_when_on_syntax.js +50 -47
- package/lib/syntax/binding_on_syntax.js +9 -9
- package/lib/syntax/binding_to_syntax.js +70 -49
- package/lib/syntax/binding_when_on_syntax.js +42 -40
- package/lib/syntax/binding_when_syntax.js +54 -76
- package/lib/syntax/constraint_helpers.js +31 -23
- package/lib/utils/async.js +1 -1
- package/lib/utils/binding_utils.js +31 -29
- package/lib/utils/exceptions.js +19 -9
- package/lib/utils/id.js +1 -1
- package/lib/utils/js.js +2 -3
- package/lib/utils/serialization.js +42 -33
- package/package.json +14 -15
- package/amd/annotation/decorator_utils.d.ts +0 -16
- package/amd/annotation/decorator_utils.js +0 -119
- package/amd/annotation/inject.d.ts +0 -5
- package/amd/annotation/inject.js +0 -31
- package/amd/annotation/inject_base.d.ts +0 -4
- package/amd/annotation/inject_base.js +0 -16
- package/amd/annotation/injectable.d.ts +0 -2
- package/amd/annotation/injectable.js +0 -40
- package/amd/annotation/lazy_service_identifier.js +0 -4
- package/amd/annotation/multi_inject.d.ts +0 -5
- package/amd/annotation/multi_inject.js +0 -31
- package/amd/annotation/named.d.ts +0 -2
- package/amd/annotation/named.js +0 -32
- package/amd/annotation/optional.d.ts +0 -2
- package/amd/annotation/optional.js +0 -32
- package/amd/annotation/post_construct.d.ts +0 -4
- package/amd/annotation/post_construct.js +0 -32
- package/amd/annotation/pre_destroy.d.ts +0 -4
- package/amd/annotation/pre_destroy.js +0 -32
- package/amd/annotation/property_event_decorator.d.ts +0 -4
- package/amd/annotation/property_event_decorator.js +0 -16
- package/amd/annotation/tagged.d.ts +0 -2
- package/amd/annotation/tagged.js +0 -8
- package/amd/annotation/target_name.d.ts +0 -3
- package/amd/annotation/target_name.js +0 -35
- package/amd/annotation/unmanaged.d.ts +0 -3
- package/amd/annotation/unmanaged.js +0 -35
- package/amd/bindings/binding.d.ts +0 -20
- package/amd/bindings/binding.js +0 -40
- package/amd/bindings/binding_count.d.ts +0 -5
- package/amd/bindings/binding_count.js +0 -11
- package/amd/constants/error_msgs.d.ts +0 -30
- package/amd/constants/error_msgs.js +0 -75
- package/amd/constants/literal_types.d.ts +0 -5
- package/amd/constants/literal_types.js +0 -28
- package/amd/constants/metadata_keys.d.ts +0 -13
- package/amd/constants/metadata_keys.js +0 -28
- package/amd/container/container.d.ts +0 -73
- package/amd/container/container.js +0 -766
- package/amd/container/container_module.d.ts +0 -11
- package/amd/container/container_module.js +0 -21
- package/amd/container/container_snapshot.d.ts +0 -10
- package/amd/container/container_snapshot.js +0 -20
- package/amd/container/lookup.d.ts +0 -17
- package/amd/container/lookup.js +0 -132
- package/amd/container/module_activation_store.d.ts +0 -10
- package/amd/container/module_activation_store.js +0 -51
- package/amd/interfaces/interfaces.d.ts +0 -269
- package/amd/interfaces/interfaces.js +0 -4
- package/amd/inversify.d.ts +0 -24
- package/amd/inversify.js +0 -57
- package/amd/planning/context.d.ts +0 -11
- package/amd/planning/context.js +0 -19
- package/amd/planning/metadata.d.ts +0 -8
- package/amd/planning/metadata.js +0 -45
- package/amd/planning/metadata_reader.d.ts +0 -6
- package/amd/planning/metadata_reader.js +0 -49
- package/amd/planning/plan.d.ts +0 -7
- package/amd/planning/plan.js +0 -13
- package/amd/planning/planner.d.ts +0 -5
- package/amd/planning/planner.js +0 -187
- package/amd/planning/queryable_string.d.ts +0 -10
- package/amd/planning/queryable_string.js +0 -33
- package/amd/planning/reflection_utils.d.ts +0 -5
- package/amd/planning/reflection_utils.js +0 -55
- package/amd/planning/request.d.ts +0 -14
- package/amd/planning/request.js +0 -24
- package/amd/planning/target.js +0 -111
- package/amd/resolution/instantiation.d.ts +0 -3
- package/amd/resolution/instantiation.js +0 -219
- package/amd/resolution/resolver.d.ts +0 -3
- package/amd/resolution/resolver.js +0 -234
- package/amd/scope/scope.d.ts +0 -3
- package/amd/scope/scope.js +0 -93
- package/amd/syntax/binding_in_syntax.d.ts +0 -9
- package/amd/syntax/binding_in_syntax.js +0 -24
- package/amd/syntax/binding_in_when_on_syntax.d.ts +0 -29
- package/amd/syntax/binding_in_when_on_syntax.js +0 -75
- package/amd/syntax/binding_on_syntax.d.ts +0 -8
- package/amd/syntax/binding_on_syntax.js +0 -20
- package/amd/syntax/binding_to_syntax.d.ts +0 -18
- package/amd/syntax/binding_to_syntax.js +0 -116
- package/amd/syntax/binding_when_on_syntax.d.ts +0 -25
- package/amd/syntax/binding_when_on_syntax.js +0 -65
- package/amd/syntax/binding_when_syntax.d.ts +0 -21
- package/amd/syntax/binding_when_syntax.js +0 -107
- package/amd/syntax/constraint_helpers.d.ts +0 -6
- package/amd/syntax/constraint_helpers.js +0 -66
- package/amd/utils/async.d.ts +0 -3
- package/amd/utils/async.js +0 -17
- package/amd/utils/binding_utils.d.ts +0 -4
- package/amd/utils/binding_utils.js +0 -86
- package/amd/utils/clonable.d.ts +0 -3
- package/amd/utils/clonable.js +0 -11
- package/amd/utils/exceptions.d.ts +0 -2
- package/amd/utils/exceptions.js +0 -46
- package/amd/utils/factory_type.d.ts +0 -5
- package/amd/utils/factory_type.js +0 -11
- package/amd/utils/id.d.ts +0 -2
- package/amd/utils/id.js +0 -9
- package/amd/utils/js.d.ts +0 -1
- package/amd/utils/js.js +0 -18
- package/amd/utils/serialization.d.ts +0 -10
- package/amd/utils/serialization.js +0 -135
- package/es6/annotation/decorator_utils.d.ts +0 -16
- package/es6/annotation/decorator_utils.js +0 -114
- package/es6/annotation/inject.d.ts +0 -5
- package/es6/annotation/inject.js +0 -30
- package/es6/annotation/inject_base.d.ts +0 -4
- package/es6/annotation/inject_base.js +0 -17
- package/es6/annotation/injectable.d.ts +0 -2
- package/es6/annotation/injectable.js +0 -38
- package/es6/annotation/lazy_service_identifier.js +0 -2
- package/es6/annotation/multi_inject.d.ts +0 -5
- package/es6/annotation/multi_inject.js +0 -30
- package/es6/annotation/named.d.ts +0 -2
- package/es6/annotation/named.js +0 -32
- package/es6/annotation/optional.d.ts +0 -2
- package/es6/annotation/optional.js +0 -32
- package/es6/annotation/post_construct.d.ts +0 -4
- package/es6/annotation/post_construct.js +0 -31
- package/es6/annotation/pre_destroy.d.ts +0 -4
- package/es6/annotation/pre_destroy.js +0 -31
- package/es6/annotation/property_event_decorator.d.ts +0 -4
- package/es6/annotation/property_event_decorator.js +0 -15
- package/es6/annotation/tagged.d.ts +0 -2
- package/es6/annotation/tagged.js +0 -8
- package/es6/annotation/target_name.d.ts +0 -3
- package/es6/annotation/target_name.js +0 -35
- package/es6/annotation/unmanaged.d.ts +0 -3
- package/es6/annotation/unmanaged.js +0 -35
- package/es6/bindings/binding.d.ts +0 -20
- package/es6/bindings/binding.js +0 -39
- package/es6/bindings/binding_count.d.ts +0 -5
- package/es6/bindings/binding_count.js +0 -9
- package/es6/constants/error_msgs.d.ts +0 -30
- package/es6/constants/error_msgs.js +0 -59
- package/es6/constants/literal_types.d.ts +0 -5
- package/es6/constants/literal_types.js +0 -26
- package/es6/constants/metadata_keys.d.ts +0 -13
- package/es6/constants/metadata_keys.js +0 -26
- package/es6/container/container.d.ts +0 -73
- package/es6/container/container.js +0 -545
- package/es6/container/container_module.d.ts +0 -11
- package/es6/container/container_module.js +0 -18
- package/es6/container/container_snapshot.d.ts +0 -10
- package/es6/container/container_snapshot.js +0 -15
- package/es6/container/lookup.d.ts +0 -17
- package/es6/container/lookup.js +0 -125
- package/es6/container/module_activation_store.d.ts +0 -10
- package/es6/container/module_activation_store.js +0 -49
- package/es6/interfaces/interfaces.d.ts +0 -269
- package/es6/interfaces/interfaces.js +0 -2
- package/es6/inversify.d.ts +0 -24
- package/es6/inversify.js +0 -76
- package/es6/planning/context.d.ts +0 -11
- package/es6/planning/context.js +0 -17
- package/es6/planning/metadata.d.ts +0 -8
- package/es6/planning/metadata.js +0 -42
- package/es6/planning/metadata_reader.d.ts +0 -6
- package/es6/planning/metadata_reader.js +0 -44
- package/es6/planning/plan.d.ts +0 -7
- package/es6/planning/plan.js +0 -10
- package/es6/planning/planner.d.ts +0 -5
- package/es6/planning/planner.js +0 -194
- package/es6/planning/queryable_string.d.ts +0 -10
- package/es6/planning/queryable_string.js +0 -30
- package/es6/planning/reflection_utils.d.ts +0 -5
- package/es6/planning/reflection_utils.js +0 -53
- package/es6/planning/request.d.ts +0 -14
- package/es6/planning/request.js +0 -22
- package/es6/planning/target.js +0 -105
- package/es6/resolution/instantiation.d.ts +0 -3
- package/es6/resolution/instantiation.js +0 -158
- package/es6/resolution/resolver.d.ts +0 -3
- package/es6/resolution/resolver.js +0 -193
- package/es6/scope/scope.d.ts +0 -3
- package/es6/scope/scope.js +0 -57
- package/es6/syntax/binding_in_syntax.d.ts +0 -9
- package/es6/syntax/binding_in_syntax.js +0 -23
- package/es6/syntax/binding_in_when_on_syntax.d.ts +0 -29
- package/es6/syntax/binding_in_when_on_syntax.js +0 -75
- package/es6/syntax/binding_on_syntax.d.ts +0 -8
- package/es6/syntax/binding_on_syntax.js +0 -18
- package/es6/syntax/binding_to_syntax.d.ts +0 -18
- package/es6/syntax/binding_to_syntax.js +0 -110
- package/es6/syntax/binding_when_on_syntax.d.ts +0 -25
- package/es6/syntax/binding_when_on_syntax.js +0 -64
- package/es6/syntax/binding_when_syntax.d.ts +0 -21
- package/es6/syntax/binding_when_syntax.js +0 -84
- package/es6/syntax/constraint_helpers.d.ts +0 -6
- package/es6/syntax/constraint_helpers.js +0 -63
- package/es6/utils/async.d.ts +0 -3
- package/es6/utils/async.js +0 -15
- package/es6/utils/binding_utils.d.ts +0 -4
- package/es6/utils/binding_utils.js +0 -79
- package/es6/utils/clonable.d.ts +0 -3
- package/es6/utils/clonable.js +0 -9
- package/es6/utils/exceptions.d.ts +0 -2
- package/es6/utils/exceptions.js +0 -44
- package/es6/utils/factory_type.d.ts +0 -5
- package/es6/utils/factory_type.js +0 -9
- package/es6/utils/id.d.ts +0 -2
- package/es6/utils/id.js +0 -7
- package/es6/utils/js.d.ts +0 -1
- package/es6/utils/js.js +0 -15
- package/es6/utils/serialization.d.ts +0 -10
- package/es6/utils/serialization.js +0 -132
package/amd/utils/clonable.d.ts
DELETED
package/amd/utils/clonable.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isClonable = isClonable;
|
|
5
|
-
function isClonable(obj) {
|
|
6
|
-
return (typeof obj === 'object' &&
|
|
7
|
-
obj !== null &&
|
|
8
|
-
'clone' in obj &&
|
|
9
|
-
typeof obj.clone === 'function');
|
|
10
|
-
}
|
|
11
|
-
});
|
package/amd/utils/exceptions.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
-
if (k2 === undefined) k2 = k;
|
|
3
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
-
}
|
|
7
|
-
Object.defineProperty(o, k2, desc);
|
|
8
|
-
}) : (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
o[k2] = m[k];
|
|
11
|
-
}));
|
|
12
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
-
}) : function(o, v) {
|
|
15
|
-
o["default"] = v;
|
|
16
|
-
});
|
|
17
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
-
if (mod && mod.__esModule) return mod;
|
|
19
|
-
var result = {};
|
|
20
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
-
__setModuleDefault(result, mod);
|
|
22
|
-
return result;
|
|
23
|
-
};
|
|
24
|
-
define(["require", "exports", "../constants/error_msgs"], function (require, exports, ERROR_MSGS) {
|
|
25
|
-
"use strict";
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.tryAndThrowErrorIfStackOverflow = void 0;
|
|
28
|
-
exports.isStackOverflowException = isStackOverflowException;
|
|
29
|
-
ERROR_MSGS = __importStar(ERROR_MSGS);
|
|
30
|
-
function isStackOverflowException(error) {
|
|
31
|
-
return (error instanceof RangeError ||
|
|
32
|
-
error.message === ERROR_MSGS.STACK_OVERFLOW);
|
|
33
|
-
}
|
|
34
|
-
var tryAndThrowErrorIfStackOverflow = function (fn, errorCallback) {
|
|
35
|
-
try {
|
|
36
|
-
return fn();
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
if (isStackOverflowException(error)) {
|
|
40
|
-
throw errorCallback();
|
|
41
|
-
}
|
|
42
|
-
throw error;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
exports.tryAndThrowErrorIfStackOverflow = tryAndThrowErrorIfStackOverflow;
|
|
46
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.FactoryType = void 0;
|
|
5
|
-
var FactoryType;
|
|
6
|
-
(function (FactoryType) {
|
|
7
|
-
FactoryType["DynamicValue"] = "toDynamicValue";
|
|
8
|
-
FactoryType["Factory"] = "toFactory";
|
|
9
|
-
FactoryType["Provider"] = "toProvider";
|
|
10
|
-
})(FactoryType || (exports.FactoryType = FactoryType = {}));
|
|
11
|
-
});
|
package/amd/utils/id.d.ts
DELETED
package/amd/utils/id.js
DELETED
package/amd/utils/js.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getFirstArrayDuplicate<T>(array: T[]): T | undefined;
|
package/amd/utils/js.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getFirstArrayDuplicate = getFirstArrayDuplicate;
|
|
5
|
-
function getFirstArrayDuplicate(array) {
|
|
6
|
-
var seenValues = new Set();
|
|
7
|
-
for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {
|
|
8
|
-
var entry = array_1[_i];
|
|
9
|
-
if (seenValues.has(entry)) {
|
|
10
|
-
return entry;
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
seenValues.add(entry);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { interfaces } from '../interfaces/interfaces';
|
|
2
|
-
declare function getServiceIdentifierAsString(serviceIdentifier: interfaces.ServiceIdentifier): string;
|
|
3
|
-
declare function listRegisteredBindingsForServiceIdentifier(container: interfaces.Container, serviceIdentifier: string, getBindings: <T>(container: interfaces.Container, serviceIdentifier: interfaces.ServiceIdentifier<T>) => interfaces.Binding<T>[]): string;
|
|
4
|
-
declare function circularDependencyToException(request: interfaces.Request): void;
|
|
5
|
-
declare function listMetadataForTarget(serviceIdentifierString: string, target: interfaces.Target): string;
|
|
6
|
-
declare function getFunctionName(func: {
|
|
7
|
-
name: string | null | undefined;
|
|
8
|
-
}): string;
|
|
9
|
-
declare function getSymbolDescription(symbol: symbol): string;
|
|
10
|
-
export { getFunctionName, getServiceIdentifierAsString, listRegisteredBindingsForServiceIdentifier, listMetadataForTarget, circularDependencyToException, getSymbolDescription, };
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
-
if (k2 === undefined) k2 = k;
|
|
3
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
-
}
|
|
7
|
-
Object.defineProperty(o, k2, desc);
|
|
8
|
-
}) : (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
o[k2] = m[k];
|
|
11
|
-
}));
|
|
12
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
-
}) : function(o, v) {
|
|
15
|
-
o["default"] = v;
|
|
16
|
-
});
|
|
17
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
-
if (mod && mod.__esModule) return mod;
|
|
19
|
-
var result = {};
|
|
20
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
-
__setModuleDefault(result, mod);
|
|
22
|
-
return result;
|
|
23
|
-
};
|
|
24
|
-
define(["require", "exports", "../constants/error_msgs"], function (require, exports, ERROR_MSGS) {
|
|
25
|
-
"use strict";
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.getFunctionName = getFunctionName;
|
|
28
|
-
exports.getServiceIdentifierAsString = getServiceIdentifierAsString;
|
|
29
|
-
exports.listRegisteredBindingsForServiceIdentifier = listRegisteredBindingsForServiceIdentifier;
|
|
30
|
-
exports.listMetadataForTarget = listMetadataForTarget;
|
|
31
|
-
exports.circularDependencyToException = circularDependencyToException;
|
|
32
|
-
exports.getSymbolDescription = getSymbolDescription;
|
|
33
|
-
ERROR_MSGS = __importStar(ERROR_MSGS);
|
|
34
|
-
function getServiceIdentifierAsString(serviceIdentifier) {
|
|
35
|
-
if (typeof serviceIdentifier === 'function') {
|
|
36
|
-
return serviceIdentifier.name;
|
|
37
|
-
}
|
|
38
|
-
else if (typeof serviceIdentifier === 'symbol') {
|
|
39
|
-
return serviceIdentifier.toString();
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return serviceIdentifier;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function listRegisteredBindingsForServiceIdentifier(container, serviceIdentifier, getBindings) {
|
|
46
|
-
var registeredBindingsList = '';
|
|
47
|
-
var registeredBindings = getBindings(container, serviceIdentifier);
|
|
48
|
-
if (registeredBindings.length !== 0) {
|
|
49
|
-
registeredBindingsList = '\nRegistered bindings:';
|
|
50
|
-
registeredBindings.forEach(function (binding) {
|
|
51
|
-
var name = 'Object';
|
|
52
|
-
if (binding.implementationType !== null) {
|
|
53
|
-
name = getFunctionName(binding.implementationType);
|
|
54
|
-
}
|
|
55
|
-
registeredBindingsList = "".concat(registeredBindingsList, "\n ").concat(name);
|
|
56
|
-
if (binding.constraint.metaData) {
|
|
57
|
-
registeredBindingsList = "".concat(registeredBindingsList, " - ").concat(binding.constraint.metaData);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
return registeredBindingsList;
|
|
62
|
-
}
|
|
63
|
-
function alreadyDependencyChain(request, serviceIdentifier) {
|
|
64
|
-
if (request.parentRequest === null) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
else if (request.parentRequest.serviceIdentifier === serviceIdentifier) {
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
return alreadyDependencyChain(request.parentRequest, serviceIdentifier);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function dependencyChainToString(request) {
|
|
75
|
-
function _createStringArr(req, result) {
|
|
76
|
-
if (result === void 0) { result = []; }
|
|
77
|
-
var serviceIdentifier = getServiceIdentifierAsString(req.serviceIdentifier);
|
|
78
|
-
result.push(serviceIdentifier);
|
|
79
|
-
if (req.parentRequest !== null) {
|
|
80
|
-
return _createStringArr(req.parentRequest, result);
|
|
81
|
-
}
|
|
82
|
-
return result;
|
|
83
|
-
}
|
|
84
|
-
var stringArr = _createStringArr(request);
|
|
85
|
-
return stringArr.reverse().join(' --> ');
|
|
86
|
-
}
|
|
87
|
-
function circularDependencyToException(request) {
|
|
88
|
-
request.childRequests.forEach(function (childRequest) {
|
|
89
|
-
if (alreadyDependencyChain(request, childRequest.serviceIdentifier)) {
|
|
90
|
-
var services = dependencyChainToString(childRequest);
|
|
91
|
-
throw new Error("".concat(ERROR_MSGS.CIRCULAR_DEPENDENCY, " ").concat(services));
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
circularDependencyToException(childRequest);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
function listMetadataForTarget(serviceIdentifierString, target) {
|
|
99
|
-
if (target.isTagged() || target.isNamed()) {
|
|
100
|
-
var m_1 = '';
|
|
101
|
-
var namedTag = target.getNamedTag();
|
|
102
|
-
var otherTags = target.getCustomTags();
|
|
103
|
-
if (namedTag !== null) {
|
|
104
|
-
m_1 += stringifyMetadata(namedTag) + '\n';
|
|
105
|
-
}
|
|
106
|
-
if (otherTags !== null) {
|
|
107
|
-
otherTags.forEach(function (tag) {
|
|
108
|
-
m_1 += stringifyMetadata(tag) + '\n';
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return " ".concat(serviceIdentifierString, "\n ").concat(serviceIdentifierString, " - ").concat(m_1);
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
return " ".concat(serviceIdentifierString);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
function getFunctionName(func) {
|
|
118
|
-
if (func.name != null && func.name !== '') {
|
|
119
|
-
return func.name;
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
var name_1 = func.toString();
|
|
123
|
-
var match = name_1.match(/^function\s*([^\s(]+)/);
|
|
124
|
-
return match === null
|
|
125
|
-
? "Anonymous function: ".concat(name_1)
|
|
126
|
-
: match[1];
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
function getSymbolDescription(symbol) {
|
|
130
|
-
return symbol.toString().slice(7, -1);
|
|
131
|
-
}
|
|
132
|
-
function stringifyMetadata(metadata) {
|
|
133
|
-
return "{\"key\":\"".concat(metadata.key.toString(), "\",\"value\":\"").concat(metadata.value.toString(), "\"}");
|
|
134
|
-
}
|
|
135
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { interfaces } from '../interfaces/interfaces';
|
|
2
|
-
type Prototype<T> = {
|
|
3
|
-
[Property in keyof T]: T[Property] extends NewableFunction ? T[Property] : T[Property] | undefined;
|
|
4
|
-
} & {
|
|
5
|
-
constructor: NewableFunction;
|
|
6
|
-
};
|
|
7
|
-
interface ConstructorFunction<T = Record<string, unknown>> {
|
|
8
|
-
prototype: Prototype<T>;
|
|
9
|
-
new (...args: unknown[]): T;
|
|
10
|
-
}
|
|
11
|
-
export type DecoratorTarget<T = unknown> = ConstructorFunction<T> | Prototype<T>;
|
|
12
|
-
declare function tagParameter(annotationTarget: DecoratorTarget, parameterName: string | symbol | undefined, parameterIndex: number, metadata: interfaces.MetadataOrMetadataArray): void;
|
|
13
|
-
declare function tagProperty(annotationTarget: DecoratorTarget, propertyName: string | symbol, metadata: interfaces.MetadataOrMetadataArray): void;
|
|
14
|
-
declare function createTaggedDecorator(metadata: interfaces.MetadataOrMetadataArray): <T>(target: DecoratorTarget, targetKey?: string | symbol, indexOrPropertyDescriptor?: number | TypedPropertyDescriptor<T>) => void;
|
|
15
|
-
declare function decorate(decorator: DecoratorTarget | ParameterDecorator | MethodDecorator, target: object, parameterIndexOrProperty?: number | string): void;
|
|
16
|
-
export { decorate, tagParameter, tagProperty, createTaggedDecorator };
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.decorate = decorate;
|
|
27
|
-
exports.tagParameter = tagParameter;
|
|
28
|
-
exports.tagProperty = tagProperty;
|
|
29
|
-
exports.createTaggedDecorator = createTaggedDecorator;
|
|
30
|
-
const ERROR_MSGS = __importStar(require("../constants/error_msgs"));
|
|
31
|
-
const METADATA_KEY = __importStar(require("../constants/metadata_keys"));
|
|
32
|
-
const js_1 = require("../utils/js");
|
|
33
|
-
function targetIsConstructorFunction(target) {
|
|
34
|
-
return target.prototype !== undefined;
|
|
35
|
-
}
|
|
36
|
-
function _throwIfMethodParameter(parameterName) {
|
|
37
|
-
if (parameterName !== undefined) {
|
|
38
|
-
throw new Error(ERROR_MSGS.INVALID_DECORATOR_OPERATION);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function tagParameter(annotationTarget, parameterName, parameterIndex, metadata) {
|
|
42
|
-
_throwIfMethodParameter(parameterName);
|
|
43
|
-
_tagParameterOrProperty(METADATA_KEY.TAGGED, annotationTarget, parameterIndex.toString(), metadata);
|
|
44
|
-
}
|
|
45
|
-
function tagProperty(annotationTarget, propertyName, metadata) {
|
|
46
|
-
if (targetIsConstructorFunction(annotationTarget)) {
|
|
47
|
-
throw new Error(ERROR_MSGS.INVALID_DECORATOR_OPERATION);
|
|
48
|
-
}
|
|
49
|
-
_tagParameterOrProperty(METADATA_KEY.TAGGED_PROP, annotationTarget.constructor, propertyName, metadata);
|
|
50
|
-
}
|
|
51
|
-
function _ensureNoMetadataKeyDuplicates(metadata) {
|
|
52
|
-
let metadatas = [];
|
|
53
|
-
if (Array.isArray(metadata)) {
|
|
54
|
-
metadatas = metadata;
|
|
55
|
-
const duplicate = (0, js_1.getFirstArrayDuplicate)(metadatas.map((md) => md.key));
|
|
56
|
-
if (duplicate !== undefined) {
|
|
57
|
-
throw new Error(`${ERROR_MSGS.DUPLICATED_METADATA} ${duplicate.toString()}`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
metadatas = [metadata];
|
|
62
|
-
}
|
|
63
|
-
return metadatas;
|
|
64
|
-
}
|
|
65
|
-
function _tagParameterOrProperty(metadataKey, annotationTarget, key, metadata) {
|
|
66
|
-
const metadatas = _ensureNoMetadataKeyDuplicates(metadata);
|
|
67
|
-
let paramsOrPropertiesMetadata = {};
|
|
68
|
-
if (Reflect.hasOwnMetadata(metadataKey, annotationTarget)) {
|
|
69
|
-
paramsOrPropertiesMetadata = Reflect.getMetadata(metadataKey, annotationTarget);
|
|
70
|
-
}
|
|
71
|
-
let paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];
|
|
72
|
-
if (paramOrPropertyMetadata === undefined) {
|
|
73
|
-
paramOrPropertyMetadata = [];
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
for (const m of paramOrPropertyMetadata) {
|
|
77
|
-
if (metadatas.some((md) => md.key === m.key)) {
|
|
78
|
-
throw new Error(`${ERROR_MSGS.DUPLICATED_METADATA} ${m.key.toString()}`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
paramOrPropertyMetadata.push(...metadatas);
|
|
83
|
-
paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata;
|
|
84
|
-
Reflect.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);
|
|
85
|
-
}
|
|
86
|
-
function createTaggedDecorator(metadata) {
|
|
87
|
-
return (target, targetKey, indexOrPropertyDescriptor) => {
|
|
88
|
-
if (typeof indexOrPropertyDescriptor === 'number') {
|
|
89
|
-
tagParameter(target, targetKey, indexOrPropertyDescriptor, metadata);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
tagProperty(target, targetKey, metadata);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
function _decorate(decorators, target) {
|
|
97
|
-
Reflect.decorate(decorators, target);
|
|
98
|
-
}
|
|
99
|
-
function _param(paramIndex, decorator) {
|
|
100
|
-
return function (target, key) {
|
|
101
|
-
decorator(target, key, paramIndex);
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
function decorate(decorator, target, parameterIndexOrProperty) {
|
|
105
|
-
if (typeof parameterIndexOrProperty === 'number') {
|
|
106
|
-
_decorate([_param(parameterIndexOrProperty, decorator)], target);
|
|
107
|
-
}
|
|
108
|
-
else if (typeof parameterIndexOrProperty === 'string') {
|
|
109
|
-
Reflect.decorate([decorator], target, parameterIndexOrProperty);
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
_decorate([decorator], target);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { LazyServiceIdentifier } from '@inversifyjs/common';
|
|
2
|
-
import { interfaces } from '../interfaces/interfaces';
|
|
3
|
-
import { DecoratorTarget } from './decorator_utils';
|
|
4
|
-
declare const inject: <T = unknown>(serviceIdentifier: interfaces.ServiceIdentifier<T> | LazyServiceIdentifier<T>) => (target: DecoratorTarget, targetKey?: string | symbol, indexOrPropertyDescriptor?: number | TypedPropertyDescriptor<T>) => void;
|
|
5
|
-
export { inject };
|
package/es6/annotation/inject.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.inject = void 0;
|
|
27
|
-
const METADATA_KEY = __importStar(require("../constants/metadata_keys"));
|
|
28
|
-
const inject_base_1 = require("./inject_base");
|
|
29
|
-
const inject = (0, inject_base_1.injectBase)(METADATA_KEY.INJECT_TAG);
|
|
30
|
-
exports.inject = inject;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { LazyServiceIdentifier } from '@inversifyjs/common';
|
|
2
|
-
import { interfaces } from '../interfaces/interfaces';
|
|
3
|
-
import { DecoratorTarget } from './decorator_utils';
|
|
4
|
-
export declare function injectBase(metadataKey: string): <T = unknown>(serviceIdentifier: interfaces.ServiceIdentifier<T> | LazyServiceIdentifier<T>) => (target: DecoratorTarget, targetKey?: string | symbol, indexOrPropertyDescriptor?: number | TypedPropertyDescriptor<T>) => void;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.injectBase = injectBase;
|
|
4
|
-
const error_msgs_1 = require("../constants/error_msgs");
|
|
5
|
-
const metadata_1 = require("../planning/metadata");
|
|
6
|
-
const decorator_utils_1 = require("./decorator_utils");
|
|
7
|
-
function injectBase(metadataKey) {
|
|
8
|
-
return (serviceIdentifier) => {
|
|
9
|
-
return (target, targetKey, indexOrPropertyDescriptor) => {
|
|
10
|
-
if (serviceIdentifier === undefined) {
|
|
11
|
-
const className = typeof target === 'function' ? target.name : target.constructor.name;
|
|
12
|
-
throw new Error((0, error_msgs_1.UNDEFINED_INJECT_ANNOTATION)(className));
|
|
13
|
-
}
|
|
14
|
-
(0, decorator_utils_1.createTaggedDecorator)(new metadata_1.Metadata(metadataKey, serviceIdentifier))(target, targetKey, indexOrPropertyDescriptor);
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.injectable = injectable;
|
|
27
|
-
const ERRORS_MSGS = __importStar(require("../constants/error_msgs"));
|
|
28
|
-
const METADATA_KEY = __importStar(require("../constants/metadata_keys"));
|
|
29
|
-
function injectable() {
|
|
30
|
-
return function (target) {
|
|
31
|
-
if (Reflect.hasOwnMetadata(METADATA_KEY.PARAM_TYPES, target)) {
|
|
32
|
-
throw new Error(ERRORS_MSGS.DUPLICATED_INJECTABLE_DECORATOR);
|
|
33
|
-
}
|
|
34
|
-
const types = Reflect.getMetadata(METADATA_KEY.DESIGN_PARAM_TYPES, target) || [];
|
|
35
|
-
Reflect.defineMetadata(METADATA_KEY.PARAM_TYPES, types, target);
|
|
36
|
-
return target;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { LazyServiceIdentifier } from '@inversifyjs/common';
|
|
2
|
-
import { interfaces } from '../interfaces/interfaces';
|
|
3
|
-
import { DecoratorTarget } from './decorator_utils';
|
|
4
|
-
declare const multiInject: <T = unknown>(serviceIdentifier: interfaces.ServiceIdentifier<T> | LazyServiceIdentifier<T>) => (target: DecoratorTarget, targetKey?: string | symbol, indexOrPropertyDescriptor?: number | TypedPropertyDescriptor<T>) => void;
|
|
5
|
-
export { multiInject };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.multiInject = void 0;
|
|
27
|
-
const METADATA_KEY = __importStar(require("../constants/metadata_keys"));
|
|
28
|
-
const inject_base_1 = require("./inject_base");
|
|
29
|
-
const multiInject = (0, inject_base_1.injectBase)(METADATA_KEY.MULTI_INJECT_TAG);
|
|
30
|
-
exports.multiInject = multiInject;
|
package/es6/annotation/named.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.named = named;
|
|
27
|
-
const METADATA_KEY = __importStar(require("../constants/metadata_keys"));
|
|
28
|
-
const metadata_1 = require("../planning/metadata");
|
|
29
|
-
const decorator_utils_1 = require("./decorator_utils");
|
|
30
|
-
function named(name) {
|
|
31
|
-
return (0, decorator_utils_1.createTaggedDecorator)(new metadata_1.Metadata(METADATA_KEY.NAMED_TAG, name));
|
|
32
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.optional = optional;
|
|
27
|
-
const METADATA_KEY = __importStar(require("../constants/metadata_keys"));
|
|
28
|
-
const metadata_1 = require("../planning/metadata");
|
|
29
|
-
const decorator_utils_1 = require("./decorator_utils");
|
|
30
|
-
function optional() {
|
|
31
|
-
return (0, decorator_utils_1.createTaggedDecorator)(new metadata_1.Metadata(METADATA_KEY.OPTIONAL_TAG, true));
|
|
32
|
-
}
|