inversify 6.1.4 → 6.1.5-beta.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.
- package/CHANGELOG.md +16 -1
- package/README.md +6 -15
- package/{amd → lib/cjs}/annotation/decorator_utils.d.ts +1 -0
- package/lib/cjs/annotation/decorator_utils.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/decorator_utils.js +25 -7
- package/lib/cjs/annotation/decorator_utils.js.map +1 -0
- package/{es6 → lib/cjs}/annotation/inject.d.ts +1 -0
- package/lib/cjs/annotation/inject.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/inject.js +18 -7
- package/lib/cjs/annotation/inject.js.map +1 -0
- package/{amd → lib/cjs}/annotation/inject_base.d.ts +1 -0
- package/lib/cjs/annotation/inject_base.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/inject_base.js +2 -0
- package/lib/cjs/annotation/inject_base.js.map +1 -0
- package/{amd → lib/cjs}/annotation/injectable.d.ts +1 -0
- package/lib/cjs/annotation/injectable.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/injectable.js +19 -7
- package/lib/cjs/annotation/injectable.js.map +1 -0
- package/{es → lib/cjs}/annotation/multi_inject.d.ts +1 -0
- package/lib/cjs/annotation/multi_inject.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/multi_inject.js +18 -7
- package/lib/cjs/annotation/multi_inject.js.map +1 -0
- package/{amd → lib/cjs}/annotation/named.d.ts +1 -0
- package/lib/cjs/annotation/named.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/named.js +19 -7
- package/lib/cjs/annotation/named.js.map +1 -0
- package/{amd → lib/cjs}/annotation/optional.d.ts +1 -0
- package/lib/cjs/annotation/optional.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/optional.js +18 -7
- package/lib/cjs/annotation/optional.js.map +1 -0
- package/{amd → lib/cjs}/annotation/post_construct.d.ts +1 -0
- package/lib/cjs/annotation/post_construct.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/post_construct.js +18 -7
- package/lib/cjs/annotation/post_construct.js.map +1 -0
- package/{es6 → lib/cjs}/annotation/pre_destroy.d.ts +1 -0
- package/lib/cjs/annotation/pre_destroy.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/pre_destroy.js +18 -7
- package/lib/cjs/annotation/pre_destroy.js.map +1 -0
- package/{es → lib/cjs}/annotation/property_event_decorator.d.ts +1 -0
- package/lib/cjs/annotation/property_event_decorator.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/property_event_decorator.js +1 -0
- package/lib/cjs/annotation/property_event_decorator.js.map +1 -0
- package/{amd → lib/cjs}/annotation/tagged.d.ts +1 -0
- package/lib/cjs/annotation/tagged.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/tagged.js +2 -0
- package/lib/cjs/annotation/tagged.js.map +1 -0
- package/{es6 → lib/cjs}/annotation/target_name.d.ts +1 -0
- package/lib/cjs/annotation/target_name.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/target_name.js +18 -7
- package/lib/cjs/annotation/target_name.js.map +1 -0
- package/{es6 → lib/cjs}/annotation/unmanaged.d.ts +1 -0
- package/lib/cjs/annotation/unmanaged.d.ts.map +1 -0
- package/{es6 → lib/cjs}/annotation/unmanaged.js +18 -7
- package/lib/cjs/annotation/unmanaged.js.map +1 -0
- package/{es6 → lib/cjs}/bindings/binding.d.ts +1 -0
- package/lib/cjs/bindings/binding.d.ts.map +1 -0
- package/{es6 → lib/cjs}/bindings/binding.js +29 -0
- package/lib/cjs/bindings/binding.js.map +1 -0
- package/{amd → lib/cjs}/bindings/binding_count.d.ts +1 -0
- package/lib/cjs/bindings/binding_count.d.ts.map +1 -0
- package/lib/{bindings → cjs/bindings}/binding_count.js +1 -0
- package/lib/cjs/bindings/binding_count.js.map +1 -0
- package/{amd → lib/cjs}/constants/error_msgs.d.ts +1 -0
- package/lib/cjs/constants/error_msgs.d.ts.map +1 -0
- package/{es6 → lib/cjs}/constants/error_msgs.js +2 -0
- package/lib/cjs/constants/error_msgs.js.map +1 -0
- package/{es → lib/cjs}/constants/literal_types.d.ts +1 -0
- package/lib/cjs/constants/literal_types.d.ts.map +1 -0
- package/{es6 → lib/cjs}/constants/literal_types.js +4 -0
- package/lib/cjs/constants/literal_types.js.map +1 -0
- package/{amd → lib/cjs}/constants/metadata_keys.d.ts +1 -0
- package/lib/cjs/constants/metadata_keys.d.ts.map +1 -0
- package/{es6 → lib/cjs}/constants/metadata_keys.js +13 -0
- package/lib/cjs/constants/metadata_keys.js.map +1 -0
- package/{es6 → lib/cjs}/container/container.d.ts +3 -0
- package/lib/cjs/container/container.d.ts.map +1 -0
- package/{es6 → lib/cjs}/container/container.js +157 -147
- package/lib/cjs/container/container.js.map +1 -0
- package/{amd → lib/cjs}/container/container_module.d.ts +1 -0
- package/lib/cjs/container/container_module.d.ts.map +1 -0
- package/{es6 → lib/cjs}/container/container_module.js +5 -0
- package/lib/cjs/container/container_module.js.map +1 -0
- package/{es → lib/cjs}/container/container_snapshot.d.ts +1 -0
- package/lib/cjs/container/container_snapshot.d.ts.map +1 -0
- package/{es6 → lib/cjs}/container/container_snapshot.js +6 -0
- package/lib/cjs/container/container_snapshot.js.map +1 -0
- package/{es → lib/cjs}/container/lookup.d.ts +1 -0
- package/lib/cjs/container/lookup.d.ts.map +1 -0
- package/{es6 → lib/cjs}/container/lookup.js +26 -7
- package/lib/cjs/container/lookup.js.map +1 -0
- package/{es6 → lib/cjs}/container/module_activation_store.d.ts +3 -2
- package/lib/cjs/container/module_activation_store.d.ts.map +1 -0
- package/{es6 → lib/cjs}/container/module_activation_store.js +2 -3
- package/lib/cjs/container/module_activation_store.js.map +1 -0
- package/{amd/inversify.d.ts → lib/cjs/index.d.ts} +2 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/{es6/inversify.js → lib/cjs/index.js} +20 -7
- package/lib/cjs/index.js.map +1 -0
- package/{amd → lib/cjs}/interfaces/interfaces.d.ts +3 -2
- package/lib/cjs/interfaces/interfaces.d.ts.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/interfaces.js +1 -0
- package/lib/cjs/interfaces/interfaces.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/{es6 → lib/cjs}/planning/context.d.ts +1 -0
- package/lib/cjs/planning/context.d.ts.map +1 -0
- package/{es6 → lib/cjs}/planning/context.js +5 -0
- package/lib/cjs/planning/context.js.map +1 -0
- package/{es6 → lib/cjs}/planning/metadata.d.ts +1 -0
- package/lib/cjs/planning/metadata.d.ts.map +1 -0
- package/{es6 → lib/cjs}/planning/metadata.js +20 -7
- package/lib/cjs/planning/metadata.js.map +1 -0
- package/{es → lib/cjs}/planning/metadata_reader.d.ts +1 -0
- package/lib/cjs/planning/metadata_reader.d.ts.map +1 -0
- package/{es6 → lib/cjs}/planning/metadata_reader.js +24 -12
- package/lib/cjs/planning/metadata_reader.js.map +1 -0
- package/{amd → lib/cjs}/planning/plan.d.ts +1 -0
- package/lib/cjs/planning/plan.d.ts.map +1 -0
- package/{es6 → lib/cjs}/planning/plan.js +3 -0
- package/lib/cjs/planning/plan.js.map +1 -0
- package/{amd → lib/cjs}/planning/planner.d.ts +1 -0
- package/lib/cjs/planning/planner.d.ts.map +1 -0
- package/{es6 → lib/cjs}/planning/planner.js +27 -7
- package/lib/cjs/planning/planner.js.map +1 -0
- package/{amd → lib/cjs}/planning/queryable_string.d.ts +1 -0
- package/lib/cjs/planning/queryable_string.d.ts.map +1 -0
- package/{es6 → lib/cjs}/planning/queryable_string.js +3 -0
- package/lib/cjs/planning/queryable_string.js.map +1 -0
- package/{amd → lib/cjs}/planning/reflection_utils.d.ts +1 -0
- package/lib/cjs/planning/reflection_utils.d.ts.map +1 -0
- package/{es6 → lib/cjs}/planning/reflection_utils.js +25 -8
- package/lib/cjs/planning/reflection_utils.js.map +1 -0
- package/{amd → lib/cjs}/planning/request.d.ts +1 -0
- package/lib/cjs/planning/request.d.ts.map +1 -0
- package/{es6 → lib/cjs}/planning/request.js +13 -1
- package/lib/cjs/planning/request.js.map +1 -0
- package/{es → lib/cjs}/resolution/instantiation.d.ts +1 -0
- package/lib/cjs/resolution/instantiation.d.ts.map +1 -0
- package/{es6 → lib/cjs}/resolution/instantiation.js +40 -37
- package/lib/cjs/resolution/instantiation.js.map +1 -0
- package/{amd → lib/cjs}/resolution/resolver.d.ts +1 -0
- package/lib/cjs/resolution/resolver.d.ts.map +1 -0
- package/{es6 → lib/cjs}/resolution/resolver.js +39 -20
- package/lib/cjs/resolution/resolver.js.map +1 -0
- package/{amd → lib/cjs}/scope/scope.d.ts +1 -0
- package/lib/cjs/scope/scope.d.ts.map +1 -0
- package/{es6 → lib/cjs}/scope/scope.js +10 -12
- package/lib/cjs/scope/scope.js.map +1 -0
- package/{amd → lib/cjs}/syntax/binding_in_syntax.d.ts +1 -0
- package/lib/cjs/syntax/binding_in_syntax.d.ts.map +1 -0
- package/{es6 → lib/cjs}/syntax/binding_in_syntax.js +2 -0
- package/lib/cjs/syntax/binding_in_syntax.js.map +1 -0
- package/{es6 → lib/cjs}/syntax/binding_in_when_on_syntax.d.ts +1 -0
- package/lib/cjs/syntax/binding_in_when_on_syntax.d.ts.map +1 -0
- package/{es6 → lib/cjs}/syntax/binding_in_when_on_syntax.js +5 -0
- package/lib/cjs/syntax/binding_in_when_on_syntax.js.map +1 -0
- package/{es6 → lib/cjs}/syntax/binding_on_syntax.d.ts +1 -0
- package/lib/cjs/syntax/binding_on_syntax.d.ts.map +1 -0
- package/{es6 → lib/cjs}/syntax/binding_on_syntax.js +2 -0
- package/lib/cjs/syntax/binding_on_syntax.js.map +1 -0
- package/{es → lib/cjs}/syntax/binding_to_syntax.d.ts +1 -0
- package/lib/cjs/syntax/binding_to_syntax.d.ts.map +1 -0
- package/{es6 → lib/cjs}/syntax/binding_to_syntax.js +43 -8
- package/lib/cjs/syntax/binding_to_syntax.js.map +1 -0
- package/{amd → lib/cjs}/syntax/binding_when_on_syntax.d.ts +1 -0
- package/lib/cjs/syntax/binding_when_on_syntax.d.ts.map +1 -0
- package/{es6 → lib/cjs}/syntax/binding_when_on_syntax.js +4 -0
- package/lib/cjs/syntax/binding_when_on_syntax.js.map +1 -0
- package/{es6 → lib/cjs}/syntax/binding_when_syntax.d.ts +1 -0
- package/lib/cjs/syntax/binding_when_syntax.d.ts.map +1 -0
- package/{es6 → lib/cjs}/syntax/binding_when_syntax.js +5 -1
- package/lib/cjs/syntax/binding_when_syntax.js.map +1 -0
- package/{amd → lib/cjs}/syntax/constraint_helpers.d.ts +1 -0
- package/lib/cjs/syntax/constraint_helpers.d.ts.map +1 -0
- package/{es6 → lib/cjs}/syntax/constraint_helpers.js +22 -7
- package/lib/cjs/syntax/constraint_helpers.js.map +1 -0
- package/{amd → lib/cjs}/utils/async.d.ts +1 -0
- package/lib/cjs/utils/async.d.ts.map +1 -0
- package/{es6 → lib/cjs}/utils/async.js +1 -0
- package/lib/cjs/utils/async.js.map +1 -0
- package/{es6 → lib/cjs}/utils/binding_utils.d.ts +1 -0
- package/lib/cjs/utils/binding_utils.d.ts.map +1 -0
- package/{es6 → lib/cjs}/utils/binding_utils.js +21 -7
- package/lib/cjs/utils/binding_utils.js.map +1 -0
- package/{es6 → lib/cjs}/utils/clonable.d.ts +1 -0
- package/lib/cjs/utils/clonable.d.ts.map +1 -0
- package/{es6 → lib/cjs}/utils/clonable.js +1 -0
- package/lib/cjs/utils/clonable.js.map +1 -0
- package/{amd → lib/cjs}/utils/exceptions.d.ts +1 -0
- package/lib/cjs/utils/exceptions.d.ts.map +1 -0
- package/{es6 → lib/cjs}/utils/exceptions.js +18 -7
- package/lib/cjs/utils/exceptions.js.map +1 -0
- package/{es6 → lib/cjs}/utils/factory_type.d.ts +1 -0
- package/lib/cjs/utils/factory_type.d.ts.map +1 -0
- package/{es6 → lib/cjs}/utils/factory_type.js +1 -0
- package/lib/cjs/utils/factory_type.js.map +1 -0
- package/{amd → lib/cjs}/utils/id.d.ts +1 -0
- package/lib/cjs/utils/id.d.ts.map +1 -0
- package/{es6 → lib/cjs}/utils/id.js +1 -0
- package/lib/cjs/utils/id.js.map +1 -0
- package/{amd → lib/cjs}/utils/js.d.ts +1 -0
- package/lib/cjs/utils/js.d.ts.map +1 -0
- package/{es6 → lib/cjs}/utils/js.js +1 -0
- package/lib/cjs/utils/js.js.map +1 -0
- package/{amd → lib/cjs}/utils/serialization.d.ts +1 -0
- package/lib/cjs/utils/serialization.d.ts.map +1 -0
- package/{es6 → lib/cjs}/utils/serialization.js +23 -7
- package/lib/cjs/utils/serialization.js.map +1 -0
- package/{es6/interfaces/interfaces.d.ts → lib/esm/index.d.ts} +207 -8
- package/lib/esm/index.d.ts.map +1 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/index.js.map +1 -0
- package/package.json +30 -34
- 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.js +0 -16
- 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.js +0 -32
- package/amd/annotation/optional.js +0 -32
- 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.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.js +0 -11
- 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.js +0 -28
- package/amd/container/container.d.ts +0 -73
- package/amd/container/container.js +0 -766
- 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.js +0 -4
- 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.js +0 -13
- package/amd/planning/planner.js +0 -187
- package/amd/planning/queryable_string.js +0 -33
- package/amd/planning/reflection_utils.js +0 -55
- 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.js +0 -234
- package/amd/scope/scope.js +0 -93
- 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.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.js +0 -66
- 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.js +0 -46
- package/amd/utils/factory_type.d.ts +0 -5
- package/amd/utils/factory_type.js +0 -11
- package/amd/utils/id.js +0 -9
- package/amd/utils/js.js +0 -18
- package/amd/utils/serialization.js +0 -135
- package/es/annotation/decorator_utils.d.ts +0 -16
- package/es/annotation/decorator_utils.js +0 -90
- package/es/annotation/inject.d.ts +0 -5
- package/es/annotation/inject.js +0 -4
- package/es/annotation/inject_base.d.ts +0 -4
- package/es/annotation/inject_base.js +0 -14
- package/es/annotation/injectable.d.ts +0 -2
- package/es/annotation/injectable.js +0 -13
- package/es/annotation/lazy_service_identifier.js +0 -1
- package/es/annotation/multi_inject.js +0 -4
- package/es/annotation/named.d.ts +0 -2
- package/es/annotation/named.js +0 -7
- package/es/annotation/optional.d.ts +0 -2
- package/es/annotation/optional.js +0 -7
- package/es/annotation/post_construct.d.ts +0 -4
- package/es/annotation/post_construct.js +0 -5
- package/es/annotation/pre_destroy.d.ts +0 -4
- package/es/annotation/pre_destroy.js +0 -5
- package/es/annotation/property_event_decorator.js +0 -13
- package/es/annotation/tagged.d.ts +0 -2
- package/es/annotation/tagged.js +0 -6
- package/es/annotation/target_name.d.ts +0 -3
- package/es/annotation/target_name.js +0 -10
- package/es/annotation/unmanaged.d.ts +0 -3
- package/es/annotation/unmanaged.js +0 -10
- package/es/bindings/binding.d.ts +0 -20
- package/es/bindings/binding.js +0 -37
- package/es/bindings/binding_count.d.ts +0 -5
- package/es/bindings/binding_count.js +0 -6
- package/es/constants/error_msgs.d.ts +0 -30
- package/es/constants/error_msgs.js +0 -62
- package/es/constants/literal_types.js +0 -21
- package/es/constants/metadata_keys.d.ts +0 -13
- package/es/constants/metadata_keys.js +0 -23
- package/es/container/container.d.ts +0 -73
- package/es/container/container.js +0 -750
- package/es/container/container_module.d.ts +0 -11
- package/es/container/container_module.js +0 -17
- package/es/container/container_snapshot.js +0 -15
- package/es/container/lookup.js +0 -105
- package/es/container/module_activation_store.d.ts +0 -10
- package/es/container/module_activation_store.js +0 -47
- package/es/interfaces/interfaces.d.ts +0 -269
- package/es/interfaces/interfaces.js +0 -1
- package/es/inversify.d.ts +0 -24
- package/es/inversify.js +0 -2
- package/es/planning/context.d.ts +0 -11
- package/es/planning/context.js +0 -15
- package/es/planning/metadata.d.ts +0 -8
- package/es/planning/metadata.js +0 -17
- package/es/planning/metadata_reader.js +0 -21
- package/es/planning/plan.d.ts +0 -7
- package/es/planning/plan.js +0 -8
- package/es/planning/planner.d.ts +0 -5
- package/es/planning/planner.js +0 -168
- package/es/planning/queryable_string.d.ts +0 -10
- package/es/planning/queryable_string.js +0 -28
- package/es/planning/reflection_utils.d.ts +0 -5
- package/es/planning/reflection_utils.js +0 -27
- package/es/planning/request.d.ts +0 -14
- package/es/planning/request.js +0 -20
- package/es/planning/target.js +0 -87
- package/es/resolution/instantiation.js +0 -195
- package/es/resolution/resolver.d.ts +0 -3
- package/es/resolution/resolver.js +0 -214
- package/es/scope/scope.d.ts +0 -3
- package/es/scope/scope.js +0 -88
- package/es/syntax/binding_in_syntax.d.ts +0 -9
- package/es/syntax/binding_in_syntax.js +0 -21
- package/es/syntax/binding_in_when_on_syntax.d.ts +0 -29
- package/es/syntax/binding_in_when_on_syntax.js +0 -73
- package/es/syntax/binding_on_syntax.d.ts +0 -8
- package/es/syntax/binding_on_syntax.js +0 -16
- package/es/syntax/binding_to_syntax.js +0 -91
- package/es/syntax/binding_when_on_syntax.d.ts +0 -25
- package/es/syntax/binding_when_on_syntax.js +0 -62
- package/es/syntax/binding_when_syntax.d.ts +0 -21
- package/es/syntax/binding_when_syntax.js +0 -104
- package/es/syntax/constraint_helpers.d.ts +0 -6
- package/es/syntax/constraint_helpers.js +0 -36
- package/es/utils/async.d.ts +0 -3
- package/es/utils/async.js +0 -12
- package/es/utils/binding_utils.d.ts +0 -4
- package/es/utils/binding_utils.js +0 -58
- package/es/utils/clonable.d.ts +0 -3
- package/es/utils/clonable.js +0 -7
- package/es/utils/exceptions.d.ts +0 -2
- package/es/utils/exceptions.js +0 -16
- package/es/utils/factory_type.d.ts +0 -5
- package/es/utils/factory_type.js +0 -6
- package/es/utils/id.d.ts +0 -2
- package/es/utils/id.js +0 -5
- package/es/utils/js.d.ts +0 -1
- package/es/utils/js.js +0 -13
- package/es/utils/serialization.d.ts +0 -10
- package/es/utils/serialization.js +0 -103
- package/es6/annotation/decorator_utils.d.ts +0 -16
- package/es6/annotation/inject_base.d.ts +0 -4
- package/es6/annotation/injectable.d.ts +0 -2
- package/es6/annotation/lazy_service_identifier.js +0 -2
- package/es6/annotation/multi_inject.d.ts +0 -5
- package/es6/annotation/named.d.ts +0 -2
- package/es6/annotation/optional.d.ts +0 -2
- package/es6/annotation/post_construct.d.ts +0 -4
- package/es6/annotation/property_event_decorator.d.ts +0 -4
- package/es6/annotation/tagged.d.ts +0 -2
- 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/literal_types.d.ts +0 -5
- package/es6/constants/metadata_keys.d.ts +0 -13
- package/es6/container/container_module.d.ts +0 -11
- package/es6/container/container_snapshot.d.ts +0 -10
- package/es6/container/lookup.d.ts +0 -17
- package/es6/interfaces/interfaces.js +0 -2
- package/es6/inversify.d.ts +0 -24
- package/es6/planning/metadata_reader.d.ts +0 -6
- package/es6/planning/plan.d.ts +0 -7
- package/es6/planning/planner.d.ts +0 -5
- package/es6/planning/queryable_string.d.ts +0 -10
- package/es6/planning/reflection_utils.d.ts +0 -5
- package/es6/planning/request.d.ts +0 -14
- package/es6/planning/target.js +0 -105
- package/es6/resolution/instantiation.d.ts +0 -3
- package/es6/resolution/resolver.d.ts +0 -3
- package/es6/scope/scope.d.ts +0 -3
- package/es6/syntax/binding_in_syntax.d.ts +0 -9
- package/es6/syntax/binding_to_syntax.d.ts +0 -18
- package/es6/syntax/binding_when_on_syntax.d.ts +0 -25
- package/es6/syntax/constraint_helpers.d.ts +0 -6
- package/es6/utils/async.d.ts +0 -3
- package/es6/utils/exceptions.d.ts +0 -2
- package/es6/utils/id.d.ts +0 -2
- package/es6/utils/js.d.ts +0 -1
- package/es6/utils/serialization.d.ts +0 -10
- package/lib/annotation/decorator_utils.d.ts +0 -16
- package/lib/annotation/decorator_utils.js +0 -118
- package/lib/annotation/inject.d.ts +0 -5
- package/lib/annotation/inject.js +0 -30
- package/lib/annotation/inject_base.d.ts +0 -4
- package/lib/annotation/inject_base.js +0 -17
- package/lib/annotation/injectable.d.ts +0 -2
- package/lib/annotation/injectable.js +0 -38
- package/lib/annotation/lazy_service_identifier.d.ts +0 -3
- package/lib/annotation/lazy_service_identifier.js +0 -2
- package/lib/annotation/multi_inject.d.ts +0 -5
- package/lib/annotation/multi_inject.js +0 -30
- package/lib/annotation/named.d.ts +0 -2
- package/lib/annotation/named.js +0 -32
- package/lib/annotation/optional.d.ts +0 -2
- package/lib/annotation/optional.js +0 -32
- package/lib/annotation/post_construct.d.ts +0 -4
- package/lib/annotation/post_construct.js +0 -31
- package/lib/annotation/pre_destroy.d.ts +0 -4
- package/lib/annotation/pre_destroy.js +0 -31
- package/lib/annotation/property_event_decorator.d.ts +0 -4
- package/lib/annotation/property_event_decorator.js +0 -15
- package/lib/annotation/tagged.d.ts +0 -2
- package/lib/annotation/tagged.js +0 -8
- package/lib/annotation/target_name.d.ts +0 -3
- package/lib/annotation/target_name.js +0 -35
- package/lib/annotation/unmanaged.d.ts +0 -3
- package/lib/annotation/unmanaged.js +0 -35
- package/lib/bindings/binding.d.ts +0 -20
- package/lib/bindings/binding.js +0 -40
- package/lib/bindings/binding_count.d.ts +0 -5
- package/lib/constants/error_msgs.d.ts +0 -30
- package/lib/constants/error_msgs.js +0 -73
- package/lib/constants/literal_types.d.ts +0 -5
- package/lib/constants/literal_types.js +0 -26
- package/lib/constants/metadata_keys.d.ts +0 -13
- package/lib/constants/metadata_keys.js +0 -26
- package/lib/container/container.d.ts +0 -73
- package/lib/container/container.js +0 -776
- package/lib/container/container_module.d.ts +0 -11
- package/lib/container/container_module.js +0 -20
- package/lib/container/container_snapshot.d.ts +0 -10
- package/lib/container/container_snapshot.js +0 -18
- package/lib/container/lookup.d.ts +0 -17
- package/lib/container/lookup.js +0 -131
- package/lib/container/module_activation_store.d.ts +0 -10
- package/lib/container/module_activation_store.js +0 -50
- package/lib/interfaces/interfaces.d.ts +0 -269
- package/lib/inversify.d.ts +0 -24
- package/lib/inversify.js +0 -76
- package/lib/planning/context.d.ts +0 -11
- package/lib/planning/context.js +0 -18
- package/lib/planning/metadata.d.ts +0 -8
- package/lib/planning/metadata.js +0 -43
- package/lib/planning/metadata_reader.d.ts +0 -6
- package/lib/planning/metadata_reader.js +0 -47
- package/lib/planning/plan.d.ts +0 -7
- package/lib/planning/plan.js +0 -11
- package/lib/planning/planner.d.ts +0 -5
- package/lib/planning/planner.js +0 -195
- package/lib/planning/queryable_string.d.ts +0 -10
- package/lib/planning/queryable_string.js +0 -31
- package/lib/planning/reflection_utils.d.ts +0 -5
- package/lib/planning/reflection_utils.js +0 -55
- package/lib/planning/request.d.ts +0 -14
- package/lib/planning/request.js +0 -23
- package/lib/planning/target.d.ts +0 -23
- package/lib/planning/target.js +0 -113
- package/lib/resolution/instantiation.d.ts +0 -3
- package/lib/resolution/instantiation.js +0 -220
- package/lib/resolution/resolver.d.ts +0 -3
- package/lib/resolution/resolver.js +0 -239
- package/lib/scope/scope.d.ts +0 -3
- package/lib/scope/scope.js +0 -93
- package/lib/syntax/binding_in_syntax.d.ts +0 -9
- package/lib/syntax/binding_in_syntax.js +0 -24
- package/lib/syntax/binding_in_when_on_syntax.d.ts +0 -29
- package/lib/syntax/binding_in_when_on_syntax.js +0 -76
- package/lib/syntax/binding_on_syntax.d.ts +0 -8
- package/lib/syntax/binding_on_syntax.js +0 -19
- package/lib/syntax/binding_to_syntax.d.ts +0 -18
- package/lib/syntax/binding_to_syntax.js +0 -117
- package/lib/syntax/binding_when_on_syntax.d.ts +0 -25
- package/lib/syntax/binding_when_on_syntax.js +0 -65
- package/lib/syntax/binding_when_syntax.d.ts +0 -21
- package/lib/syntax/binding_when_syntax.js +0 -107
- package/lib/syntax/constraint_helpers.d.ts +0 -6
- package/lib/syntax/constraint_helpers.js +0 -65
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/utils/async.d.ts +0 -3
- package/lib/utils/async.js +0 -15
- package/lib/utils/binding_utils.d.ts +0 -4
- package/lib/utils/binding_utils.js +0 -87
- package/lib/utils/clonable.d.ts +0 -3
- package/lib/utils/clonable.js +0 -9
- package/lib/utils/exceptions.d.ts +0 -2
- package/lib/utils/exceptions.js +0 -44
- package/lib/utils/factory_type.d.ts +0 -5
- package/lib/utils/factory_type.js +0 -9
- package/lib/utils/id.d.ts +0 -2
- package/lib/utils/id.js +0 -7
- package/lib/utils/js.d.ts +0 -1
- package/lib/utils/js.js +0 -16
- package/lib/utils/serialization.d.ts +0 -10
- package/lib/utils/serialization.js +0 -133
- /package/{es → lib/esm}/package.json +0 -0
package/amd/planning/planner.js
DELETED
|
@@ -1,187 +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", "@inversifyjs/core", "../bindings/binding_count", "../constants/error_msgs", "../constants/literal_types", "../constants/metadata_keys", "../utils/exceptions", "../utils/serialization", "./context", "./metadata", "./plan", "./reflection_utils", "./request"], function (require, exports, core_1, binding_count_1, ERROR_MSGS, literal_types_1, METADATA_KEY, exceptions_1, serialization_1, context_1, metadata_1, plan_1, reflection_utils_1, request_1) {
|
|
25
|
-
"use strict";
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.plan = plan;
|
|
28
|
-
exports.createMockRequest = createMockRequest;
|
|
29
|
-
exports.getBindingDictionary = getBindingDictionary;
|
|
30
|
-
ERROR_MSGS = __importStar(ERROR_MSGS);
|
|
31
|
-
METADATA_KEY = __importStar(METADATA_KEY);
|
|
32
|
-
function getBindingDictionary(cntnr) {
|
|
33
|
-
return cntnr._bindingDictionary;
|
|
34
|
-
}
|
|
35
|
-
function _createTarget(isMultiInject, targetType, serviceIdentifier, name, key, value) {
|
|
36
|
-
var metadataList = _getTargetMetadata(isMultiInject, serviceIdentifier, key, value);
|
|
37
|
-
var classElementMetadata = (0, core_1.getClassElementMetadataFromLegacyMetadata)(metadataList);
|
|
38
|
-
if (classElementMetadata.kind === core_1.ClassElementMetadataKind.unmanaged) {
|
|
39
|
-
throw new Error('Unexpected metadata when creating target');
|
|
40
|
-
}
|
|
41
|
-
var target = new core_1.LegacyTargetImpl(name, classElementMetadata, targetType);
|
|
42
|
-
return target;
|
|
43
|
-
}
|
|
44
|
-
function _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target) {
|
|
45
|
-
var bindings = getBindings(context.container, target.serviceIdentifier);
|
|
46
|
-
var activeBindings = [];
|
|
47
|
-
if (bindings.length === binding_count_1.BindingCount.NoBindingsAvailable &&
|
|
48
|
-
context.container.options.autoBindInjectable === true &&
|
|
49
|
-
typeof target.serviceIdentifier === 'function' &&
|
|
50
|
-
metadataReader.getConstructorMetadata(target.serviceIdentifier)
|
|
51
|
-
.compilerGeneratedMetadata) {
|
|
52
|
-
context.container.bind(target.serviceIdentifier).toSelf();
|
|
53
|
-
bindings = getBindings(context.container, target.serviceIdentifier);
|
|
54
|
-
}
|
|
55
|
-
if (!avoidConstraints) {
|
|
56
|
-
activeBindings = bindings.filter(function (binding) {
|
|
57
|
-
var request = new request_1.Request(binding.serviceIdentifier, context, parentRequest, binding, target);
|
|
58
|
-
return binding.constraint(request);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
activeBindings = bindings;
|
|
63
|
-
}
|
|
64
|
-
_validateActiveBindingCount(target.serviceIdentifier, activeBindings, parentRequest, target, context.container);
|
|
65
|
-
return activeBindings;
|
|
66
|
-
}
|
|
67
|
-
function _getTargetMetadata(isMultiInject, serviceIdentifier, key, value) {
|
|
68
|
-
var metadataKey = isMultiInject
|
|
69
|
-
? METADATA_KEY.MULTI_INJECT_TAG
|
|
70
|
-
: METADATA_KEY.INJECT_TAG;
|
|
71
|
-
var metadataList = [
|
|
72
|
-
new metadata_1.Metadata(metadataKey, serviceIdentifier),
|
|
73
|
-
];
|
|
74
|
-
if (key !== undefined) {
|
|
75
|
-
metadataList.push(new metadata_1.Metadata(key, value));
|
|
76
|
-
}
|
|
77
|
-
return metadataList;
|
|
78
|
-
}
|
|
79
|
-
function _validateActiveBindingCount(serviceIdentifier, bindings, parentRequest, target, container) {
|
|
80
|
-
switch (bindings.length) {
|
|
81
|
-
case binding_count_1.BindingCount.NoBindingsAvailable:
|
|
82
|
-
if (target.isOptional()) {
|
|
83
|
-
return bindings;
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
var serviceIdentifierString = (0, serialization_1.getServiceIdentifierAsString)(serviceIdentifier);
|
|
87
|
-
var msg = ERROR_MSGS.NOT_REGISTERED;
|
|
88
|
-
msg += (0, serialization_1.listMetadataForTarget)(serviceIdentifierString, target);
|
|
89
|
-
msg += (0, serialization_1.listRegisteredBindingsForServiceIdentifier)(container, serviceIdentifierString, getBindings);
|
|
90
|
-
if (parentRequest !== null) {
|
|
91
|
-
msg += "\n".concat(ERROR_MSGS.TRYING_TO_RESOLVE_BINDINGS((0, serialization_1.getServiceIdentifierAsString)(parentRequest.serviceIdentifier)));
|
|
92
|
-
}
|
|
93
|
-
throw new Error(msg);
|
|
94
|
-
}
|
|
95
|
-
case binding_count_1.BindingCount.OnlyOneBindingAvailable:
|
|
96
|
-
return bindings;
|
|
97
|
-
case binding_count_1.BindingCount.MultipleBindingsAvailable:
|
|
98
|
-
default:
|
|
99
|
-
if (!target.isArray()) {
|
|
100
|
-
var serviceIdentifierString = (0, serialization_1.getServiceIdentifierAsString)(serviceIdentifier);
|
|
101
|
-
var msg = "".concat(ERROR_MSGS.AMBIGUOUS_MATCH, " ").concat(serviceIdentifierString);
|
|
102
|
-
msg += (0, serialization_1.listRegisteredBindingsForServiceIdentifier)(container, serviceIdentifierString, getBindings);
|
|
103
|
-
throw new Error(msg);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
return bindings;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, parentRequest, target) {
|
|
111
|
-
var activeBindings;
|
|
112
|
-
var childRequest;
|
|
113
|
-
if (parentRequest === null) {
|
|
114
|
-
activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, null, target);
|
|
115
|
-
childRequest = new request_1.Request(serviceIdentifier, context, null, activeBindings, target);
|
|
116
|
-
var thePlan = new plan_1.Plan(context, childRequest);
|
|
117
|
-
context.addPlan(thePlan);
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target);
|
|
121
|
-
childRequest = parentRequest.addChildRequest(target.serviceIdentifier, activeBindings, target);
|
|
122
|
-
}
|
|
123
|
-
activeBindings.forEach(function (binding) {
|
|
124
|
-
var subChildRequest = null;
|
|
125
|
-
if (target.isArray()) {
|
|
126
|
-
subChildRequest = childRequest.addChildRequest(binding.serviceIdentifier, binding, target);
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
if (binding.cache !== null) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
subChildRequest = childRequest;
|
|
133
|
-
}
|
|
134
|
-
if (binding.type === literal_types_1.BindingTypeEnum.Instance &&
|
|
135
|
-
binding.implementationType !== null) {
|
|
136
|
-
var dependencies = (0, reflection_utils_1.getDependencies)(metadataReader, binding.implementationType);
|
|
137
|
-
if (context.container.options.skipBaseClassChecks !== true) {
|
|
138
|
-
var baseClassDependencyCount = (0, reflection_utils_1.getBaseClassDependencyCount)(metadataReader, binding.implementationType);
|
|
139
|
-
if (dependencies.length < baseClassDependencyCount) {
|
|
140
|
-
var error = ERROR_MSGS.ARGUMENTS_LENGTH_MISMATCH((0, reflection_utils_1.getFunctionName)(binding.implementationType));
|
|
141
|
-
throw new Error(error);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
dependencies.forEach(function (dependency) {
|
|
145
|
-
_createSubRequests(metadataReader, false, dependency.serviceIdentifier, context, subChildRequest, dependency);
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
function getBindings(container, serviceIdentifier) {
|
|
151
|
-
var bindings = [];
|
|
152
|
-
var bindingDictionary = getBindingDictionary(container);
|
|
153
|
-
if (bindingDictionary.hasKey(serviceIdentifier)) {
|
|
154
|
-
bindings = bindingDictionary.get(serviceIdentifier);
|
|
155
|
-
}
|
|
156
|
-
else if (container.parent !== null) {
|
|
157
|
-
bindings = getBindings(container.parent, serviceIdentifier);
|
|
158
|
-
}
|
|
159
|
-
return bindings;
|
|
160
|
-
}
|
|
161
|
-
function plan(metadataReader, container, isMultiInject, targetType, serviceIdentifier, key, value, avoidConstraints) {
|
|
162
|
-
if (avoidConstraints === void 0) { avoidConstraints = false; }
|
|
163
|
-
var context = new context_1.Context(container);
|
|
164
|
-
var target = _createTarget(isMultiInject, targetType, serviceIdentifier, '', key, value);
|
|
165
|
-
try {
|
|
166
|
-
_createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, null, target);
|
|
167
|
-
return context;
|
|
168
|
-
}
|
|
169
|
-
catch (error) {
|
|
170
|
-
if ((0, exceptions_1.isStackOverflowException)(error)) {
|
|
171
|
-
(0, serialization_1.circularDependencyToException)(context.plan.rootRequest);
|
|
172
|
-
}
|
|
173
|
-
throw error;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
function createMockRequest(container, serviceIdentifier, key, value) {
|
|
177
|
-
var metadataList = _getTargetMetadata(false, serviceIdentifier, key, value);
|
|
178
|
-
var classElementMetadata = (0, core_1.getClassElementMetadataFromLegacyMetadata)(metadataList);
|
|
179
|
-
if (classElementMetadata.kind === core_1.ClassElementMetadataKind.unmanaged) {
|
|
180
|
-
throw new Error('Unexpected metadata when creating target');
|
|
181
|
-
}
|
|
182
|
-
var target = new core_1.LegacyTargetImpl('', classElementMetadata, 'Variable');
|
|
183
|
-
var context = new context_1.Context(container);
|
|
184
|
-
var request = new request_1.Request(serviceIdentifier, context, null, [], target);
|
|
185
|
-
return request;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.QueryableString = void 0;
|
|
5
|
-
var QueryableString = (function () {
|
|
6
|
-
function QueryableString(str) {
|
|
7
|
-
this.str = str;
|
|
8
|
-
}
|
|
9
|
-
QueryableString.prototype.startsWith = function (searchString) {
|
|
10
|
-
return this.str.indexOf(searchString) === 0;
|
|
11
|
-
};
|
|
12
|
-
QueryableString.prototype.endsWith = function (searchString) {
|
|
13
|
-
var reverseString = '';
|
|
14
|
-
var reverseSearchString = searchString
|
|
15
|
-
.split('')
|
|
16
|
-
.reverse()
|
|
17
|
-
.join('');
|
|
18
|
-
reverseString = this.str.split('').reverse().join('');
|
|
19
|
-
return this.startsWith.call({ str: reverseString }, reverseSearchString);
|
|
20
|
-
};
|
|
21
|
-
QueryableString.prototype.contains = function (searchString) {
|
|
22
|
-
return this.str.indexOf(searchString) !== -1;
|
|
23
|
-
};
|
|
24
|
-
QueryableString.prototype.equals = function (compareString) {
|
|
25
|
-
return this.str === compareString;
|
|
26
|
-
};
|
|
27
|
-
QueryableString.prototype.value = function () {
|
|
28
|
-
return this.str;
|
|
29
|
-
};
|
|
30
|
-
return QueryableString;
|
|
31
|
-
}());
|
|
32
|
-
exports.QueryableString = QueryableString;
|
|
33
|
-
});
|
|
@@ -1,55 +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", "@inversifyjs/core", "../constants/metadata_keys", "../utils/serialization"], function (require, exports, core_1, METADATA_KEY, serialization_1) {
|
|
25
|
-
"use strict";
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.getFunctionName = void 0;
|
|
28
|
-
exports.getDependencies = getDependencies;
|
|
29
|
-
exports.getBaseClassDependencyCount = getBaseClassDependencyCount;
|
|
30
|
-
METADATA_KEY = __importStar(METADATA_KEY);
|
|
31
|
-
Object.defineProperty(exports, "getFunctionName", { enumerable: true, get: function () { return serialization_1.getFunctionName; } });
|
|
32
|
-
function getDependencies(metadataReader, func) {
|
|
33
|
-
return (0, core_1.getTargets)(metadataReader)(func);
|
|
34
|
-
}
|
|
35
|
-
function getBaseClassDependencyCount(metadataReader, func) {
|
|
36
|
-
var baseConstructor = Object.getPrototypeOf(func.prototype).constructor;
|
|
37
|
-
if (baseConstructor !== Object) {
|
|
38
|
-
var targets = (0, core_1.getTargets)(metadataReader)(baseConstructor);
|
|
39
|
-
var metadata = targets.map(function (t) {
|
|
40
|
-
return t.metadata.filter(function (m) { return m.key === METADATA_KEY.UNMANAGED_TAG; });
|
|
41
|
-
});
|
|
42
|
-
var unmanagedCount = [].concat.apply([], metadata).length;
|
|
43
|
-
var dependencyCount = targets.length - unmanagedCount;
|
|
44
|
-
if (dependencyCount > 0) {
|
|
45
|
-
return dependencyCount;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
return getBaseClassDependencyCount(metadataReader, baseConstructor);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
return 0;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
package/amd/planning/request.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "../utils/id"], function (require, exports, id_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Request = void 0;
|
|
5
|
-
var Request = (function () {
|
|
6
|
-
function Request(serviceIdentifier, parentContext, parentRequest, bindings, target) {
|
|
7
|
-
this.id = (0, id_1.id)();
|
|
8
|
-
this.serviceIdentifier = serviceIdentifier;
|
|
9
|
-
this.parentContext = parentContext;
|
|
10
|
-
this.parentRequest = parentRequest;
|
|
11
|
-
this.target = target;
|
|
12
|
-
this.childRequests = [];
|
|
13
|
-
this.bindings = Array.isArray(bindings) ? bindings : [bindings];
|
|
14
|
-
this.requestScope = parentRequest === null ? new Map() : null;
|
|
15
|
-
}
|
|
16
|
-
Request.prototype.addChildRequest = function (serviceIdentifier, bindings, target) {
|
|
17
|
-
var child = new Request(serviceIdentifier, this.parentContext, this, bindings, target);
|
|
18
|
-
this.childRequests.push(child);
|
|
19
|
-
return child;
|
|
20
|
-
};
|
|
21
|
-
return Request;
|
|
22
|
-
}());
|
|
23
|
-
exports.Request = Request;
|
|
24
|
-
});
|
package/amd/planning/target.js
DELETED
|
@@ -1,111 +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/metadata_keys", "../utils/id", "../utils/serialization", "./metadata", "./queryable_string"], function (require, exports, METADATA_KEY, id_1, serialization_1, metadata_1, queryable_string_1) {
|
|
25
|
-
"use strict";
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.Target = void 0;
|
|
28
|
-
METADATA_KEY = __importStar(METADATA_KEY);
|
|
29
|
-
var Target = (function () {
|
|
30
|
-
function Target(type, identifier, serviceIdentifier, namedOrTagged) {
|
|
31
|
-
this.id = (0, id_1.id)();
|
|
32
|
-
this.type = type;
|
|
33
|
-
this.serviceIdentifier = serviceIdentifier;
|
|
34
|
-
var queryableName = typeof identifier === 'symbol'
|
|
35
|
-
? (0, serialization_1.getSymbolDescription)(identifier)
|
|
36
|
-
: identifier;
|
|
37
|
-
this.name = new queryable_string_1.QueryableString(queryableName || '');
|
|
38
|
-
this.identifier = identifier;
|
|
39
|
-
this.metadata = new Array();
|
|
40
|
-
var metadataItem = null;
|
|
41
|
-
if (typeof namedOrTagged === 'string') {
|
|
42
|
-
metadataItem = new metadata_1.Metadata(METADATA_KEY.NAMED_TAG, namedOrTagged);
|
|
43
|
-
}
|
|
44
|
-
else if (namedOrTagged instanceof metadata_1.Metadata) {
|
|
45
|
-
metadataItem = namedOrTagged;
|
|
46
|
-
}
|
|
47
|
-
if (metadataItem !== null) {
|
|
48
|
-
this.metadata.push(metadataItem);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
Target.prototype.hasTag = function (key) {
|
|
52
|
-
for (var _i = 0, _a = this.metadata; _i < _a.length; _i++) {
|
|
53
|
-
var m = _a[_i];
|
|
54
|
-
if (m.key === key) {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return false;
|
|
59
|
-
};
|
|
60
|
-
Target.prototype.isArray = function () {
|
|
61
|
-
return this.hasTag(METADATA_KEY.MULTI_INJECT_TAG);
|
|
62
|
-
};
|
|
63
|
-
Target.prototype.matchesArray = function (name) {
|
|
64
|
-
return this.matchesTag(METADATA_KEY.MULTI_INJECT_TAG)(name);
|
|
65
|
-
};
|
|
66
|
-
Target.prototype.isNamed = function () {
|
|
67
|
-
return this.hasTag(METADATA_KEY.NAMED_TAG);
|
|
68
|
-
};
|
|
69
|
-
Target.prototype.isTagged = function () {
|
|
70
|
-
return this.metadata.some(function (metadata) {
|
|
71
|
-
return METADATA_KEY.NON_CUSTOM_TAG_KEYS.every(function (key) { return metadata.key !== key; });
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
Target.prototype.isOptional = function () {
|
|
75
|
-
return this.matchesTag(METADATA_KEY.OPTIONAL_TAG)(true);
|
|
76
|
-
};
|
|
77
|
-
Target.prototype.getNamedTag = function () {
|
|
78
|
-
if (this.isNamed()) {
|
|
79
|
-
return this.metadata.filter(function (m) { return m.key === METADATA_KEY.NAMED_TAG; })[0];
|
|
80
|
-
}
|
|
81
|
-
return null;
|
|
82
|
-
};
|
|
83
|
-
Target.prototype.getCustomTags = function () {
|
|
84
|
-
if (this.isTagged()) {
|
|
85
|
-
return this.metadata.filter(function (metadata) {
|
|
86
|
-
return METADATA_KEY.NON_CUSTOM_TAG_KEYS.every(function (key) { return metadata.key !== key; });
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
Target.prototype.matchesNamedTag = function (name) {
|
|
94
|
-
return this.matchesTag(METADATA_KEY.NAMED_TAG)(name);
|
|
95
|
-
};
|
|
96
|
-
Target.prototype.matchesTag = function (key) {
|
|
97
|
-
var _this = this;
|
|
98
|
-
return function (value) {
|
|
99
|
-
for (var _i = 0, _a = _this.metadata; _i < _a.length; _i++) {
|
|
100
|
-
var m = _a[_i];
|
|
101
|
-
if (m.key === key && m.value === value) {
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return false;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
return Target;
|
|
109
|
-
}());
|
|
110
|
-
exports.Target = Target;
|
|
111
|
-
});
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { interfaces } from '../interfaces/interfaces';
|
|
2
|
-
declare function resolveInstance<T>(binding: interfaces.Binding<T>, constr: interfaces.Newable<T>, childRequests: interfaces.Request[], resolveRequest: interfaces.ResolveRequestHandler): T | Promise<T>;
|
|
3
|
-
export { resolveInstance };
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
-
}
|
|
18
|
-
Object.defineProperty(o, k2, desc);
|
|
19
|
-
}) : (function(o, m, k, k2) {
|
|
20
|
-
if (k2 === undefined) k2 = k;
|
|
21
|
-
o[k2] = m[k];
|
|
22
|
-
}));
|
|
23
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
24
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
25
|
-
}) : function(o, v) {
|
|
26
|
-
o["default"] = v;
|
|
27
|
-
});
|
|
28
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
45
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
47
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48
|
-
function step(op) {
|
|
49
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
50
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
51
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
52
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
53
|
-
switch (op[0]) {
|
|
54
|
-
case 0: case 1: t = op; break;
|
|
55
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
56
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
57
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
58
|
-
default:
|
|
59
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
61
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
62
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
63
|
-
if (t[2]) _.ops.pop();
|
|
64
|
-
_.trys.pop(); continue;
|
|
65
|
-
}
|
|
66
|
-
op = body.call(thisArg, _);
|
|
67
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
68
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
72
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
73
|
-
if (ar || !(i in from)) {
|
|
74
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
75
|
-
ar[i] = from[i];
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
79
|
-
};
|
|
80
|
-
define(["require", "exports", "../constants/error_msgs", "../constants/literal_types", "../constants/metadata_keys", "../utils/async"], function (require, exports, error_msgs_1, literal_types_1, METADATA_KEY, async_1) {
|
|
81
|
-
"use strict";
|
|
82
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
83
|
-
exports.resolveInstance = resolveInstance;
|
|
84
|
-
METADATA_KEY = __importStar(METADATA_KEY);
|
|
85
|
-
function _resolveRequests(childRequests, resolveRequest) {
|
|
86
|
-
return childRequests.reduce(function (resolvedRequests, childRequest) {
|
|
87
|
-
var injection = resolveRequest(childRequest);
|
|
88
|
-
var targetType = childRequest.target.type;
|
|
89
|
-
if (targetType === literal_types_1.TargetTypeEnum.ConstructorArgument) {
|
|
90
|
-
resolvedRequests.constructorInjections.push(injection);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
resolvedRequests.propertyRequests.push(childRequest);
|
|
94
|
-
resolvedRequests.propertyInjections.push(injection);
|
|
95
|
-
}
|
|
96
|
-
if (!resolvedRequests.isAsync) {
|
|
97
|
-
resolvedRequests.isAsync = (0, async_1.isPromiseOrContainsPromise)(injection);
|
|
98
|
-
}
|
|
99
|
-
return resolvedRequests;
|
|
100
|
-
}, {
|
|
101
|
-
constructorInjections: [],
|
|
102
|
-
isAsync: false,
|
|
103
|
-
propertyInjections: [],
|
|
104
|
-
propertyRequests: [],
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
function _createInstance(constr, childRequests, resolveRequest) {
|
|
108
|
-
var result;
|
|
109
|
-
if (childRequests.length > 0) {
|
|
110
|
-
var resolved = _resolveRequests(childRequests, resolveRequest);
|
|
111
|
-
var createInstanceWithInjectionsArg = __assign(__assign({}, resolved), { constr: constr });
|
|
112
|
-
if (resolved.isAsync) {
|
|
113
|
-
result = createInstanceWithInjectionsAsync(createInstanceWithInjectionsArg);
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
result = createInstanceWithInjections(createInstanceWithInjectionsArg);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
result = new constr();
|
|
121
|
-
}
|
|
122
|
-
return result;
|
|
123
|
-
}
|
|
124
|
-
function createInstanceWithInjections(args) {
|
|
125
|
-
var _a;
|
|
126
|
-
var instance = new ((_a = args.constr).bind.apply(_a, __spreadArray([void 0], args.constructorInjections, false)))();
|
|
127
|
-
args.propertyRequests.forEach(function (r, index) {
|
|
128
|
-
var property = r.target.identifier;
|
|
129
|
-
var injection = args.propertyInjections[index];
|
|
130
|
-
if (!r.target.isOptional() || injection !== undefined) {
|
|
131
|
-
instance[property] = injection;
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
return instance;
|
|
135
|
-
}
|
|
136
|
-
function createInstanceWithInjectionsAsync(args) {
|
|
137
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
138
|
-
var constructorInjections, propertyInjections;
|
|
139
|
-
return __generator(this, function (_a) {
|
|
140
|
-
switch (_a.label) {
|
|
141
|
-
case 0: return [4, possiblyWaitInjections(args.constructorInjections)];
|
|
142
|
-
case 1:
|
|
143
|
-
constructorInjections = _a.sent();
|
|
144
|
-
return [4, possiblyWaitInjections(args.propertyInjections)];
|
|
145
|
-
case 2:
|
|
146
|
-
propertyInjections = _a.sent();
|
|
147
|
-
return [2, createInstanceWithInjections(__assign(__assign({}, args), { constructorInjections: constructorInjections, propertyInjections: propertyInjections }))];
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
function possiblyWaitInjections(possiblePromiseinjections) {
|
|
153
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
154
|
-
var injections, _i, possiblePromiseinjections_1, injection;
|
|
155
|
-
return __generator(this, function (_a) {
|
|
156
|
-
injections = [];
|
|
157
|
-
for (_i = 0, possiblePromiseinjections_1 = possiblePromiseinjections; _i < possiblePromiseinjections_1.length; _i++) {
|
|
158
|
-
injection = possiblePromiseinjections_1[_i];
|
|
159
|
-
if (Array.isArray(injection)) {
|
|
160
|
-
injections.push(Promise.all(injection));
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
injections.push(injection);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return [2, Promise.all(injections)];
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
function _getInstanceAfterPostConstruct(constr, result) {
|
|
171
|
-
var postConstructResult = _postConstruct(constr, result);
|
|
172
|
-
if ((0, async_1.isPromise)(postConstructResult)) {
|
|
173
|
-
return postConstructResult.then(function () { return result; });
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
return result;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
function _postConstruct(constr, instance) {
|
|
180
|
-
var _a, _b;
|
|
181
|
-
if (Reflect.hasMetadata(METADATA_KEY.POST_CONSTRUCT, constr)) {
|
|
182
|
-
var data = Reflect.getMetadata(METADATA_KEY.POST_CONSTRUCT, constr);
|
|
183
|
-
try {
|
|
184
|
-
return (_b = (_a = instance)[data.value]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
185
|
-
}
|
|
186
|
-
catch (e) {
|
|
187
|
-
if (e instanceof Error) {
|
|
188
|
-
throw new Error((0, error_msgs_1.POST_CONSTRUCT_ERROR)(constr.name, e.message));
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
function _validateInstanceResolution(binding, constr) {
|
|
194
|
-
if (binding.scope !== literal_types_1.BindingScopeEnum.Singleton) {
|
|
195
|
-
_throwIfHandlingDeactivation(binding, constr);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
function _throwIfHandlingDeactivation(binding, constr) {
|
|
199
|
-
var scopeErrorMessage = "Class cannot be instantiated in ".concat(binding.scope === literal_types_1.BindingScopeEnum.Request ? 'request' : 'transient', " scope.");
|
|
200
|
-
if (typeof binding.onDeactivation === 'function') {
|
|
201
|
-
throw new Error((0, error_msgs_1.ON_DEACTIVATION_ERROR)(constr.name, scopeErrorMessage));
|
|
202
|
-
}
|
|
203
|
-
if (Reflect.hasMetadata(METADATA_KEY.PRE_DESTROY, constr)) {
|
|
204
|
-
throw new Error((0, error_msgs_1.PRE_DESTROY_ERROR)(constr.name, scopeErrorMessage));
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
function resolveInstance(binding, constr, childRequests, resolveRequest) {
|
|
208
|
-
_validateInstanceResolution(binding, constr);
|
|
209
|
-
var result = _createInstance(constr, childRequests, resolveRequest);
|
|
210
|
-
if ((0, async_1.isPromise)(result)) {
|
|
211
|
-
return result.then(function (resolvedResult) {
|
|
212
|
-
return _getInstanceAfterPostConstruct(constr, resolvedResult);
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
return _getInstanceAfterPostConstruct(constr, result);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
});
|