inversify 6.0.1 → 6.0.3
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/.nyc_output/c29b2307-4e95-47d0-b220-9efcfa7ee49f.json +1 -0
- package/.nyc_output/processinfo/c29b2307-4e95-47d0-b220-9efcfa7ee49f.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/CHANGELOG.md +33 -3
- package/README.md +27 -24
- package/amd/annotation/decorator_utils.js +14 -12
- package/amd/annotation/inject.js +5 -2
- package/amd/annotation/inject_base.js +2 -4
- package/amd/annotation/injectable.js +6 -4
- package/amd/annotation/lazy_service_identifier.js +6 -7
- package/amd/annotation/multi_inject.js +5 -2
- package/amd/annotation/named.js +6 -4
- package/amd/annotation/optional.js +6 -4
- package/amd/annotation/post_construct.js +5 -2
- package/amd/annotation/pre_destroy.js +5 -2
- package/amd/annotation/property_event_decorator.js +1 -3
- package/amd/annotation/tagged.js +1 -3
- package/amd/annotation/target_name.js +6 -4
- package/amd/annotation/unmanaged.js +6 -4
- package/amd/bindings/binding.js +0 -1
- package/amd/bindings/binding_count.js +1 -3
- package/amd/constants/error_msgs.js +52 -43
- package/amd/constants/literal_types.js +14 -15
- package/amd/constants/metadata_keys.js +12 -13
- package/amd/container/container.js +27 -18
- package/amd/container/container_module.js +0 -1
- package/amd/container/container_snapshot.js +0 -1
- package/amd/container/lookup.js +5 -2
- package/amd/container/module_activation_store.js +0 -1
- package/amd/interfaces/interfaces.js +1 -3
- package/amd/inversify.js +9 -5
- package/amd/planning/context.js +0 -1
- package/amd/planning/metadata.js +7 -4
- package/amd/planning/metadata_reader.js +5 -2
- package/amd/planning/plan.js +0 -1
- package/amd/planning/planner.js +13 -11
- package/amd/planning/queryable_string.js +3 -4
- package/amd/planning/reflection_utils.js +15 -12
- package/amd/planning/request.js +0 -1
- package/amd/planning/target.js +6 -3
- package/amd/resolution/instantiation.js +19 -13
- package/amd/resolution/resolver.js +10 -8
- package/amd/scope/scope.js +8 -9
- package/amd/syntax/binding_in_syntax.js +0 -1
- package/amd/syntax/binding_in_when_on_syntax.js +0 -1
- package/amd/syntax/binding_on_syntax.js +0 -1
- package/amd/syntax/binding_to_syntax.js +6 -3
- package/amd/syntax/binding_when_on_syntax.js +0 -1
- package/amd/syntax/binding_when_syntax.js +0 -1
- package/amd/syntax/constraint_helpers.js +6 -3
- package/amd/utils/async.js +2 -4
- package/amd/utils/binding_utils.js +9 -6
- package/amd/utils/clonable.js +1 -3
- package/amd/utils/exceptions.js +9 -6
- package/amd/utils/factory_type.js +1 -2
- package/amd/utils/id.js +1 -3
- package/amd/utils/js.js +1 -3
- package/amd/utils/serialization.js +26 -24
- package/es/annotation/decorator_utils.js +8 -9
- package/es/annotation/inject.js +2 -3
- package/es/annotation/inject_base.js +4 -5
- package/es/annotation/injectable.js +2 -3
- package/es/annotation/lazy_service_identifier.js +5 -6
- package/es/annotation/multi_inject.js +2 -3
- package/es/annotation/named.js +3 -4
- package/es/annotation/optional.js +3 -4
- package/es/annotation/post_construct.js +3 -4
- package/es/annotation/pre_destroy.js +3 -4
- package/es/annotation/property_event_decorator.js +1 -2
- package/es/annotation/tagged.js +0 -1
- package/es/annotation/target_name.js +0 -1
- package/es/annotation/unmanaged.js +3 -4
- package/es/bindings/binding.js +2 -3
- package/es/bindings/binding_count.js +1 -3
- package/es/constants/error_msgs.js +52 -43
- package/es/constants/literal_types.js +14 -15
- package/es/constants/metadata_keys.js +12 -13
- package/es/container/container.js +36 -31
- package/es/container/container_module.js +1 -2
- package/es/container/container_snapshot.js +0 -1
- package/es/container/lookup.js +2 -3
- package/es/container/module_activation_store.js +1 -2
- package/es/interfaces/interfaces.js +0 -1
- package/es/inversify.js +24 -24
- package/es/planning/context.js +1 -2
- package/es/planning/metadata.js +3 -4
- package/es/planning/metadata_reader.js +1 -2
- package/es/planning/plan.js +0 -1
- package/es/planning/planner.js +17 -18
- package/es/planning/queryable_string.js +3 -4
- package/es/planning/reflection_utils.js +13 -14
- package/es/planning/request.js +1 -2
- package/es/planning/target.js +1 -2
- package/es/resolution/instantiation.js +17 -14
- package/es/resolution/resolver.js +12 -13
- package/es/scope/scope.js +5 -6
- package/es/syntax/binding_in_syntax.js +2 -3
- package/es/syntax/binding_in_when_on_syntax.js +3 -4
- package/es/syntax/binding_on_syntax.js +1 -2
- package/es/syntax/binding_to_syntax.js +1 -2
- package/es/syntax/binding_when_on_syntax.js +2 -3
- package/es/syntax/binding_when_syntax.js +2 -3
- package/es/syntax/constraint_helpers.js +3 -4
- package/es/utils/async.js +0 -1
- package/es/utils/binding_utils.js +6 -7
- package/es/utils/clonable.js +0 -1
- package/es/utils/exceptions.js +3 -4
- package/es/utils/factory_type.js +0 -1
- package/es/utils/id.js +0 -1
- package/es/utils/js.js +0 -1
- package/es/utils/serialization.js +16 -17
- package/es6/annotation/decorator_utils.js +12 -10
- package/es6/annotation/inject.js +5 -2
- package/es6/annotation/inject_base.js +2 -4
- package/es6/annotation/injectable.js +6 -4
- package/es6/annotation/lazy_service_identifier.js +3 -4
- package/es6/annotation/multi_inject.js +5 -2
- package/es6/annotation/named.js +6 -4
- package/es6/annotation/optional.js +6 -4
- package/es6/annotation/post_construct.js +5 -2
- package/es6/annotation/pre_destroy.js +5 -2
- package/es6/annotation/property_event_decorator.js +1 -3
- package/es6/annotation/tagged.js +1 -3
- package/es6/annotation/target_name.js +6 -4
- package/es6/annotation/unmanaged.js +6 -4
- package/es6/bindings/binding.js +0 -1
- package/es6/bindings/binding_count.js +1 -3
- package/es6/constants/error_msgs.js +46 -38
- package/es6/constants/literal_types.js +14 -15
- package/es6/constants/metadata_keys.js +12 -13
- package/es6/container/container.js +35 -27
- package/es6/container/container_module.js +0 -1
- package/es6/container/container_snapshot.js +0 -1
- package/es6/container/lookup.js +5 -2
- package/es6/container/module_activation_store.js +0 -1
- package/es6/interfaces/interfaces.js +1 -3
- package/es6/inversify.js +9 -4
- package/es6/planning/context.js +0 -1
- package/es6/planning/metadata.js +5 -2
- package/es6/planning/metadata_reader.js +5 -2
- package/es6/planning/plan.js +0 -1
- package/es6/planning/planner.js +12 -10
- package/es6/planning/queryable_string.js +3 -4
- package/es6/planning/reflection_utils.js +12 -9
- package/es6/planning/request.js +0 -1
- package/es6/planning/target.js +6 -3
- package/es6/resolution/instantiation.js +15 -9
- package/es6/resolution/resolver.js +7 -5
- package/es6/scope/scope.js +5 -6
- package/es6/syntax/binding_in_syntax.js +0 -1
- package/es6/syntax/binding_in_when_on_syntax.js +0 -1
- package/es6/syntax/binding_on_syntax.js +0 -1
- package/es6/syntax/binding_to_syntax.js +5 -2
- package/es6/syntax/binding_when_on_syntax.js +0 -1
- package/es6/syntax/binding_when_syntax.js +0 -1
- package/es6/syntax/constraint_helpers.js +6 -3
- package/es6/utils/async.js +2 -4
- package/es6/utils/binding_utils.js +7 -4
- package/es6/utils/clonable.js +1 -3
- package/es6/utils/exceptions.js +9 -6
- package/es6/utils/factory_type.js +1 -2
- package/es6/utils/id.js +1 -3
- package/es6/utils/js.js +1 -3
- package/es6/utils/serialization.js +20 -18
- package/lib/annotation/decorator_utils.d.ts +5 -5
- package/lib/annotation/decorator_utils.js +14 -12
- package/lib/annotation/inject.d.ts +1 -1
- package/lib/annotation/inject.js +5 -2
- package/lib/annotation/inject_base.d.ts +3 -3
- package/lib/annotation/inject_base.js +2 -4
- package/lib/annotation/injectable.d.ts +1 -1
- package/lib/annotation/injectable.js +6 -4
- package/lib/annotation/lazy_service_identifier.d.ts +3 -3
- package/lib/annotation/lazy_service_identifier.js +6 -7
- package/lib/annotation/multi_inject.d.ts +1 -1
- package/lib/annotation/multi_inject.js +5 -2
- package/lib/annotation/named.d.ts +1 -1
- package/lib/annotation/named.js +6 -4
- package/lib/annotation/optional.d.ts +1 -1
- package/lib/annotation/optional.js +6 -4
- package/lib/annotation/post_construct.js +5 -2
- package/lib/annotation/pre_destroy.js +5 -2
- package/lib/annotation/property_event_decorator.js +1 -3
- package/lib/annotation/tagged.d.ts +1 -1
- package/lib/annotation/tagged.js +1 -3
- package/lib/annotation/target_name.d.ts +1 -1
- package/lib/annotation/target_name.js +6 -4
- package/lib/annotation/unmanaged.d.ts +2 -2
- package/lib/annotation/unmanaged.js +6 -4
- package/lib/bindings/binding.d.ts +2 -2
- package/lib/bindings/binding.js +0 -1
- package/lib/bindings/binding_count.d.ts +1 -2
- package/lib/bindings/binding_count.js +1 -3
- package/lib/constants/error_msgs.js +52 -43
- package/lib/constants/literal_types.d.ts +1 -1
- package/lib/constants/literal_types.js +14 -15
- package/lib/constants/metadata_keys.js +12 -13
- package/lib/container/container.d.ts +2 -2
- package/lib/container/container.js +27 -18
- package/lib/container/container_module.d.ts +1 -1
- package/lib/container/container_module.js +0 -1
- package/lib/container/container_snapshot.d.ts +1 -1
- package/lib/container/container_snapshot.js +0 -1
- package/lib/container/lookup.d.ts +1 -1
- package/lib/container/lookup.js +5 -2
- package/lib/container/module_activation_store.d.ts +1 -1
- package/lib/container/module_activation_store.js +0 -1
- package/lib/interfaces/interfaces.d.ts +23 -22
- package/lib/interfaces/interfaces.js +1 -3
- package/lib/inversify.d.ts +24 -23
- package/lib/inversify.js +9 -4
- package/lib/planning/context.d.ts +1 -1
- package/lib/planning/context.js +0 -1
- package/lib/planning/metadata.d.ts +1 -1
- package/lib/planning/metadata.js +7 -4
- package/lib/planning/metadata_reader.d.ts +1 -1
- package/lib/planning/metadata_reader.js +5 -2
- package/lib/planning/plan.d.ts +1 -1
- package/lib/planning/plan.js +0 -1
- package/lib/planning/planner.d.ts +1 -1
- package/lib/planning/planner.js +13 -11
- package/lib/planning/queryable_string.d.ts +1 -1
- package/lib/planning/queryable_string.js +3 -4
- package/lib/planning/reflection_utils.d.ts +2 -2
- package/lib/planning/reflection_utils.js +15 -12
- package/lib/planning/request.d.ts +1 -1
- package/lib/planning/request.js +0 -1
- package/lib/planning/target.js +6 -3
- package/lib/resolution/instantiation.d.ts +1 -1
- package/lib/resolution/instantiation.js +19 -13
- package/lib/resolution/resolver.d.ts +1 -1
- package/lib/resolution/resolver.js +10 -8
- package/lib/scope/scope.d.ts +1 -1
- package/lib/scope/scope.js +8 -9
- package/lib/syntax/binding_in_syntax.d.ts +1 -1
- package/lib/syntax/binding_in_syntax.js +0 -1
- package/lib/syntax/binding_in_when_on_syntax.d.ts +1 -1
- package/lib/syntax/binding_in_when_on_syntax.js +0 -1
- package/lib/syntax/binding_on_syntax.d.ts +1 -1
- package/lib/syntax/binding_on_syntax.js +0 -1
- package/lib/syntax/binding_to_syntax.d.ts +1 -1
- package/lib/syntax/binding_to_syntax.js +6 -3
- package/lib/syntax/binding_when_on_syntax.d.ts +1 -1
- package/lib/syntax/binding_when_on_syntax.js +0 -1
- package/lib/syntax/binding_when_syntax.d.ts +1 -1
- package/lib/syntax/binding_when_syntax.js +0 -1
- package/lib/syntax/constraint_helpers.d.ts +1 -1
- package/lib/syntax/constraint_helpers.js +6 -3
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/async.js +2 -4
- package/lib/utils/binding_utils.d.ts +1 -1
- package/lib/utils/binding_utils.js +9 -6
- package/lib/utils/clonable.d.ts +1 -1
- package/lib/utils/clonable.js +1 -3
- package/lib/utils/exceptions.d.ts +1 -1
- package/lib/utils/exceptions.js +9 -6
- package/lib/utils/factory_type.js +1 -2
- package/lib/utils/id.js +1 -3
- package/lib/utils/js.js +1 -3
- package/lib/utils/serialization.d.ts +1 -1
- package/lib/utils/serialization.js +26 -24
- package/package.json +46 -61
- package/.auditignore +0 -2
- package/.nyc_output/c19faffc-964b-4370-81a6-9b4942f3c35e.json +0 -1
- package/.nyc_output/processinfo/c19faffc-964b-4370-81a6-9b4942f3c35e.json +0 -1
- package/CODE_OF_CONDUCT.md +0 -46
- package/amd/annotation/decorator_utils.js.map +0 -1
- package/amd/annotation/inject.js.map +0 -1
- package/amd/annotation/inject_base.js.map +0 -1
- package/amd/annotation/injectable.js.map +0 -1
- package/amd/annotation/lazy_service_identifier.js.map +0 -1
- package/amd/annotation/multi_inject.js.map +0 -1
- package/amd/annotation/named.js.map +0 -1
- package/amd/annotation/optional.js.map +0 -1
- package/amd/annotation/post_construct.js.map +0 -1
- package/amd/annotation/pre_destroy.js.map +0 -1
- package/amd/annotation/property_event_decorator.js.map +0 -1
- package/amd/annotation/tagged.js.map +0 -1
- package/amd/annotation/target_name.js.map +0 -1
- package/amd/annotation/unmanaged.js.map +0 -1
- package/amd/bindings/binding.js.map +0 -1
- package/amd/bindings/binding_count.js.map +0 -1
- package/amd/constants/error_msgs.js.map +0 -1
- package/amd/constants/literal_types.js.map +0 -1
- package/amd/constants/metadata_keys.js.map +0 -1
- package/amd/container/container.js.map +0 -1
- package/amd/container/container_module.js.map +0 -1
- package/amd/container/container_snapshot.js.map +0 -1
- package/amd/container/lookup.js.map +0 -1
- package/amd/container/module_activation_store.js.map +0 -1
- package/amd/interfaces/interfaces.js.map +0 -1
- package/amd/inversify.js.map +0 -1
- package/amd/planning/context.js.map +0 -1
- package/amd/planning/metadata.js.map +0 -1
- package/amd/planning/metadata_reader.js.map +0 -1
- package/amd/planning/plan.js.map +0 -1
- package/amd/planning/planner.js.map +0 -1
- package/amd/planning/queryable_string.js.map +0 -1
- package/amd/planning/reflection_utils.js.map +0 -1
- package/amd/planning/request.js.map +0 -1
- package/amd/planning/target.js.map +0 -1
- package/amd/resolution/instantiation.js.map +0 -1
- package/amd/resolution/resolver.js.map +0 -1
- package/amd/scope/scope.js.map +0 -1
- package/amd/syntax/binding_in_syntax.js.map +0 -1
- package/amd/syntax/binding_in_when_on_syntax.js.map +0 -1
- package/amd/syntax/binding_on_syntax.js.map +0 -1
- package/amd/syntax/binding_to_syntax.js.map +0 -1
- package/amd/syntax/binding_when_on_syntax.js.map +0 -1
- package/amd/syntax/binding_when_syntax.js.map +0 -1
- package/amd/syntax/constraint_helpers.js.map +0 -1
- package/amd/utils/async.js.map +0 -1
- package/amd/utils/binding_utils.js.map +0 -1
- package/amd/utils/clonable.js.map +0 -1
- package/amd/utils/exceptions.js.map +0 -1
- package/amd/utils/factory_type.js.map +0 -1
- package/amd/utils/id.js.map +0 -1
- package/amd/utils/js.js.map +0 -1
- package/amd/utils/serialization.js.map +0 -1
- package/es/annotation/decorator_utils.js.map +0 -1
- package/es/annotation/inject.js.map +0 -1
- package/es/annotation/inject_base.js.map +0 -1
- package/es/annotation/injectable.js.map +0 -1
- package/es/annotation/lazy_service_identifier.js.map +0 -1
- package/es/annotation/multi_inject.js.map +0 -1
- package/es/annotation/named.js.map +0 -1
- package/es/annotation/optional.js.map +0 -1
- package/es/annotation/post_construct.js.map +0 -1
- package/es/annotation/pre_destroy.js.map +0 -1
- package/es/annotation/property_event_decorator.js.map +0 -1
- package/es/annotation/tagged.js.map +0 -1
- package/es/annotation/target_name.js.map +0 -1
- package/es/annotation/unmanaged.js.map +0 -1
- package/es/bindings/binding.js.map +0 -1
- package/es/bindings/binding_count.js.map +0 -1
- package/es/constants/error_msgs.js.map +0 -1
- package/es/constants/literal_types.js.map +0 -1
- package/es/constants/metadata_keys.js.map +0 -1
- package/es/container/container.js.map +0 -1
- package/es/container/container_module.js.map +0 -1
- package/es/container/container_snapshot.js.map +0 -1
- package/es/container/lookup.js.map +0 -1
- package/es/container/module_activation_store.js.map +0 -1
- package/es/interfaces/interfaces.js.map +0 -1
- package/es/inversify.js.map +0 -1
- package/es/planning/context.js.map +0 -1
- package/es/planning/metadata.js.map +0 -1
- package/es/planning/metadata_reader.js.map +0 -1
- package/es/planning/plan.js.map +0 -1
- package/es/planning/planner.js.map +0 -1
- package/es/planning/queryable_string.js.map +0 -1
- package/es/planning/reflection_utils.js.map +0 -1
- package/es/planning/request.js.map +0 -1
- package/es/planning/target.js.map +0 -1
- package/es/resolution/instantiation.js.map +0 -1
- package/es/resolution/resolver.js.map +0 -1
- package/es/scope/scope.js.map +0 -1
- package/es/syntax/binding_in_syntax.js.map +0 -1
- package/es/syntax/binding_in_when_on_syntax.js.map +0 -1
- package/es/syntax/binding_on_syntax.js.map +0 -1
- package/es/syntax/binding_to_syntax.js.map +0 -1
- package/es/syntax/binding_when_on_syntax.js.map +0 -1
- package/es/syntax/binding_when_syntax.js.map +0 -1
- package/es/syntax/constraint_helpers.js.map +0 -1
- package/es/utils/async.js.map +0 -1
- package/es/utils/binding_utils.js.map +0 -1
- package/es/utils/clonable.js.map +0 -1
- package/es/utils/exceptions.js.map +0 -1
- package/es/utils/factory_type.js.map +0 -1
- package/es/utils/id.js.map +0 -1
- package/es/utils/js.js.map +0 -1
- package/es/utils/serialization.js.map +0 -1
- package/es6/annotation/decorator_utils.js.map +0 -1
- package/es6/annotation/inject.js.map +0 -1
- package/es6/annotation/inject_base.js.map +0 -1
- package/es6/annotation/injectable.js.map +0 -1
- package/es6/annotation/lazy_service_identifier.js.map +0 -1
- package/es6/annotation/multi_inject.js.map +0 -1
- package/es6/annotation/named.js.map +0 -1
- package/es6/annotation/optional.js.map +0 -1
- package/es6/annotation/post_construct.js.map +0 -1
- package/es6/annotation/pre_destroy.js.map +0 -1
- package/es6/annotation/property_event_decorator.js.map +0 -1
- package/es6/annotation/tagged.js.map +0 -1
- package/es6/annotation/target_name.js.map +0 -1
- package/es6/annotation/unmanaged.js.map +0 -1
- package/es6/bindings/binding.js.map +0 -1
- package/es6/bindings/binding_count.js.map +0 -1
- package/es6/constants/error_msgs.js.map +0 -1
- package/es6/constants/literal_types.js.map +0 -1
- package/es6/constants/metadata_keys.js.map +0 -1
- package/es6/container/container.js.map +0 -1
- package/es6/container/container_module.js.map +0 -1
- package/es6/container/container_snapshot.js.map +0 -1
- package/es6/container/lookup.js.map +0 -1
- package/es6/container/module_activation_store.js.map +0 -1
- package/es6/interfaces/interfaces.js.map +0 -1
- package/es6/inversify.js.map +0 -1
- package/es6/planning/context.js.map +0 -1
- package/es6/planning/metadata.js.map +0 -1
- package/es6/planning/metadata_reader.js.map +0 -1
- package/es6/planning/plan.js.map +0 -1
- package/es6/planning/planner.js.map +0 -1
- package/es6/planning/queryable_string.js.map +0 -1
- package/es6/planning/reflection_utils.js.map +0 -1
- package/es6/planning/request.js.map +0 -1
- package/es6/planning/target.js.map +0 -1
- package/es6/resolution/instantiation.js.map +0 -1
- package/es6/resolution/resolver.js.map +0 -1
- package/es6/scope/scope.js.map +0 -1
- package/es6/syntax/binding_in_syntax.js.map +0 -1
- package/es6/syntax/binding_in_when_on_syntax.js.map +0 -1
- package/es6/syntax/binding_on_syntax.js.map +0 -1
- package/es6/syntax/binding_to_syntax.js.map +0 -1
- package/es6/syntax/binding_when_on_syntax.js.map +0 -1
- package/es6/syntax/binding_when_syntax.js.map +0 -1
- package/es6/syntax/constraint_helpers.js.map +0 -1
- package/es6/utils/async.js.map +0 -1
- package/es6/utils/binding_utils.js.map +0 -1
- package/es6/utils/clonable.js.map +0 -1
- package/es6/utils/exceptions.js.map +0 -1
- package/es6/utils/factory_type.js.map +0 -1
- package/es6/utils/id.js.map +0 -1
- package/es6/utils/js.js.map +0 -1
- package/es6/utils/serialization.js.map +0 -1
- package/lib/annotation/decorator_utils.js.map +0 -1
- package/lib/annotation/inject.js.map +0 -1
- package/lib/annotation/inject_base.js.map +0 -1
- package/lib/annotation/injectable.js.map +0 -1
- package/lib/annotation/lazy_service_identifier.js.map +0 -1
- package/lib/annotation/multi_inject.js.map +0 -1
- package/lib/annotation/named.js.map +0 -1
- package/lib/annotation/optional.js.map +0 -1
- package/lib/annotation/post_construct.js.map +0 -1
- package/lib/annotation/pre_destroy.js.map +0 -1
- package/lib/annotation/property_event_decorator.js.map +0 -1
- package/lib/annotation/tagged.js.map +0 -1
- package/lib/annotation/target_name.js.map +0 -1
- package/lib/annotation/unmanaged.js.map +0 -1
- package/lib/bindings/binding.js.map +0 -1
- package/lib/bindings/binding_count.js.map +0 -1
- package/lib/constants/error_msgs.js.map +0 -1
- package/lib/constants/literal_types.js.map +0 -1
- package/lib/constants/metadata_keys.js.map +0 -1
- package/lib/container/container.js.map +0 -1
- package/lib/container/container_module.js.map +0 -1
- package/lib/container/container_snapshot.js.map +0 -1
- package/lib/container/lookup.js.map +0 -1
- package/lib/container/module_activation_store.js.map +0 -1
- package/lib/interfaces/interfaces.js.map +0 -1
- package/lib/inversify.js.map +0 -1
- package/lib/planning/context.js.map +0 -1
- package/lib/planning/metadata.js.map +0 -1
- package/lib/planning/metadata_reader.js.map +0 -1
- package/lib/planning/plan.js.map +0 -1
- package/lib/planning/planner.js.map +0 -1
- package/lib/planning/queryable_string.js.map +0 -1
- package/lib/planning/reflection_utils.js.map +0 -1
- package/lib/planning/request.js.map +0 -1
- package/lib/planning/target.js.map +0 -1
- package/lib/resolution/instantiation.js.map +0 -1
- package/lib/resolution/resolver.js.map +0 -1
- package/lib/scope/scope.js.map +0 -1
- package/lib/syntax/binding_in_syntax.js.map +0 -1
- package/lib/syntax/binding_in_when_on_syntax.js.map +0 -1
- package/lib/syntax/binding_on_syntax.js.map +0 -1
- package/lib/syntax/binding_to_syntax.js.map +0 -1
- package/lib/syntax/binding_when_on_syntax.js.map +0 -1
- package/lib/syntax/binding_when_syntax.js.map +0 -1
- package/lib/syntax/constraint_helpers.js.map +0 -1
- package/lib/utils/async.js.map +0 -1
- package/lib/utils/binding_utils.js.map +0 -1
- package/lib/utils/clonable.js.map +0 -1
- package/lib/utils/exceptions.js.map +0 -1
- package/lib/utils/factory_type.js.map +0 -1
- package/lib/utils/id.js.map +0 -1
- package/lib/utils/js.js.map +0 -1
- package/lib/utils/serialization.js.map +0 -1
- package/mocha.opts +0 -3
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -19,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
21
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.unmanaged =
|
|
26
|
+
exports.unmanaged = unmanaged;
|
|
23
27
|
const METADATA_KEY = __importStar(require("../constants/metadata_keys"));
|
|
24
28
|
const metadata_1 = require("../planning/metadata");
|
|
25
29
|
const decorator_utils_1 = require("./decorator_utils");
|
|
@@ -29,5 +33,3 @@ function unmanaged() {
|
|
|
29
33
|
(0, decorator_utils_1.tagParameter)(target, targetKey, index, metadata);
|
|
30
34
|
};
|
|
31
35
|
}
|
|
32
|
-
exports.unmanaged = unmanaged;
|
|
33
|
-
//# sourceMappingURL=unmanaged.js.map
|
package/es6/bindings/binding.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BindingCount = void 0;
|
|
4
|
-
|
|
4
|
+
exports.BindingCount = {
|
|
5
5
|
MultipleBindingsAvailable: 2,
|
|
6
6
|
NoBindingsAvailable: 0,
|
|
7
7
|
OnlyOneBindingAvailable: 1
|
|
8
8
|
};
|
|
9
|
-
exports.BindingCount = BindingCount;
|
|
10
|
-
//# sourceMappingURL=binding_count.js.map
|
|
@@ -1,54 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.STACK_OVERFLOW = exports.CIRCULAR_DEPENDENCY_IN_FACTORY = exports.ON_DEACTIVATION_ERROR = exports.PRE_DESTROY_ERROR = exports.POST_CONSTRUCT_ERROR = exports.ASYNC_UNBIND_REQUIRED = exports.MULTIPLE_POST_CONSTRUCT_METHODS = exports.MULTIPLE_PRE_DESTROY_METHODS = exports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = exports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = exports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = exports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = exports.ARGUMENTS_LENGTH_MISMATCH = exports.INVALID_DECORATOR_OPERATION = exports.INVALID_TO_SELF_VALUE = exports.LAZY_IN_SYNC = exports.INVALID_FUNCTION_BINDING = exports.INVALID_MIDDLEWARE_RETURN = exports.NO_MORE_SNAPSHOTS_AVAILABLE = exports.INVALID_BINDING_TYPE = exports.NOT_IMPLEMENTED = exports.CIRCULAR_DEPENDENCY = exports.UNDEFINED_INJECT_ANNOTATION = exports.MISSING_INJECT_ANNOTATION = exports.MISSING_INJECTABLE_ANNOTATION = exports.NOT_REGISTERED = exports.CANNOT_UNBIND = exports.AMBIGUOUS_MATCH = exports.KEY_NOT_FOUND = exports.NULL_ARGUMENT = exports.DUPLICATED_METADATA = exports.DUPLICATED_INJECTABLE_DECORATOR = void 0;
|
|
4
|
-
exports.DUPLICATED_INJECTABLE_DECORATOR =
|
|
5
|
-
exports.DUPLICATED_METADATA =
|
|
6
|
-
exports.NULL_ARGUMENT =
|
|
7
|
-
exports.KEY_NOT_FOUND =
|
|
8
|
-
exports.AMBIGUOUS_MATCH =
|
|
9
|
-
exports.CANNOT_UNBIND =
|
|
10
|
-
exports.NOT_REGISTERED =
|
|
11
|
-
exports.MISSING_INJECTABLE_ANNOTATION =
|
|
12
|
-
exports.MISSING_INJECT_ANNOTATION =
|
|
4
|
+
exports.DUPLICATED_INJECTABLE_DECORATOR = 'Cannot apply @injectable decorator multiple times.';
|
|
5
|
+
exports.DUPLICATED_METADATA = 'Metadata key was used more than once in a parameter:';
|
|
6
|
+
exports.NULL_ARGUMENT = 'NULL argument';
|
|
7
|
+
exports.KEY_NOT_FOUND = 'Key Not Found';
|
|
8
|
+
exports.AMBIGUOUS_MATCH = 'Ambiguous match found for serviceIdentifier:';
|
|
9
|
+
exports.CANNOT_UNBIND = 'Could not unbind serviceIdentifier:';
|
|
10
|
+
exports.NOT_REGISTERED = 'No matching bindings found for serviceIdentifier:';
|
|
11
|
+
exports.MISSING_INJECTABLE_ANNOTATION = 'Missing required @injectable annotation in:';
|
|
12
|
+
exports.MISSING_INJECT_ANNOTATION = 'Missing required @inject or @multiInject annotation in:';
|
|
13
13
|
const UNDEFINED_INJECT_ANNOTATION = (name) => `@inject called with undefined this could mean that the class ${name} has ` +
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
'a circular dependency problem. You can use a LazyServiceIdentifer to ' +
|
|
15
|
+
'overcome this limitation.';
|
|
16
16
|
exports.UNDEFINED_INJECT_ANNOTATION = UNDEFINED_INJECT_ANNOTATION;
|
|
17
|
-
exports.CIRCULAR_DEPENDENCY =
|
|
18
|
-
exports.NOT_IMPLEMENTED =
|
|
19
|
-
exports.INVALID_BINDING_TYPE =
|
|
20
|
-
exports.NO_MORE_SNAPSHOTS_AVAILABLE =
|
|
21
|
-
exports.INVALID_MIDDLEWARE_RETURN =
|
|
22
|
-
exports.INVALID_FUNCTION_BINDING =
|
|
23
|
-
const LAZY_IN_SYNC = (key) => `You are attempting to construct
|
|
24
|
-
|
|
17
|
+
exports.CIRCULAR_DEPENDENCY = 'Circular dependency found:';
|
|
18
|
+
exports.NOT_IMPLEMENTED = 'Sorry, this feature is not fully implemented yet.';
|
|
19
|
+
exports.INVALID_BINDING_TYPE = 'Invalid binding type:';
|
|
20
|
+
exports.NO_MORE_SNAPSHOTS_AVAILABLE = 'No snapshot available to restore.';
|
|
21
|
+
exports.INVALID_MIDDLEWARE_RETURN = 'Invalid return type in middleware. Middleware must return!';
|
|
22
|
+
exports.INVALID_FUNCTION_BINDING = 'Value provided to function binding must be a function!';
|
|
23
|
+
const LAZY_IN_SYNC = (key) => `You are attempting to construct ${keyToString(key)} in a synchronous way ` +
|
|
24
|
+
'but it has asynchronous dependencies.';
|
|
25
25
|
exports.LAZY_IN_SYNC = LAZY_IN_SYNC;
|
|
26
|
-
exports.INVALID_TO_SELF_VALUE =
|
|
27
|
-
|
|
28
|
-
exports.INVALID_DECORATOR_OPERATION =
|
|
29
|
-
|
|
30
|
-
const ARGUMENTS_LENGTH_MISMATCH = (...values) =>
|
|
26
|
+
exports.INVALID_TO_SELF_VALUE = 'The toSelf function can only be applied when a constructor is ' +
|
|
27
|
+
'used as service identifier';
|
|
28
|
+
exports.INVALID_DECORATOR_OPERATION = 'The @inject @multiInject @tagged and @named decorators ' +
|
|
29
|
+
'must be applied to the parameters of a class constructor or a class property.';
|
|
30
|
+
const ARGUMENTS_LENGTH_MISMATCH = (...values) => 'The number of constructor arguments in the derived class ' +
|
|
31
31
|
`${values[0]} must be >= than the number of constructor arguments of its base class.`;
|
|
32
32
|
exports.ARGUMENTS_LENGTH_MISMATCH = ARGUMENTS_LENGTH_MISMATCH;
|
|
33
|
-
exports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT =
|
|
34
|
-
|
|
35
|
-
exports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE =
|
|
36
|
-
|
|
37
|
-
exports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE =
|
|
38
|
-
|
|
39
|
-
exports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK =
|
|
40
|
-
|
|
41
|
-
exports.MULTIPLE_PRE_DESTROY_METHODS =
|
|
42
|
-
exports.MULTIPLE_POST_CONSTRUCT_METHODS =
|
|
43
|
-
exports.ASYNC_UNBIND_REQUIRED =
|
|
33
|
+
exports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = 'Invalid Container constructor argument. Container options ' +
|
|
34
|
+
'must be an object.';
|
|
35
|
+
exports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = 'Invalid Container option. Default scope must ' +
|
|
36
|
+
'be a string ("singleton" or "transient").';
|
|
37
|
+
exports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = 'Invalid Container option. Auto bind injectable must ' +
|
|
38
|
+
'be a boolean';
|
|
39
|
+
exports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = 'Invalid Container option. Skip base check must ' +
|
|
40
|
+
'be a boolean';
|
|
41
|
+
exports.MULTIPLE_PRE_DESTROY_METHODS = 'Cannot apply @preDestroy decorator multiple times in the same class';
|
|
42
|
+
exports.MULTIPLE_POST_CONSTRUCT_METHODS = 'Cannot apply @postConstruct decorator multiple times in the same class';
|
|
43
|
+
exports.ASYNC_UNBIND_REQUIRED = 'Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)';
|
|
44
44
|
const POST_CONSTRUCT_ERROR = (clazz, errorMessage) => `@postConstruct error in class ${clazz}: ${errorMessage}`;
|
|
45
45
|
exports.POST_CONSTRUCT_ERROR = POST_CONSTRUCT_ERROR;
|
|
46
46
|
const PRE_DESTROY_ERROR = (clazz, errorMessage) => `@preDestroy error in class ${clazz}: ${errorMessage}`;
|
|
47
47
|
exports.PRE_DESTROY_ERROR = PRE_DESTROY_ERROR;
|
|
48
48
|
const ON_DEACTIVATION_ERROR = (clazz, errorMessage) => `onDeactivation() error in class ${clazz}: ${errorMessage}`;
|
|
49
49
|
exports.ON_DEACTIVATION_ERROR = ON_DEACTIVATION_ERROR;
|
|
50
|
-
const CIRCULAR_DEPENDENCY_IN_FACTORY = (factoryType, serviceIdentifier) => `It looks like there is a circular dependency in one of the '${factoryType}' bindings. Please investigate bindings with` +
|
|
50
|
+
const CIRCULAR_DEPENDENCY_IN_FACTORY = (factoryType, serviceIdentifier) => `It looks like there is a circular dependency in one of the '${factoryType}' bindings. Please investigate bindings with ` +
|
|
51
51
|
`service identifier '${serviceIdentifier}'.`;
|
|
52
52
|
exports.CIRCULAR_DEPENDENCY_IN_FACTORY = CIRCULAR_DEPENDENCY_IN_FACTORY;
|
|
53
|
-
exports.STACK_OVERFLOW =
|
|
54
|
-
|
|
53
|
+
exports.STACK_OVERFLOW = 'Maximum call stack size exceeded';
|
|
54
|
+
function keyToString(key) {
|
|
55
|
+
if (typeof key === 'function') {
|
|
56
|
+
return `[function/class ${key.name || '<anonymous>'}]`;
|
|
57
|
+
}
|
|
58
|
+
if (typeof key === 'symbol') {
|
|
59
|
+
return key.toString();
|
|
60
|
+
}
|
|
61
|
+
return `'${key}'`;
|
|
62
|
+
}
|
|
@@ -2,26 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TargetTypeEnum = exports.BindingTypeEnum = exports.BindingScopeEnum = void 0;
|
|
4
4
|
const BindingScopeEnum = {
|
|
5
|
-
Request:
|
|
6
|
-
Singleton:
|
|
7
|
-
Transient:
|
|
5
|
+
Request: 'Request',
|
|
6
|
+
Singleton: 'Singleton',
|
|
7
|
+
Transient: 'Transient'
|
|
8
8
|
};
|
|
9
9
|
exports.BindingScopeEnum = BindingScopeEnum;
|
|
10
10
|
const BindingTypeEnum = {
|
|
11
|
-
ConstantValue:
|
|
12
|
-
Constructor:
|
|
13
|
-
DynamicValue:
|
|
14
|
-
Factory:
|
|
15
|
-
Function:
|
|
16
|
-
Instance:
|
|
17
|
-
Invalid:
|
|
18
|
-
Provider:
|
|
11
|
+
ConstantValue: 'ConstantValue',
|
|
12
|
+
Constructor: 'Constructor',
|
|
13
|
+
DynamicValue: 'DynamicValue',
|
|
14
|
+
Factory: 'Factory',
|
|
15
|
+
Function: 'Function',
|
|
16
|
+
Instance: 'Instance',
|
|
17
|
+
Invalid: 'Invalid',
|
|
18
|
+
Provider: 'Provider'
|
|
19
19
|
};
|
|
20
20
|
exports.BindingTypeEnum = BindingTypeEnum;
|
|
21
21
|
const TargetTypeEnum = {
|
|
22
|
-
ClassProperty:
|
|
23
|
-
ConstructorArgument:
|
|
24
|
-
Variable:
|
|
22
|
+
ClassProperty: 'ClassProperty',
|
|
23
|
+
ConstructorArgument: 'ConstructorArgument',
|
|
24
|
+
Variable: 'Variable'
|
|
25
25
|
};
|
|
26
26
|
exports.TargetTypeEnum = TargetTypeEnum;
|
|
27
|
-
//# sourceMappingURL=literal_types.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NON_CUSTOM_TAG_KEYS = exports.PRE_DESTROY = exports.POST_CONSTRUCT = exports.DESIGN_PARAM_TYPES = exports.PARAM_TYPES = exports.TAGGED_PROP = exports.TAGGED = exports.MULTI_INJECT_TAG = exports.INJECT_TAG = exports.OPTIONAL_TAG = exports.UNMANAGED_TAG = exports.NAME_TAG = exports.NAMED_TAG = void 0;
|
|
4
|
-
exports.NAMED_TAG =
|
|
5
|
-
exports.NAME_TAG =
|
|
6
|
-
exports.UNMANAGED_TAG =
|
|
7
|
-
exports.OPTIONAL_TAG =
|
|
8
|
-
exports.INJECT_TAG =
|
|
9
|
-
exports.MULTI_INJECT_TAG =
|
|
10
|
-
exports.TAGGED =
|
|
11
|
-
exports.TAGGED_PROP =
|
|
12
|
-
exports.PARAM_TYPES =
|
|
13
|
-
exports.DESIGN_PARAM_TYPES =
|
|
14
|
-
exports.POST_CONSTRUCT =
|
|
15
|
-
exports.PRE_DESTROY =
|
|
4
|
+
exports.NAMED_TAG = 'named';
|
|
5
|
+
exports.NAME_TAG = 'name';
|
|
6
|
+
exports.UNMANAGED_TAG = 'unmanaged';
|
|
7
|
+
exports.OPTIONAL_TAG = 'optional';
|
|
8
|
+
exports.INJECT_TAG = 'inject';
|
|
9
|
+
exports.MULTI_INJECT_TAG = 'multi_inject';
|
|
10
|
+
exports.TAGGED = 'inversify:tagged';
|
|
11
|
+
exports.TAGGED_PROP = 'inversify:tagged_props';
|
|
12
|
+
exports.PARAM_TYPES = 'inversify:paramtypes';
|
|
13
|
+
exports.DESIGN_PARAM_TYPES = 'design:paramtypes';
|
|
14
|
+
exports.POST_CONSTRUCT = 'post_construct';
|
|
15
|
+
exports.PRE_DESTROY = 'pre_destroy';
|
|
16
16
|
function getNonCustomTagKeys() {
|
|
17
17
|
return [
|
|
18
18
|
exports.INJECT_TAG,
|
|
@@ -24,4 +24,3 @@ function getNonCustomTagKeys() {
|
|
|
24
24
|
];
|
|
25
25
|
}
|
|
26
26
|
exports.NON_CUSTOM_TAG_KEYS = getNonCustomTagKeys();
|
|
27
|
-
//# sourceMappingURL=metadata_keys.js.map
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -44,9 +48,26 @@ const container_snapshot_1 = require("./container_snapshot");
|
|
|
44
48
|
const lookup_1 = require("./lookup");
|
|
45
49
|
const module_activation_store_1 = require("./module_activation_store");
|
|
46
50
|
class Container {
|
|
51
|
+
static merge(container1, container2, ...containers) {
|
|
52
|
+
const container = new Container();
|
|
53
|
+
const targetContainers = [container1, container2, ...containers]
|
|
54
|
+
.map((targetContainer) => (0, planner_1.getBindingDictionary)(targetContainer));
|
|
55
|
+
const bindingDictionary = (0, planner_1.getBindingDictionary)(container);
|
|
56
|
+
function copyDictionary(origin, destination) {
|
|
57
|
+
origin.traverse((_key, value) => {
|
|
58
|
+
value.forEach((binding) => {
|
|
59
|
+
destination.add(binding.serviceIdentifier, binding.clone());
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
targetContainers.forEach((targetBindingDictionary) => {
|
|
64
|
+
copyDictionary(targetBindingDictionary, bindingDictionary);
|
|
65
|
+
});
|
|
66
|
+
return container;
|
|
67
|
+
}
|
|
47
68
|
constructor(containerOptions) {
|
|
48
69
|
const options = containerOptions || {};
|
|
49
|
-
if (typeof options !==
|
|
70
|
+
if (typeof options !== 'object') {
|
|
50
71
|
throw new Error(`${ERROR_MSGS.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT}`);
|
|
51
72
|
}
|
|
52
73
|
if (options.defaultScope === undefined) {
|
|
@@ -60,13 +81,13 @@ class Container {
|
|
|
60
81
|
if (options.autoBindInjectable === undefined) {
|
|
61
82
|
options.autoBindInjectable = false;
|
|
62
83
|
}
|
|
63
|
-
else if (typeof options.autoBindInjectable !==
|
|
84
|
+
else if (typeof options.autoBindInjectable !== 'boolean') {
|
|
64
85
|
throw new Error(`${ERROR_MSGS.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE}`);
|
|
65
86
|
}
|
|
66
87
|
if (options.skipBaseClassChecks === undefined) {
|
|
67
88
|
options.skipBaseClassChecks = false;
|
|
68
89
|
}
|
|
69
|
-
else if (typeof options.skipBaseClassChecks !==
|
|
90
|
+
else if (typeof options.skipBaseClassChecks !== 'boolean') {
|
|
70
91
|
throw new Error(`${ERROR_MSGS.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK}`);
|
|
71
92
|
}
|
|
72
93
|
this.options = {
|
|
@@ -84,23 +105,6 @@ class Container {
|
|
|
84
105
|
this._metadataReader = new metadata_reader_1.MetadataReader();
|
|
85
106
|
this._moduleActivationStore = new module_activation_store_1.ModuleActivationStore();
|
|
86
107
|
}
|
|
87
|
-
static merge(container1, container2, ...containers) {
|
|
88
|
-
const container = new Container();
|
|
89
|
-
const targetContainers = [container1, container2, ...containers]
|
|
90
|
-
.map((targetContainer) => (0, planner_1.getBindingDictionary)(targetContainer));
|
|
91
|
-
const bindingDictionary = (0, planner_1.getBindingDictionary)(container);
|
|
92
|
-
function copyDictionary(origin, destination) {
|
|
93
|
-
origin.traverse((_key, value) => {
|
|
94
|
-
value.forEach((binding) => {
|
|
95
|
-
destination.add(binding.serviceIdentifier, binding.clone());
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
targetContainers.forEach((targetBindingDictionary) => {
|
|
100
|
-
copyDictionary(targetBindingDictionary, bindingDictionary);
|
|
101
|
-
});
|
|
102
|
-
return container;
|
|
103
|
-
}
|
|
104
108
|
load(...modules) {
|
|
105
109
|
const getHelpers = this._getContainerModuleHelpersFactory();
|
|
106
110
|
for (const currentModule of modules) {
|
|
@@ -298,9 +302,10 @@ class Container {
|
|
|
298
302
|
return resolved;
|
|
299
303
|
}
|
|
300
304
|
_preDestroy(constructor, instance) {
|
|
305
|
+
var _a, _b;
|
|
301
306
|
if (Reflect.hasMetadata(METADATA_KEY.PRE_DESTROY, constructor)) {
|
|
302
307
|
const data = Reflect.getMetadata(METADATA_KEY.PRE_DESTROY, constructor);
|
|
303
|
-
return instance[data.value]();
|
|
308
|
+
return (_b = (_a = instance)[data.value]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
304
309
|
}
|
|
305
310
|
}
|
|
306
311
|
_removeModuleHandlers(moduleId) {
|
|
@@ -326,7 +331,9 @@ class Container {
|
|
|
326
331
|
}
|
|
327
332
|
}
|
|
328
333
|
catch (ex) {
|
|
329
|
-
|
|
334
|
+
if (ex instanceof Error) {
|
|
335
|
+
throw new Error(ERROR_MSGS.ON_DEACTIVATION_ERROR(constructor.name, ex.message));
|
|
336
|
+
}
|
|
330
337
|
}
|
|
331
338
|
}
|
|
332
339
|
_handleDeactivationError(asyncResult, constructor) {
|
|
@@ -335,7 +342,9 @@ class Container {
|
|
|
335
342
|
yield asyncResult;
|
|
336
343
|
}
|
|
337
344
|
catch (ex) {
|
|
338
|
-
|
|
345
|
+
if (ex instanceof Error) {
|
|
346
|
+
throw new Error(ERROR_MSGS.ON_DEACTIVATION_ERROR(constructor.name, ex.message));
|
|
347
|
+
}
|
|
339
348
|
}
|
|
340
349
|
});
|
|
341
350
|
}
|
|
@@ -495,7 +504,7 @@ class Container {
|
|
|
495
504
|
}
|
|
496
505
|
}
|
|
497
506
|
_bindingDeactivationAndPreDestroy(binding, instance, constructor) {
|
|
498
|
-
if (typeof binding.onDeactivation ===
|
|
507
|
+
if (typeof binding.onDeactivation === 'function') {
|
|
499
508
|
const result = binding.onDeactivation(instance);
|
|
500
509
|
if ((0, async_1.isPromise)(result)) {
|
|
501
510
|
return result.then(() => this._preDestroy(constructor, instance));
|
|
@@ -505,7 +514,7 @@ class Container {
|
|
|
505
514
|
}
|
|
506
515
|
_bindingDeactivationAndPreDestroyAsync(binding, instance, constructor) {
|
|
507
516
|
return __awaiter(this, void 0, void 0, function* () {
|
|
508
|
-
if (typeof binding.onDeactivation ===
|
|
517
|
+
if (typeof binding.onDeactivation === 'function') {
|
|
509
518
|
yield binding.onDeactivation(instance);
|
|
510
519
|
}
|
|
511
520
|
yield this._preDestroy(constructor, instance);
|
|
@@ -513,4 +522,3 @@ class Container {
|
|
|
513
522
|
}
|
|
514
523
|
}
|
|
515
524
|
exports.Container = Container;
|
|
516
|
-
//# sourceMappingURL=container.js.map
|
package/es6/container/lookup.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -118,4 +122,3 @@ class Lookup {
|
|
|
118
122
|
}
|
|
119
123
|
}
|
|
120
124
|
exports.Lookup = Lookup;
|
|
121
|
-
//# sourceMappingURL=lookup.js.map
|
package/es6/inversify.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -19,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
21
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.multiBindToService = exports.getServiceIdentifierAsString = exports.typeConstraint = exports.namedConstraint = exports.taggedConstraint = exports.traverseAncerstors = exports.decorate = exports.interfaces = exports.id = exports.MetadataReader = exports.preDestroy = exports.postConstruct = exports.targetName = exports.multiInject = exports.unmanaged = exports.optional = exports.LazyServiceIdentifer = exports.inject = exports.named = exports.tagged = exports.injectable = exports.createTaggedDecorator = exports.ContainerModule = exports.AsyncContainerModule = exports.TargetTypeEnum = exports.BindingTypeEnum = exports.BindingScopeEnum = exports.Container = exports.METADATA_KEY = void 0;
|
|
26
|
+
exports.multiBindToService = exports.getServiceIdentifierAsString = exports.typeConstraint = exports.namedConstraint = exports.taggedConstraint = exports.traverseAncerstors = exports.decorate = exports.interfaces = exports.id = exports.MetadataReader = exports.preDestroy = exports.postConstruct = exports.targetName = exports.multiInject = exports.unmanaged = exports.optional = exports.LazyServiceIdentifer = exports.LazyServiceIdentifier = exports.inject = exports.named = exports.tagged = exports.injectable = exports.createTaggedDecorator = exports.ContainerModule = exports.AsyncContainerModule = exports.TargetTypeEnum = exports.BindingTypeEnum = exports.BindingScopeEnum = exports.Container = exports.METADATA_KEY = void 0;
|
|
23
27
|
const keys = __importStar(require("./constants/metadata_keys"));
|
|
24
28
|
exports.METADATA_KEY = keys;
|
|
25
29
|
var container_1 = require("./container/container");
|
|
@@ -42,7 +46,9 @@ Object.defineProperty(exports, "named", { enumerable: true, get: function () { r
|
|
|
42
46
|
var inject_1 = require("./annotation/inject");
|
|
43
47
|
Object.defineProperty(exports, "inject", { enumerable: true, get: function () { return inject_1.inject; } });
|
|
44
48
|
var lazy_service_identifier_1 = require("./annotation/lazy_service_identifier");
|
|
45
|
-
Object.defineProperty(exports, "
|
|
49
|
+
Object.defineProperty(exports, "LazyServiceIdentifier", { enumerable: true, get: function () { return lazy_service_identifier_1.LazyServiceIdentifier; } });
|
|
50
|
+
var lazy_service_identifier_2 = require("./annotation/lazy_service_identifier");
|
|
51
|
+
Object.defineProperty(exports, "LazyServiceIdentifer", { enumerable: true, get: function () { return lazy_service_identifier_2.LazyServiceIdentifier; } });
|
|
46
52
|
var optional_1 = require("./annotation/optional");
|
|
47
53
|
Object.defineProperty(exports, "optional", { enumerable: true, get: function () { return optional_1.optional; } });
|
|
48
54
|
var unmanaged_1 = require("./annotation/unmanaged");
|
|
@@ -72,4 +78,3 @@ var serialization_1 = require("./utils/serialization");
|
|
|
72
78
|
Object.defineProperty(exports, "getServiceIdentifierAsString", { enumerable: true, get: function () { return serialization_1.getServiceIdentifierAsString; } });
|
|
73
79
|
var binding_utils_1 = require("./utils/binding_utils");
|
|
74
80
|
Object.defineProperty(exports, "multiBindToService", { enumerable: true, get: function () { return binding_utils_1.multiBindToService; } });
|
|
75
|
-
//# sourceMappingURL=inversify.js.map
|
package/es6/planning/context.js
CHANGED
package/es6/planning/metadata.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -36,4 +40,3 @@ class Metadata {
|
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
exports.Metadata = Metadata;
|
|
39
|
-
//# sourceMappingURL=metadata.js.map
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -36,4 +40,3 @@ class MetadataReader {
|
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
exports.MetadataReader = MetadataReader;
|
|
39
|
-
//# sourceMappingURL=metadata_reader.js.map
|
package/es6/planning/plan.js
CHANGED
package/es6/planning/planner.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -19,7 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
21
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
26
|
+
exports.plan = plan;
|
|
27
|
+
exports.createMockRequest = createMockRequest;
|
|
28
|
+
exports.getBindingDictionary = getBindingDictionary;
|
|
23
29
|
const binding_count_1 = require("../bindings/binding_count");
|
|
24
30
|
const ERROR_MSGS = __importStar(require("../constants/error_msgs"));
|
|
25
31
|
const literal_types_1 = require("../constants/literal_types");
|
|
@@ -35,7 +41,6 @@ const target_1 = require("./target");
|
|
|
35
41
|
function getBindingDictionary(cntnr) {
|
|
36
42
|
return cntnr._bindingDictionary;
|
|
37
43
|
}
|
|
38
|
-
exports.getBindingDictionary = getBindingDictionary;
|
|
39
44
|
function _createTarget(isMultiInject, targetType, serviceIdentifier, name, key, value) {
|
|
40
45
|
const metadataKey = isMultiInject ? METADATA_KEY.MULTI_INJECT_TAG : METADATA_KEY.INJECT_TAG;
|
|
41
46
|
const injectMetadata = new metadata_1.Metadata(metadataKey, serviceIdentifier);
|
|
@@ -51,7 +56,7 @@ function _getActiveBindings(metadataReader, avoidConstraints, context, parentReq
|
|
|
51
56
|
let activeBindings = [];
|
|
52
57
|
if (bindings.length === binding_count_1.BindingCount.NoBindingsAvailable &&
|
|
53
58
|
context.container.options.autoBindInjectable &&
|
|
54
|
-
typeof target.serviceIdentifier ===
|
|
59
|
+
typeof target.serviceIdentifier === 'function' &&
|
|
55
60
|
metadataReader.getConstructorMetadata(target.serviceIdentifier).compilerGeneratedMetadata) {
|
|
56
61
|
context.container.bind(target.serviceIdentifier).toSelf();
|
|
57
62
|
bindings = getBindings(context.container, target.serviceIdentifier);
|
|
@@ -148,24 +153,21 @@ function getBindings(container, serviceIdentifier) {
|
|
|
148
153
|
}
|
|
149
154
|
function plan(metadataReader, container, isMultiInject, targetType, serviceIdentifier, key, value, avoidConstraints = false) {
|
|
150
155
|
const context = new context_1.Context(container);
|
|
151
|
-
const target = _createTarget(isMultiInject, targetType, serviceIdentifier,
|
|
156
|
+
const target = _createTarget(isMultiInject, targetType, serviceIdentifier, '', key, value);
|
|
152
157
|
try {
|
|
153
158
|
_createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, null, target);
|
|
154
159
|
return context;
|
|
155
160
|
}
|
|
156
161
|
catch (error) {
|
|
157
|
-
if ((0, exceptions_1.
|
|
162
|
+
if ((0, exceptions_1.isStackOverflowException)(error)) {
|
|
158
163
|
(0, serialization_1.circularDependencyToException)(context.plan.rootRequest);
|
|
159
164
|
}
|
|
160
165
|
throw error;
|
|
161
166
|
}
|
|
162
167
|
}
|
|
163
|
-
exports.plan = plan;
|
|
164
168
|
function createMockRequest(container, serviceIdentifier, key, value) {
|
|
165
|
-
const target = new target_1.Target(literal_types_1.TargetTypeEnum.Variable,
|
|
169
|
+
const target = new target_1.Target(literal_types_1.TargetTypeEnum.Variable, '', serviceIdentifier, new metadata_1.Metadata(key, value));
|
|
166
170
|
const context = new context_1.Context(container);
|
|
167
171
|
const request = new request_1.Request(serviceIdentifier, context, null, [], target);
|
|
168
172
|
return request;
|
|
169
173
|
}
|
|
170
|
-
exports.createMockRequest = createMockRequest;
|
|
171
|
-
//# sourceMappingURL=planner.js.map
|
|
@@ -9,9 +9,9 @@ class QueryableString {
|
|
|
9
9
|
return this.str.indexOf(searchString) === 0;
|
|
10
10
|
}
|
|
11
11
|
endsWith(searchString) {
|
|
12
|
-
let reverseString =
|
|
13
|
-
const reverseSearchString = searchString.split(
|
|
14
|
-
reverseString = this.str.split(
|
|
12
|
+
let reverseString = '';
|
|
13
|
+
const reverseSearchString = searchString.split('').reverse().join('');
|
|
14
|
+
reverseString = this.str.split('').reverse().join('');
|
|
15
15
|
return this.startsWith.call({ str: reverseString }, reverseSearchString);
|
|
16
16
|
}
|
|
17
17
|
contains(searchString) {
|
|
@@ -25,4 +25,3 @@ class QueryableString {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
exports.QueryableString = QueryableString;
|
|
28
|
-
//# sourceMappingURL=queryable_string.js.map
|