inversify 6.1.4 → 6.1.5-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (529) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/README.md +6 -15
  3. package/{amd → lib/cjs}/annotation/decorator_utils.d.ts +1 -0
  4. package/lib/cjs/annotation/decorator_utils.d.ts.map +1 -0
  5. package/{es6 → lib/cjs}/annotation/decorator_utils.js +25 -7
  6. package/lib/cjs/annotation/decorator_utils.js.map +1 -0
  7. package/{es6 → lib/cjs}/annotation/inject.d.ts +1 -0
  8. package/lib/cjs/annotation/inject.d.ts.map +1 -0
  9. package/{es6 → lib/cjs}/annotation/inject.js +18 -7
  10. package/lib/cjs/annotation/inject.js.map +1 -0
  11. package/{amd → lib/cjs}/annotation/inject_base.d.ts +1 -0
  12. package/lib/cjs/annotation/inject_base.d.ts.map +1 -0
  13. package/{es6 → lib/cjs}/annotation/inject_base.js +2 -0
  14. package/lib/cjs/annotation/inject_base.js.map +1 -0
  15. package/{amd → lib/cjs}/annotation/injectable.d.ts +1 -0
  16. package/lib/cjs/annotation/injectable.d.ts.map +1 -0
  17. package/{es6 → lib/cjs}/annotation/injectable.js +19 -7
  18. package/lib/cjs/annotation/injectable.js.map +1 -0
  19. package/{es → lib/cjs}/annotation/multi_inject.d.ts +1 -0
  20. package/lib/cjs/annotation/multi_inject.d.ts.map +1 -0
  21. package/{es6 → lib/cjs}/annotation/multi_inject.js +18 -7
  22. package/lib/cjs/annotation/multi_inject.js.map +1 -0
  23. package/{amd → lib/cjs}/annotation/named.d.ts +1 -0
  24. package/lib/cjs/annotation/named.d.ts.map +1 -0
  25. package/{es6 → lib/cjs}/annotation/named.js +19 -7
  26. package/lib/cjs/annotation/named.js.map +1 -0
  27. package/{amd → lib/cjs}/annotation/optional.d.ts +1 -0
  28. package/lib/cjs/annotation/optional.d.ts.map +1 -0
  29. package/{es6 → lib/cjs}/annotation/optional.js +18 -7
  30. package/lib/cjs/annotation/optional.js.map +1 -0
  31. package/{amd → lib/cjs}/annotation/post_construct.d.ts +1 -0
  32. package/lib/cjs/annotation/post_construct.d.ts.map +1 -0
  33. package/{es6 → lib/cjs}/annotation/post_construct.js +18 -7
  34. package/lib/cjs/annotation/post_construct.js.map +1 -0
  35. package/{es6 → lib/cjs}/annotation/pre_destroy.d.ts +1 -0
  36. package/lib/cjs/annotation/pre_destroy.d.ts.map +1 -0
  37. package/{es6 → lib/cjs}/annotation/pre_destroy.js +18 -7
  38. package/lib/cjs/annotation/pre_destroy.js.map +1 -0
  39. package/{es → lib/cjs}/annotation/property_event_decorator.d.ts +1 -0
  40. package/lib/cjs/annotation/property_event_decorator.d.ts.map +1 -0
  41. package/{es6 → lib/cjs}/annotation/property_event_decorator.js +1 -0
  42. package/lib/cjs/annotation/property_event_decorator.js.map +1 -0
  43. package/{amd → lib/cjs}/annotation/tagged.d.ts +1 -0
  44. package/lib/cjs/annotation/tagged.d.ts.map +1 -0
  45. package/{es6 → lib/cjs}/annotation/tagged.js +2 -0
  46. package/lib/cjs/annotation/tagged.js.map +1 -0
  47. package/{es6 → lib/cjs}/annotation/target_name.d.ts +1 -0
  48. package/lib/cjs/annotation/target_name.d.ts.map +1 -0
  49. package/{es6 → lib/cjs}/annotation/target_name.js +18 -7
  50. package/lib/cjs/annotation/target_name.js.map +1 -0
  51. package/{es6 → lib/cjs}/annotation/unmanaged.d.ts +1 -0
  52. package/lib/cjs/annotation/unmanaged.d.ts.map +1 -0
  53. package/{es6 → lib/cjs}/annotation/unmanaged.js +18 -7
  54. package/lib/cjs/annotation/unmanaged.js.map +1 -0
  55. package/{es6 → lib/cjs}/bindings/binding.d.ts +1 -0
  56. package/lib/cjs/bindings/binding.d.ts.map +1 -0
  57. package/{es6 → lib/cjs}/bindings/binding.js +29 -0
  58. package/lib/cjs/bindings/binding.js.map +1 -0
  59. package/{amd → lib/cjs}/bindings/binding_count.d.ts +1 -0
  60. package/lib/cjs/bindings/binding_count.d.ts.map +1 -0
  61. package/lib/{bindings → cjs/bindings}/binding_count.js +1 -0
  62. package/lib/cjs/bindings/binding_count.js.map +1 -0
  63. package/{amd → lib/cjs}/constants/error_msgs.d.ts +1 -0
  64. package/lib/cjs/constants/error_msgs.d.ts.map +1 -0
  65. package/{es6 → lib/cjs}/constants/error_msgs.js +2 -0
  66. package/lib/cjs/constants/error_msgs.js.map +1 -0
  67. package/{es → lib/cjs}/constants/literal_types.d.ts +1 -0
  68. package/lib/cjs/constants/literal_types.d.ts.map +1 -0
  69. package/{es6 → lib/cjs}/constants/literal_types.js +4 -0
  70. package/lib/cjs/constants/literal_types.js.map +1 -0
  71. package/{amd → lib/cjs}/constants/metadata_keys.d.ts +1 -0
  72. package/lib/cjs/constants/metadata_keys.d.ts.map +1 -0
  73. package/{es6 → lib/cjs}/constants/metadata_keys.js +13 -0
  74. package/lib/cjs/constants/metadata_keys.js.map +1 -0
  75. package/{es6 → lib/cjs}/container/container.d.ts +3 -0
  76. package/lib/cjs/container/container.d.ts.map +1 -0
  77. package/{es6 → lib/cjs}/container/container.js +157 -147
  78. package/lib/cjs/container/container.js.map +1 -0
  79. package/{amd → lib/cjs}/container/container_module.d.ts +1 -0
  80. package/lib/cjs/container/container_module.d.ts.map +1 -0
  81. package/{es6 → lib/cjs}/container/container_module.js +5 -0
  82. package/lib/cjs/container/container_module.js.map +1 -0
  83. package/{es → lib/cjs}/container/container_snapshot.d.ts +1 -0
  84. package/lib/cjs/container/container_snapshot.d.ts.map +1 -0
  85. package/{es6 → lib/cjs}/container/container_snapshot.js +6 -0
  86. package/lib/cjs/container/container_snapshot.js.map +1 -0
  87. package/{es → lib/cjs}/container/lookup.d.ts +1 -0
  88. package/lib/cjs/container/lookup.d.ts.map +1 -0
  89. package/{es6 → lib/cjs}/container/lookup.js +26 -7
  90. package/lib/cjs/container/lookup.js.map +1 -0
  91. package/{es6 → lib/cjs}/container/module_activation_store.d.ts +3 -2
  92. package/lib/cjs/container/module_activation_store.d.ts.map +1 -0
  93. package/{es6 → lib/cjs}/container/module_activation_store.js +2 -3
  94. package/lib/cjs/container/module_activation_store.js.map +1 -0
  95. package/{amd/inversify.d.ts → lib/cjs/index.d.ts} +2 -0
  96. package/lib/cjs/index.d.ts.map +1 -0
  97. package/{es6/inversify.js → lib/cjs/index.js} +20 -7
  98. package/lib/cjs/index.js.map +1 -0
  99. package/{amd → lib/cjs}/interfaces/interfaces.d.ts +3 -2
  100. package/lib/cjs/interfaces/interfaces.d.ts.map +1 -0
  101. package/lib/{interfaces → cjs/interfaces}/interfaces.js +1 -0
  102. package/lib/cjs/interfaces/interfaces.js.map +1 -0
  103. package/lib/cjs/package.json +3 -0
  104. package/{es6 → lib/cjs}/planning/context.d.ts +1 -0
  105. package/lib/cjs/planning/context.d.ts.map +1 -0
  106. package/{es6 → lib/cjs}/planning/context.js +5 -0
  107. package/lib/cjs/planning/context.js.map +1 -0
  108. package/{es6 → lib/cjs}/planning/metadata.d.ts +1 -0
  109. package/lib/cjs/planning/metadata.d.ts.map +1 -0
  110. package/{es6 → lib/cjs}/planning/metadata.js +20 -7
  111. package/lib/cjs/planning/metadata.js.map +1 -0
  112. package/{es → lib/cjs}/planning/metadata_reader.d.ts +1 -0
  113. package/lib/cjs/planning/metadata_reader.d.ts.map +1 -0
  114. package/{es6 → lib/cjs}/planning/metadata_reader.js +24 -12
  115. package/lib/cjs/planning/metadata_reader.js.map +1 -0
  116. package/{amd → lib/cjs}/planning/plan.d.ts +1 -0
  117. package/lib/cjs/planning/plan.d.ts.map +1 -0
  118. package/{es6 → lib/cjs}/planning/plan.js +3 -0
  119. package/lib/cjs/planning/plan.js.map +1 -0
  120. package/{amd → lib/cjs}/planning/planner.d.ts +1 -0
  121. package/lib/cjs/planning/planner.d.ts.map +1 -0
  122. package/{es6 → lib/cjs}/planning/planner.js +27 -7
  123. package/lib/cjs/planning/planner.js.map +1 -0
  124. package/{amd → lib/cjs}/planning/queryable_string.d.ts +1 -0
  125. package/lib/cjs/planning/queryable_string.d.ts.map +1 -0
  126. package/{es6 → lib/cjs}/planning/queryable_string.js +3 -0
  127. package/lib/cjs/planning/queryable_string.js.map +1 -0
  128. package/{amd → lib/cjs}/planning/reflection_utils.d.ts +1 -0
  129. package/lib/cjs/planning/reflection_utils.d.ts.map +1 -0
  130. package/{es6 → lib/cjs}/planning/reflection_utils.js +25 -8
  131. package/lib/cjs/planning/reflection_utils.js.map +1 -0
  132. package/{amd → lib/cjs}/planning/request.d.ts +1 -0
  133. package/lib/cjs/planning/request.d.ts.map +1 -0
  134. package/{es6 → lib/cjs}/planning/request.js +13 -1
  135. package/lib/cjs/planning/request.js.map +1 -0
  136. package/{es → lib/cjs}/resolution/instantiation.d.ts +1 -0
  137. package/lib/cjs/resolution/instantiation.d.ts.map +1 -0
  138. package/{es6 → lib/cjs}/resolution/instantiation.js +40 -37
  139. package/lib/cjs/resolution/instantiation.js.map +1 -0
  140. package/{amd → lib/cjs}/resolution/resolver.d.ts +1 -0
  141. package/lib/cjs/resolution/resolver.d.ts.map +1 -0
  142. package/{es6 → lib/cjs}/resolution/resolver.js +39 -20
  143. package/lib/cjs/resolution/resolver.js.map +1 -0
  144. package/{amd → lib/cjs}/scope/scope.d.ts +1 -0
  145. package/lib/cjs/scope/scope.d.ts.map +1 -0
  146. package/{es6 → lib/cjs}/scope/scope.js +10 -12
  147. package/lib/cjs/scope/scope.js.map +1 -0
  148. package/{amd → lib/cjs}/syntax/binding_in_syntax.d.ts +1 -0
  149. package/lib/cjs/syntax/binding_in_syntax.d.ts.map +1 -0
  150. package/{es6 → lib/cjs}/syntax/binding_in_syntax.js +2 -0
  151. package/lib/cjs/syntax/binding_in_syntax.js.map +1 -0
  152. package/{es6 → lib/cjs}/syntax/binding_in_when_on_syntax.d.ts +1 -0
  153. package/lib/cjs/syntax/binding_in_when_on_syntax.d.ts.map +1 -0
  154. package/{es6 → lib/cjs}/syntax/binding_in_when_on_syntax.js +5 -0
  155. package/lib/cjs/syntax/binding_in_when_on_syntax.js.map +1 -0
  156. package/{es6 → lib/cjs}/syntax/binding_on_syntax.d.ts +1 -0
  157. package/lib/cjs/syntax/binding_on_syntax.d.ts.map +1 -0
  158. package/{es6 → lib/cjs}/syntax/binding_on_syntax.js +2 -0
  159. package/lib/cjs/syntax/binding_on_syntax.js.map +1 -0
  160. package/{es → lib/cjs}/syntax/binding_to_syntax.d.ts +1 -0
  161. package/lib/cjs/syntax/binding_to_syntax.d.ts.map +1 -0
  162. package/{es6 → lib/cjs}/syntax/binding_to_syntax.js +43 -8
  163. package/lib/cjs/syntax/binding_to_syntax.js.map +1 -0
  164. package/{amd → lib/cjs}/syntax/binding_when_on_syntax.d.ts +1 -0
  165. package/lib/cjs/syntax/binding_when_on_syntax.d.ts.map +1 -0
  166. package/{es6 → lib/cjs}/syntax/binding_when_on_syntax.js +4 -0
  167. package/lib/cjs/syntax/binding_when_on_syntax.js.map +1 -0
  168. package/{es6 → lib/cjs}/syntax/binding_when_syntax.d.ts +1 -0
  169. package/lib/cjs/syntax/binding_when_syntax.d.ts.map +1 -0
  170. package/{es6 → lib/cjs}/syntax/binding_when_syntax.js +5 -1
  171. package/lib/cjs/syntax/binding_when_syntax.js.map +1 -0
  172. package/{amd → lib/cjs}/syntax/constraint_helpers.d.ts +1 -0
  173. package/lib/cjs/syntax/constraint_helpers.d.ts.map +1 -0
  174. package/{es6 → lib/cjs}/syntax/constraint_helpers.js +22 -7
  175. package/lib/cjs/syntax/constraint_helpers.js.map +1 -0
  176. package/{amd → lib/cjs}/utils/async.d.ts +1 -0
  177. package/lib/cjs/utils/async.d.ts.map +1 -0
  178. package/{es6 → lib/cjs}/utils/async.js +1 -0
  179. package/lib/cjs/utils/async.js.map +1 -0
  180. package/{es6 → lib/cjs}/utils/binding_utils.d.ts +1 -0
  181. package/lib/cjs/utils/binding_utils.d.ts.map +1 -0
  182. package/{es6 → lib/cjs}/utils/binding_utils.js +21 -7
  183. package/lib/cjs/utils/binding_utils.js.map +1 -0
  184. package/{es6 → lib/cjs}/utils/clonable.d.ts +1 -0
  185. package/lib/cjs/utils/clonable.d.ts.map +1 -0
  186. package/{es6 → lib/cjs}/utils/clonable.js +1 -0
  187. package/lib/cjs/utils/clonable.js.map +1 -0
  188. package/{amd → lib/cjs}/utils/exceptions.d.ts +1 -0
  189. package/lib/cjs/utils/exceptions.d.ts.map +1 -0
  190. package/{es6 → lib/cjs}/utils/exceptions.js +18 -7
  191. package/lib/cjs/utils/exceptions.js.map +1 -0
  192. package/{es6 → lib/cjs}/utils/factory_type.d.ts +1 -0
  193. package/lib/cjs/utils/factory_type.d.ts.map +1 -0
  194. package/{es6 → lib/cjs}/utils/factory_type.js +1 -0
  195. package/lib/cjs/utils/factory_type.js.map +1 -0
  196. package/{amd → lib/cjs}/utils/id.d.ts +1 -0
  197. package/lib/cjs/utils/id.d.ts.map +1 -0
  198. package/{es6 → lib/cjs}/utils/id.js +1 -0
  199. package/lib/cjs/utils/id.js.map +1 -0
  200. package/{amd → lib/cjs}/utils/js.d.ts +1 -0
  201. package/lib/cjs/utils/js.d.ts.map +1 -0
  202. package/{es6 → lib/cjs}/utils/js.js +1 -0
  203. package/lib/cjs/utils/js.js.map +1 -0
  204. package/{amd → lib/cjs}/utils/serialization.d.ts +1 -0
  205. package/lib/cjs/utils/serialization.d.ts.map +1 -0
  206. package/{es6 → lib/cjs}/utils/serialization.js +23 -7
  207. package/lib/cjs/utils/serialization.js.map +1 -0
  208. package/{es6/interfaces/interfaces.d.ts → lib/esm/index.d.ts} +207 -8
  209. package/lib/esm/index.d.ts.map +1 -0
  210. package/lib/esm/index.js +2 -0
  211. package/lib/esm/index.js.map +1 -0
  212. package/package.json +30 -34
  213. package/amd/annotation/decorator_utils.js +0 -119
  214. package/amd/annotation/inject.d.ts +0 -5
  215. package/amd/annotation/inject.js +0 -31
  216. package/amd/annotation/inject_base.js +0 -16
  217. package/amd/annotation/injectable.js +0 -40
  218. package/amd/annotation/lazy_service_identifier.js +0 -4
  219. package/amd/annotation/multi_inject.d.ts +0 -5
  220. package/amd/annotation/multi_inject.js +0 -31
  221. package/amd/annotation/named.js +0 -32
  222. package/amd/annotation/optional.js +0 -32
  223. package/amd/annotation/post_construct.js +0 -32
  224. package/amd/annotation/pre_destroy.d.ts +0 -4
  225. package/amd/annotation/pre_destroy.js +0 -32
  226. package/amd/annotation/property_event_decorator.d.ts +0 -4
  227. package/amd/annotation/property_event_decorator.js +0 -16
  228. package/amd/annotation/tagged.js +0 -8
  229. package/amd/annotation/target_name.d.ts +0 -3
  230. package/amd/annotation/target_name.js +0 -35
  231. package/amd/annotation/unmanaged.d.ts +0 -3
  232. package/amd/annotation/unmanaged.js +0 -35
  233. package/amd/bindings/binding.d.ts +0 -20
  234. package/amd/bindings/binding.js +0 -40
  235. package/amd/bindings/binding_count.js +0 -11
  236. package/amd/constants/error_msgs.js +0 -75
  237. package/amd/constants/literal_types.d.ts +0 -5
  238. package/amd/constants/literal_types.js +0 -28
  239. package/amd/constants/metadata_keys.js +0 -28
  240. package/amd/container/container.d.ts +0 -73
  241. package/amd/container/container.js +0 -766
  242. package/amd/container/container_module.js +0 -21
  243. package/amd/container/container_snapshot.d.ts +0 -10
  244. package/amd/container/container_snapshot.js +0 -20
  245. package/amd/container/lookup.d.ts +0 -17
  246. package/amd/container/lookup.js +0 -132
  247. package/amd/container/module_activation_store.d.ts +0 -10
  248. package/amd/container/module_activation_store.js +0 -51
  249. package/amd/interfaces/interfaces.js +0 -4
  250. package/amd/inversify.js +0 -57
  251. package/amd/planning/context.d.ts +0 -11
  252. package/amd/planning/context.js +0 -19
  253. package/amd/planning/metadata.d.ts +0 -8
  254. package/amd/planning/metadata.js +0 -45
  255. package/amd/planning/metadata_reader.d.ts +0 -6
  256. package/amd/planning/metadata_reader.js +0 -49
  257. package/amd/planning/plan.js +0 -13
  258. package/amd/planning/planner.js +0 -187
  259. package/amd/planning/queryable_string.js +0 -33
  260. package/amd/planning/reflection_utils.js +0 -55
  261. package/amd/planning/request.js +0 -24
  262. package/amd/planning/target.js +0 -111
  263. package/amd/resolution/instantiation.d.ts +0 -3
  264. package/amd/resolution/instantiation.js +0 -219
  265. package/amd/resolution/resolver.js +0 -234
  266. package/amd/scope/scope.js +0 -93
  267. package/amd/syntax/binding_in_syntax.js +0 -24
  268. package/amd/syntax/binding_in_when_on_syntax.d.ts +0 -29
  269. package/amd/syntax/binding_in_when_on_syntax.js +0 -75
  270. package/amd/syntax/binding_on_syntax.d.ts +0 -8
  271. package/amd/syntax/binding_on_syntax.js +0 -20
  272. package/amd/syntax/binding_to_syntax.d.ts +0 -18
  273. package/amd/syntax/binding_to_syntax.js +0 -116
  274. package/amd/syntax/binding_when_on_syntax.js +0 -65
  275. package/amd/syntax/binding_when_syntax.d.ts +0 -21
  276. package/amd/syntax/binding_when_syntax.js +0 -107
  277. package/amd/syntax/constraint_helpers.js +0 -66
  278. package/amd/utils/async.js +0 -17
  279. package/amd/utils/binding_utils.d.ts +0 -4
  280. package/amd/utils/binding_utils.js +0 -86
  281. package/amd/utils/clonable.d.ts +0 -3
  282. package/amd/utils/clonable.js +0 -11
  283. package/amd/utils/exceptions.js +0 -46
  284. package/amd/utils/factory_type.d.ts +0 -5
  285. package/amd/utils/factory_type.js +0 -11
  286. package/amd/utils/id.js +0 -9
  287. package/amd/utils/js.js +0 -18
  288. package/amd/utils/serialization.js +0 -135
  289. package/es/annotation/decorator_utils.d.ts +0 -16
  290. package/es/annotation/decorator_utils.js +0 -90
  291. package/es/annotation/inject.d.ts +0 -5
  292. package/es/annotation/inject.js +0 -4
  293. package/es/annotation/inject_base.d.ts +0 -4
  294. package/es/annotation/inject_base.js +0 -14
  295. package/es/annotation/injectable.d.ts +0 -2
  296. package/es/annotation/injectable.js +0 -13
  297. package/es/annotation/lazy_service_identifier.js +0 -1
  298. package/es/annotation/multi_inject.js +0 -4
  299. package/es/annotation/named.d.ts +0 -2
  300. package/es/annotation/named.js +0 -7
  301. package/es/annotation/optional.d.ts +0 -2
  302. package/es/annotation/optional.js +0 -7
  303. package/es/annotation/post_construct.d.ts +0 -4
  304. package/es/annotation/post_construct.js +0 -5
  305. package/es/annotation/pre_destroy.d.ts +0 -4
  306. package/es/annotation/pre_destroy.js +0 -5
  307. package/es/annotation/property_event_decorator.js +0 -13
  308. package/es/annotation/tagged.d.ts +0 -2
  309. package/es/annotation/tagged.js +0 -6
  310. package/es/annotation/target_name.d.ts +0 -3
  311. package/es/annotation/target_name.js +0 -10
  312. package/es/annotation/unmanaged.d.ts +0 -3
  313. package/es/annotation/unmanaged.js +0 -10
  314. package/es/bindings/binding.d.ts +0 -20
  315. package/es/bindings/binding.js +0 -37
  316. package/es/bindings/binding_count.d.ts +0 -5
  317. package/es/bindings/binding_count.js +0 -6
  318. package/es/constants/error_msgs.d.ts +0 -30
  319. package/es/constants/error_msgs.js +0 -62
  320. package/es/constants/literal_types.js +0 -21
  321. package/es/constants/metadata_keys.d.ts +0 -13
  322. package/es/constants/metadata_keys.js +0 -23
  323. package/es/container/container.d.ts +0 -73
  324. package/es/container/container.js +0 -750
  325. package/es/container/container_module.d.ts +0 -11
  326. package/es/container/container_module.js +0 -17
  327. package/es/container/container_snapshot.js +0 -15
  328. package/es/container/lookup.js +0 -105
  329. package/es/container/module_activation_store.d.ts +0 -10
  330. package/es/container/module_activation_store.js +0 -47
  331. package/es/interfaces/interfaces.d.ts +0 -269
  332. package/es/interfaces/interfaces.js +0 -1
  333. package/es/inversify.d.ts +0 -24
  334. package/es/inversify.js +0 -2
  335. package/es/planning/context.d.ts +0 -11
  336. package/es/planning/context.js +0 -15
  337. package/es/planning/metadata.d.ts +0 -8
  338. package/es/planning/metadata.js +0 -17
  339. package/es/planning/metadata_reader.js +0 -21
  340. package/es/planning/plan.d.ts +0 -7
  341. package/es/planning/plan.js +0 -8
  342. package/es/planning/planner.d.ts +0 -5
  343. package/es/planning/planner.js +0 -168
  344. package/es/planning/queryable_string.d.ts +0 -10
  345. package/es/planning/queryable_string.js +0 -28
  346. package/es/planning/reflection_utils.d.ts +0 -5
  347. package/es/planning/reflection_utils.js +0 -27
  348. package/es/planning/request.d.ts +0 -14
  349. package/es/planning/request.js +0 -20
  350. package/es/planning/target.js +0 -87
  351. package/es/resolution/instantiation.js +0 -195
  352. package/es/resolution/resolver.d.ts +0 -3
  353. package/es/resolution/resolver.js +0 -214
  354. package/es/scope/scope.d.ts +0 -3
  355. package/es/scope/scope.js +0 -88
  356. package/es/syntax/binding_in_syntax.d.ts +0 -9
  357. package/es/syntax/binding_in_syntax.js +0 -21
  358. package/es/syntax/binding_in_when_on_syntax.d.ts +0 -29
  359. package/es/syntax/binding_in_when_on_syntax.js +0 -73
  360. package/es/syntax/binding_on_syntax.d.ts +0 -8
  361. package/es/syntax/binding_on_syntax.js +0 -16
  362. package/es/syntax/binding_to_syntax.js +0 -91
  363. package/es/syntax/binding_when_on_syntax.d.ts +0 -25
  364. package/es/syntax/binding_when_on_syntax.js +0 -62
  365. package/es/syntax/binding_when_syntax.d.ts +0 -21
  366. package/es/syntax/binding_when_syntax.js +0 -104
  367. package/es/syntax/constraint_helpers.d.ts +0 -6
  368. package/es/syntax/constraint_helpers.js +0 -36
  369. package/es/utils/async.d.ts +0 -3
  370. package/es/utils/async.js +0 -12
  371. package/es/utils/binding_utils.d.ts +0 -4
  372. package/es/utils/binding_utils.js +0 -58
  373. package/es/utils/clonable.d.ts +0 -3
  374. package/es/utils/clonable.js +0 -7
  375. package/es/utils/exceptions.d.ts +0 -2
  376. package/es/utils/exceptions.js +0 -16
  377. package/es/utils/factory_type.d.ts +0 -5
  378. package/es/utils/factory_type.js +0 -6
  379. package/es/utils/id.d.ts +0 -2
  380. package/es/utils/id.js +0 -5
  381. package/es/utils/js.d.ts +0 -1
  382. package/es/utils/js.js +0 -13
  383. package/es/utils/serialization.d.ts +0 -10
  384. package/es/utils/serialization.js +0 -103
  385. package/es6/annotation/decorator_utils.d.ts +0 -16
  386. package/es6/annotation/inject_base.d.ts +0 -4
  387. package/es6/annotation/injectable.d.ts +0 -2
  388. package/es6/annotation/lazy_service_identifier.js +0 -2
  389. package/es6/annotation/multi_inject.d.ts +0 -5
  390. package/es6/annotation/named.d.ts +0 -2
  391. package/es6/annotation/optional.d.ts +0 -2
  392. package/es6/annotation/post_construct.d.ts +0 -4
  393. package/es6/annotation/property_event_decorator.d.ts +0 -4
  394. package/es6/annotation/tagged.d.ts +0 -2
  395. package/es6/bindings/binding_count.d.ts +0 -5
  396. package/es6/bindings/binding_count.js +0 -9
  397. package/es6/constants/error_msgs.d.ts +0 -30
  398. package/es6/constants/literal_types.d.ts +0 -5
  399. package/es6/constants/metadata_keys.d.ts +0 -13
  400. package/es6/container/container_module.d.ts +0 -11
  401. package/es6/container/container_snapshot.d.ts +0 -10
  402. package/es6/container/lookup.d.ts +0 -17
  403. package/es6/interfaces/interfaces.js +0 -2
  404. package/es6/inversify.d.ts +0 -24
  405. package/es6/planning/metadata_reader.d.ts +0 -6
  406. package/es6/planning/plan.d.ts +0 -7
  407. package/es6/planning/planner.d.ts +0 -5
  408. package/es6/planning/queryable_string.d.ts +0 -10
  409. package/es6/planning/reflection_utils.d.ts +0 -5
  410. package/es6/planning/request.d.ts +0 -14
  411. package/es6/planning/target.js +0 -105
  412. package/es6/resolution/instantiation.d.ts +0 -3
  413. package/es6/resolution/resolver.d.ts +0 -3
  414. package/es6/scope/scope.d.ts +0 -3
  415. package/es6/syntax/binding_in_syntax.d.ts +0 -9
  416. package/es6/syntax/binding_to_syntax.d.ts +0 -18
  417. package/es6/syntax/binding_when_on_syntax.d.ts +0 -25
  418. package/es6/syntax/constraint_helpers.d.ts +0 -6
  419. package/es6/utils/async.d.ts +0 -3
  420. package/es6/utils/exceptions.d.ts +0 -2
  421. package/es6/utils/id.d.ts +0 -2
  422. package/es6/utils/js.d.ts +0 -1
  423. package/es6/utils/serialization.d.ts +0 -10
  424. package/lib/annotation/decorator_utils.d.ts +0 -16
  425. package/lib/annotation/decorator_utils.js +0 -118
  426. package/lib/annotation/inject.d.ts +0 -5
  427. package/lib/annotation/inject.js +0 -30
  428. package/lib/annotation/inject_base.d.ts +0 -4
  429. package/lib/annotation/inject_base.js +0 -17
  430. package/lib/annotation/injectable.d.ts +0 -2
  431. package/lib/annotation/injectable.js +0 -38
  432. package/lib/annotation/lazy_service_identifier.d.ts +0 -3
  433. package/lib/annotation/lazy_service_identifier.js +0 -2
  434. package/lib/annotation/multi_inject.d.ts +0 -5
  435. package/lib/annotation/multi_inject.js +0 -30
  436. package/lib/annotation/named.d.ts +0 -2
  437. package/lib/annotation/named.js +0 -32
  438. package/lib/annotation/optional.d.ts +0 -2
  439. package/lib/annotation/optional.js +0 -32
  440. package/lib/annotation/post_construct.d.ts +0 -4
  441. package/lib/annotation/post_construct.js +0 -31
  442. package/lib/annotation/pre_destroy.d.ts +0 -4
  443. package/lib/annotation/pre_destroy.js +0 -31
  444. package/lib/annotation/property_event_decorator.d.ts +0 -4
  445. package/lib/annotation/property_event_decorator.js +0 -15
  446. package/lib/annotation/tagged.d.ts +0 -2
  447. package/lib/annotation/tagged.js +0 -8
  448. package/lib/annotation/target_name.d.ts +0 -3
  449. package/lib/annotation/target_name.js +0 -35
  450. package/lib/annotation/unmanaged.d.ts +0 -3
  451. package/lib/annotation/unmanaged.js +0 -35
  452. package/lib/bindings/binding.d.ts +0 -20
  453. package/lib/bindings/binding.js +0 -40
  454. package/lib/bindings/binding_count.d.ts +0 -5
  455. package/lib/constants/error_msgs.d.ts +0 -30
  456. package/lib/constants/error_msgs.js +0 -73
  457. package/lib/constants/literal_types.d.ts +0 -5
  458. package/lib/constants/literal_types.js +0 -26
  459. package/lib/constants/metadata_keys.d.ts +0 -13
  460. package/lib/constants/metadata_keys.js +0 -26
  461. package/lib/container/container.d.ts +0 -73
  462. package/lib/container/container.js +0 -776
  463. package/lib/container/container_module.d.ts +0 -11
  464. package/lib/container/container_module.js +0 -20
  465. package/lib/container/container_snapshot.d.ts +0 -10
  466. package/lib/container/container_snapshot.js +0 -18
  467. package/lib/container/lookup.d.ts +0 -17
  468. package/lib/container/lookup.js +0 -131
  469. package/lib/container/module_activation_store.d.ts +0 -10
  470. package/lib/container/module_activation_store.js +0 -50
  471. package/lib/interfaces/interfaces.d.ts +0 -269
  472. package/lib/inversify.d.ts +0 -24
  473. package/lib/inversify.js +0 -76
  474. package/lib/planning/context.d.ts +0 -11
  475. package/lib/planning/context.js +0 -18
  476. package/lib/planning/metadata.d.ts +0 -8
  477. package/lib/planning/metadata.js +0 -43
  478. package/lib/planning/metadata_reader.d.ts +0 -6
  479. package/lib/planning/metadata_reader.js +0 -47
  480. package/lib/planning/plan.d.ts +0 -7
  481. package/lib/planning/plan.js +0 -11
  482. package/lib/planning/planner.d.ts +0 -5
  483. package/lib/planning/planner.js +0 -195
  484. package/lib/planning/queryable_string.d.ts +0 -10
  485. package/lib/planning/queryable_string.js +0 -31
  486. package/lib/planning/reflection_utils.d.ts +0 -5
  487. package/lib/planning/reflection_utils.js +0 -55
  488. package/lib/planning/request.d.ts +0 -14
  489. package/lib/planning/request.js +0 -23
  490. package/lib/planning/target.d.ts +0 -23
  491. package/lib/planning/target.js +0 -113
  492. package/lib/resolution/instantiation.d.ts +0 -3
  493. package/lib/resolution/instantiation.js +0 -220
  494. package/lib/resolution/resolver.d.ts +0 -3
  495. package/lib/resolution/resolver.js +0 -239
  496. package/lib/scope/scope.d.ts +0 -3
  497. package/lib/scope/scope.js +0 -93
  498. package/lib/syntax/binding_in_syntax.d.ts +0 -9
  499. package/lib/syntax/binding_in_syntax.js +0 -24
  500. package/lib/syntax/binding_in_when_on_syntax.d.ts +0 -29
  501. package/lib/syntax/binding_in_when_on_syntax.js +0 -76
  502. package/lib/syntax/binding_on_syntax.d.ts +0 -8
  503. package/lib/syntax/binding_on_syntax.js +0 -19
  504. package/lib/syntax/binding_to_syntax.d.ts +0 -18
  505. package/lib/syntax/binding_to_syntax.js +0 -117
  506. package/lib/syntax/binding_when_on_syntax.d.ts +0 -25
  507. package/lib/syntax/binding_when_on_syntax.js +0 -65
  508. package/lib/syntax/binding_when_syntax.d.ts +0 -21
  509. package/lib/syntax/binding_when_syntax.js +0 -107
  510. package/lib/syntax/constraint_helpers.d.ts +0 -6
  511. package/lib/syntax/constraint_helpers.js +0 -65
  512. package/lib/tsconfig.tsbuildinfo +0 -1
  513. package/lib/utils/async.d.ts +0 -3
  514. package/lib/utils/async.js +0 -15
  515. package/lib/utils/binding_utils.d.ts +0 -4
  516. package/lib/utils/binding_utils.js +0 -87
  517. package/lib/utils/clonable.d.ts +0 -3
  518. package/lib/utils/clonable.js +0 -9
  519. package/lib/utils/exceptions.d.ts +0 -2
  520. package/lib/utils/exceptions.js +0 -44
  521. package/lib/utils/factory_type.d.ts +0 -5
  522. package/lib/utils/factory_type.js +0 -9
  523. package/lib/utils/id.d.ts +0 -2
  524. package/lib/utils/id.js +0 -7
  525. package/lib/utils/js.d.ts +0 -1
  526. package/lib/utils/js.js +0 -16
  527. package/lib/utils/serialization.d.ts +0 -10
  528. package/lib/utils/serialization.js +0 -133
  529. /package/{es → lib/esm}/package.json +0 -0
@@ -1,11 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- declare class Context implements interfaces.Context {
3
- id: number;
4
- container: interfaces.Container;
5
- plan: interfaces.Plan;
6
- currentRequest: interfaces.Request;
7
- constructor(container: interfaces.Container);
8
- addPlan(plan: interfaces.Plan): void;
9
- setCurrentRequest(currentRequest: interfaces.Request): void;
10
- }
11
- export { Context };
@@ -1,15 +0,0 @@
1
- import { id } from '../utils/id';
2
- var Context = (function () {
3
- function Context(container) {
4
- this.id = id();
5
- this.container = container;
6
- }
7
- Context.prototype.addPlan = function (plan) {
8
- this.plan = plan;
9
- };
10
- Context.prototype.setCurrentRequest = function (currentRequest) {
11
- this.currentRequest = currentRequest;
12
- };
13
- return Context;
14
- }());
15
- export { Context };
@@ -1,8 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- declare class Metadata implements interfaces.Metadata {
3
- key: string | number | symbol;
4
- value: unknown;
5
- constructor(key: string | number | symbol, value: unknown);
6
- toString(): string;
7
- }
8
- export { Metadata };
@@ -1,17 +0,0 @@
1
- import * as METADATA_KEY from '../constants/metadata_keys';
2
- var Metadata = (function () {
3
- function Metadata(key, value) {
4
- this.key = key;
5
- this.value = value;
6
- }
7
- Metadata.prototype.toString = function () {
8
- if (this.key === METADATA_KEY.NAMED_TAG) {
9
- return "named: ".concat(String(this.value).toString(), " ");
10
- }
11
- else {
12
- return "tagged: { key:".concat(this.key.toString(), ", value: ").concat(String(this.value), " }");
13
- }
14
- };
15
- return Metadata;
16
- }());
17
- export { Metadata };
@@ -1,21 +0,0 @@
1
- import * as METADATA_KEY from '../constants/metadata_keys';
2
- var MetadataReader = (function () {
3
- function MetadataReader() {
4
- }
5
- MetadataReader.prototype.getConstructorMetadata = function (constructorFunc) {
6
- var _a;
7
- var compilerGeneratedMetadata = (_a = Reflect.getMetadata(METADATA_KEY.DESIGN_PARAM_TYPES, constructorFunc)) !== null && _a !== void 0 ? _a : [];
8
- var userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED, constructorFunc);
9
- return {
10
- compilerGeneratedMetadata: compilerGeneratedMetadata,
11
- userGeneratedMetadata: userGeneratedMetadata !== null && userGeneratedMetadata !== void 0 ? userGeneratedMetadata : {},
12
- };
13
- };
14
- MetadataReader.prototype.getPropertiesMetadata = function (constructorFunc) {
15
- var _a;
16
- var userGeneratedMetadata = (_a = Reflect.getMetadata(METADATA_KEY.TAGGED_PROP, constructorFunc)) !== null && _a !== void 0 ? _a : {};
17
- return userGeneratedMetadata;
18
- };
19
- return MetadataReader;
20
- }());
21
- export { MetadataReader };
@@ -1,7 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- declare class Plan implements interfaces.Plan {
3
- parentContext: interfaces.Context;
4
- rootRequest: interfaces.Request;
5
- constructor(parentContext: interfaces.Context, rootRequest: interfaces.Request);
6
- }
7
- export { Plan };
@@ -1,8 +0,0 @@
1
- var Plan = (function () {
2
- function Plan(parentContext, rootRequest) {
3
- this.parentContext = parentContext;
4
- this.rootRequest = rootRequest;
5
- }
6
- return Plan;
7
- }());
8
- export { Plan };
@@ -1,5 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- declare function getBindingDictionary(cntnr: interfaces.Container): interfaces.Lookup<interfaces.Binding<unknown>>;
3
- declare function plan(metadataReader: interfaces.MetadataReader, container: interfaces.Container, isMultiInject: boolean, targetType: interfaces.TargetType, serviceIdentifier: interfaces.ServiceIdentifier, key?: string | number | symbol, value?: unknown, avoidConstraints?: boolean): interfaces.Context;
4
- declare function createMockRequest(container: interfaces.Container, serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): interfaces.Request;
5
- export { plan, createMockRequest, getBindingDictionary };
@@ -1,168 +0,0 @@
1
- import { ClassElementMetadataKind, getClassElementMetadataFromLegacyMetadata, LegacyTargetImpl as TargetImpl, } from '@inversifyjs/core';
2
- import { BindingCount } from '../bindings/binding_count';
3
- import * as ERROR_MSGS from '../constants/error_msgs';
4
- import { BindingTypeEnum } from '../constants/literal_types';
5
- import * as METADATA_KEY from '../constants/metadata_keys';
6
- import { isStackOverflowException } from '../utils/exceptions';
7
- import { circularDependencyToException, getServiceIdentifierAsString, listMetadataForTarget, listRegisteredBindingsForServiceIdentifier, } from '../utils/serialization';
8
- import { Context } from './context';
9
- import { Metadata } from './metadata';
10
- import { Plan } from './plan';
11
- import { getBaseClassDependencyCount, getDependencies, getFunctionName, } from './reflection_utils';
12
- import { Request } from './request';
13
- function getBindingDictionary(cntnr) {
14
- return cntnr._bindingDictionary;
15
- }
16
- function _createTarget(isMultiInject, targetType, serviceIdentifier, name, key, value) {
17
- var metadataList = _getTargetMetadata(isMultiInject, serviceIdentifier, key, value);
18
- var classElementMetadata = getClassElementMetadataFromLegacyMetadata(metadataList);
19
- if (classElementMetadata.kind === ClassElementMetadataKind.unmanaged) {
20
- throw new Error('Unexpected metadata when creating target');
21
- }
22
- var target = new TargetImpl(name, classElementMetadata, targetType);
23
- return target;
24
- }
25
- function _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target) {
26
- var bindings = getBindings(context.container, target.serviceIdentifier);
27
- var activeBindings = [];
28
- if (bindings.length === BindingCount.NoBindingsAvailable &&
29
- context.container.options.autoBindInjectable === true &&
30
- typeof target.serviceIdentifier === 'function' &&
31
- metadataReader.getConstructorMetadata(target.serviceIdentifier)
32
- .compilerGeneratedMetadata) {
33
- context.container.bind(target.serviceIdentifier).toSelf();
34
- bindings = getBindings(context.container, target.serviceIdentifier);
35
- }
36
- if (!avoidConstraints) {
37
- activeBindings = bindings.filter(function (binding) {
38
- var request = new Request(binding.serviceIdentifier, context, parentRequest, binding, target);
39
- return binding.constraint(request);
40
- });
41
- }
42
- else {
43
- activeBindings = bindings;
44
- }
45
- _validateActiveBindingCount(target.serviceIdentifier, activeBindings, parentRequest, target, context.container);
46
- return activeBindings;
47
- }
48
- function _getTargetMetadata(isMultiInject, serviceIdentifier, key, value) {
49
- var metadataKey = isMultiInject
50
- ? METADATA_KEY.MULTI_INJECT_TAG
51
- : METADATA_KEY.INJECT_TAG;
52
- var metadataList = [
53
- new Metadata(metadataKey, serviceIdentifier),
54
- ];
55
- if (key !== undefined) {
56
- metadataList.push(new Metadata(key, value));
57
- }
58
- return metadataList;
59
- }
60
- function _validateActiveBindingCount(serviceIdentifier, bindings, parentRequest, target, container) {
61
- switch (bindings.length) {
62
- case BindingCount.NoBindingsAvailable:
63
- if (target.isOptional()) {
64
- return bindings;
65
- }
66
- else {
67
- var serviceIdentifierString = getServiceIdentifierAsString(serviceIdentifier);
68
- var msg = ERROR_MSGS.NOT_REGISTERED;
69
- msg += listMetadataForTarget(serviceIdentifierString, target);
70
- msg += listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings);
71
- if (parentRequest !== null) {
72
- msg += "\n".concat(ERROR_MSGS.TRYING_TO_RESOLVE_BINDINGS(getServiceIdentifierAsString(parentRequest.serviceIdentifier)));
73
- }
74
- throw new Error(msg);
75
- }
76
- case BindingCount.OnlyOneBindingAvailable:
77
- return bindings;
78
- case BindingCount.MultipleBindingsAvailable:
79
- default:
80
- if (!target.isArray()) {
81
- var serviceIdentifierString = getServiceIdentifierAsString(serviceIdentifier);
82
- var msg = "".concat(ERROR_MSGS.AMBIGUOUS_MATCH, " ").concat(serviceIdentifierString);
83
- msg += listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings);
84
- throw new Error(msg);
85
- }
86
- else {
87
- return bindings;
88
- }
89
- }
90
- }
91
- function _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, parentRequest, target) {
92
- var activeBindings;
93
- var childRequest;
94
- if (parentRequest === null) {
95
- activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, null, target);
96
- childRequest = new Request(serviceIdentifier, context, null, activeBindings, target);
97
- var thePlan = new Plan(context, childRequest);
98
- context.addPlan(thePlan);
99
- }
100
- else {
101
- activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target);
102
- childRequest = parentRequest.addChildRequest(target.serviceIdentifier, activeBindings, target);
103
- }
104
- activeBindings.forEach(function (binding) {
105
- var subChildRequest = null;
106
- if (target.isArray()) {
107
- subChildRequest = childRequest.addChildRequest(binding.serviceIdentifier, binding, target);
108
- }
109
- else {
110
- if (binding.cache !== null) {
111
- return;
112
- }
113
- subChildRequest = childRequest;
114
- }
115
- if (binding.type === BindingTypeEnum.Instance &&
116
- binding.implementationType !== null) {
117
- var dependencies = getDependencies(metadataReader, binding.implementationType);
118
- if (context.container.options.skipBaseClassChecks !== true) {
119
- var baseClassDependencyCount = getBaseClassDependencyCount(metadataReader, binding.implementationType);
120
- if (dependencies.length < baseClassDependencyCount) {
121
- var error = ERROR_MSGS.ARGUMENTS_LENGTH_MISMATCH(getFunctionName(binding.implementationType));
122
- throw new Error(error);
123
- }
124
- }
125
- dependencies.forEach(function (dependency) {
126
- _createSubRequests(metadataReader, false, dependency.serviceIdentifier, context, subChildRequest, dependency);
127
- });
128
- }
129
- });
130
- }
131
- function getBindings(container, serviceIdentifier) {
132
- var bindings = [];
133
- var bindingDictionary = getBindingDictionary(container);
134
- if (bindingDictionary.hasKey(serviceIdentifier)) {
135
- bindings = bindingDictionary.get(serviceIdentifier);
136
- }
137
- else if (container.parent !== null) {
138
- bindings = getBindings(container.parent, serviceIdentifier);
139
- }
140
- return bindings;
141
- }
142
- function plan(metadataReader, container, isMultiInject, targetType, serviceIdentifier, key, value, avoidConstraints) {
143
- if (avoidConstraints === void 0) { avoidConstraints = false; }
144
- var context = new Context(container);
145
- var target = _createTarget(isMultiInject, targetType, serviceIdentifier, '', key, value);
146
- try {
147
- _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, null, target);
148
- return context;
149
- }
150
- catch (error) {
151
- if (isStackOverflowException(error)) {
152
- circularDependencyToException(context.plan.rootRequest);
153
- }
154
- throw error;
155
- }
156
- }
157
- function createMockRequest(container, serviceIdentifier, key, value) {
158
- var metadataList = _getTargetMetadata(false, serviceIdentifier, key, value);
159
- var classElementMetadata = getClassElementMetadataFromLegacyMetadata(metadataList);
160
- if (classElementMetadata.kind === ClassElementMetadataKind.unmanaged) {
161
- throw new Error('Unexpected metadata when creating target');
162
- }
163
- var target = new TargetImpl('', classElementMetadata, 'Variable');
164
- var context = new Context(container);
165
- var request = new Request(serviceIdentifier, context, null, [], target);
166
- return request;
167
- }
168
- export { plan, createMockRequest, getBindingDictionary };
@@ -1,10 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- export declare class QueryableString implements interfaces.QueryableString {
3
- private readonly str;
4
- constructor(str: string);
5
- startsWith(searchString: string): boolean;
6
- endsWith(searchString: string): boolean;
7
- contains(searchString: string): boolean;
8
- equals(compareString: string): boolean;
9
- value(): string;
10
- }
@@ -1,28 +0,0 @@
1
- var QueryableString = (function () {
2
- function QueryableString(str) {
3
- this.str = str;
4
- }
5
- QueryableString.prototype.startsWith = function (searchString) {
6
- return this.str.indexOf(searchString) === 0;
7
- };
8
- QueryableString.prototype.endsWith = function (searchString) {
9
- var reverseString = '';
10
- var reverseSearchString = searchString
11
- .split('')
12
- .reverse()
13
- .join('');
14
- reverseString = this.str.split('').reverse().join('');
15
- return this.startsWith.call({ str: reverseString }, reverseSearchString);
16
- };
17
- QueryableString.prototype.contains = function (searchString) {
18
- return this.str.indexOf(searchString) !== -1;
19
- };
20
- QueryableString.prototype.equals = function (compareString) {
21
- return this.str === compareString;
22
- };
23
- QueryableString.prototype.value = function () {
24
- return this.str;
25
- };
26
- return QueryableString;
27
- }());
28
- export { QueryableString };
@@ -1,5 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- import { getFunctionName } from '../utils/serialization';
3
- declare function getDependencies(metadataReader: interfaces.MetadataReader, func: NewableFunction): interfaces.Target[];
4
- declare function getBaseClassDependencyCount(metadataReader: interfaces.MetadataReader, func: NewableFunction): number;
5
- export { getDependencies, getBaseClassDependencyCount, getFunctionName };
@@ -1,27 +0,0 @@
1
- import { getTargets } from '@inversifyjs/core';
2
- import * as METADATA_KEY from '../constants/metadata_keys';
3
- import { getFunctionName } from '../utils/serialization';
4
- function getDependencies(metadataReader, func) {
5
- return getTargets(metadataReader)(func);
6
- }
7
- function getBaseClassDependencyCount(metadataReader, func) {
8
- var baseConstructor = Object.getPrototypeOf(func.prototype).constructor;
9
- if (baseConstructor !== Object) {
10
- var targets = getTargets(metadataReader)(baseConstructor);
11
- var metadata = targets.map(function (t) {
12
- return t.metadata.filter(function (m) { return m.key === METADATA_KEY.UNMANAGED_TAG; });
13
- });
14
- var unmanagedCount = [].concat.apply([], metadata).length;
15
- var dependencyCount = targets.length - unmanagedCount;
16
- if (dependencyCount > 0) {
17
- return dependencyCount;
18
- }
19
- else {
20
- return getBaseClassDependencyCount(metadataReader, baseConstructor);
21
- }
22
- }
23
- else {
24
- return 0;
25
- }
26
- }
27
- export { getDependencies, getBaseClassDependencyCount, getFunctionName };
@@ -1,14 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- declare class Request implements interfaces.Request {
3
- id: number;
4
- serviceIdentifier: interfaces.ServiceIdentifier;
5
- parentContext: interfaces.Context;
6
- parentRequest: interfaces.Request | null;
7
- bindings: interfaces.Binding<unknown>[];
8
- childRequests: interfaces.Request[];
9
- target: interfaces.Target;
10
- requestScope: interfaces.RequestScope | null;
11
- constructor(serviceIdentifier: interfaces.ServiceIdentifier, parentContext: interfaces.Context, parentRequest: interfaces.Request | null, bindings: interfaces.Binding<any> | interfaces.Binding<any>[], target: interfaces.Target);
12
- addChildRequest(serviceIdentifier: interfaces.ServiceIdentifier, bindings: interfaces.Binding<unknown> | interfaces.Binding<unknown>[], target: interfaces.Target): interfaces.Request;
13
- }
14
- export { Request };
@@ -1,20 +0,0 @@
1
- import { id } from '../utils/id';
2
- var Request = (function () {
3
- function Request(serviceIdentifier, parentContext, parentRequest, bindings, target) {
4
- this.id = id();
5
- this.serviceIdentifier = serviceIdentifier;
6
- this.parentContext = parentContext;
7
- this.parentRequest = parentRequest;
8
- this.target = target;
9
- this.childRequests = [];
10
- this.bindings = Array.isArray(bindings) ? bindings : [bindings];
11
- this.requestScope = parentRequest === null ? new Map() : null;
12
- }
13
- Request.prototype.addChildRequest = function (serviceIdentifier, bindings, target) {
14
- var child = new Request(serviceIdentifier, this.parentContext, this, bindings, target);
15
- this.childRequests.push(child);
16
- return child;
17
- };
18
- return Request;
19
- }());
20
- export { Request };
@@ -1,87 +0,0 @@
1
- import * as METADATA_KEY from '../constants/metadata_keys';
2
- import { id } from '../utils/id';
3
- import { getSymbolDescription } from '../utils/serialization';
4
- import { Metadata } from './metadata';
5
- import { QueryableString } from './queryable_string';
6
- var Target = (function () {
7
- function Target(type, identifier, serviceIdentifier, namedOrTagged) {
8
- this.id = id();
9
- this.type = type;
10
- this.serviceIdentifier = serviceIdentifier;
11
- var queryableName = typeof identifier === 'symbol'
12
- ? getSymbolDescription(identifier)
13
- : identifier;
14
- this.name = new QueryableString(queryableName || '');
15
- this.identifier = identifier;
16
- this.metadata = new Array();
17
- var metadataItem = null;
18
- if (typeof namedOrTagged === 'string') {
19
- metadataItem = new Metadata(METADATA_KEY.NAMED_TAG, namedOrTagged);
20
- }
21
- else if (namedOrTagged instanceof Metadata) {
22
- metadataItem = namedOrTagged;
23
- }
24
- if (metadataItem !== null) {
25
- this.metadata.push(metadataItem);
26
- }
27
- }
28
- Target.prototype.hasTag = function (key) {
29
- for (var _i = 0, _a = this.metadata; _i < _a.length; _i++) {
30
- var m = _a[_i];
31
- if (m.key === key) {
32
- return true;
33
- }
34
- }
35
- return false;
36
- };
37
- Target.prototype.isArray = function () {
38
- return this.hasTag(METADATA_KEY.MULTI_INJECT_TAG);
39
- };
40
- Target.prototype.matchesArray = function (name) {
41
- return this.matchesTag(METADATA_KEY.MULTI_INJECT_TAG)(name);
42
- };
43
- Target.prototype.isNamed = function () {
44
- return this.hasTag(METADATA_KEY.NAMED_TAG);
45
- };
46
- Target.prototype.isTagged = function () {
47
- return this.metadata.some(function (metadata) {
48
- return METADATA_KEY.NON_CUSTOM_TAG_KEYS.every(function (key) { return metadata.key !== key; });
49
- });
50
- };
51
- Target.prototype.isOptional = function () {
52
- return this.matchesTag(METADATA_KEY.OPTIONAL_TAG)(true);
53
- };
54
- Target.prototype.getNamedTag = function () {
55
- if (this.isNamed()) {
56
- return this.metadata.filter(function (m) { return m.key === METADATA_KEY.NAMED_TAG; })[0];
57
- }
58
- return null;
59
- };
60
- Target.prototype.getCustomTags = function () {
61
- if (this.isTagged()) {
62
- return this.metadata.filter(function (metadata) {
63
- return METADATA_KEY.NON_CUSTOM_TAG_KEYS.every(function (key) { return metadata.key !== key; });
64
- });
65
- }
66
- else {
67
- return null;
68
- }
69
- };
70
- Target.prototype.matchesNamedTag = function (name) {
71
- return this.matchesTag(METADATA_KEY.NAMED_TAG)(name);
72
- };
73
- Target.prototype.matchesTag = function (key) {
74
- var _this = this;
75
- return function (value) {
76
- for (var _i = 0, _a = _this.metadata; _i < _a.length; _i++) {
77
- var m = _a[_i];
78
- if (m.key === key && m.value === value) {
79
- return true;
80
- }
81
- }
82
- return false;
83
- };
84
- };
85
- return Target;
86
- }());
87
- export { Target };
@@ -1,195 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
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 = 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
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
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
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
49
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
50
- if (ar || !(i in from)) {
51
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
52
- ar[i] = from[i];
53
- }
54
- }
55
- return to.concat(ar || Array.prototype.slice.call(from));
56
- };
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
- function _resolveRequests(childRequests, resolveRequest) {
62
- return childRequests.reduce(function (resolvedRequests, childRequest) {
63
- var injection = resolveRequest(childRequest);
64
- var targetType = childRequest.target.type;
65
- if (targetType === TargetTypeEnum.ConstructorArgument) {
66
- resolvedRequests.constructorInjections.push(injection);
67
- }
68
- else {
69
- resolvedRequests.propertyRequests.push(childRequest);
70
- resolvedRequests.propertyInjections.push(injection);
71
- }
72
- if (!resolvedRequests.isAsync) {
73
- resolvedRequests.isAsync = isPromiseOrContainsPromise(injection);
74
- }
75
- return resolvedRequests;
76
- }, {
77
- constructorInjections: [],
78
- isAsync: false,
79
- propertyInjections: [],
80
- propertyRequests: [],
81
- });
82
- }
83
- function _createInstance(constr, childRequests, resolveRequest) {
84
- var result;
85
- if (childRequests.length > 0) {
86
- var resolved = _resolveRequests(childRequests, resolveRequest);
87
- var createInstanceWithInjectionsArg = __assign(__assign({}, resolved), { constr: constr });
88
- if (resolved.isAsync) {
89
- result = createInstanceWithInjectionsAsync(createInstanceWithInjectionsArg);
90
- }
91
- else {
92
- result = createInstanceWithInjections(createInstanceWithInjectionsArg);
93
- }
94
- }
95
- else {
96
- result = new constr();
97
- }
98
- return result;
99
- }
100
- function createInstanceWithInjections(args) {
101
- var _a;
102
- var instance = new ((_a = args.constr).bind.apply(_a, __spreadArray([void 0], args.constructorInjections, false)))();
103
- args.propertyRequests.forEach(function (r, index) {
104
- var property = r.target.identifier;
105
- var injection = args.propertyInjections[index];
106
- if (!r.target.isOptional() || injection !== undefined) {
107
- instance[property] = injection;
108
- }
109
- });
110
- return instance;
111
- }
112
- function createInstanceWithInjectionsAsync(args) {
113
- return __awaiter(this, void 0, void 0, function () {
114
- var constructorInjections, propertyInjections;
115
- return __generator(this, function (_a) {
116
- switch (_a.label) {
117
- case 0: return [4, possiblyWaitInjections(args.constructorInjections)];
118
- case 1:
119
- constructorInjections = _a.sent();
120
- return [4, possiblyWaitInjections(args.propertyInjections)];
121
- case 2:
122
- propertyInjections = _a.sent();
123
- return [2, createInstanceWithInjections(__assign(__assign({}, args), { constructorInjections: constructorInjections, propertyInjections: propertyInjections }))];
124
- }
125
- });
126
- });
127
- }
128
- function possiblyWaitInjections(possiblePromiseinjections) {
129
- return __awaiter(this, void 0, void 0, function () {
130
- var injections, _i, possiblePromiseinjections_1, injection;
131
- return __generator(this, function (_a) {
132
- injections = [];
133
- for (_i = 0, possiblePromiseinjections_1 = possiblePromiseinjections; _i < possiblePromiseinjections_1.length; _i++) {
134
- injection = possiblePromiseinjections_1[_i];
135
- if (Array.isArray(injection)) {
136
- injections.push(Promise.all(injection));
137
- }
138
- else {
139
- injections.push(injection);
140
- }
141
- }
142
- return [2, Promise.all(injections)];
143
- });
144
- });
145
- }
146
- function _getInstanceAfterPostConstruct(constr, result) {
147
- var postConstructResult = _postConstruct(constr, result);
148
- if (isPromise(postConstructResult)) {
149
- return postConstructResult.then(function () { return result; });
150
- }
151
- else {
152
- return result;
153
- }
154
- }
155
- function _postConstruct(constr, instance) {
156
- var _a, _b;
157
- if (Reflect.hasMetadata(METADATA_KEY.POST_CONSTRUCT, constr)) {
158
- var data = Reflect.getMetadata(METADATA_KEY.POST_CONSTRUCT, constr);
159
- try {
160
- return (_b = (_a = instance)[data.value]) === null || _b === void 0 ? void 0 : _b.call(_a);
161
- }
162
- catch (e) {
163
- if (e instanceof Error) {
164
- throw new Error(POST_CONSTRUCT_ERROR(constr.name, e.message));
165
- }
166
- }
167
- }
168
- }
169
- function _validateInstanceResolution(binding, constr) {
170
- if (binding.scope !== BindingScopeEnum.Singleton) {
171
- _throwIfHandlingDeactivation(binding, constr);
172
- }
173
- }
174
- function _throwIfHandlingDeactivation(binding, constr) {
175
- var scopeErrorMessage = "Class cannot be instantiated in ".concat(binding.scope === BindingScopeEnum.Request ? 'request' : 'transient', " scope.");
176
- if (typeof binding.onDeactivation === 'function') {
177
- throw new Error(ON_DEACTIVATION_ERROR(constr.name, scopeErrorMessage));
178
- }
179
- if (Reflect.hasMetadata(METADATA_KEY.PRE_DESTROY, constr)) {
180
- throw new Error(PRE_DESTROY_ERROR(constr.name, scopeErrorMessage));
181
- }
182
- }
183
- function resolveInstance(binding, constr, childRequests, resolveRequest) {
184
- _validateInstanceResolution(binding, constr);
185
- var result = _createInstance(constr, childRequests, resolveRequest);
186
- if (isPromise(result)) {
187
- return result.then(function (resolvedResult) {
188
- return _getInstanceAfterPostConstruct(constr, resolvedResult);
189
- });
190
- }
191
- else {
192
- return _getInstanceAfterPostConstruct(constr, result);
193
- }
194
- }
195
- export { resolveInstance };