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
package/lib/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
|
var binding_count_1 = require("../bindings/binding_count");
|
|
24
30
|
var ERROR_MSGS = __importStar(require("../constants/error_msgs"));
|
|
25
31
|
var literal_types_1 = require("../constants/literal_types");
|
|
@@ -35,7 +41,6 @@ var 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
|
var metadataKey = isMultiInject ? METADATA_KEY.MULTI_INJECT_TAG : METADATA_KEY.INJECT_TAG;
|
|
41
46
|
var injectMetadata = new metadata_1.Metadata(metadataKey, serviceIdentifier);
|
|
@@ -51,7 +56,7 @@ function _getActiveBindings(metadataReader, avoidConstraints, context, parentReq
|
|
|
51
56
|
var 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);
|
|
@@ -87,7 +92,7 @@ function _validateActiveBindingCount(serviceIdentifier, bindings, target, contai
|
|
|
87
92
|
default:
|
|
88
93
|
if (!target.isArray()) {
|
|
89
94
|
var serviceIdentifierString = (0, serialization_1.getServiceIdentifierAsString)(serviceIdentifier);
|
|
90
|
-
var msg = ERROR_MSGS.AMBIGUOUS_MATCH
|
|
95
|
+
var msg = "".concat(ERROR_MSGS.AMBIGUOUS_MATCH, " ").concat(serviceIdentifierString);
|
|
91
96
|
msg += (0, serialization_1.listRegisteredBindingsForServiceIdentifier)(container, serviceIdentifierString, getBindings);
|
|
92
97
|
throw new Error(msg);
|
|
93
98
|
}
|
|
@@ -149,24 +154,21 @@ function getBindings(container, serviceIdentifier) {
|
|
|
149
154
|
function plan(metadataReader, container, isMultiInject, targetType, serviceIdentifier, key, value, avoidConstraints) {
|
|
150
155
|
if (avoidConstraints === void 0) { avoidConstraints = false; }
|
|
151
156
|
var context = new context_1.Context(container);
|
|
152
|
-
var target = _createTarget(isMultiInject, targetType, serviceIdentifier,
|
|
157
|
+
var target = _createTarget(isMultiInject, targetType, serviceIdentifier, '', key, value);
|
|
153
158
|
try {
|
|
154
159
|
_createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, null, target);
|
|
155
160
|
return context;
|
|
156
161
|
}
|
|
157
162
|
catch (error) {
|
|
158
|
-
if ((0, exceptions_1.
|
|
163
|
+
if ((0, exceptions_1.isStackOverflowException)(error)) {
|
|
159
164
|
(0, serialization_1.circularDependencyToException)(context.plan.rootRequest);
|
|
160
165
|
}
|
|
161
166
|
throw error;
|
|
162
167
|
}
|
|
163
168
|
}
|
|
164
|
-
exports.plan = plan;
|
|
165
169
|
function createMockRequest(container, serviceIdentifier, key, value) {
|
|
166
|
-
var target = new target_1.Target(literal_types_1.TargetTypeEnum.Variable,
|
|
170
|
+
var target = new target_1.Target(literal_types_1.TargetTypeEnum.Variable, '', serviceIdentifier, new metadata_1.Metadata(key, value));
|
|
167
171
|
var context = new context_1.Context(container);
|
|
168
172
|
var request = new request_1.Request(serviceIdentifier, context, null, [], target);
|
|
169
173
|
return request;
|
|
170
174
|
}
|
|
171
|
-
exports.createMockRequest = createMockRequest;
|
|
172
|
-
//# sourceMappingURL=planner.js.map
|
|
@@ -9,9 +9,9 @@ var QueryableString = (function () {
|
|
|
9
9
|
return this.str.indexOf(searchString) === 0;
|
|
10
10
|
};
|
|
11
11
|
QueryableString.prototype.endsWith = function (searchString) {
|
|
12
|
-
var reverseString =
|
|
13
|
-
var reverseSearchString = searchString.split(
|
|
14
|
-
reverseString = this.str.split(
|
|
12
|
+
var reverseString = '';
|
|
13
|
+
var 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
|
QueryableString.prototype.contains = function (searchString) {
|
|
@@ -26,4 +26,3 @@ var QueryableString = (function () {
|
|
|
26
26
|
return QueryableString;
|
|
27
27
|
}());
|
|
28
28
|
exports.QueryableString = QueryableString;
|
|
29
|
-
//# sourceMappingURL=queryable_string.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { interfaces } from
|
|
2
|
-
import { getFunctionName } from
|
|
1
|
+
import { interfaces } from '../interfaces/interfaces';
|
|
2
|
+
import { getFunctionName } from '../utils/serialization';
|
|
3
3
|
declare function getDependencies(metadataReader: interfaces.MetadataReader, func: NewableFunction): interfaces.Target[];
|
|
4
4
|
declare function getBaseClassDependencyCount(metadataReader: interfaces.MetadataReader, func: NewableFunction): number;
|
|
5
5
|
export { getDependencies, getBaseClassDependencyCount, getFunctionName };
|
|
@@ -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];
|
|
@@ -28,7 +32,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
28
32
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
29
33
|
};
|
|
30
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.getFunctionName =
|
|
35
|
+
exports.getFunctionName = void 0;
|
|
36
|
+
exports.getDependencies = getDependencies;
|
|
37
|
+
exports.getBaseClassDependencyCount = getBaseClassDependencyCount;
|
|
32
38
|
var lazy_service_identifier_1 = require("../annotation/lazy_service_identifier");
|
|
33
39
|
var ERROR_MSGS = __importStar(require("../constants/error_msgs"));
|
|
34
40
|
var literal_types_1 = require("../constants/literal_types");
|
|
@@ -40,12 +46,11 @@ function getDependencies(metadataReader, func) {
|
|
|
40
46
|
var constructorName = (0, serialization_1.getFunctionName)(func);
|
|
41
47
|
return getTargets(metadataReader, constructorName, func, false);
|
|
42
48
|
}
|
|
43
|
-
exports.getDependencies = getDependencies;
|
|
44
49
|
function getTargets(metadataReader, constructorName, func, isBaseClass) {
|
|
45
50
|
var metadata = metadataReader.getConstructorMetadata(func);
|
|
46
51
|
var serviceIdentifiers = metadata.compilerGeneratedMetadata;
|
|
47
52
|
if (serviceIdentifiers === undefined) {
|
|
48
|
-
var msg = ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION
|
|
53
|
+
var msg = "".concat(ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION, " ").concat(constructorName, ".");
|
|
49
54
|
throw new Error(msg);
|
|
50
55
|
}
|
|
51
56
|
var constructorArgsMetadata = metadata.userGeneratedMetadata;
|
|
@@ -63,18 +68,18 @@ function getConstructorArgsAsTarget(index, isBaseClass, constructorName, service
|
|
|
63
68
|
var metadata = formatTargetMetadata(targetMetadata);
|
|
64
69
|
var isManaged = metadata.unmanaged !== true;
|
|
65
70
|
var serviceIdentifier = serviceIdentifiers[index];
|
|
66
|
-
var injectIdentifier =
|
|
67
|
-
serviceIdentifier = (injectIdentifier
|
|
68
|
-
if (serviceIdentifier instanceof lazy_service_identifier_1.
|
|
71
|
+
var injectIdentifier = metadata.inject || metadata.multiInject;
|
|
72
|
+
serviceIdentifier = (injectIdentifier ? injectIdentifier : serviceIdentifier);
|
|
73
|
+
if (serviceIdentifier instanceof lazy_service_identifier_1.LazyServiceIdentifier) {
|
|
69
74
|
serviceIdentifier = serviceIdentifier.unwrap();
|
|
70
75
|
}
|
|
71
76
|
if (isManaged) {
|
|
72
77
|
var isObject = serviceIdentifier === Object;
|
|
73
78
|
var isFunction = serviceIdentifier === Function;
|
|
74
79
|
var isUndefined = serviceIdentifier === undefined;
|
|
75
|
-
var isUnknownType =
|
|
80
|
+
var isUnknownType = isObject || isFunction || isUndefined;
|
|
76
81
|
if (!isBaseClass && isUnknownType) {
|
|
77
|
-
var msg = ERROR_MSGS.MISSING_INJECT_ANNOTATION
|
|
82
|
+
var msg = "".concat(ERROR_MSGS.MISSING_INJECT_ANNOTATION, " argument ").concat(index, " in class ").concat(constructorName, ".");
|
|
78
83
|
throw new Error(msg);
|
|
79
84
|
}
|
|
80
85
|
var target = new target_1.Target(literal_types_1.TargetTypeEnum.ConstructorArgument, metadata.targetName, serviceIdentifier);
|
|
@@ -97,7 +102,7 @@ function getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdenti
|
|
|
97
102
|
function _getServiceIdentifierForProperty(inject, multiInject, propertyName, className) {
|
|
98
103
|
var serviceIdentifier = (inject || multiInject);
|
|
99
104
|
if (serviceIdentifier === undefined) {
|
|
100
|
-
var msg = ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION
|
|
105
|
+
var msg = "".concat(ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION, " for property ").concat(String(propertyName), " in class ").concat(className, ".");
|
|
101
106
|
throw new Error(msg);
|
|
102
107
|
}
|
|
103
108
|
return serviceIdentifier;
|
|
@@ -144,7 +149,6 @@ function getBaseClassDependencyCount(metadataReader, func) {
|
|
|
144
149
|
return 0;
|
|
145
150
|
}
|
|
146
151
|
}
|
|
147
|
-
exports.getBaseClassDependencyCount = getBaseClassDependencyCount;
|
|
148
152
|
function formatTargetMetadata(targetMetadata) {
|
|
149
153
|
var targetMetadataMap = {};
|
|
150
154
|
targetMetadata.forEach(function (m) {
|
|
@@ -157,4 +161,3 @@ function formatTargetMetadata(targetMetadata) {
|
|
|
157
161
|
unmanaged: targetMetadataMap[METADATA_KEY.UNMANAGED_TAG]
|
|
158
162
|
};
|
|
159
163
|
}
|
|
160
|
-
//# sourceMappingURL=reflection_utils.js.map
|
package/lib/planning/request.js
CHANGED
package/lib/planning/target.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];
|
|
@@ -31,7 +35,7 @@ var Target = (function () {
|
|
|
31
35
|
this.type = type;
|
|
32
36
|
this.serviceIdentifier = serviceIdentifier;
|
|
33
37
|
var queryableName = typeof identifier === 'symbol' ? (0, serialization_1.getSymbolDescription)(identifier) : identifier;
|
|
34
|
-
this.name = new queryable_string_1.QueryableString(queryableName ||
|
|
38
|
+
this.name = new queryable_string_1.QueryableString(queryableName || '');
|
|
35
39
|
this.identifier = identifier;
|
|
36
40
|
this.metadata = new Array();
|
|
37
41
|
var metadataItem = null;
|
|
@@ -101,4 +105,3 @@ var Target = (function () {
|
|
|
101
105
|
return Target;
|
|
102
106
|
}());
|
|
103
107
|
exports.Target = Target;
|
|
104
|
-
//# sourceMappingURL=target.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { interfaces } from
|
|
1
|
+
import { interfaces } from '../interfaces/interfaces';
|
|
2
2
|
declare function resolveInstance<T>(binding: interfaces.Binding<T>, constr: interfaces.Newable<T>, childRequests: interfaces.Request[], resolveRequest: interfaces.ResolveRequestHandler): T | Promise<T>;
|
|
3
3
|
export { resolveInstance };
|
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -39,12 +43,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
39
43
|
});
|
|
40
44
|
};
|
|
41
45
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
42
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
43
|
-
return g =
|
|
46
|
+
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);
|
|
47
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
44
48
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
49
|
function step(op) {
|
|
46
50
|
if (f) throw new TypeError("Generator is already executing.");
|
|
47
|
-
while (_) try {
|
|
51
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
48
52
|
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;
|
|
49
53
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
50
54
|
switch (op[0]) {
|
|
@@ -75,7 +79,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
75
79
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
76
80
|
};
|
|
77
81
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
|
-
exports.resolveInstance =
|
|
82
|
+
exports.resolveInstance = resolveInstance;
|
|
79
83
|
var error_msgs_1 = require("../constants/error_msgs");
|
|
80
84
|
var literal_types_1 = require("../constants/literal_types");
|
|
81
85
|
var METADATA_KEY = __importStar(require("../constants/metadata_keys"));
|
|
@@ -120,7 +124,9 @@ function createInstanceWithInjections(args) {
|
|
|
120
124
|
args.propertyRequests.forEach(function (r, index) {
|
|
121
125
|
var property = r.target.identifier;
|
|
122
126
|
var injection = args.propertyInjections[index];
|
|
123
|
-
|
|
127
|
+
if (!r.target.isOptional() || injection !== undefined) {
|
|
128
|
+
instance[property] = injection;
|
|
129
|
+
}
|
|
124
130
|
});
|
|
125
131
|
return instance;
|
|
126
132
|
}
|
|
@@ -175,7 +181,9 @@ function _postConstruct(constr, instance) {
|
|
|
175
181
|
return (_b = (_a = instance)[data.value]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
176
182
|
}
|
|
177
183
|
catch (e) {
|
|
178
|
-
|
|
184
|
+
if (e instanceof Error) {
|
|
185
|
+
throw new Error((0, error_msgs_1.POST_CONSTRUCT_ERROR)(constr.name, e.message));
|
|
186
|
+
}
|
|
179
187
|
}
|
|
180
188
|
}
|
|
181
189
|
}
|
|
@@ -185,10 +193,10 @@ function _validateInstanceResolution(binding, constr) {
|
|
|
185
193
|
}
|
|
186
194
|
}
|
|
187
195
|
function _throwIfHandlingDeactivation(binding, constr) {
|
|
188
|
-
var scopeErrorMessage = "Class cannot be instantiated in "
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
if (typeof binding.onDeactivation ===
|
|
196
|
+
var scopeErrorMessage = "Class cannot be instantiated in ".concat(binding.scope === literal_types_1.BindingScopeEnum.Request ?
|
|
197
|
+
'request' :
|
|
198
|
+
'transient', " scope.");
|
|
199
|
+
if (typeof binding.onDeactivation === 'function') {
|
|
192
200
|
throw new Error((0, error_msgs_1.ON_DEACTIVATION_ERROR)(constr.name, scopeErrorMessage));
|
|
193
201
|
}
|
|
194
202
|
if (Reflect.hasMetadata(METADATA_KEY.PRE_DESTROY, constr)) {
|
|
@@ -205,5 +213,3 @@ function resolveInstance(binding, constr, childRequests, resolveRequest) {
|
|
|
205
213
|
return _getInstanceAfterPostConstruct(constr, result);
|
|
206
214
|
}
|
|
207
215
|
}
|
|
208
|
-
exports.resolveInstance = resolveInstance;
|
|
209
|
-
//# sourceMappingURL=instantiation.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];
|
|
@@ -28,12 +32,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
28
32
|
});
|
|
29
33
|
};
|
|
30
34
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
31
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
32
|
-
return g =
|
|
35
|
+
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);
|
|
36
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
33
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
34
38
|
function step(op) {
|
|
35
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
36
|
-
while (_) try {
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
37
41
|
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;
|
|
38
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
39
43
|
switch (op[0]) {
|
|
@@ -55,7 +59,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
55
59
|
}
|
|
56
60
|
};
|
|
57
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
-
exports.resolve =
|
|
62
|
+
exports.resolve = resolve;
|
|
59
63
|
var ERROR_MSGS = __importStar(require("../constants/error_msgs"));
|
|
60
64
|
var literal_types_1 = require("../constants/literal_types");
|
|
61
65
|
var planner_1 = require("../planning/planner");
|
|
@@ -156,7 +160,7 @@ function _onActivation(request, binding, resolved) {
|
|
|
156
160
|
}
|
|
157
161
|
var _bindingActivation = function (context, binding, previousResult) {
|
|
158
162
|
var result;
|
|
159
|
-
if (typeof binding.onActivation ===
|
|
163
|
+
if (typeof binding.onActivation === 'function') {
|
|
160
164
|
result = binding.onActivation(context, previousResult);
|
|
161
165
|
}
|
|
162
166
|
else {
|
|
@@ -224,5 +228,3 @@ function resolve(context) {
|
|
|
224
228
|
var _f = _resolveRequest(context.plan.rootRequest.requestScope);
|
|
225
229
|
return _f(context.plan.rootRequest);
|
|
226
230
|
}
|
|
227
|
-
exports.resolve = resolve;
|
|
228
|
-
//# sourceMappingURL=resolver.js.map
|
package/lib/scope/scope.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { interfaces } from
|
|
1
|
+
import type { interfaces } from '../interfaces/interfaces';
|
|
2
2
|
export declare const tryGetFromScope: <T>(requestScope: interfaces.RequestScope, binding: interfaces.Binding<T>) => T | Promise<T> | null;
|
|
3
3
|
export declare const saveToScope: <T>(requestScope: interfaces.RequestScope, binding: interfaces.Binding<T>, result: T | Promise<T>) => void;
|
package/lib/scope/scope.js
CHANGED
|
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
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);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
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;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -37,13 +37,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.saveToScope = exports.tryGetFromScope = void 0;
|
|
40
|
-
var
|
|
40
|
+
var literal_types_1 = require("../constants/literal_types");
|
|
41
41
|
var async_1 = require("../utils/async");
|
|
42
42
|
var tryGetFromScope = function (requestScope, binding) {
|
|
43
|
-
if ((binding.scope ===
|
|
43
|
+
if ((binding.scope === literal_types_1.BindingScopeEnum.Singleton) && binding.activated) {
|
|
44
44
|
return binding.cache;
|
|
45
45
|
}
|
|
46
|
-
if (binding.scope ===
|
|
46
|
+
if (binding.scope === literal_types_1.BindingScopeEnum.Request &&
|
|
47
47
|
requestScope.has(binding.id)) {
|
|
48
48
|
return requestScope.get(binding.id);
|
|
49
49
|
}
|
|
@@ -51,10 +51,10 @@ var tryGetFromScope = function (requestScope, binding) {
|
|
|
51
51
|
};
|
|
52
52
|
exports.tryGetFromScope = tryGetFromScope;
|
|
53
53
|
var saveToScope = function (requestScope, binding, result) {
|
|
54
|
-
if (binding.scope ===
|
|
54
|
+
if (binding.scope === literal_types_1.BindingScopeEnum.Singleton) {
|
|
55
55
|
_saveToSingletonScope(binding, result);
|
|
56
56
|
}
|
|
57
|
-
if (binding.scope ===
|
|
57
|
+
if (binding.scope === literal_types_1.BindingScopeEnum.Request) {
|
|
58
58
|
_saveToRequestScope(requestScope, binding, result);
|
|
59
59
|
}
|
|
60
60
|
};
|
|
@@ -91,4 +91,3 @@ var _saveAsyncResultToSingletonScope = function (binding, asyncResult) { return
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
}); };
|
|
94
|
-
//# sourceMappingURL=scope.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { interfaces } from
|
|
1
|
+
import { interfaces } from '../interfaces/interfaces';
|
|
2
2
|
declare class BindingInWhenOnSyntax<T> implements interfaces.BindingInSyntax<T>, interfaces.BindingWhenSyntax<T>, interfaces.BindingOnSyntax<T> {
|
|
3
3
|
private _bindingInSyntax;
|
|
4
4
|
private _bindingWhenSyntax;
|
|
@@ -3,7 +3,7 @@ import { BindingWhenOnSyntax } from "./binding_when_on_syntax";
|
|
|
3
3
|
declare class BindingToSyntax<T> implements interfaces.BindingToSyntax<T> {
|
|
4
4
|
private _binding;
|
|
5
5
|
constructor(binding: interfaces.Binding<T>);
|
|
6
|
-
to(constructor:
|
|
6
|
+
to(constructor: interfaces.Newable<T>): interfaces.BindingInWhenOnSyntax<T>;
|
|
7
7
|
toSelf(): interfaces.BindingInWhenOnSyntax<T>;
|
|
8
8
|
toConstantValue(value: T): interfaces.BindingWhenOnSyntax<T>;
|
|
9
9
|
toDynamicValue(func: interfaces.DynamicValue<T>): interfaces.BindingInWhenOnSyntax<T>;
|
|
@@ -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];
|
|
@@ -35,7 +39,7 @@ var BindingToSyntax = (function () {
|
|
|
35
39
|
};
|
|
36
40
|
BindingToSyntax.prototype.toSelf = function () {
|
|
37
41
|
if (typeof this._binding.serviceIdentifier !== "function") {
|
|
38
|
-
throw new Error(""
|
|
42
|
+
throw new Error("".concat(ERROR_MSGS.INVALID_TO_SELF_VALUE));
|
|
39
43
|
}
|
|
40
44
|
var self = this._binding.serviceIdentifier;
|
|
41
45
|
return this.to(self);
|
|
@@ -104,4 +108,3 @@ var BindingToSyntax = (function () {
|
|
|
104
108
|
return BindingToSyntax;
|
|
105
109
|
}());
|
|
106
110
|
exports.BindingToSyntax = BindingToSyntax;
|
|
107
|
-
//# sourceMappingURL=binding_to_syntax.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { interfaces } from
|
|
1
|
+
import { interfaces } from '../interfaces/interfaces';
|
|
2
2
|
declare class BindingWhenOnSyntax<T> implements interfaces.BindingWhenSyntax<T>, interfaces.BindingOnSyntax<T> {
|
|
3
3
|
private _bindingWhenSyntax;
|
|
4
4
|
private _bindingOnSyntax;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { interfaces } from
|
|
1
|
+
import { interfaces } from '../interfaces/interfaces';
|
|
2
2
|
declare const traverseAncerstors: (request: interfaces.Request, constraint: interfaces.ConstraintFunction) => boolean;
|
|
3
3
|
declare const taggedConstraint: (key: string | number | symbol) => (value: unknown) => interfaces.ConstraintFunction;
|
|
4
4
|
declare const namedConstraint: (value: unknown) => interfaces.ConstraintFunction;
|
|
@@ -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];
|
|
@@ -46,7 +50,7 @@ var typeConstraint = function (type) { return function (request) {
|
|
|
46
50
|
var binding = null;
|
|
47
51
|
if (request !== null) {
|
|
48
52
|
binding = request.bindings[0];
|
|
49
|
-
if (typeof type ===
|
|
53
|
+
if (typeof type === 'string') {
|
|
50
54
|
var serviceIdentifier = binding.serviceIdentifier;
|
|
51
55
|
return serviceIdentifier === type;
|
|
52
56
|
}
|
|
@@ -58,4 +62,3 @@ var typeConstraint = function (type) { return function (request) {
|
|
|
58
62
|
return false;
|
|
59
63
|
}; };
|
|
60
64
|
exports.typeConstraint = typeConstraint;
|
|
61
|
-
//# sourceMappingURL=constraint_helpers.js.map
|