@tsed/core 6.88.1 → 6.89.0

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 (504) hide show
  1. package/lib/{decorators → cjs/decorators}/configurable.d.ts +0 -0
  2. package/lib/cjs/decorators/configurable.js +18 -0
  3. package/lib/cjs/decorators/configurable.js.map +1 -0
  4. package/lib/{decorators → cjs/decorators}/deprecated.d.ts +0 -0
  5. package/lib/cjs/decorators/deprecated.js +43 -0
  6. package/lib/cjs/decorators/deprecated.js.map +1 -0
  7. package/lib/{decorators → cjs/decorators}/enumerable.d.ts +0 -0
  8. package/lib/cjs/decorators/enumerable.js +18 -0
  9. package/lib/cjs/decorators/enumerable.js.map +1 -0
  10. package/lib/{decorators → cjs/decorators}/index.d.ts +0 -0
  11. package/lib/cjs/decorators/index.js +18 -0
  12. package/lib/cjs/decorators/index.js.map +1 -0
  13. package/lib/{decorators → cjs/decorators}/notConfigurable.d.ts +0 -0
  14. package/lib/cjs/decorators/notConfigurable.js +13 -0
  15. package/lib/cjs/decorators/notConfigurable.js.map +1 -0
  16. package/lib/{decorators → cjs/decorators}/notEnumerable.d.ts +0 -0
  17. package/lib/cjs/decorators/notEnumerable.js +13 -0
  18. package/lib/cjs/decorators/notEnumerable.js.map +1 -0
  19. package/lib/{decorators → cjs/decorators}/readOnly.d.ts +0 -0
  20. package/lib/cjs/decorators/readOnly.js +13 -0
  21. package/lib/cjs/decorators/readOnly.js.map +1 -0
  22. package/lib/{decorators → cjs/decorators}/storeFn.d.ts +0 -0
  23. package/lib/cjs/decorators/storeFn.js +22 -0
  24. package/lib/cjs/decorators/storeFn.js.map +1 -0
  25. package/lib/{decorators → cjs/decorators}/storeMerge.d.ts +0 -0
  26. package/lib/cjs/decorators/storeMerge.js +11 -0
  27. package/lib/cjs/decorators/storeMerge.js.map +1 -0
  28. package/lib/{decorators → cjs/decorators}/storeSet.d.ts +0 -0
  29. package/lib/cjs/decorators/storeSet.js +11 -0
  30. package/lib/cjs/decorators/storeSet.js.map +1 -0
  31. package/lib/{decorators → cjs/decorators}/writable.d.ts +0 -0
  32. package/lib/cjs/decorators/writable.js +18 -0
  33. package/lib/cjs/decorators/writable.js.map +1 -0
  34. package/lib/{domain → cjs/domain}/AnyToPromise.d.ts +0 -0
  35. package/lib/cjs/domain/AnyToPromise.js +148 -0
  36. package/lib/cjs/domain/AnyToPromise.js.map +1 -0
  37. package/lib/{domain → cjs/domain}/DecoratorTypes.d.ts +0 -0
  38. package/lib/cjs/domain/DecoratorTypes.js +15 -0
  39. package/lib/cjs/domain/DecoratorTypes.js.map +1 -0
  40. package/lib/{domain → cjs/domain}/Env.d.ts +0 -0
  41. package/lib/cjs/domain/Env.js +19 -0
  42. package/lib/cjs/domain/Env.js.map +1 -0
  43. package/lib/{domain → cjs/domain}/Hooks.d.ts +0 -0
  44. package/lib/cjs/domain/Hooks.js +89 -0
  45. package/lib/cjs/domain/Hooks.js.map +1 -0
  46. package/lib/{domain → cjs/domain}/Metadata.d.ts +0 -0
  47. package/lib/cjs/domain/Metadata.js +508 -0
  48. package/lib/cjs/domain/Metadata.js.map +1 -0
  49. package/lib/{domain → cjs/domain}/Store.d.ts +0 -0
  50. package/lib/cjs/domain/Store.js +157 -0
  51. package/lib/cjs/domain/Store.js.map +1 -0
  52. package/lib/{domain → cjs/domain}/Type.d.ts +0 -0
  53. package/lib/cjs/domain/Type.js +7 -0
  54. package/lib/cjs/domain/Type.js.map +1 -0
  55. package/lib/{domain → cjs/domain}/index.d.ts +0 -0
  56. package/lib/cjs/domain/index.js +11 -0
  57. package/lib/cjs/domain/index.js.map +1 -0
  58. package/lib/{errors → cjs/errors}/UnsupportedDecoratorType.d.ts +0 -0
  59. package/lib/cjs/errors/UnsupportedDecoratorType.js +21 -0
  60. package/lib/cjs/errors/UnsupportedDecoratorType.js.map +1 -0
  61. package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
  62. package/lib/cjs/index.js +9 -0
  63. package/lib/cjs/index.js.map +1 -0
  64. package/lib/{interfaces → cjs/interfaces}/AnyDecorator.d.ts +0 -0
  65. package/lib/cjs/interfaces/AnyDecorator.js +3 -0
  66. package/lib/cjs/interfaces/AnyDecorator.js.map +1 -0
  67. package/lib/{interfaces → cjs/interfaces}/DecoratorParameters.d.ts +0 -0
  68. package/lib/cjs/interfaces/DecoratorParameters.js +3 -0
  69. package/lib/cjs/interfaces/DecoratorParameters.js.map +1 -0
  70. package/lib/{interfaces → cjs/interfaces}/HashOf.d.ts +0 -0
  71. package/lib/cjs/interfaces/HashOf.js +3 -0
  72. package/lib/cjs/interfaces/HashOf.js.map +1 -0
  73. package/lib/{interfaces → cjs/interfaces}/MetadataTypes.d.ts +0 -0
  74. package/lib/cjs/interfaces/MetadataTypes.js +3 -0
  75. package/lib/cjs/interfaces/MetadataTypes.js.map +1 -0
  76. package/lib/{interfaces → cjs/interfaces}/ValueOf.d.ts +0 -0
  77. package/lib/cjs/interfaces/ValueOf.js +3 -0
  78. package/lib/cjs/interfaces/ValueOf.js.map +1 -0
  79. package/lib/{interfaces → cjs/interfaces}/index.d.ts +0 -0
  80. package/lib/cjs/interfaces/index.js +3 -0
  81. package/lib/cjs/interfaces/index.js.map +1 -0
  82. package/lib/{utils → cjs/utils}/catchError.d.ts +0 -0
  83. package/lib/cjs/utils/catchError.js +22 -0
  84. package/lib/cjs/utils/catchError.js.map +1 -0
  85. package/lib/{utils → cjs/utils}/decorators/decorateMethodsOf.d.ts +0 -0
  86. package/lib/cjs/utils/decorators/decorateMethodsOf.js +23 -0
  87. package/lib/cjs/utils/decorators/decorateMethodsOf.js.map +1 -0
  88. package/lib/{utils → cjs/utils}/decorators/decoratorArgs.d.ts +0 -0
  89. package/lib/cjs/utils/decorators/decoratorArgs.js +9 -0
  90. package/lib/cjs/utils/decorators/decoratorArgs.js.map +1 -0
  91. package/lib/{utils → cjs/utils}/decorators/decoratorTypeOf.d.ts +0 -0
  92. package/lib/cjs/utils/decorators/decoratorTypeOf.js +23 -0
  93. package/lib/cjs/utils/decorators/decoratorTypeOf.js.map +1 -0
  94. package/lib/{utils → cjs/utils}/decorators/inheritedDescriptorOf.d.ts +0 -0
  95. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js +15 -0
  96. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  97. package/lib/{utils → cjs/utils}/decorators/useDecorators.d.ts +0 -0
  98. package/lib/cjs/utils/decorators/useDecorators.js +14 -0
  99. package/lib/cjs/utils/decorators/useDecorators.js.map +1 -0
  100. package/lib/{utils → cjs/utils}/decorators/useMethodDecorators.d.ts +0 -0
  101. package/lib/cjs/utils/decorators/useMethodDecorators.js +15 -0
  102. package/lib/cjs/utils/decorators/useMethodDecorators.js.map +1 -0
  103. package/lib/{utils → cjs/utils}/imports/importPackage.d.ts +0 -0
  104. package/lib/cjs/utils/imports/importPackage.js +35 -0
  105. package/lib/cjs/utils/imports/importPackage.js.map +1 -0
  106. package/lib/{utils → cjs/utils}/index.d.ts +0 -0
  107. package/lib/cjs/utils/index.js +18 -0
  108. package/lib/cjs/utils/index.js.map +1 -0
  109. package/lib/{utils → cjs/utils}/objects/ancestorOf.d.ts +0 -0
  110. package/lib/cjs/utils/objects/ancestorOf.js +12 -0
  111. package/lib/cjs/utils/objects/ancestorOf.js.map +1 -0
  112. package/lib/{utils → cjs/utils}/objects/ancestorsOf.d.ts +0 -0
  113. package/lib/cjs/utils/objects/ancestorsOf.js +22 -0
  114. package/lib/cjs/utils/objects/ancestorsOf.js.map +1 -0
  115. package/lib/{utils → cjs/utils}/objects/classOf.d.ts +0 -0
  116. package/lib/cjs/utils/objects/classOf.js +23 -0
  117. package/lib/cjs/utils/objects/classOf.js.map +1 -0
  118. package/lib/{utils → cjs/utils}/objects/cleanObject.d.ts +0 -0
  119. package/lib/cjs/utils/objects/cleanObject.js +24 -0
  120. package/lib/cjs/utils/objects/cleanObject.js.map +1 -0
  121. package/lib/{utils → cjs/utils}/objects/constructorOf.d.ts +0 -0
  122. package/lib/cjs/utils/objects/constructorOf.js +20 -0
  123. package/lib/cjs/utils/objects/constructorOf.js.map +1 -0
  124. package/lib/{utils → cjs/utils}/objects/createInstance.d.ts +0 -0
  125. package/lib/cjs/utils/objects/createInstance.js +9 -0
  126. package/lib/cjs/utils/objects/createInstance.js.map +1 -0
  127. package/lib/{utils → cjs/utils}/objects/deepClone.d.ts +0 -0
  128. package/lib/cjs/utils/objects/deepClone.js +57 -0
  129. package/lib/cjs/utils/objects/deepClone.js.map +1 -0
  130. package/lib/{utils → cjs/utils}/objects/deepExtends.d.ts +0 -0
  131. package/lib/cjs/utils/objects/deepExtends.js +79 -0
  132. package/lib/cjs/utils/objects/deepExtends.js.map +1 -0
  133. package/lib/{utils → cjs/utils}/objects/deepMerge.d.ts +0 -0
  134. package/lib/cjs/utils/objects/deepMerge.js +63 -0
  135. package/lib/cjs/utils/objects/deepMerge.js.map +1 -0
  136. package/lib/{utils → cjs/utils}/objects/descriptorOf.d.ts +0 -0
  137. package/lib/cjs/utils/objects/descriptorOf.js +19 -0
  138. package/lib/cjs/utils/objects/descriptorOf.js.map +1 -0
  139. package/lib/{utils → cjs/utils}/objects/getClassOrSymbol.d.ts +0 -0
  140. package/lib/cjs/utils/objects/getClassOrSymbol.js +10 -0
  141. package/lib/cjs/utils/objects/getClassOrSymbol.js.map +1 -0
  142. package/lib/{utils → cjs/utils}/objects/getConstructorArgNames.d.ts +0 -0
  143. package/lib/cjs/utils/objects/getConstructorArgNames.js +9 -0
  144. package/lib/cjs/utils/objects/getConstructorArgNames.js.map +1 -0
  145. package/lib/{utils → cjs/utils}/objects/getEnumerableKeys.d.ts +0 -0
  146. package/lib/cjs/utils/objects/getEnumerableKeys.js +20 -0
  147. package/lib/cjs/utils/objects/getEnumerableKeys.js.map +1 -0
  148. package/lib/{utils → cjs/utils}/objects/getValue.d.ts +0 -0
  149. package/lib/cjs/utils/objects/getValue.js +49 -0
  150. package/lib/cjs/utils/objects/getValue.js.map +1 -0
  151. package/lib/{utils → cjs/utils}/objects/index.d.ts +0 -0
  152. package/lib/cjs/utils/objects/index.js +47 -0
  153. package/lib/cjs/utils/objects/index.js.map +1 -0
  154. package/lib/{utils → cjs/utils}/objects/isArray.d.ts +0 -0
  155. package/lib/cjs/utils/objects/isArray.js +23 -0
  156. package/lib/cjs/utils/objects/isArray.js.map +1 -0
  157. package/lib/{utils → cjs/utils}/objects/isArrowFn.d.ts +0 -0
  158. package/lib/cjs/utils/objects/isArrowFn.js +9 -0
  159. package/lib/cjs/utils/objects/isArrowFn.js.map +1 -0
  160. package/lib/{utils → cjs/utils}/objects/isBoolean.d.ts +0 -0
  161. package/lib/cjs/utils/objects/isBoolean.js +17 -0
  162. package/lib/cjs/utils/objects/isBoolean.js.map +1 -0
  163. package/lib/{utils → cjs/utils}/objects/isClass.d.ts +0 -0
  164. package/lib/cjs/utils/objects/isClass.js +26 -0
  165. package/lib/cjs/utils/objects/isClass.js.map +1 -0
  166. package/lib/{utils → cjs/utils}/objects/isCollection.d.ts +0 -0
  167. package/lib/cjs/utils/objects/isCollection.js +22 -0
  168. package/lib/cjs/utils/objects/isCollection.js.map +1 -0
  169. package/lib/{utils → cjs/utils}/objects/isDate.d.ts +0 -0
  170. package/lib/cjs/utils/objects/isDate.js +13 -0
  171. package/lib/cjs/utils/objects/isDate.js.map +1 -0
  172. package/lib/{utils → cjs/utils}/objects/isEmpty.d.ts +0 -0
  173. package/lib/cjs/utils/objects/isEmpty.js +14 -0
  174. package/lib/cjs/utils/objects/isEmpty.js.map +1 -0
  175. package/lib/{utils → cjs/utils}/objects/isEnumerable.d.ts +0 -0
  176. package/lib/cjs/utils/objects/isEnumerable.js +22 -0
  177. package/lib/cjs/utils/objects/isEnumerable.js.map +1 -0
  178. package/lib/{utils → cjs/utils}/objects/isFunction.d.ts +0 -0
  179. package/lib/cjs/utils/objects/isFunction.js +8 -0
  180. package/lib/cjs/utils/objects/isFunction.js.map +1 -0
  181. package/lib/{utils → cjs/utils}/objects/isInheritedFrom.d.ts +0 -0
  182. package/lib/cjs/utils/objects/isInheritedFrom.js +26 -0
  183. package/lib/cjs/utils/objects/isInheritedFrom.js.map +1 -0
  184. package/lib/{utils → cjs/utils}/objects/isNil.d.ts +0 -0
  185. package/lib/cjs/utils/objects/isNil.js +8 -0
  186. package/lib/cjs/utils/objects/isNil.js.map +1 -0
  187. package/lib/{utils → cjs/utils}/objects/isNumber.d.ts +0 -0
  188. package/lib/cjs/utils/objects/isNumber.js +17 -0
  189. package/lib/cjs/utils/objects/isNumber.js.map +1 -0
  190. package/lib/{utils → cjs/utils}/objects/isObject.d.ts +0 -0
  191. package/lib/cjs/utils/objects/isObject.js +8 -0
  192. package/lib/cjs/utils/objects/isObject.js.map +1 -0
  193. package/lib/{utils → cjs/utils}/objects/isObservable.d.ts +0 -0
  194. package/lib/cjs/utils/objects/isObservable.js +8 -0
  195. package/lib/cjs/utils/objects/isObservable.js.map +1 -0
  196. package/lib/{utils → cjs/utils}/objects/isPlainObject.d.ts +0 -0
  197. package/lib/cjs/utils/objects/isPlainObject.js +18 -0
  198. package/lib/cjs/utils/objects/isPlainObject.js.map +1 -0
  199. package/lib/{utils → cjs/utils}/objects/isPrimitive.d.ts +0 -0
  200. package/lib/cjs/utils/objects/isPrimitive.js +30 -0
  201. package/lib/cjs/utils/objects/isPrimitive.js.map +1 -0
  202. package/lib/{utils → cjs/utils}/objects/isPromise.d.ts +0 -0
  203. package/lib/cjs/utils/objects/isPromise.js +16 -0
  204. package/lib/cjs/utils/objects/isPromise.js.map +1 -0
  205. package/lib/{utils → cjs/utils}/objects/isProtectedKey.d.ts +0 -0
  206. package/lib/cjs/utils/objects/isProtectedKey.js +12 -0
  207. package/lib/cjs/utils/objects/isProtectedKey.js.map +1 -0
  208. package/lib/{utils → cjs/utils}/objects/isSerializable.d.ts +0 -0
  209. package/lib/cjs/utils/objects/isSerializable.js +13 -0
  210. package/lib/cjs/utils/objects/isSerializable.js.map +1 -0
  211. package/lib/{utils → cjs/utils}/objects/isStream.d.ts +0 -0
  212. package/lib/cjs/utils/objects/isStream.js +8 -0
  213. package/lib/cjs/utils/objects/isStream.js.map +1 -0
  214. package/lib/{utils → cjs/utils}/objects/isString.d.ts +0 -0
  215. package/lib/cjs/utils/objects/isString.js +16 -0
  216. package/lib/cjs/utils/objects/isString.js.map +1 -0
  217. package/lib/{utils → cjs/utils}/objects/isSymbol.d.ts +0 -0
  218. package/lib/cjs/utils/objects/isSymbol.js +16 -0
  219. package/lib/cjs/utils/objects/isSymbol.js.map +1 -0
  220. package/lib/{utils → cjs/utils}/objects/methodsOf.d.ts +0 -0
  221. package/lib/cjs/utils/objects/methodsOf.js +25 -0
  222. package/lib/cjs/utils/objects/methodsOf.js.map +1 -0
  223. package/lib/{utils → cjs/utils}/objects/nameOf.d.ts +0 -0
  224. package/lib/cjs/utils/objects/nameOf.js +32 -0
  225. package/lib/cjs/utils/objects/nameOf.js.map +1 -0
  226. package/lib/{utils → cjs/utils}/objects/objectKeys.d.ts +0 -0
  227. package/lib/cjs/utils/objects/objectKeys.js +9 -0
  228. package/lib/cjs/utils/objects/objectKeys.js.map +1 -0
  229. package/lib/{utils → cjs/utils}/objects/primitiveOf.d.ts +0 -0
  230. package/lib/cjs/utils/objects/primitiveOf.js +20 -0
  231. package/lib/cjs/utils/objects/primitiveOf.js.map +1 -0
  232. package/lib/{utils → cjs/utils}/objects/prototypeOf.d.ts +0 -0
  233. package/lib/cjs/utils/objects/prototypeOf.js +14 -0
  234. package/lib/cjs/utils/objects/prototypeOf.js.map +1 -0
  235. package/lib/{utils → cjs/utils}/objects/setValue.d.ts +0 -0
  236. package/lib/cjs/utils/objects/setValue.js +34 -0
  237. package/lib/cjs/utils/objects/setValue.js.map +1 -0
  238. package/lib/{utils → cjs/utils}/objects/toMap.d.ts +0 -0
  239. package/lib/cjs/utils/objects/toMap.js +32 -0
  240. package/lib/cjs/utils/objects/toMap.js.map +1 -0
  241. package/lib/{utils → cjs/utils}/objects/toStringConstructor.d.ts +0 -0
  242. package/lib/cjs/utils/objects/toStringConstructor.js +12 -0
  243. package/lib/cjs/utils/objects/toStringConstructor.js.map +1 -0
  244. package/lib/{utils → cjs/utils}/proxyDelegation.d.ts +0 -0
  245. package/lib/cjs/utils/proxyDelegation.js +54 -0
  246. package/lib/cjs/utils/proxyDelegation.js.map +1 -0
  247. package/lib/{utils → cjs/utils}/uniq.d.ts +0 -0
  248. package/lib/cjs/utils/uniq.js +16 -0
  249. package/lib/cjs/utils/uniq.js.map +1 -0
  250. package/lib/esm/decorators/configurable.js +14 -0
  251. package/lib/esm/decorators/configurable.js.map +1 -0
  252. package/lib/esm/decorators/deprecated.js +39 -0
  253. package/lib/esm/decorators/deprecated.js.map +1 -0
  254. package/lib/esm/decorators/enumerable.js +14 -0
  255. package/lib/esm/decorators/enumerable.js.map +1 -0
  256. package/lib/esm/decorators/index.js +15 -0
  257. package/lib/esm/decorators/index.js.map +1 -0
  258. package/lib/esm/decorators/notConfigurable.js +9 -0
  259. package/lib/esm/decorators/notConfigurable.js.map +1 -0
  260. package/lib/esm/decorators/notEnumerable.js +9 -0
  261. package/lib/esm/decorators/notEnumerable.js.map +1 -0
  262. package/lib/esm/decorators/readOnly.js +9 -0
  263. package/lib/esm/decorators/readOnly.js.map +1 -0
  264. package/lib/esm/decorators/storeFn.js +18 -0
  265. package/lib/esm/decorators/storeFn.js.map +1 -0
  266. package/lib/esm/decorators/storeMerge.js +7 -0
  267. package/lib/esm/decorators/storeMerge.js.map +1 -0
  268. package/lib/esm/decorators/storeSet.js +7 -0
  269. package/lib/esm/decorators/storeSet.js.map +1 -0
  270. package/lib/esm/decorators/writable.js +14 -0
  271. package/lib/esm/decorators/writable.js.map +1 -0
  272. package/lib/esm/domain/AnyToPromise.js +144 -0
  273. package/lib/esm/domain/AnyToPromise.js.map +1 -0
  274. package/lib/esm/domain/DecoratorTypes.js +12 -0
  275. package/lib/esm/domain/DecoratorTypes.js.map +1 -0
  276. package/lib/esm/domain/Env.js +16 -0
  277. package/lib/esm/domain/Env.js.map +1 -0
  278. package/lib/esm/domain/Hooks.js +85 -0
  279. package/lib/esm/domain/Hooks.js.map +1 -0
  280. package/lib/esm/domain/Metadata.js +504 -0
  281. package/lib/esm/domain/Metadata.js.map +1 -0
  282. package/lib/esm/domain/Store.js +153 -0
  283. package/lib/esm/domain/Store.js.map +1 -0
  284. package/lib/esm/domain/Type.js +4 -0
  285. package/lib/esm/domain/Type.js.map +1 -0
  286. package/lib/esm/domain/index.js +8 -0
  287. package/lib/esm/domain/index.js.map +1 -0
  288. package/lib/esm/errors/UnsupportedDecoratorType.js +17 -0
  289. package/lib/esm/errors/UnsupportedDecoratorType.js.map +1 -0
  290. package/lib/esm/index.js +6 -0
  291. package/lib/esm/index.js.map +1 -0
  292. package/lib/esm/interfaces/AnyDecorator.js +2 -0
  293. package/lib/esm/interfaces/AnyDecorator.js.map +1 -0
  294. package/lib/esm/interfaces/DecoratorParameters.js +2 -0
  295. package/lib/esm/interfaces/DecoratorParameters.js.map +1 -0
  296. package/lib/esm/interfaces/HashOf.js +2 -0
  297. package/lib/esm/interfaces/HashOf.js.map +1 -0
  298. package/lib/esm/interfaces/MetadataTypes.js +2 -0
  299. package/lib/esm/interfaces/MetadataTypes.js.map +1 -0
  300. package/lib/esm/interfaces/ValueOf.js +2 -0
  301. package/lib/esm/interfaces/ValueOf.js.map +1 -0
  302. package/lib/esm/interfaces/index.js +2 -0
  303. package/lib/esm/interfaces/index.js.map +1 -0
  304. package/lib/esm/utils/catchError.js +17 -0
  305. package/lib/esm/utils/catchError.js.map +1 -0
  306. package/lib/esm/utils/decorators/decorateMethodsOf.js +19 -0
  307. package/lib/esm/utils/decorators/decorateMethodsOf.js.map +1 -0
  308. package/lib/esm/utils/decorators/decoratorArgs.js +5 -0
  309. package/lib/esm/utils/decorators/decoratorArgs.js.map +1 -0
  310. package/lib/esm/utils/decorators/decoratorTypeOf.js +19 -0
  311. package/lib/esm/utils/decorators/decoratorTypeOf.js.map +1 -0
  312. package/lib/esm/utils/decorators/inheritedDescriptorOf.js +11 -0
  313. package/lib/esm/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  314. package/lib/esm/utils/decorators/useDecorators.js +10 -0
  315. package/lib/esm/utils/decorators/useDecorators.js.map +1 -0
  316. package/lib/esm/utils/decorators/useMethodDecorators.js +10 -0
  317. package/lib/esm/utils/decorators/useMethodDecorators.js.map +1 -0
  318. package/lib/esm/utils/imports/importPackage.js +12 -0
  319. package/lib/esm/utils/imports/importPackage.js.map +1 -0
  320. package/lib/esm/utils/index.js +15 -0
  321. package/lib/esm/utils/index.js.map +1 -0
  322. package/lib/esm/utils/objects/ancestorOf.js +7 -0
  323. package/lib/esm/utils/objects/ancestorOf.js.map +1 -0
  324. package/lib/esm/utils/objects/ancestorsOf.js +18 -0
  325. package/lib/esm/utils/objects/ancestorsOf.js.map +1 -0
  326. package/lib/esm/utils/objects/classOf.js +18 -0
  327. package/lib/esm/utils/objects/classOf.js.map +1 -0
  328. package/lib/esm/utils/objects/cleanObject.js +20 -0
  329. package/lib/esm/utils/objects/cleanObject.js.map +1 -0
  330. package/lib/esm/utils/objects/constructorOf.js +15 -0
  331. package/lib/esm/utils/objects/constructorOf.js.map +1 -0
  332. package/lib/esm/utils/objects/createInstance.js +5 -0
  333. package/lib/esm/utils/objects/createInstance.js.map +1 -0
  334. package/lib/esm/utils/objects/deepClone.js +53 -0
  335. package/lib/esm/utils/objects/deepClone.js.map +1 -0
  336. package/lib/esm/utils/objects/deepExtends.js +75 -0
  337. package/lib/esm/utils/objects/deepExtends.js.map +1 -0
  338. package/lib/esm/utils/objects/deepMerge.js +58 -0
  339. package/lib/esm/utils/objects/deepMerge.js.map +1 -0
  340. package/lib/esm/utils/objects/descriptorOf.js +14 -0
  341. package/lib/esm/utils/objects/descriptorOf.js.map +1 -0
  342. package/lib/esm/utils/objects/getClassOrSymbol.js +6 -0
  343. package/lib/esm/utils/objects/getClassOrSymbol.js.map +1 -0
  344. package/lib/esm/utils/objects/getConstructorArgNames.js +5 -0
  345. package/lib/esm/utils/objects/getConstructorArgNames.js.map +1 -0
  346. package/lib/esm/utils/objects/getEnumerableKeys.js +16 -0
  347. package/lib/esm/utils/objects/getEnumerableKeys.js.map +1 -0
  348. package/lib/esm/utils/objects/getValue.js +45 -0
  349. package/lib/esm/utils/objects/getValue.js.map +1 -0
  350. package/lib/esm/utils/objects/index.js +44 -0
  351. package/lib/esm/utils/objects/index.js.map +1 -0
  352. package/lib/esm/utils/objects/isArray.js +18 -0
  353. package/lib/esm/utils/objects/isArray.js.map +1 -0
  354. package/lib/esm/utils/objects/isArrowFn.js +5 -0
  355. package/lib/esm/utils/objects/isArrowFn.js.map +1 -0
  356. package/lib/esm/utils/objects/isBoolean.js +12 -0
  357. package/lib/esm/utils/objects/isBoolean.js.map +1 -0
  358. package/lib/esm/utils/objects/isClass.js +22 -0
  359. package/lib/esm/utils/objects/isClass.js.map +1 -0
  360. package/lib/esm/utils/objects/isCollection.js +18 -0
  361. package/lib/esm/utils/objects/isCollection.js.map +1 -0
  362. package/lib/esm/utils/objects/isDate.js +9 -0
  363. package/lib/esm/utils/objects/isDate.js.map +1 -0
  364. package/lib/esm/utils/objects/isEmpty.js +10 -0
  365. package/lib/esm/utils/objects/isEmpty.js.map +1 -0
  366. package/lib/esm/utils/objects/isEnumerable.js +18 -0
  367. package/lib/esm/utils/objects/isEnumerable.js.map +1 -0
  368. package/lib/esm/utils/objects/isFunction.js +4 -0
  369. package/lib/esm/utils/objects/isFunction.js.map +1 -0
  370. package/lib/esm/utils/objects/isInheritedFrom.js +22 -0
  371. package/lib/esm/utils/objects/isInheritedFrom.js.map +1 -0
  372. package/lib/esm/utils/objects/isNil.js +4 -0
  373. package/lib/esm/utils/objects/isNil.js.map +1 -0
  374. package/lib/esm/utils/objects/isNumber.js +12 -0
  375. package/lib/esm/utils/objects/isNumber.js.map +1 -0
  376. package/lib/esm/utils/objects/isObject.js +4 -0
  377. package/lib/esm/utils/objects/isObject.js.map +1 -0
  378. package/lib/esm/utils/objects/isObservable.js +4 -0
  379. package/lib/esm/utils/objects/isObservable.js.map +1 -0
  380. package/lib/esm/utils/objects/isPlainObject.js +13 -0
  381. package/lib/esm/utils/objects/isPlainObject.js.map +1 -0
  382. package/lib/esm/utils/objects/isPrimitive.js +24 -0
  383. package/lib/esm/utils/objects/isPrimitive.js.map +1 -0
  384. package/lib/esm/utils/objects/isPromise.js +12 -0
  385. package/lib/esm/utils/objects/isPromise.js.map +1 -0
  386. package/lib/esm/utils/objects/isProtectedKey.js +8 -0
  387. package/lib/esm/utils/objects/isProtectedKey.js.map +1 -0
  388. package/lib/esm/utils/objects/isSerializable.js +9 -0
  389. package/lib/esm/utils/objects/isSerializable.js.map +1 -0
  390. package/lib/esm/utils/objects/isStream.js +4 -0
  391. package/lib/esm/utils/objects/isStream.js.map +1 -0
  392. package/lib/esm/utils/objects/isString.js +11 -0
  393. package/lib/esm/utils/objects/isString.js.map +1 -0
  394. package/lib/esm/utils/objects/isSymbol.js +11 -0
  395. package/lib/esm/utils/objects/isSymbol.js.map +1 -0
  396. package/lib/esm/utils/objects/methodsOf.js +21 -0
  397. package/lib/esm/utils/objects/methodsOf.js.map +1 -0
  398. package/lib/esm/utils/objects/nameOf.js +26 -0
  399. package/lib/esm/utils/objects/nameOf.js.map +1 -0
  400. package/lib/esm/utils/objects/objectKeys.js +5 -0
  401. package/lib/esm/utils/objects/objectKeys.js.map +1 -0
  402. package/lib/esm/utils/objects/primitiveOf.js +16 -0
  403. package/lib/esm/utils/objects/primitiveOf.js.map +1 -0
  404. package/lib/esm/utils/objects/prototypeOf.js +10 -0
  405. package/lib/esm/utils/objects/prototypeOf.js.map +1 -0
  406. package/lib/esm/utils/objects/setValue.js +30 -0
  407. package/lib/esm/utils/objects/setValue.js.map +1 -0
  408. package/lib/esm/utils/objects/toMap.js +28 -0
  409. package/lib/esm/utils/objects/toMap.js.map +1 -0
  410. package/lib/esm/utils/objects/toStringConstructor.js +8 -0
  411. package/lib/esm/utils/objects/toStringConstructor.js.map +1 -0
  412. package/lib/esm/utils/proxyDelegation.js +50 -0
  413. package/lib/esm/utils/proxyDelegation.js.map +1 -0
  414. package/lib/esm/utils/uniq.js +11 -0
  415. package/lib/esm/utils/uniq.js.map +1 -0
  416. package/lib/types/decorators/configurable.d.ts +2 -0
  417. package/lib/types/decorators/deprecated.d.ts +32 -0
  418. package/lib/types/decorators/enumerable.d.ts +2 -0
  419. package/lib/types/decorators/index.d.ts +14 -0
  420. package/lib/types/decorators/notConfigurable.d.ts +2 -0
  421. package/lib/types/decorators/notEnumerable.d.ts +2 -0
  422. package/lib/types/decorators/readOnly.d.ts +2 -0
  423. package/lib/types/decorators/storeFn.d.ts +9 -0
  424. package/lib/types/decorators/storeMerge.d.ts +1 -0
  425. package/lib/types/decorators/storeSet.d.ts +1 -0
  426. package/lib/types/decorators/writable.d.ts +2 -0
  427. package/lib/types/domain/AnyToPromise.d.ts +42 -0
  428. package/lib/types/domain/DecoratorTypes.d.ts +10 -0
  429. package/lib/types/domain/Env.d.ts +13 -0
  430. package/lib/types/domain/Hooks.d.ts +45 -0
  431. package/lib/types/domain/Metadata.d.ts +442 -0
  432. package/lib/types/domain/Store.d.ts +69 -0
  433. package/lib/types/domain/Type.d.ts +11 -0
  434. package/lib/types/domain/index.d.ts +7 -0
  435. package/lib/types/errors/UnsupportedDecoratorType.d.ts +5 -0
  436. package/lib/types/index.d.ts +6 -0
  437. package/lib/types/interfaces/AnyDecorator.d.ts +1 -0
  438. package/lib/types/interfaces/DecoratorParameters.d.ts +3 -0
  439. package/lib/types/interfaces/HashOf.d.ts +1 -0
  440. package/lib/types/interfaces/MetadataTypes.d.ts +5 -0
  441. package/lib/types/interfaces/ValueOf.d.ts +1 -0
  442. package/lib/types/interfaces/index.d.ts +4 -0
  443. package/lib/types/utils/catchError.d.ts +2 -0
  444. package/lib/types/utils/decorators/decorateMethodsOf.d.ts +1 -0
  445. package/lib/types/utils/decorators/decoratorArgs.d.ts +2 -0
  446. package/lib/types/utils/decorators/decoratorTypeOf.d.ts +2 -0
  447. package/lib/types/utils/decorators/inheritedDescriptorOf.d.ts +1 -0
  448. package/lib/types/utils/decorators/useDecorators.d.ts +2 -0
  449. package/lib/types/utils/decorators/useMethodDecorators.d.ts +3 -0
  450. package/lib/types/utils/imports/importPackage.d.ts +1 -0
  451. package/lib/types/utils/index.d.ts +12 -0
  452. package/lib/types/utils/objects/ancestorOf.d.ts +2 -0
  453. package/lib/types/utils/objects/ancestorsOf.d.ts +6 -0
  454. package/lib/types/utils/objects/classOf.d.ts +13 -0
  455. package/lib/types/utils/objects/cleanObject.d.ts +6 -0
  456. package/lib/types/utils/objects/constructorOf.d.ts +11 -0
  457. package/lib/types/utils/objects/createInstance.d.ts +1 -0
  458. package/lib/types/utils/objects/deepClone.d.ts +6 -0
  459. package/lib/types/utils/objects/deepExtends.d.ts +10 -0
  460. package/lib/types/utils/objects/deepMerge.d.ts +9 -0
  461. package/lib/types/utils/objects/descriptorOf.d.ts +8 -0
  462. package/lib/types/utils/objects/getClassOrSymbol.d.ts +1 -0
  463. package/lib/types/utils/objects/getConstructorArgNames.d.ts +1 -0
  464. package/lib/types/utils/objects/getEnumerableKeys.d.ts +5 -0
  465. package/lib/types/utils/objects/getValue.d.ts +32 -0
  466. package/lib/types/utils/objects/index.d.ts +43 -0
  467. package/lib/types/utils/objects/isArray.d.ts +13 -0
  468. package/lib/types/utils/objects/isArrowFn.d.ts +1 -0
  469. package/lib/types/utils/objects/isBoolean.d.ts +7 -0
  470. package/lib/types/utils/objects/isClass.d.ts +1 -0
  471. package/lib/types/utils/objects/isCollection.d.ts +6 -0
  472. package/lib/types/utils/objects/isDate.d.ts +6 -0
  473. package/lib/types/utils/objects/isEmpty.d.ts +6 -0
  474. package/lib/types/utils/objects/isEnumerable.d.ts +6 -0
  475. package/lib/types/utils/objects/isFunction.d.ts +1 -0
  476. package/lib/types/utils/objects/isInheritedFrom.d.ts +1 -0
  477. package/lib/types/utils/objects/isNil.d.ts +1 -0
  478. package/lib/types/utils/objects/isNumber.d.ts +7 -0
  479. package/lib/types/utils/objects/isObject.d.ts +1 -0
  480. package/lib/types/utils/objects/isObservable.d.ts +1 -0
  481. package/lib/types/utils/objects/isPlainObject.d.ts +7 -0
  482. package/lib/types/utils/objects/isPrimitive.d.ts +14 -0
  483. package/lib/types/utils/objects/isPromise.d.ts +7 -0
  484. package/lib/types/utils/objects/isProtectedKey.d.ts +5 -0
  485. package/lib/types/utils/objects/isSerializable.d.ts +1 -0
  486. package/lib/types/utils/objects/isStream.d.ts +1 -0
  487. package/lib/types/utils/objects/isString.d.ts +6 -0
  488. package/lib/types/utils/objects/isSymbol.d.ts +6 -0
  489. package/lib/types/utils/objects/methodsOf.d.ts +5 -0
  490. package/lib/types/utils/objects/nameOf.d.ts +14 -0
  491. package/lib/types/utils/objects/objectKeys.d.ts +1 -0
  492. package/lib/types/utils/objects/primitiveOf.d.ts +1 -0
  493. package/lib/types/utils/objects/prototypeOf.d.ts +6 -0
  494. package/lib/types/utils/objects/setValue.d.ts +1 -0
  495. package/lib/types/utils/objects/toMap.d.ts +3 -0
  496. package/lib/types/utils/objects/toStringConstructor.d.ts +1 -0
  497. package/lib/types/utils/proxyDelegation.d.ts +33 -0
  498. package/lib/types/utils/uniq.d.ts +2 -0
  499. package/package.json +10 -6
  500. package/tsconfig.compile.esm.json +23 -0
  501. package/lib/index.js +0 -2317
  502. package/lib/index.js.map +0 -1
  503. package/lib/index.modern.js +0 -2207
  504. package/lib/index.modern.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnyToPromise.js","sourceRoot":"","sources":["../../../src/domain/AnyToPromise.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,2BAA2B,CAAC;AAEnD;;GAEG;AACH,SAAS,UAAU,CAAC,GAAQ;IAC1B,O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,CAAC,CAAC;qBAC3D,KAAK,CAAC,CAAC,KAAU,EAAE,EAAE;oBACpB,IAAI,KAAK,CAAC,QAAQ,IAAI,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;wBAChD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;qBACpC;oBACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC5B,CAAC,CAAC,CAAC;aACN;SACF;QAED,IAAI,CAAC,uBAAA,IAAI,qCAAiB,EAAE;YAC1B,sCAAsC;YACtC,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,GAAG,eAAe;gBAClB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,yBAAyB,CAAC,IAAI;aACrC,CAAC,CAAC;SACJ;IACH,CAAC;IAES,kBAAkB,CAAC,OAAY;QACvC,OAAO,OAAO,KAAK,kBAAkB,CAAC,QAAQ,CAAC;IACjD,CAAC;CACF","sourcesContent":["import {isObservable} from \"../utils/objects/isObservable\";\nimport {isPromise} from \"../utils/objects/isPromise\";\nimport {isStream} from \"../utils/objects/isStream\";\n\n/**\n * @ignore\n */\nfunction isResponse(obj: any) {\n return obj.data && obj.headers && obj.status && obj.statusText;\n}\n\n/**\n * @ignore\n */\nexport enum AnyToPromiseStatus {\n PENDING = \"PENDING\",\n CANCELED = \"CANCELED\",\n RESOLVED = \"RESOLVED\",\n REJECTED = \"REJECTED\"\n}\n\nexport enum AnyToPromiseResponseTypes {\n STREAM = \"STREAM\",\n BUFFER = \"BUFFER\",\n DATA = \"DATA\"\n}\n\nexport interface AnyPromiseResult<T = any> {\n state: AnyToPromiseStatus;\n type: AnyToPromiseResponseTypes;\n status?: number;\n headers?: Record<string, any>;\n data: T;\n}\n\nexport class AnyToPromise<T = any> {\n public status = AnyToPromiseStatus.PENDING;\n public args: any[];\n\n #resolves: any;\n #rejects: any;\n #hasNextFunction = false;\n\n readonly #promise: Promise<AnyPromiseResult<T>>;\n\n constructor({hasNextFunction = false}: {hasNextFunction?: boolean} = {}) {\n this.#hasNextFunction = hasNextFunction;\n\n this.#promise = new Promise((resolve: any, reject: any) => {\n this.#resolves = resolve;\n this.#rejects = reject;\n });\n }\n\n isDone(): boolean {\n return this.status !== AnyToPromiseStatus.PENDING;\n }\n\n get next() {\n this.#hasNextFunction = true;\n\n return (error?: any) => {\n if (this.isDone()) {\n return;\n }\n\n return error ? this.reject(error) : this.resolve({type: AnyToPromiseResponseTypes.DATA});\n };\n }\n\n /**\n *\n */\n async call(cb: Function): Promise<AnyPromiseResult<T>> {\n if (this.isDone()) {\n return this as any;\n }\n\n try {\n this.handle(cb());\n } catch (er) {\n this.reject(er);\n }\n\n return this.#promise;\n }\n\n reject(er: any) {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.REJECTED);\n\n this.#rejects(er);\n }\n\n resolve(response: any = {}) {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.RESOLVED);\n\n this.#resolves({...response, state: AnyToPromiseStatus.RESOLVED});\n }\n\n destroy() {}\n\n cancel() {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.CANCELED);\n\n return this.#resolves({state: AnyToPromiseStatus.CANCELED});\n }\n\n done(status: AnyToPromiseStatus) {\n this.destroy();\n this.status = status;\n }\n\n handle(process: any, additionalProps = {}): any {\n if (this.isDone()) {\n return;\n }\n\n if (process) {\n if (this.isCanceledResponse(process)) {\n // ABANDON\n return this.cancel();\n }\n\n if (isObservable(process)) {\n process = process.toPromise();\n }\n\n if (isResponse(process)) {\n return this.handle(process.data, {\n ...additionalProps,\n status: process.status,\n headers: process.headers\n });\n }\n\n if (isStream(process)) {\n return this.resolve({...additionalProps, type: AnyToPromiseResponseTypes.STREAM, data: process});\n }\n if (isStream(process) || Buffer.isBuffer(process)) {\n return this.resolve({...additionalProps, type: AnyToPromiseResponseTypes.BUFFER, data: process});\n }\n\n if (isPromise(process)) {\n return process\n .then((result: any) => this.handle(result, additionalProps))\n .catch((error: any) => {\n if (error.response && isResponse(error.response)) {\n return this.handle(error.response);\n }\n return this.reject(error);\n });\n }\n }\n\n if (!this.#hasNextFunction) {\n // no next function and empty response\n return this.resolve({\n ...additionalProps,\n data: process,\n type: AnyToPromiseResponseTypes.DATA\n });\n }\n }\n\n protected isCanceledResponse(process: any) {\n return process === AnyToPromiseStatus.CANCELED;\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ export var DecoratorTypes;
2
+ (function (DecoratorTypes) {
3
+ DecoratorTypes["PARAM"] = "parameter";
4
+ DecoratorTypes["PARAM_CTOR"] = "parameter.constructor";
5
+ DecoratorTypes["PARAM_STC"] = "parameter.static";
6
+ DecoratorTypes["PROP"] = "property";
7
+ DecoratorTypes["PROP_STC"] = "property.static";
8
+ DecoratorTypes["METHOD"] = "method";
9
+ DecoratorTypes["METHOD_STC"] = "method.static";
10
+ DecoratorTypes["CLASS"] = "class";
11
+ })(DecoratorTypes || (DecoratorTypes = {}));
12
+ //# sourceMappingURL=DecoratorTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoratorTypes.js","sourceRoot":"","sources":["../../../src/domain/DecoratorTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,sDAAoC,CAAA;IACpC,gDAA8B,CAAA;IAC9B,mCAAiB,CAAA;IACjB,8CAA4B,CAAA;IAC5B,mCAAiB,CAAA;IACjB,8CAA4B,CAAA;IAC5B,iCAAe,CAAA;AACjB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB","sourcesContent":["export enum DecoratorTypes {\n PARAM = \"parameter\",\n PARAM_CTOR = \"parameter.constructor\",\n PARAM_STC = \"parameter.static\",\n PROP = \"property\",\n PROP_STC = \"property.static\",\n METHOD = \"method\",\n METHOD_STC = \"method.static\",\n CLASS = \"class\"\n}\n"]}
@@ -0,0 +1,16 @@
1
+ /**
2
+ *
3
+ */
4
+ export var Env;
5
+ (function (Env) {
6
+ Env["PROD"] = "production";
7
+ Env["DEV"] = "development";
8
+ Env["TEST"] = "test";
9
+ })(Env || (Env = {}));
10
+ /**
11
+ * Fallback
12
+ * @type {Env}
13
+ */
14
+ // tslint:disable-next-line: variable-name
15
+ export const EnvTypes = Env;
16
+ //# sourceMappingURL=Env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Env.js","sourceRoot":"","sources":["../../../src/domain/Env.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,GAIX;AAJD,WAAY,GAAG;IACb,0BAAmB,CAAA;IACnB,0BAAmB,CAAA;IACnB,oBAAa,CAAA;AACf,CAAC,EAJW,GAAG,KAAH,GAAG,QAId;AAED;;;GAGG;AACH,0CAA0C;AAC1C,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC","sourcesContent":["/**\n *\n */\nexport enum Env {\n PROD = \"production\",\n DEV = \"development\",\n TEST = \"test\"\n}\n\n/**\n * Fallback\n * @type {Env}\n */\n// tslint:disable-next-line: variable-name\nexport const EnvTypes = Env;\n"]}
@@ -0,0 +1,85 @@
1
+ export class Hooks {
2
+ constructor() {
3
+ this.listeners = new Map();
4
+ }
5
+ /**
6
+ * Listen a hook event
7
+ * @param event
8
+ * @param cb
9
+ */
10
+ on(event, cb) {
11
+ if (!this.listeners.has(event)) {
12
+ this.listeners.set(event, []);
13
+ }
14
+ this.listeners.get(event).push(cb);
15
+ return this;
16
+ }
17
+ /**
18
+ * Remove a listener attached to an event
19
+ * @param event
20
+ * @param cb
21
+ */
22
+ off(event, cb) {
23
+ if (this.listeners.has(event)) {
24
+ this.listeners.set(event, this.listeners.get(event).filter((item) => item === cb));
25
+ }
26
+ return this;
27
+ }
28
+ /**
29
+ * Trigger an event and call listener.
30
+ * @param event
31
+ * @param args
32
+ * @param callThis
33
+ */
34
+ emit(event, args = [], callThis = null) {
35
+ if (this.listeners.has(event)) {
36
+ for (const cb of this.listeners.get(event)) {
37
+ cb.call(callThis, ...args);
38
+ }
39
+ }
40
+ }
41
+ /**
42
+ * Trigger an event, listener alter given value and return it.
43
+ * @param event
44
+ * @param value
45
+ * @param args
46
+ * @param callThis
47
+ */
48
+ alter(event, value, args = [], callThis = null) {
49
+ if (this.listeners.has(event)) {
50
+ for (const cb of this.listeners.get(event)) {
51
+ value = cb.call(callThis, value, ...args);
52
+ }
53
+ }
54
+ return value;
55
+ }
56
+ /**
57
+ * Trigger an event and call async listener.
58
+ * @param event
59
+ * @param args
60
+ * @param callThis
61
+ */
62
+ async asyncEmit(event, args = [], callThis = null) {
63
+ if (this.listeners.has(event)) {
64
+ for (const cb of this.listeners.get(event)) {
65
+ await cb.call(callThis, ...args);
66
+ }
67
+ }
68
+ }
69
+ /**
70
+ * Trigger an event, async listener alter given value and return it.
71
+ * @param event
72
+ * @param value
73
+ * @param args
74
+ * @param callThis
75
+ */
76
+ async asyncAlter(event, value, args = [], callThis = null) {
77
+ if (this.listeners.has(event)) {
78
+ for (const cb of this.listeners.get(event)) {
79
+ value = await cb.call(callThis, value, ...args);
80
+ }
81
+ }
82
+ return value;
83
+ }
84
+ }
85
+ //# sourceMappingURL=Hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hooks.js","sourceRoot":"","sources":["../../../src/domain/Hooks.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,KAAK;IAAlB;QACU,cAAS,GAA4B,IAAI,GAAG,EAAE,CAAC;IA8FzD,CAAC;IA5FC;;;;OAIG;IACH,EAAE,CAAC,KAAa,EAAE,EAAY;QAC5B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;SAC/B;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;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YAC7B,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAE,EAAE;gBAC3C,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC;aAClC;SACF;IACH,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,UAAU,CAAC,KAAa,EAAE,KAAU,EAAE,OAAiB,EAAE,EAAE,WAAgB,IAAI;QACnF,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC7B,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAE,EAAE;gBAC3C,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;aACjD;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["export class Hooks {\n private listeners: Map<string, Function[]> = new Map();\n\n /**\n * Listen a hook event\n * @param event\n * @param cb\n */\n on(event: string, cb: Function) {\n if (!this.listeners.has(event)) {\n this.listeners.set(event, []);\n }\n\n this.listeners.get(event)!.push(cb);\n\n return this;\n }\n\n /**\n * Remove a listener attached to an event\n * @param event\n * @param cb\n */\n off(event: string, cb: Function) {\n if (this.listeners.has(event)) {\n this.listeners.set(\n event,\n this.listeners.get(event)!.filter((item) => item === cb)\n );\n }\n\n return this;\n }\n\n /**\n * Trigger an event and call listener.\n * @param event\n * @param args\n * @param callThis\n */\n emit(event: string, args: any[] = [], callThis: any = null): void {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n cb.call(callThis, ...args);\n }\n }\n }\n\n /**\n * Trigger an event, listener alter given value and return it.\n * @param event\n * @param value\n * @param args\n * @param callThis\n */\n alter(event: string, value: any, args: any[] = [], callThis: any = null): any {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n value = cb.call(callThis, value, ...args);\n }\n }\n\n return value;\n }\n\n /**\n * Trigger an event and call async listener.\n * @param event\n * @param args\n * @param callThis\n */\n async asyncEmit(event: string, args: any[] = [], callThis: any = null): Promise<void> {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n await cb.call(callThis, ...args);\n }\n }\n }\n\n /**\n * Trigger an event, async listener alter given value and return it.\n * @param event\n * @param value\n * @param args\n * @param callThis\n */\n async asyncAlter(event: string, value: any, args: string[] = [], callThis: any = null): Promise<any> {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n value = await cb.call(callThis, value, ...args);\n }\n }\n\n return value;\n }\n}\n"]}
@@ -0,0 +1,504 @@
1
+ import "reflect-metadata";
2
+ import { classOf } from "../utils/objects/classOf";
3
+ /**
4
+ * Metadata key
5
+ * @private
6
+ * @type {string}
7
+ */
8
+ const DESIGN_PARAM_TYPES = "design:paramtypes";
9
+ /**
10
+ * Metadata key
11
+ * @private
12
+ * @type {string}
13
+ */
14
+ const DESIGN_TYPE = "design:type";
15
+ /**
16
+ * Metadata key
17
+ * @private
18
+ * @type {string}
19
+ */
20
+ const DESIGN_RETURN_TYPE = "design:returntype";
21
+ /**
22
+ * Properties collections
23
+ * @private
24
+ * @type {string}
25
+ */
26
+ const PROPERTIES = new Map();
27
+ /**
28
+ * @stable
29
+ */
30
+ export class Metadata {
31
+ /**
32
+ * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
33
+ * @param key A key used to store and retrieve metadata.
34
+ * @param target The target object on which the metadata is defined.
35
+ * @param propertyKey The property key for the target.
36
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
37
+ * @example
38
+ *
39
+ * ```typescript
40
+ * class Example {
41
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
42
+ * // static staticProperty;
43
+ * // property;
44
+ *
45
+ * static staticMethod(p) { }
46
+ * method(p) { }
47
+ * }
48
+ *
49
+ * // constructor
50
+ * result = Metadata.get("custom:annotation", Example);
51
+ *
52
+ * // property (on constructor)
53
+ * result = Metadata.get("custom:annotation", Example, "staticProperty");
54
+ *
55
+ * // property (on prototype)
56
+ * result = Metadata.get("custom:annotation", Example.prototype, "property");
57
+ *
58
+ * // method (on constructor)
59
+ * result = Metadata.get("custom:annotation", Example, "staticMethod");
60
+ *
61
+ * // method (on prototype)
62
+ * result = Metadata.get("custom:annotation", Example.prototype, "method");
63
+ * ```
64
+ *
65
+ */
66
+ static get(key, target, propertyKey) {
67
+ return Reflect.getMetadata(key, classOf(target), propertyKey);
68
+ }
69
+ /**
70
+ * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
71
+ * @param key A key used to store and retrieve metadata.
72
+ * @param target The target object on which the metadata is defined.
73
+ * @param propertyKey The property key for the target.
74
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
75
+ * @example
76
+ *
77
+ * ```typescript
78
+ * class Example {
79
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
80
+ * // static staticProperty;
81
+ * // property;
82
+ *
83
+ * static staticMethod(p) { }
84
+ * method(p) { }
85
+ * }
86
+ *
87
+ * // constructor
88
+ * result = Metadata.getOwn("custom:annotation", Example);
89
+ *
90
+ * // property (on constructor)
91
+ * result = Metadata.getOwn("custom:annotation", Example, "staticProperty");
92
+ *
93
+ * // property (on prototype)
94
+ * result = Metadata.getOwn("custom:annotation", Example.prototype, "property");
95
+ *
96
+ * // method (on constructor)
97
+ * result = Metadata.getOwn("custom:annotation", Example, "staticMethod");
98
+ *
99
+ * // method (on prototype)
100
+ * result = Metadata.getOwn("custom:annotation", Example.prototype, "method");
101
+ * ```
102
+ *
103
+ */
104
+ static getOwn(key, target, propertyKey) {
105
+ return Reflect.getOwnMetadata(key, classOf(target), propertyKey);
106
+ }
107
+ /**
108
+ * Gets the metadata value for the provided metadata DESIGN_TYPE on the target object or its prototype chain.
109
+ * @param target The target object on which the metadata is defined.
110
+ * @param propertyKey The property key for the target.
111
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
112
+ * @example
113
+ *
114
+ * ```typescript
115
+ * class Example {
116
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
117
+ * // static staticProperty;
118
+ * // property;
119
+ *
120
+ * static staticMethod(p) { }
121
+ * method(p) { }
122
+ * }
123
+ *
124
+ * // on contructor
125
+ * result = Metadata.getType(Example);
126
+ *
127
+ * // property (on constructor)
128
+ * result = Metadata.getType(Example, "staticProperty");
129
+ *
130
+ * // method (on constructor)
131
+ * result = Metadata.getType(Example, "staticMethod");
132
+ * ```
133
+ *
134
+ */
135
+ static getType(target, propertyKey) {
136
+ return Reflect.getMetadata(DESIGN_TYPE, target, propertyKey);
137
+ }
138
+ /**
139
+ * Gets the metadata value for the provided metadata DESIGN_TYPE on the target object or its prototype chain.
140
+ * @param target The target object on which the metadata is defined.
141
+ * @param propertyKey The property key for the target.
142
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
143
+ * @example
144
+ *
145
+ * ```typescript
146
+ * class Example {
147
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
148
+ * // static staticProperty;
149
+ * // property;
150
+ *
151
+ * static staticMethod(p) { }
152
+ * method(p) { }
153
+ * }
154
+ *
155
+ * // on contructor
156
+ * result = Metadata.getOwnType(Example);
157
+ *
158
+ * // property (on constructor)
159
+ * result = Metadata.getOwnType(Example, "staticProperty");
160
+ *
161
+ * // method (on constructor)
162
+ * result = Metadata.getOwnType(Example, "staticMethod");
163
+ * ```
164
+ *
165
+ */
166
+ static getOwnType(target, propertyKey) {
167
+ return Reflect.getMetadata(DESIGN_TYPE, target, propertyKey);
168
+ }
169
+ /**
170
+ * Gets the metadata value for the provided metadata DESIGN_RETURN_TYPE on the target object or its prototype chain.
171
+ * @param target The target object on which the metadata is defined.
172
+ * @param propertyKey The property key for the target.
173
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
174
+ * @example
175
+ *
176
+ * ```typescript
177
+ * class Example {
178
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
179
+ * // static staticProperty;
180
+ * // property;
181
+ *
182
+ * static staticMethod(p) { }
183
+ * method(p) { }
184
+ * }
185
+ *
186
+ * // on contructor
187
+ * result = Metadata.getReturnType(Example);
188
+ *
189
+ * // property (on constructor)
190
+ * result = Metadata.getReturnType(Example, "staticProperty");
191
+ *
192
+ * // method (on constructor)
193
+ * result = Metadata.getReturnType(Example, "staticMethod");
194
+ * ```
195
+ *
196
+ */
197
+ static getReturnType(target, propertyKey) {
198
+ return Reflect.getMetadata(DESIGN_RETURN_TYPE, target, propertyKey);
199
+ }
200
+ /**
201
+ * Gets the metadata value for the provided metadata DESIGN_RETURN_TYPE on the target object or its prototype chain.
202
+ * @param target The target object on which the metadata is defined.
203
+ * @param propertyKey The property key for the target.
204
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
205
+ * @example
206
+ *
207
+ * ```typescript
208
+ * class Example {
209
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
210
+ * // static staticProperty;
211
+ * // property;
212
+ *
213
+ * static staticMethod(p) { }
214
+ * method(p) { }
215
+ * }
216
+ *
217
+ * // on contructor
218
+ * result = Metadata.getOwnReturnType(Example);
219
+ *
220
+ * // property (on constructor)
221
+ * result = Metadata.getOwnReturnType(Example, "staticProperty");
222
+ *
223
+ * // method (on constructor)
224
+ * result = Metadata.getOwnReturnType(Example, "staticMethod");
225
+ * ```
226
+ *
227
+ */
228
+ static getOwnReturnType(target, propertyKey) {
229
+ return Reflect.getOwnMetadata(DESIGN_RETURN_TYPE, target, propertyKey);
230
+ }
231
+ /**
232
+ * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
233
+ * @param key A key used to store and retrieve metadata.
234
+ * @param target The target object on which the metadata is defined.
235
+ * @param propertyKey The property key for the target.
236
+ * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
237
+ * @example
238
+ *
239
+ * ```typescript
240
+ * class Example {
241
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
242
+ * // static staticProperty;
243
+ * // property;
244
+ *
245
+ * static staticMethod(p) { }
246
+ * method(p) { }
247
+ * }
248
+ *
249
+ * // constructor
250
+ * result = Metadata.has("custom:annotation", Example);
251
+ *
252
+ * // property (on constructor)
253
+ * result = Metadata.has("custom:annotation", Example, "staticProperty");
254
+ *
255
+ * // property (on prototype)
256
+ * result = Metadata.has("custom:annotation", Example.prototype, "property");
257
+ *
258
+ * // method (on constructor)
259
+ * result = Metadata.has("custom:annotation", Example, "staticMethod");
260
+ *
261
+ * // method (on prototype)
262
+ * result = Metadata.has("custom:annotation", Example.prototype, "method");
263
+ * ```
264
+ *
265
+ */
266
+ static has(key, target, propertyKey) {
267
+ try {
268
+ return Reflect.hasMetadata(key, classOf(target), propertyKey);
269
+ }
270
+ catch (er) { }
271
+ return false;
272
+ }
273
+ /**
274
+ * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
275
+ * @param key A key used to store and retrieve metadata.
276
+ * @param target The target object on which the metadata is defined.
277
+ * @param propertyKey The property key for the target.
278
+ * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
279
+ * @example
280
+ *
281
+ * ```typescript
282
+ * class Example {
283
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
284
+ * // static staticProperty;
285
+ * // property;
286
+ *
287
+ * static staticMethod(p) { }
288
+ * method(p) { }
289
+ * }
290
+ *
291
+ * // constructor
292
+ * result = Metadata.has("custom:annotation", Example);
293
+ *
294
+ * // property (on constructor)
295
+ * result = Metadata.hasOwn("custom:annotation", Example, "staticProperty");
296
+ *
297
+ * // property (on prototype)
298
+ * result = Metadata.hasOwn("custom:annotation", Example.prototype, "property");
299
+ *
300
+ * // method (on constructor)
301
+ * result = Metadata.hasOwn("custom:annotation", Example, "staticMethod");
302
+ *
303
+ * // method (on prototype)
304
+ * result = Metadata.hasOwn("custom:annotation", Example.prototype, "method");
305
+ * ```
306
+ *
307
+ */
308
+ static hasOwn(key, target, propertyKey) {
309
+ return Reflect.hasOwnMetadata(key, classOf(target), propertyKey);
310
+ }
311
+ /**
312
+ * Deletes the metadata entry from the target object with the provided key.
313
+ * @param key A key used to store and retrieve metadata.
314
+ * @param target The target object on which the metadata is defined.
315
+ * @param propertyKey The property key for the target.
316
+ * @returns `true` if the metadata entry was found and deleted; otherwise, false.
317
+ * @example
318
+ *
319
+ * ```typescript
320
+ * class Example {
321
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
322
+ * // static staticProperty;
323
+ * // property;
324
+ *
325
+ * static staticMethod(p) { }
326
+ * method(p) { }
327
+ * }
328
+ *
329
+ * // constructor
330
+ * result = Metadata.delete("custom:annotation", Example);
331
+ *
332
+ * // property (on constructor)
333
+ * result = Metadata.delete("custom:annotation", Example, "staticProperty");
334
+ *
335
+ * // property (on prototype)
336
+ * result = Metadata.delete("custom:annotation", Example.prototype, "property");
337
+ *
338
+ * // method (on constructor)
339
+ * result = Metadata.delete("custom:annotation", Example, "staticMethod");
340
+ *
341
+ * // method (on prototype)
342
+ * result = Metadata.delete("custom:annotation", Example.prototype, "method");
343
+ * ```
344
+ *
345
+ */
346
+ static delete(key, target, propertyKey) {
347
+ return Reflect.deleteMetadata(key, classOf(target), propertyKey);
348
+ }
349
+ /**
350
+ * Set the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.
351
+ * @param target The target object on which the metadata is defined.
352
+ * @param propertyKey The property key for the target.
353
+ * @param value A value that contains attached metadata.
354
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
355
+ * @example
356
+ *
357
+ * ```typescript
358
+ * class Example {
359
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
360
+ * // static staticProperty;
361
+ * // property;
362
+ *
363
+ * static staticMethod(p) { }
364
+ * method(p) { }
365
+ * }
366
+ *
367
+ * // on contructor
368
+ * result = Metadata.setParamTypes(Example, undefined, [Object]);
369
+ *
370
+ * // property (on constructor)
371
+ * result = Metadata.setParamTypes(Example, "staticProperty", [Object]);
372
+ *
373
+ * // property (on prototype)
374
+ * result = Metadata.setParamTypes(Example.prototype, "property", [Object]);
375
+ *
376
+ * // method (on constructor)
377
+ * result = Metadata.setParamTypes(Example, "staticMethod", [Object]);
378
+ *
379
+ * // method (on prototype)
380
+ * result = Metadata.setParamTypes(Example.prototype, "method", [Object]);
381
+ * ```
382
+ *
383
+ */
384
+ static setParamTypes(target, propertyKey, value) {
385
+ return this.set(DESIGN_PARAM_TYPES, value, target.prototype, propertyKey);
386
+ }
387
+ /**
388
+ * Define a unique metadata entry on the target.
389
+ * @param key A key used to store and retrieve metadata.
390
+ * @param value A value that contains attached metadata.
391
+ * @param target The target object on which to define metadata.
392
+ * @param propertyKey The property key for the target.
393
+ * @example
394
+ *
395
+ * ```typescript
396
+ * class Example {
397
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
398
+ * // static staticProperty;
399
+ * // property;
400
+ *
401
+ * static staticMethod(p) { }
402
+ * method(p) { }
403
+ * }
404
+ *
405
+ * // constructor
406
+ * Reflect.defineMetadata("custom:annotation", options, Example);
407
+ *
408
+ * // property (on constructor)
409
+ * Reflect.defineMetadata("custom:annotation", Number, Example, "staticProperty");
410
+ *
411
+ * // property (on prototype)
412
+ * Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "property");
413
+ *
414
+ * // method (on constructor)
415
+ * Reflect.defineMetadata("custom:annotation", Number, Example, "staticMethod");
416
+ *
417
+ * // method (on prototype)
418
+ * Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "method");
419
+ *
420
+ * // decorator factory as metadata-producing annotation.
421
+ * function MyAnnotation(options): PropertyDecorator {
422
+ * return (target, key) => Reflect.defineMetadata("custom:annotation", options, target, key);
423
+ * }
424
+ * ```
425
+ *
426
+ */
427
+ static set(key, value, target, propertyKey) {
428
+ const targets = PROPERTIES.has(key) ? PROPERTIES.get(key) || [] : [];
429
+ const classConstructor = classOf(target);
430
+ if (targets.indexOf(classConstructor) === -1) {
431
+ targets.push(classConstructor);
432
+ PROPERTIES.set(key, targets);
433
+ }
434
+ Reflect.defineMetadata(key, value, classOf(target), propertyKey);
435
+ }
436
+ /**
437
+ * Gets the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.
438
+ * @param targetPrototype
439
+ * @param propertyKey The property key for the target.
440
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
441
+ * @example
442
+ *
443
+ * ```typescript
444
+ * class Example {
445
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
446
+ * // static staticProperty;
447
+ * // property;
448
+ *
449
+ * static staticMethod(p) { }
450
+ * method(p) { }
451
+ * }
452
+ *
453
+ * // on contructor
454
+ * result = Metadata.getParamTypes(Example.prototype);
455
+ *
456
+ * // property (on constructor)
457
+ * result = Metadata.getParamTypes(Example.prototype, "staticProperty");
458
+ *
459
+ * // method (on constructor)
460
+ * result = Metadata.getParamTypes(Example.prototype, "staticMethod");
461
+ * ```
462
+ *
463
+ */
464
+ static getParamTypes(targetPrototype, propertyKey) {
465
+ return Reflect.getMetadata(DESIGN_PARAM_TYPES, targetPrototype, propertyKey) || [];
466
+ }
467
+ /**
468
+ * Gets the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.
469
+ * @param target The target object on which the metadata is defined.
470
+ * @param propertyKey The property key for the target.
471
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
472
+ * @example
473
+ *
474
+ * ```typescript
475
+ * class Example {
476
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
477
+ * // static staticProperty;
478
+ * // property;
479
+ *
480
+ * static staticMethod(p) { }
481
+ * method(p) { }
482
+ * }
483
+ *
484
+ * // on contructor
485
+ * result = Metadata.getParamTypes(Example);
486
+ *
487
+ * // property (on constructor)
488
+ * result = Metadata.getParamTypes(Example, "staticProperty");
489
+ *
490
+ * // method (on constructor)
491
+ * result = Metadata.getParamTypes(Example, "staticMethod");
492
+ * ```
493
+ *
494
+ */
495
+ static getOwnParamTypes(target, propertyKey) {
496
+ return Reflect.getOwnMetadata(DESIGN_PARAM_TYPES, target, propertyKey) || [];
497
+ }
498
+ }
499
+ /**
500
+ * Get all metadata for a metadataKey.
501
+ * @param metadataKey
502
+ */
503
+ Metadata.getTargetsFromPropertyKey = (metadataKey) => PROPERTIES.has(metadataKey) ? PROPERTIES.get(metadataKey) || [] : [];
504
+ //# sourceMappingURL=Metadata.js.map