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
|
@@ -19,12 +19,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g =
|
|
22
|
+
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);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
24
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
25
|
function step(op) {
|
|
26
26
|
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
28
|
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;
|
|
29
29
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
30
|
switch (op[0]) {
|
|
@@ -54,25 +54,25 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
54
54
|
}
|
|
55
55
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
56
|
};
|
|
57
|
-
import { Binding } from
|
|
58
|
-
import * as ERROR_MSGS from
|
|
59
|
-
import { BindingScopeEnum, TargetTypeEnum } from
|
|
60
|
-
import * as METADATA_KEY from
|
|
61
|
-
import { MetadataReader } from
|
|
62
|
-
import { createMockRequest, getBindingDictionary, plan } from
|
|
63
|
-
import { resolve } from
|
|
64
|
-
import { BindingToSyntax } from
|
|
65
|
-
import { isPromise, isPromiseOrContainsPromise } from
|
|
66
|
-
import { id } from
|
|
67
|
-
import { getServiceIdentifierAsString } from
|
|
68
|
-
import { ContainerSnapshot } from
|
|
69
|
-
import { Lookup } from
|
|
70
|
-
import { ModuleActivationStore } from
|
|
57
|
+
import { Binding } from '../bindings/binding';
|
|
58
|
+
import * as ERROR_MSGS from '../constants/error_msgs';
|
|
59
|
+
import { BindingScopeEnum, TargetTypeEnum } from '../constants/literal_types';
|
|
60
|
+
import * as METADATA_KEY from '../constants/metadata_keys';
|
|
61
|
+
import { MetadataReader } from '../planning/metadata_reader';
|
|
62
|
+
import { createMockRequest, getBindingDictionary, plan } from '../planning/planner';
|
|
63
|
+
import { resolve } from '../resolution/resolver';
|
|
64
|
+
import { BindingToSyntax } from '../syntax/binding_to_syntax';
|
|
65
|
+
import { isPromise, isPromiseOrContainsPromise } from '../utils/async';
|
|
66
|
+
import { id } from '../utils/id';
|
|
67
|
+
import { getServiceIdentifierAsString } from '../utils/serialization';
|
|
68
|
+
import { ContainerSnapshot } from './container_snapshot';
|
|
69
|
+
import { Lookup } from './lookup';
|
|
70
|
+
import { ModuleActivationStore } from './module_activation_store';
|
|
71
71
|
var Container = (function () {
|
|
72
72
|
function Container(containerOptions) {
|
|
73
73
|
var options = containerOptions || {};
|
|
74
|
-
if (typeof options !==
|
|
75
|
-
throw new Error(""
|
|
74
|
+
if (typeof options !== 'object') {
|
|
75
|
+
throw new Error("".concat(ERROR_MSGS.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT));
|
|
76
76
|
}
|
|
77
77
|
if (options.defaultScope === undefined) {
|
|
78
78
|
options.defaultScope = BindingScopeEnum.Transient;
|
|
@@ -80,19 +80,19 @@ var Container = (function () {
|
|
|
80
80
|
else if (options.defaultScope !== BindingScopeEnum.Singleton &&
|
|
81
81
|
options.defaultScope !== BindingScopeEnum.Transient &&
|
|
82
82
|
options.defaultScope !== BindingScopeEnum.Request) {
|
|
83
|
-
throw new Error(""
|
|
83
|
+
throw new Error("".concat(ERROR_MSGS.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE));
|
|
84
84
|
}
|
|
85
85
|
if (options.autoBindInjectable === undefined) {
|
|
86
86
|
options.autoBindInjectable = false;
|
|
87
87
|
}
|
|
88
|
-
else if (typeof options.autoBindInjectable !==
|
|
89
|
-
throw new Error(""
|
|
88
|
+
else if (typeof options.autoBindInjectable !== 'boolean') {
|
|
89
|
+
throw new Error("".concat(ERROR_MSGS.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE));
|
|
90
90
|
}
|
|
91
91
|
if (options.skipBaseClassChecks === undefined) {
|
|
92
92
|
options.skipBaseClassChecks = false;
|
|
93
93
|
}
|
|
94
|
-
else if (typeof options.skipBaseClassChecks !==
|
|
95
|
-
throw new Error(""
|
|
94
|
+
else if (typeof options.skipBaseClassChecks !== 'boolean') {
|
|
95
|
+
throw new Error("".concat(ERROR_MSGS.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK));
|
|
96
96
|
}
|
|
97
97
|
this.options = {
|
|
98
98
|
autoBindInjectable: options.autoBindInjectable,
|
|
@@ -413,9 +413,10 @@ var Container = (function () {
|
|
|
413
413
|
return resolved;
|
|
414
414
|
};
|
|
415
415
|
Container.prototype._preDestroy = function (constructor, instance) {
|
|
416
|
+
var _a, _b;
|
|
416
417
|
if (Reflect.hasMetadata(METADATA_KEY.PRE_DESTROY, constructor)) {
|
|
417
418
|
var data = Reflect.getMetadata(METADATA_KEY.PRE_DESTROY, constructor);
|
|
418
|
-
return instance[data.value]();
|
|
419
|
+
return (_b = (_a = instance)[data.value]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
419
420
|
}
|
|
420
421
|
};
|
|
421
422
|
Container.prototype._removeModuleHandlers = function (moduleId) {
|
|
@@ -442,7 +443,9 @@ var Container = (function () {
|
|
|
442
443
|
}
|
|
443
444
|
}
|
|
444
445
|
catch (ex) {
|
|
445
|
-
|
|
446
|
+
if (ex instanceof Error) {
|
|
447
|
+
throw new Error(ERROR_MSGS.ON_DEACTIVATION_ERROR(constructor.name, ex.message));
|
|
448
|
+
}
|
|
446
449
|
}
|
|
447
450
|
};
|
|
448
451
|
Container.prototype._handleDeactivationError = function (asyncResult, constructor) {
|
|
@@ -458,7 +461,10 @@ var Container = (function () {
|
|
|
458
461
|
return [3, 3];
|
|
459
462
|
case 2:
|
|
460
463
|
ex_1 = _a.sent();
|
|
461
|
-
|
|
464
|
+
if (ex_1 instanceof Error) {
|
|
465
|
+
throw new Error(ERROR_MSGS.ON_DEACTIVATION_ERROR(constructor.name, ex_1.message));
|
|
466
|
+
}
|
|
467
|
+
return [3, 3];
|
|
462
468
|
case 3: return [2];
|
|
463
469
|
}
|
|
464
470
|
});
|
|
@@ -665,12 +671,12 @@ var Container = (function () {
|
|
|
665
671
|
this._bindingDictionary.remove(serviceIdentifier);
|
|
666
672
|
}
|
|
667
673
|
catch (e) {
|
|
668
|
-
throw new Error(ERROR_MSGS.CANNOT_UNBIND
|
|
674
|
+
throw new Error("".concat(ERROR_MSGS.CANNOT_UNBIND, " ").concat(getServiceIdentifierAsString(serviceIdentifier)));
|
|
669
675
|
}
|
|
670
676
|
};
|
|
671
677
|
Container.prototype._bindingDeactivationAndPreDestroy = function (binding, instance, constructor) {
|
|
672
678
|
var _this = this;
|
|
673
|
-
if (typeof binding.onDeactivation ===
|
|
679
|
+
if (typeof binding.onDeactivation === 'function') {
|
|
674
680
|
var result = binding.onDeactivation(instance);
|
|
675
681
|
if (isPromise(result)) {
|
|
676
682
|
return result.then(function () { return _this._preDestroy(constructor, instance); });
|
|
@@ -683,7 +689,7 @@ var Container = (function () {
|
|
|
683
689
|
return __generator(this, function (_a) {
|
|
684
690
|
switch (_a.label) {
|
|
685
691
|
case 0:
|
|
686
|
-
if (!(typeof binding.onDeactivation ===
|
|
692
|
+
if (!(typeof binding.onDeactivation === 'function')) return [3, 2];
|
|
687
693
|
return [4, binding.onDeactivation(instance)];
|
|
688
694
|
case 1:
|
|
689
695
|
_a.sent();
|
|
@@ -699,4 +705,3 @@ var Container = (function () {
|
|
|
699
705
|
return Container;
|
|
700
706
|
}());
|
|
701
707
|
export { Container };
|
|
702
|
-
//# sourceMappingURL=container.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { id } from
|
|
1
|
+
import { id } from '../utils/id';
|
|
2
2
|
var ContainerModule = (function () {
|
|
3
3
|
function ContainerModule(registry) {
|
|
4
4
|
this.id = id();
|
|
@@ -15,4 +15,3 @@ var AsyncContainerModule = (function () {
|
|
|
15
15
|
return AsyncContainerModule;
|
|
16
16
|
}());
|
|
17
17
|
export { AsyncContainerModule };
|
|
18
|
-
//# sourceMappingURL=container_module.js.map
|
package/es/container/lookup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as ERROR_MSGS from
|
|
2
|
-
import { isClonable } from
|
|
1
|
+
import * as ERROR_MSGS from '../constants/error_msgs';
|
|
2
|
+
import { isClonable } from '../utils/clonable';
|
|
3
3
|
var Lookup = (function () {
|
|
4
4
|
function Lookup() {
|
|
5
5
|
this._map = new Map();
|
|
@@ -102,4 +102,3 @@ var Lookup = (function () {
|
|
|
102
102
|
return Lookup;
|
|
103
103
|
}());
|
|
104
104
|
export { Lookup };
|
|
105
|
-
//# sourceMappingURL=lookup.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Lookup } from
|
|
1
|
+
import { Lookup } from './lookup';
|
|
2
2
|
var ModuleActivationStore = (function () {
|
|
3
3
|
function ModuleActivationStore() {
|
|
4
4
|
this._map = new Map();
|
|
@@ -47,4 +47,3 @@ var ModuleActivationStore = (function () {
|
|
|
47
47
|
return ModuleActivationStore;
|
|
48
48
|
}());
|
|
49
49
|
export { ModuleActivationStore };
|
|
50
|
-
//# sourceMappingURL=module_activation_store.js.map
|
package/es/inversify.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import * as keys from
|
|
1
|
+
import * as keys from './constants/metadata_keys';
|
|
2
2
|
export var METADATA_KEY = keys;
|
|
3
|
-
export { Container } from
|
|
4
|
-
export { BindingScopeEnum, BindingTypeEnum, TargetTypeEnum } from
|
|
5
|
-
export { AsyncContainerModule, ContainerModule } from
|
|
6
|
-
export { createTaggedDecorator } from
|
|
7
|
-
export { injectable } from
|
|
8
|
-
export { tagged } from
|
|
9
|
-
export { named } from
|
|
10
|
-
export { inject } from
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
|
|
3
|
+
export { Container } from './container/container';
|
|
4
|
+
export { BindingScopeEnum, BindingTypeEnum, TargetTypeEnum } from './constants/literal_types';
|
|
5
|
+
export { AsyncContainerModule, ContainerModule } from './container/container_module';
|
|
6
|
+
export { createTaggedDecorator } from './annotation/decorator_utils';
|
|
7
|
+
export { injectable } from './annotation/injectable';
|
|
8
|
+
export { tagged } from './annotation/tagged';
|
|
9
|
+
export { named } from './annotation/named';
|
|
10
|
+
export { inject } from './annotation/inject';
|
|
11
|
+
export { LazyServiceIdentifier } from './annotation/lazy_service_identifier';
|
|
12
|
+
export { LazyServiceIdentifier as LazyServiceIdentifer } from './annotation/lazy_service_identifier';
|
|
13
|
+
export { optional } from './annotation/optional';
|
|
14
|
+
export { unmanaged } from './annotation/unmanaged';
|
|
15
|
+
export { multiInject } from './annotation/multi_inject';
|
|
16
|
+
export { targetName } from './annotation/target_name';
|
|
17
|
+
export { postConstruct } from './annotation/post_construct';
|
|
18
|
+
export { preDestroy } from './annotation/pre_destroy';
|
|
19
|
+
export { MetadataReader } from './planning/metadata_reader';
|
|
20
|
+
export { id } from './utils/id';
|
|
21
|
+
export { interfaces } from './interfaces/interfaces';
|
|
22
|
+
export { decorate } from './annotation/decorator_utils';
|
|
23
|
+
export { traverseAncerstors, taggedConstraint, namedConstraint, typeConstraint } from './syntax/constraint_helpers';
|
|
24
|
+
export { getServiceIdentifierAsString } from './utils/serialization';
|
|
25
|
+
export { multiBindToService } from './utils/binding_utils';
|
package/es/planning/context.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { id } from
|
|
1
|
+
import { id } from '../utils/id';
|
|
2
2
|
var Context = (function () {
|
|
3
3
|
function Context(container) {
|
|
4
4
|
this.id = id();
|
|
@@ -13,4 +13,3 @@ var Context = (function () {
|
|
|
13
13
|
return Context;
|
|
14
14
|
}());
|
|
15
15
|
export { Context };
|
|
16
|
-
//# sourceMappingURL=context.js.map
|
package/es/planning/metadata.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as METADATA_KEY from
|
|
1
|
+
import * as METADATA_KEY from '../constants/metadata_keys';
|
|
2
2
|
var Metadata = (function () {
|
|
3
3
|
function Metadata(key, value) {
|
|
4
4
|
this.key = key;
|
|
@@ -6,13 +6,12 @@ var Metadata = (function () {
|
|
|
6
6
|
}
|
|
7
7
|
Metadata.prototype.toString = function () {
|
|
8
8
|
if (this.key === METADATA_KEY.NAMED_TAG) {
|
|
9
|
-
return "named: "
|
|
9
|
+
return "named: ".concat(String(this.value).toString(), " ");
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
return "tagged: { key:"
|
|
12
|
+
return "tagged: { key:".concat(this.key.toString(), ", value: ").concat(String(this.value), " }");
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
return Metadata;
|
|
16
16
|
}());
|
|
17
17
|
export { Metadata };
|
|
18
|
-
//# sourceMappingURL=metadata.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as METADATA_KEY from
|
|
1
|
+
import * as METADATA_KEY from '../constants/metadata_keys';
|
|
2
2
|
var MetadataReader = (function () {
|
|
3
3
|
function MetadataReader() {
|
|
4
4
|
}
|
|
@@ -17,4 +17,3 @@ var MetadataReader = (function () {
|
|
|
17
17
|
return MetadataReader;
|
|
18
18
|
}());
|
|
19
19
|
export { MetadataReader };
|
|
20
|
-
//# sourceMappingURL=metadata_reader.js.map
|
package/es/planning/plan.js
CHANGED
package/es/planning/planner.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { BindingCount } from
|
|
2
|
-
import * as ERROR_MSGS from
|
|
3
|
-
import { BindingTypeEnum, TargetTypeEnum } from
|
|
4
|
-
import * as METADATA_KEY from
|
|
5
|
-
import {
|
|
6
|
-
import { circularDependencyToException, getServiceIdentifierAsString, listMetadataForTarget, listRegisteredBindingsForServiceIdentifier } from
|
|
7
|
-
import { Context } from
|
|
8
|
-
import { Metadata } from
|
|
9
|
-
import { Plan } from
|
|
10
|
-
import { getBaseClassDependencyCount, getDependencies, getFunctionName } from
|
|
11
|
-
import { Request } from
|
|
12
|
-
import { Target } from
|
|
1
|
+
import { BindingCount } from '../bindings/binding_count';
|
|
2
|
+
import * as ERROR_MSGS from '../constants/error_msgs';
|
|
3
|
+
import { BindingTypeEnum, TargetTypeEnum } from '../constants/literal_types';
|
|
4
|
+
import * as METADATA_KEY from '../constants/metadata_keys';
|
|
5
|
+
import { isStackOverflowException } from '../utils/exceptions';
|
|
6
|
+
import { circularDependencyToException, getServiceIdentifierAsString, listMetadataForTarget, listRegisteredBindingsForServiceIdentifier } from '../utils/serialization';
|
|
7
|
+
import { Context } from './context';
|
|
8
|
+
import { Metadata } from './metadata';
|
|
9
|
+
import { Plan } from './plan';
|
|
10
|
+
import { getBaseClassDependencyCount, getDependencies, getFunctionName } from './reflection_utils';
|
|
11
|
+
import { Request } from './request';
|
|
12
|
+
import { Target } from './target';
|
|
13
13
|
function getBindingDictionary(cntnr) {
|
|
14
14
|
return cntnr._bindingDictionary;
|
|
15
15
|
}
|
|
@@ -28,7 +28,7 @@ function _getActiveBindings(metadataReader, avoidConstraints, context, parentReq
|
|
|
28
28
|
var activeBindings = [];
|
|
29
29
|
if (bindings.length === BindingCount.NoBindingsAvailable &&
|
|
30
30
|
context.container.options.autoBindInjectable &&
|
|
31
|
-
typeof target.serviceIdentifier ===
|
|
31
|
+
typeof target.serviceIdentifier === 'function' &&
|
|
32
32
|
metadataReader.getConstructorMetadata(target.serviceIdentifier).compilerGeneratedMetadata) {
|
|
33
33
|
context.container.bind(target.serviceIdentifier).toSelf();
|
|
34
34
|
bindings = getBindings(context.container, target.serviceIdentifier);
|
|
@@ -64,7 +64,7 @@ function _validateActiveBindingCount(serviceIdentifier, bindings, target, contai
|
|
|
64
64
|
default:
|
|
65
65
|
if (!target.isArray()) {
|
|
66
66
|
var serviceIdentifierString = getServiceIdentifierAsString(serviceIdentifier);
|
|
67
|
-
var msg = ERROR_MSGS.AMBIGUOUS_MATCH
|
|
67
|
+
var msg = "".concat(ERROR_MSGS.AMBIGUOUS_MATCH, " ").concat(serviceIdentifierString);
|
|
68
68
|
msg += listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings);
|
|
69
69
|
throw new Error(msg);
|
|
70
70
|
}
|
|
@@ -126,23 +126,22 @@ function getBindings(container, serviceIdentifier) {
|
|
|
126
126
|
function plan(metadataReader, container, isMultiInject, targetType, serviceIdentifier, key, value, avoidConstraints) {
|
|
127
127
|
if (avoidConstraints === void 0) { avoidConstraints = false; }
|
|
128
128
|
var context = new Context(container);
|
|
129
|
-
var target = _createTarget(isMultiInject, targetType, serviceIdentifier,
|
|
129
|
+
var target = _createTarget(isMultiInject, targetType, serviceIdentifier, '', key, value);
|
|
130
130
|
try {
|
|
131
131
|
_createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, null, target);
|
|
132
132
|
return context;
|
|
133
133
|
}
|
|
134
134
|
catch (error) {
|
|
135
|
-
if (
|
|
135
|
+
if (isStackOverflowException(error)) {
|
|
136
136
|
circularDependencyToException(context.plan.rootRequest);
|
|
137
137
|
}
|
|
138
138
|
throw error;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
function createMockRequest(container, serviceIdentifier, key, value) {
|
|
142
|
-
var target = new Target(TargetTypeEnum.Variable,
|
|
142
|
+
var target = new Target(TargetTypeEnum.Variable, '', serviceIdentifier, new Metadata(key, value));
|
|
143
143
|
var context = new Context(container);
|
|
144
144
|
var request = new Request(serviceIdentifier, context, null, [], target);
|
|
145
145
|
return request;
|
|
146
146
|
}
|
|
147
147
|
export { plan, createMockRequest, getBindingDictionary };
|
|
148
|
-
//# sourceMappingURL=planner.js.map
|
|
@@ -6,9 +6,9 @@ var QueryableString = (function () {
|
|
|
6
6
|
return this.str.indexOf(searchString) === 0;
|
|
7
7
|
};
|
|
8
8
|
QueryableString.prototype.endsWith = function (searchString) {
|
|
9
|
-
var reverseString =
|
|
10
|
-
var reverseSearchString = searchString.split(
|
|
11
|
-
reverseString = this.str.split(
|
|
9
|
+
var reverseString = '';
|
|
10
|
+
var reverseSearchString = searchString.split('').reverse().join('');
|
|
11
|
+
reverseString = this.str.split('').reverse().join('');
|
|
12
12
|
return this.startsWith.call({ str: reverseString }, reverseSearchString);
|
|
13
13
|
};
|
|
14
14
|
QueryableString.prototype.contains = function (searchString) {
|
|
@@ -23,4 +23,3 @@ var QueryableString = (function () {
|
|
|
23
23
|
return QueryableString;
|
|
24
24
|
}());
|
|
25
25
|
export { QueryableString };
|
|
26
|
-
//# sourceMappingURL=queryable_string.js.map
|
|
@@ -7,12 +7,12 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
7
7
|
}
|
|
8
8
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
11
|
-
import * as ERROR_MSGS from
|
|
12
|
-
import { TargetTypeEnum } from
|
|
13
|
-
import * as METADATA_KEY from
|
|
14
|
-
import { getFunctionName } from
|
|
15
|
-
import { Target } from
|
|
10
|
+
import { LazyServiceIdentifier } from '../annotation/lazy_service_identifier';
|
|
11
|
+
import * as ERROR_MSGS from '../constants/error_msgs';
|
|
12
|
+
import { TargetTypeEnum } from '../constants/literal_types';
|
|
13
|
+
import * as METADATA_KEY from '../constants/metadata_keys';
|
|
14
|
+
import { getFunctionName } from '../utils/serialization';
|
|
15
|
+
import { Target } from './target';
|
|
16
16
|
function getDependencies(metadataReader, func) {
|
|
17
17
|
var constructorName = getFunctionName(func);
|
|
18
18
|
return getTargets(metadataReader, constructorName, func, false);
|
|
@@ -21,7 +21,7 @@ function getTargets(metadataReader, constructorName, func, isBaseClass) {
|
|
|
21
21
|
var metadata = metadataReader.getConstructorMetadata(func);
|
|
22
22
|
var serviceIdentifiers = metadata.compilerGeneratedMetadata;
|
|
23
23
|
if (serviceIdentifiers === undefined) {
|
|
24
|
-
var msg = ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION
|
|
24
|
+
var msg = "".concat(ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION, " ").concat(constructorName, ".");
|
|
25
25
|
throw new Error(msg);
|
|
26
26
|
}
|
|
27
27
|
var constructorArgsMetadata = metadata.userGeneratedMetadata;
|
|
@@ -39,18 +39,18 @@ function getConstructorArgsAsTarget(index, isBaseClass, constructorName, service
|
|
|
39
39
|
var metadata = formatTargetMetadata(targetMetadata);
|
|
40
40
|
var isManaged = metadata.unmanaged !== true;
|
|
41
41
|
var serviceIdentifier = serviceIdentifiers[index];
|
|
42
|
-
var injectIdentifier =
|
|
43
|
-
serviceIdentifier = (injectIdentifier
|
|
44
|
-
if (serviceIdentifier instanceof
|
|
42
|
+
var injectIdentifier = metadata.inject || metadata.multiInject;
|
|
43
|
+
serviceIdentifier = (injectIdentifier ? injectIdentifier : serviceIdentifier);
|
|
44
|
+
if (serviceIdentifier instanceof LazyServiceIdentifier) {
|
|
45
45
|
serviceIdentifier = serviceIdentifier.unwrap();
|
|
46
46
|
}
|
|
47
47
|
if (isManaged) {
|
|
48
48
|
var isObject = serviceIdentifier === Object;
|
|
49
49
|
var isFunction = serviceIdentifier === Function;
|
|
50
50
|
var isUndefined = serviceIdentifier === undefined;
|
|
51
|
-
var isUnknownType =
|
|
51
|
+
var isUnknownType = isObject || isFunction || isUndefined;
|
|
52
52
|
if (!isBaseClass && isUnknownType) {
|
|
53
|
-
var msg = ERROR_MSGS.MISSING_INJECT_ANNOTATION
|
|
53
|
+
var msg = "".concat(ERROR_MSGS.MISSING_INJECT_ANNOTATION, " argument ").concat(index, " in class ").concat(constructorName, ".");
|
|
54
54
|
throw new Error(msg);
|
|
55
55
|
}
|
|
56
56
|
var target = new Target(TargetTypeEnum.ConstructorArgument, metadata.targetName, serviceIdentifier);
|
|
@@ -73,7 +73,7 @@ function getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdenti
|
|
|
73
73
|
function _getServiceIdentifierForProperty(inject, multiInject, propertyName, className) {
|
|
74
74
|
var serviceIdentifier = (inject || multiInject);
|
|
75
75
|
if (serviceIdentifier === undefined) {
|
|
76
|
-
var msg = ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION
|
|
76
|
+
var msg = "".concat(ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION, " for property ").concat(String(propertyName), " in class ").concat(className, ".");
|
|
77
77
|
throw new Error(msg);
|
|
78
78
|
}
|
|
79
79
|
return serviceIdentifier;
|
|
@@ -133,4 +133,3 @@ function formatTargetMetadata(targetMetadata) {
|
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
export { getDependencies, getBaseClassDependencyCount, getFunctionName };
|
|
136
|
-
//# sourceMappingURL=reflection_utils.js.map
|
package/es/planning/request.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { id } from
|
|
1
|
+
import { id } from '../utils/id';
|
|
2
2
|
var Request = (function () {
|
|
3
3
|
function Request(serviceIdentifier, parentContext, parentRequest, bindings, target) {
|
|
4
4
|
this.id = id();
|
|
@@ -20,4 +20,3 @@ var Request = (function () {
|
|
|
20
20
|
return Request;
|
|
21
21
|
}());
|
|
22
22
|
export { Request };
|
|
23
|
-
//# sourceMappingURL=request.js.map
|
package/es/planning/target.js
CHANGED
|
@@ -9,7 +9,7 @@ var Target = (function () {
|
|
|
9
9
|
this.type = type;
|
|
10
10
|
this.serviceIdentifier = serviceIdentifier;
|
|
11
11
|
var queryableName = typeof identifier === 'symbol' ? getSymbolDescription(identifier) : identifier;
|
|
12
|
-
this.name = new QueryableString(queryableName ||
|
|
12
|
+
this.name = new QueryableString(queryableName || '');
|
|
13
13
|
this.identifier = identifier;
|
|
14
14
|
this.metadata = new Array();
|
|
15
15
|
var metadataItem = null;
|
|
@@ -79,4 +79,3 @@ var Target = (function () {
|
|
|
79
79
|
return Target;
|
|
80
80
|
}());
|
|
81
81
|
export { Target };
|
|
82
|
-
//# sourceMappingURL=target.js.map
|
|
@@ -19,12 +19,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g =
|
|
22
|
+
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);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
24
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
25
|
function step(op) {
|
|
26
26
|
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
28
|
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;
|
|
29
29
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
30
|
switch (op[0]) {
|
|
@@ -54,10 +54,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
54
54
|
}
|
|
55
55
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
56
|
};
|
|
57
|
-
import { ON_DEACTIVATION_ERROR, POST_CONSTRUCT_ERROR, PRE_DESTROY_ERROR } from
|
|
58
|
-
import { BindingScopeEnum, TargetTypeEnum } from
|
|
59
|
-
import * as METADATA_KEY from
|
|
60
|
-
import { isPromise, isPromiseOrContainsPromise } from
|
|
57
|
+
import { ON_DEACTIVATION_ERROR, POST_CONSTRUCT_ERROR, PRE_DESTROY_ERROR } from '../constants/error_msgs';
|
|
58
|
+
import { BindingScopeEnum, TargetTypeEnum } from '../constants/literal_types';
|
|
59
|
+
import * as METADATA_KEY from '../constants/metadata_keys';
|
|
60
|
+
import { isPromise, isPromiseOrContainsPromise } from '../utils/async';
|
|
61
61
|
function _resolveRequests(childRequests, resolveRequest) {
|
|
62
62
|
return childRequests.reduce(function (resolvedRequests, childRequest) {
|
|
63
63
|
var injection = resolveRequest(childRequest);
|
|
@@ -98,7 +98,9 @@ function createInstanceWithInjections(args) {
|
|
|
98
98
|
args.propertyRequests.forEach(function (r, index) {
|
|
99
99
|
var property = r.target.identifier;
|
|
100
100
|
var injection = args.propertyInjections[index];
|
|
101
|
-
|
|
101
|
+
if (!r.target.isOptional() || injection !== undefined) {
|
|
102
|
+
instance[property] = injection;
|
|
103
|
+
}
|
|
102
104
|
});
|
|
103
105
|
return instance;
|
|
104
106
|
}
|
|
@@ -153,7 +155,9 @@ function _postConstruct(constr, instance) {
|
|
|
153
155
|
return (_b = (_a = instance)[data.value]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
154
156
|
}
|
|
155
157
|
catch (e) {
|
|
156
|
-
|
|
158
|
+
if (e instanceof Error) {
|
|
159
|
+
throw new Error(POST_CONSTRUCT_ERROR(constr.name, e.message));
|
|
160
|
+
}
|
|
157
161
|
}
|
|
158
162
|
}
|
|
159
163
|
}
|
|
@@ -163,10 +167,10 @@ function _validateInstanceResolution(binding, constr) {
|
|
|
163
167
|
}
|
|
164
168
|
}
|
|
165
169
|
function _throwIfHandlingDeactivation(binding, constr) {
|
|
166
|
-
var scopeErrorMessage = "Class cannot be instantiated in "
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
if (typeof binding.onDeactivation ===
|
|
170
|
+
var scopeErrorMessage = "Class cannot be instantiated in ".concat(binding.scope === BindingScopeEnum.Request ?
|
|
171
|
+
'request' :
|
|
172
|
+
'transient', " scope.");
|
|
173
|
+
if (typeof binding.onDeactivation === 'function') {
|
|
170
174
|
throw new Error(ON_DEACTIVATION_ERROR(constr.name, scopeErrorMessage));
|
|
171
175
|
}
|
|
172
176
|
if (Reflect.hasMetadata(METADATA_KEY.PRE_DESTROY, constr)) {
|
|
@@ -184,4 +188,3 @@ function resolveInstance(binding, constr, childRequests, resolveRequest) {
|
|
|
184
188
|
}
|
|
185
189
|
}
|
|
186
190
|
export { resolveInstance };
|
|
187
|
-
//# sourceMappingURL=instantiation.js.map
|
|
@@ -8,12 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g =
|
|
11
|
+
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);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
17
|
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;
|
|
18
18
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
19
|
switch (op[0]) {
|
|
@@ -34,14 +34,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
import * as ERROR_MSGS from
|
|
38
|
-
import { BindingTypeEnum } from
|
|
39
|
-
import { getBindingDictionary } from
|
|
40
|
-
import { saveToScope, tryGetFromScope } from
|
|
41
|
-
import { isPromise } from
|
|
42
|
-
import { getFactoryDetails, ensureFullyBound } from
|
|
43
|
-
import { tryAndThrowErrorIfStackOverflow } from
|
|
44
|
-
import { resolveInstance } from
|
|
37
|
+
import * as ERROR_MSGS from '../constants/error_msgs';
|
|
38
|
+
import { BindingTypeEnum } from '../constants/literal_types';
|
|
39
|
+
import { getBindingDictionary } from '../planning/planner';
|
|
40
|
+
import { saveToScope, tryGetFromScope } from '../scope/scope';
|
|
41
|
+
import { isPromise } from '../utils/async';
|
|
42
|
+
import { getFactoryDetails, ensureFullyBound } from '../utils/binding_utils';
|
|
43
|
+
import { tryAndThrowErrorIfStackOverflow } from '../utils/exceptions';
|
|
44
|
+
import { resolveInstance } from './instantiation';
|
|
45
45
|
var _resolveRequest = function (requestScope) {
|
|
46
46
|
return function (request) {
|
|
47
47
|
request.parentContext.setCurrentRequest(request);
|
|
@@ -134,7 +134,7 @@ function _onActivation(request, binding, resolved) {
|
|
|
134
134
|
}
|
|
135
135
|
var _bindingActivation = function (context, binding, previousResult) {
|
|
136
136
|
var result;
|
|
137
|
-
if (typeof binding.onActivation ===
|
|
137
|
+
if (typeof binding.onActivation === 'function') {
|
|
138
138
|
result = binding.onActivation(context, previousResult);
|
|
139
139
|
}
|
|
140
140
|
else {
|
|
@@ -203,4 +203,3 @@ function resolve(context) {
|
|
|
203
203
|
return _f(context.plan.rootRequest);
|
|
204
204
|
}
|
|
205
205
|
export { resolve };
|
|
206
|
-
//# sourceMappingURL=resolver.js.map
|