@tsed/core 7.0.0-alpha.2 → 7.0.0-beta.11

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 (415) hide show
  1. package/jest.config.js +14 -0
  2. package/lib/cjs/decorators/configurable.js +14 -0
  3. package/lib/cjs/decorators/configurable.js.map +1 -0
  4. package/lib/cjs/decorators/deprecated.js +44 -0
  5. package/lib/cjs/decorators/deprecated.js.map +1 -0
  6. package/lib/cjs/decorators/enumerable.js +14 -0
  7. package/lib/cjs/decorators/enumerable.js.map +1 -0
  8. package/lib/cjs/decorators/notConfigurable.js +9 -0
  9. package/lib/cjs/decorators/notConfigurable.js.map +1 -0
  10. package/lib/cjs/decorators/notEnumerable.js +9 -0
  11. package/lib/cjs/decorators/notEnumerable.js.map +1 -0
  12. package/lib/cjs/decorators/readOnly.js +9 -0
  13. package/lib/cjs/decorators/readOnly.js.map +1 -0
  14. package/lib/cjs/decorators/storeFn.js +22 -0
  15. package/lib/cjs/decorators/storeFn.js.map +1 -0
  16. package/lib/cjs/decorators/storeMerge.js +11 -0
  17. package/lib/cjs/decorators/storeMerge.js.map +1 -0
  18. package/lib/cjs/decorators/storeSet.js +11 -0
  19. package/lib/cjs/decorators/storeSet.js.map +1 -0
  20. package/lib/cjs/decorators/writable.js +14 -0
  21. package/lib/cjs/decorators/writable.js.map +1 -0
  22. package/lib/cjs/domain/AnyToPromise.js +148 -0
  23. package/lib/cjs/domain/AnyToPromise.js.map +1 -0
  24. package/lib/cjs/domain/DecoratorTypes.js +15 -0
  25. package/lib/cjs/domain/DecoratorTypes.js.map +1 -0
  26. package/lib/cjs/domain/Env.js +19 -0
  27. package/lib/cjs/domain/Env.js.map +1 -0
  28. package/lib/cjs/domain/Hooks.js +89 -0
  29. package/lib/cjs/domain/Hooks.js.map +1 -0
  30. package/lib/cjs/domain/Metadata.js +508 -0
  31. package/lib/cjs/domain/Metadata.js.map +1 -0
  32. package/lib/cjs/domain/Store.js +157 -0
  33. package/lib/cjs/domain/Store.js.map +1 -0
  34. package/lib/cjs/domain/Type.js +7 -0
  35. package/lib/cjs/domain/Type.js.map +1 -0
  36. package/lib/cjs/errors/UnsupportedDecoratorType.js +23 -0
  37. package/lib/cjs/errors/UnsupportedDecoratorType.js.map +1 -0
  38. package/lib/cjs/index.js +85 -0
  39. package/lib/cjs/index.js.map +1 -0
  40. package/lib/cjs/interfaces/AnyDecorator.js +3 -0
  41. package/lib/cjs/interfaces/AnyDecorator.js.map +1 -0
  42. package/lib/cjs/interfaces/DecoratorParameters.js +3 -0
  43. package/lib/cjs/interfaces/DecoratorParameters.js.map +1 -0
  44. package/lib/cjs/interfaces/HashOf.js +3 -0
  45. package/lib/cjs/interfaces/HashOf.js.map +1 -0
  46. package/lib/cjs/interfaces/MetadataTypes.js +3 -0
  47. package/lib/cjs/interfaces/MetadataTypes.js.map +1 -0
  48. package/lib/cjs/interfaces/ValueOf.js +3 -0
  49. package/lib/cjs/interfaces/ValueOf.js.map +1 -0
  50. package/lib/cjs/package.json +3 -0
  51. package/lib/cjs/utils/catchError.js +22 -0
  52. package/lib/cjs/utils/catchError.js.map +1 -0
  53. package/lib/cjs/utils/decorators/decorateMethodsOf.js +24 -0
  54. package/lib/cjs/utils/decorators/decorateMethodsOf.js.map +1 -0
  55. package/lib/cjs/utils/decorators/decoratorArgs.js +9 -0
  56. package/lib/cjs/utils/decorators/decoratorArgs.js.map +1 -0
  57. package/lib/cjs/utils/decorators/decoratorTypeOf.js +23 -0
  58. package/lib/cjs/utils/decorators/decoratorTypeOf.js.map +1 -0
  59. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js +15 -0
  60. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  61. package/lib/cjs/utils/decorators/useDecorators.js +14 -0
  62. package/lib/cjs/utils/decorators/useDecorators.js.map +1 -0
  63. package/lib/cjs/utils/decorators/useMethodDecorators.js +15 -0
  64. package/lib/cjs/utils/decorators/useMethodDecorators.js.map +1 -0
  65. package/lib/cjs/utils/http/getHostInfoFromPort.js +21 -0
  66. package/lib/cjs/utils/http/getHostInfoFromPort.js.map +1 -0
  67. package/lib/cjs/utils/imports/importPackage.js +39 -0
  68. package/lib/cjs/utils/imports/importPackage.js.map +1 -0
  69. package/lib/cjs/utils/objects/ancestorOf.js +12 -0
  70. package/lib/cjs/utils/objects/ancestorOf.js.map +1 -0
  71. package/lib/cjs/utils/objects/ancestorsOf.js +22 -0
  72. package/lib/cjs/utils/objects/ancestorsOf.js.map +1 -0
  73. package/lib/cjs/utils/objects/classOf.js +23 -0
  74. package/lib/cjs/utils/objects/classOf.js.map +1 -0
  75. package/lib/cjs/utils/objects/cleanObject.js +24 -0
  76. package/lib/cjs/utils/objects/cleanObject.js.map +1 -0
  77. package/lib/cjs/utils/objects/constructorOf.js +20 -0
  78. package/lib/cjs/utils/objects/constructorOf.js.map +1 -0
  79. package/lib/cjs/utils/objects/createInstance.js +9 -0
  80. package/lib/cjs/utils/objects/createInstance.js.map +1 -0
  81. package/lib/cjs/utils/objects/deepClone.js +63 -0
  82. package/lib/cjs/utils/objects/deepClone.js.map +1 -0
  83. package/lib/cjs/utils/objects/deepMerge.js +63 -0
  84. package/lib/cjs/utils/objects/deepMerge.js.map +1 -0
  85. package/lib/cjs/utils/objects/descriptorOf.js +19 -0
  86. package/lib/cjs/utils/objects/descriptorOf.js.map +1 -0
  87. package/lib/cjs/utils/objects/getClassOrSymbol.js +10 -0
  88. package/lib/cjs/utils/objects/getClassOrSymbol.js.map +1 -0
  89. package/lib/cjs/utils/objects/getConstructorArgNames.js +14 -0
  90. package/lib/cjs/utils/objects/getConstructorArgNames.js.map +1 -0
  91. package/lib/cjs/utils/objects/getEnumerableKeys.js +20 -0
  92. package/lib/cjs/utils/objects/getEnumerableKeys.js.map +1 -0
  93. package/lib/cjs/utils/objects/getValue.js +49 -0
  94. package/lib/cjs/utils/objects/getValue.js.map +1 -0
  95. package/lib/cjs/utils/objects/isArray.js +23 -0
  96. package/lib/cjs/utils/objects/isArray.js.map +1 -0
  97. package/lib/cjs/utils/objects/isArrowFn.js +9 -0
  98. package/lib/cjs/utils/objects/isArrowFn.js.map +1 -0
  99. package/lib/cjs/utils/objects/isBoolean.js +17 -0
  100. package/lib/cjs/utils/objects/isBoolean.js.map +1 -0
  101. package/lib/cjs/utils/objects/isBuffer.js +13 -0
  102. package/lib/cjs/utils/objects/isBuffer.js.map +1 -0
  103. package/lib/cjs/utils/objects/isClass.js +28 -0
  104. package/lib/cjs/utils/objects/isClass.js.map +1 -0
  105. package/lib/cjs/utils/objects/isCollection.js +22 -0
  106. package/lib/cjs/utils/objects/isCollection.js.map +1 -0
  107. package/lib/cjs/utils/objects/isDate.js +13 -0
  108. package/lib/cjs/utils/objects/isDate.js.map +1 -0
  109. package/lib/cjs/utils/objects/isEmpty.js +14 -0
  110. package/lib/cjs/utils/objects/isEmpty.js.map +1 -0
  111. package/lib/cjs/utils/objects/isEnumerable.js +22 -0
  112. package/lib/cjs/utils/objects/isEnumerable.js.map +1 -0
  113. package/lib/cjs/utils/objects/isFunction.js +8 -0
  114. package/lib/cjs/utils/objects/isFunction.js.map +1 -0
  115. package/lib/cjs/utils/objects/isInheritedFrom.js +26 -0
  116. package/lib/cjs/utils/objects/isInheritedFrom.js.map +1 -0
  117. package/lib/cjs/utils/objects/isNil.js +8 -0
  118. package/lib/cjs/utils/objects/isNil.js.map +1 -0
  119. package/lib/cjs/utils/objects/isNumber.js +17 -0
  120. package/lib/cjs/utils/objects/isNumber.js.map +1 -0
  121. package/lib/cjs/utils/objects/isObject.js +8 -0
  122. package/lib/cjs/utils/objects/isObject.js.map +1 -0
  123. package/lib/cjs/utils/objects/isObservable.js +8 -0
  124. package/lib/cjs/utils/objects/isObservable.js.map +1 -0
  125. package/lib/cjs/utils/objects/isPlainObject.js +18 -0
  126. package/lib/cjs/utils/objects/isPlainObject.js.map +1 -0
  127. package/lib/cjs/utils/objects/isPrimitive.js +30 -0
  128. package/lib/cjs/utils/objects/isPrimitive.js.map +1 -0
  129. package/lib/cjs/utils/objects/isPromise.js +16 -0
  130. package/lib/cjs/utils/objects/isPromise.js.map +1 -0
  131. package/lib/cjs/utils/objects/isProtectedKey.js +12 -0
  132. package/lib/cjs/utils/objects/isProtectedKey.js.map +1 -0
  133. package/lib/cjs/utils/objects/isSerializable.js +13 -0
  134. package/lib/cjs/utils/objects/isSerializable.js.map +1 -0
  135. package/lib/cjs/utils/objects/isStream.js +8 -0
  136. package/lib/cjs/utils/objects/isStream.js.map +1 -0
  137. package/lib/cjs/utils/objects/isString.js +16 -0
  138. package/lib/cjs/utils/objects/isString.js.map +1 -0
  139. package/lib/cjs/utils/objects/isSymbol.js +16 -0
  140. package/lib/cjs/utils/objects/isSymbol.js.map +1 -0
  141. package/lib/cjs/utils/objects/methodsOf.js +25 -0
  142. package/lib/cjs/utils/objects/methodsOf.js.map +1 -0
  143. package/lib/cjs/utils/objects/nameOf.js +32 -0
  144. package/lib/cjs/utils/objects/nameOf.js.map +1 -0
  145. package/lib/cjs/utils/objects/objectKeys.js +9 -0
  146. package/lib/cjs/utils/objects/objectKeys.js.map +1 -0
  147. package/lib/cjs/utils/objects/primitiveOf.js +20 -0
  148. package/lib/cjs/utils/objects/primitiveOf.js.map +1 -0
  149. package/lib/cjs/utils/objects/prototypeOf.js +14 -0
  150. package/lib/cjs/utils/objects/prototypeOf.js.map +1 -0
  151. package/lib/cjs/utils/objects/setValue.js +34 -0
  152. package/lib/cjs/utils/objects/setValue.js.map +1 -0
  153. package/lib/cjs/utils/objects/toMap.js +32 -0
  154. package/lib/cjs/utils/objects/toMap.js.map +1 -0
  155. package/lib/cjs/utils/objects/toStringConstructor.js +12 -0
  156. package/lib/cjs/utils/objects/toStringConstructor.js.map +1 -0
  157. package/lib/cjs/utils/proxyDelegation.js +54 -0
  158. package/lib/cjs/utils/proxyDelegation.js.map +1 -0
  159. package/lib/cjs/utils/uniq.js +16 -0
  160. package/lib/cjs/utils/uniq.js.map +1 -0
  161. package/lib/esm/decorators/configurable.js +10 -0
  162. package/lib/esm/decorators/configurable.js.map +1 -0
  163. package/lib/esm/decorators/deprecated.js +40 -0
  164. package/lib/esm/decorators/deprecated.js.map +1 -0
  165. package/lib/esm/decorators/enumerable.js +10 -0
  166. package/lib/esm/decorators/enumerable.js.map +1 -0
  167. package/lib/esm/decorators/notConfigurable.js +5 -0
  168. package/lib/esm/decorators/notConfigurable.js.map +1 -0
  169. package/lib/esm/decorators/notEnumerable.js +5 -0
  170. package/lib/esm/decorators/notEnumerable.js.map +1 -0
  171. package/lib/esm/decorators/readOnly.js +5 -0
  172. package/lib/esm/decorators/readOnly.js.map +1 -0
  173. package/lib/esm/decorators/storeFn.js +18 -0
  174. package/lib/esm/decorators/storeFn.js.map +1 -0
  175. package/lib/esm/decorators/storeMerge.js +7 -0
  176. package/lib/esm/decorators/storeMerge.js.map +1 -0
  177. package/lib/esm/decorators/storeSet.js +7 -0
  178. package/lib/esm/decorators/storeSet.js.map +1 -0
  179. package/lib/esm/decorators/writable.js +10 -0
  180. package/lib/esm/decorators/writable.js.map +1 -0
  181. package/lib/esm/domain/AnyToPromise.js +144 -0
  182. package/lib/esm/domain/AnyToPromise.js.map +1 -0
  183. package/lib/esm/domain/DecoratorTypes.js +12 -0
  184. package/lib/esm/domain/DecoratorTypes.js.map +1 -0
  185. package/lib/esm/domain/Env.js +16 -0
  186. package/lib/esm/domain/Env.js.map +1 -0
  187. package/lib/esm/domain/Hooks.js +85 -0
  188. package/lib/esm/domain/Hooks.js.map +1 -0
  189. package/lib/esm/domain/Metadata.js +504 -0
  190. package/lib/esm/domain/Metadata.js.map +1 -0
  191. package/lib/esm/domain/Store.js +153 -0
  192. package/lib/esm/domain/Store.js.map +1 -0
  193. package/lib/esm/domain/Type.js +4 -0
  194. package/lib/esm/domain/Type.js.map +1 -0
  195. package/lib/esm/errors/UnsupportedDecoratorType.js +19 -0
  196. package/lib/esm/errors/UnsupportedDecoratorType.js.map +1 -0
  197. package/lib/esm/index.js +82 -0
  198. package/lib/esm/index.js.map +1 -0
  199. package/lib/esm/interfaces/AnyDecorator.js +2 -0
  200. package/lib/esm/interfaces/AnyDecorator.js.map +1 -0
  201. package/lib/esm/interfaces/DecoratorParameters.js +2 -0
  202. package/lib/esm/interfaces/DecoratorParameters.js.map +1 -0
  203. package/lib/esm/interfaces/HashOf.js +2 -0
  204. package/lib/esm/interfaces/HashOf.js.map +1 -0
  205. package/lib/esm/interfaces/MetadataTypes.js +2 -0
  206. package/lib/esm/interfaces/MetadataTypes.js.map +1 -0
  207. package/lib/esm/interfaces/ValueOf.js +2 -0
  208. package/lib/esm/interfaces/ValueOf.js.map +1 -0
  209. package/lib/esm/package.json +3 -0
  210. package/lib/esm/utils/catchError.js +17 -0
  211. package/lib/esm/utils/catchError.js.map +1 -0
  212. package/lib/esm/utils/decorators/decorateMethodsOf.js +20 -0
  213. package/lib/esm/utils/decorators/decorateMethodsOf.js.map +1 -0
  214. package/lib/esm/utils/decorators/decoratorArgs.js +5 -0
  215. package/lib/esm/utils/decorators/decoratorArgs.js.map +1 -0
  216. package/lib/esm/utils/decorators/decoratorTypeOf.js +19 -0
  217. package/lib/esm/utils/decorators/decoratorTypeOf.js.map +1 -0
  218. package/lib/esm/utils/decorators/inheritedDescriptorOf.js +11 -0
  219. package/lib/esm/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  220. package/lib/esm/utils/decorators/useDecorators.js +10 -0
  221. package/lib/esm/utils/decorators/useDecorators.js.map +1 -0
  222. package/lib/esm/utils/decorators/useMethodDecorators.js +10 -0
  223. package/lib/esm/utils/decorators/useMethodDecorators.js.map +1 -0
  224. package/lib/esm/utils/http/getHostInfoFromPort.js +17 -0
  225. package/lib/esm/utils/http/getHostInfoFromPort.js.map +1 -0
  226. package/lib/esm/utils/imports/importPackage.js +12 -0
  227. package/lib/esm/utils/imports/importPackage.js.map +1 -0
  228. package/lib/esm/utils/objects/ancestorOf.js +7 -0
  229. package/lib/esm/utils/objects/ancestorOf.js.map +1 -0
  230. package/lib/esm/utils/objects/ancestorsOf.js +18 -0
  231. package/lib/esm/utils/objects/ancestorsOf.js.map +1 -0
  232. package/lib/esm/utils/objects/classOf.js +18 -0
  233. package/lib/esm/utils/objects/classOf.js.map +1 -0
  234. package/lib/esm/utils/objects/cleanObject.js +20 -0
  235. package/lib/esm/utils/objects/cleanObject.js.map +1 -0
  236. package/lib/esm/utils/objects/constructorOf.js +15 -0
  237. package/lib/esm/utils/objects/constructorOf.js.map +1 -0
  238. package/lib/esm/utils/objects/createInstance.js +5 -0
  239. package/lib/esm/utils/objects/createInstance.js.map +1 -0
  240. package/lib/esm/utils/objects/deepClone.js +59 -0
  241. package/lib/esm/utils/objects/deepClone.js.map +1 -0
  242. package/lib/esm/utils/objects/deepMerge.js +58 -0
  243. package/lib/esm/utils/objects/deepMerge.js.map +1 -0
  244. package/lib/esm/utils/objects/descriptorOf.js +14 -0
  245. package/lib/esm/utils/objects/descriptorOf.js.map +1 -0
  246. package/lib/esm/utils/objects/getClassOrSymbol.js +6 -0
  247. package/lib/esm/utils/objects/getClassOrSymbol.js.map +1 -0
  248. package/lib/esm/utils/objects/getConstructorArgNames.js +10 -0
  249. package/lib/esm/utils/objects/getConstructorArgNames.js.map +1 -0
  250. package/lib/esm/utils/objects/getEnumerableKeys.js +16 -0
  251. package/lib/esm/utils/objects/getEnumerableKeys.js.map +1 -0
  252. package/lib/esm/utils/objects/getValue.js +45 -0
  253. package/lib/esm/utils/objects/getValue.js.map +1 -0
  254. package/lib/esm/utils/objects/isArray.js +18 -0
  255. package/lib/esm/utils/objects/isArray.js.map +1 -0
  256. package/lib/esm/utils/objects/isArrowFn.js +5 -0
  257. package/lib/esm/utils/objects/isArrowFn.js.map +1 -0
  258. package/lib/esm/utils/objects/isBoolean.js +12 -0
  259. package/lib/esm/utils/objects/isBoolean.js.map +1 -0
  260. package/lib/esm/utils/objects/isBuffer.js +9 -0
  261. package/lib/esm/utils/objects/isBuffer.js.map +1 -0
  262. package/lib/esm/utils/objects/isClass.js +24 -0
  263. package/lib/esm/utils/objects/isClass.js.map +1 -0
  264. package/lib/esm/utils/objects/isCollection.js +18 -0
  265. package/lib/esm/utils/objects/isCollection.js.map +1 -0
  266. package/lib/esm/utils/objects/isDate.js +9 -0
  267. package/lib/esm/utils/objects/isDate.js.map +1 -0
  268. package/lib/esm/utils/objects/isEmpty.js +10 -0
  269. package/lib/esm/utils/objects/isEmpty.js.map +1 -0
  270. package/lib/esm/utils/objects/isEnumerable.js +18 -0
  271. package/lib/esm/utils/objects/isEnumerable.js.map +1 -0
  272. package/lib/esm/utils/objects/isFunction.js +4 -0
  273. package/lib/esm/utils/objects/isFunction.js.map +1 -0
  274. package/lib/esm/utils/objects/isInheritedFrom.js +22 -0
  275. package/lib/esm/utils/objects/isInheritedFrom.js.map +1 -0
  276. package/lib/esm/utils/objects/isNil.js +4 -0
  277. package/lib/esm/utils/objects/isNil.js.map +1 -0
  278. package/lib/esm/utils/objects/isNumber.js +12 -0
  279. package/lib/esm/utils/objects/isNumber.js.map +1 -0
  280. package/lib/esm/utils/objects/isObject.js +4 -0
  281. package/lib/esm/utils/objects/isObject.js.map +1 -0
  282. package/lib/esm/utils/objects/isObservable.js +4 -0
  283. package/lib/esm/utils/objects/isObservable.js.map +1 -0
  284. package/lib/esm/utils/objects/isPlainObject.js +13 -0
  285. package/lib/esm/utils/objects/isPlainObject.js.map +1 -0
  286. package/lib/esm/utils/objects/isPrimitive.js +24 -0
  287. package/lib/esm/utils/objects/isPrimitive.js.map +1 -0
  288. package/lib/esm/utils/objects/isPromise.js +12 -0
  289. package/lib/esm/utils/objects/isPromise.js.map +1 -0
  290. package/lib/esm/utils/objects/isProtectedKey.js +8 -0
  291. package/lib/esm/utils/objects/isProtectedKey.js.map +1 -0
  292. package/lib/esm/utils/objects/isSerializable.js +9 -0
  293. package/lib/esm/utils/objects/isSerializable.js.map +1 -0
  294. package/lib/esm/utils/objects/isStream.js +4 -0
  295. package/lib/esm/utils/objects/isStream.js.map +1 -0
  296. package/lib/esm/utils/objects/isString.js +11 -0
  297. package/lib/esm/utils/objects/isString.js.map +1 -0
  298. package/lib/esm/utils/objects/isSymbol.js +11 -0
  299. package/lib/esm/utils/objects/isSymbol.js.map +1 -0
  300. package/lib/esm/utils/objects/methodsOf.js +21 -0
  301. package/lib/esm/utils/objects/methodsOf.js.map +1 -0
  302. package/lib/esm/utils/objects/nameOf.js +26 -0
  303. package/lib/esm/utils/objects/nameOf.js.map +1 -0
  304. package/lib/esm/utils/objects/objectKeys.js +5 -0
  305. package/lib/esm/utils/objects/objectKeys.js.map +1 -0
  306. package/lib/esm/utils/objects/primitiveOf.js +16 -0
  307. package/lib/esm/utils/objects/primitiveOf.js.map +1 -0
  308. package/lib/esm/utils/objects/prototypeOf.js +10 -0
  309. package/lib/esm/utils/objects/prototypeOf.js.map +1 -0
  310. package/lib/esm/utils/objects/setValue.js +30 -0
  311. package/lib/esm/utils/objects/setValue.js.map +1 -0
  312. package/lib/esm/utils/objects/toMap.js +28 -0
  313. package/lib/esm/utils/objects/toMap.js.map +1 -0
  314. package/lib/esm/utils/objects/toStringConstructor.js +8 -0
  315. package/lib/esm/utils/objects/toStringConstructor.js.map +1 -0
  316. package/lib/esm/utils/proxyDelegation.js +50 -0
  317. package/lib/esm/utils/proxyDelegation.js.map +1 -0
  318. package/lib/esm/utils/uniq.js +11 -0
  319. package/lib/esm/utils/uniq.js.map +1 -0
  320. package/lib/{decorators → types/decorators}/configurable.d.ts +0 -1
  321. package/lib/{decorators → types/decorators}/deprecated.d.ts +0 -0
  322. package/lib/{decorators → types/decorators}/enumerable.d.ts +0 -1
  323. package/lib/{decorators → types/decorators}/notConfigurable.d.ts +0 -1
  324. package/lib/{decorators → types/decorators}/notEnumerable.d.ts +0 -1
  325. package/lib/{decorators → types/decorators}/readOnly.d.ts +0 -1
  326. package/lib/{decorators → types/decorators}/storeFn.d.ts +0 -0
  327. package/lib/{decorators → types/decorators}/storeMerge.d.ts +0 -0
  328. package/lib/{decorators → types/decorators}/storeSet.d.ts +0 -0
  329. package/lib/{decorators → types/decorators}/writable.d.ts +0 -1
  330. package/lib/{domain → types/domain}/AnyToPromise.d.ts +0 -0
  331. package/lib/{domain → types/domain}/DecoratorTypes.d.ts +0 -0
  332. package/lib/{domain → types/domain}/Env.d.ts +0 -0
  333. package/lib/{domain → types/domain}/Hooks.d.ts +0 -0
  334. package/lib/{domain → types/domain}/Metadata.d.ts +0 -0
  335. package/lib/{domain → types/domain}/Store.d.ts +0 -0
  336. package/lib/{domain → types/domain}/Type.d.ts +0 -0
  337. package/lib/{errors → types/errors}/UnsupportedDecoratorType.d.ts +0 -0
  338. package/lib/types/index.d.ts +81 -0
  339. package/lib/{interfaces → types/interfaces}/AnyDecorator.d.ts +0 -0
  340. package/lib/{interfaces → types/interfaces}/DecoratorParameters.d.ts +0 -0
  341. package/lib/{interfaces → types/interfaces}/HashOf.d.ts +0 -0
  342. package/lib/{interfaces → types/interfaces}/MetadataTypes.d.ts +0 -0
  343. package/lib/{interfaces → types/interfaces}/ValueOf.d.ts +0 -0
  344. package/lib/{utils → types/utils}/catchError.d.ts +0 -0
  345. package/lib/{utils → types/utils}/decorators/decorateMethodsOf.d.ts +0 -0
  346. package/lib/{utils → types/utils}/decorators/decoratorArgs.d.ts +0 -0
  347. package/lib/{utils → types/utils}/decorators/decoratorTypeOf.d.ts +0 -0
  348. package/lib/{utils → types/utils}/decorators/inheritedDescriptorOf.d.ts +0 -0
  349. package/lib/{utils → types/utils}/decorators/useDecorators.d.ts +0 -0
  350. package/lib/{utils → types/utils}/decorators/useMethodDecorators.d.ts +0 -0
  351. package/lib/types/utils/http/getHostInfoFromPort.d.ts +6 -0
  352. package/lib/types/utils/imports/importPackage.d.ts +1 -0
  353. package/lib/{utils → types/utils}/objects/ancestorOf.d.ts +0 -0
  354. package/lib/{utils → types/utils}/objects/ancestorsOf.d.ts +0 -0
  355. package/lib/{utils → types/utils}/objects/classOf.d.ts +0 -0
  356. package/lib/{utils → types/utils}/objects/cleanObject.d.ts +0 -0
  357. package/lib/{utils → types/utils}/objects/constructorOf.d.ts +0 -0
  358. package/lib/{utils → types/utils}/objects/createInstance.d.ts +0 -0
  359. package/lib/types/utils/objects/deepClone.d.ts +6 -0
  360. package/lib/{utils → types/utils}/objects/deepMerge.d.ts +1 -1
  361. package/lib/{utils → types/utils}/objects/descriptorOf.d.ts +1 -0
  362. package/lib/{utils → types/utils}/objects/getClassOrSymbol.d.ts +0 -0
  363. package/lib/{utils → types/utils}/objects/getConstructorArgNames.d.ts +0 -0
  364. package/lib/{utils → types/utils}/objects/getEnumerableKeys.d.ts +0 -0
  365. package/lib/{utils → types/utils}/objects/getValue.d.ts +0 -0
  366. package/lib/{utils → types/utils}/objects/isArray.d.ts +0 -0
  367. package/lib/types/utils/objects/isArrowFn.d.ts +1 -0
  368. package/lib/{utils → types/utils}/objects/isBoolean.d.ts +0 -0
  369. package/lib/types/utils/objects/isBuffer.d.ts +7 -0
  370. package/lib/{utils → types/utils}/objects/isClass.d.ts +0 -0
  371. package/lib/{utils → types/utils}/objects/isCollection.d.ts +0 -0
  372. package/lib/{utils → types/utils}/objects/isDate.d.ts +0 -0
  373. package/lib/{utils → types/utils}/objects/isEmpty.d.ts +0 -0
  374. package/lib/{utils → types/utils}/objects/isEnumerable.d.ts +0 -0
  375. package/lib/{utils → types/utils}/objects/isFunction.d.ts +0 -0
  376. package/lib/{utils → types/utils}/objects/isInheritedFrom.d.ts +0 -0
  377. package/lib/{utils → types/utils}/objects/isNil.d.ts +0 -0
  378. package/lib/{utils → types/utils}/objects/isNumber.d.ts +0 -0
  379. package/lib/{utils → types/utils}/objects/isObject.d.ts +0 -0
  380. package/lib/{utils → types/utils}/objects/isObservable.d.ts +0 -0
  381. package/lib/{utils → types/utils}/objects/isPlainObject.d.ts +0 -0
  382. package/lib/{utils → types/utils}/objects/isPrimitive.d.ts +0 -0
  383. package/lib/{utils → types/utils}/objects/isPromise.d.ts +0 -0
  384. package/lib/{utils → types/utils}/objects/isProtectedKey.d.ts +0 -0
  385. package/lib/{utils → types/utils}/objects/isSerializable.d.ts +0 -0
  386. package/lib/{utils → types/utils}/objects/isStream.d.ts +0 -0
  387. package/lib/{utils → types/utils}/objects/isString.d.ts +0 -0
  388. package/lib/{utils → types/utils}/objects/isSymbol.d.ts +0 -0
  389. package/lib/types/utils/objects/methodsOf.d.ts +9 -0
  390. package/lib/{utils → types/utils}/objects/nameOf.d.ts +0 -0
  391. package/lib/{utils → types/utils}/objects/objectKeys.d.ts +0 -0
  392. package/lib/{utils → types/utils}/objects/primitiveOf.d.ts +0 -0
  393. package/lib/{utils → types/utils}/objects/prototypeOf.d.ts +0 -0
  394. package/lib/{utils → types/utils}/objects/setValue.d.ts +0 -0
  395. package/lib/{utils → types/utils}/objects/toMap.d.ts +0 -0
  396. package/lib/{utils → types/utils}/objects/toStringConstructor.d.ts +0 -0
  397. package/lib/{utils → types/utils}/proxyDelegation.d.ts +0 -0
  398. package/lib/{utils → types/utils}/uniq.d.ts +0 -0
  399. package/package.json +16 -12
  400. package/readme.md +1 -2
  401. package/tsconfig.compile.esm.json +12 -0
  402. package/lib/decorators/index.d.ts +0 -14
  403. package/lib/domain/Entity.d.ts +0 -97
  404. package/lib/domain/index.d.ts +0 -8
  405. package/lib/index.d.ts +0 -6
  406. package/lib/index.js +0 -2298
  407. package/lib/index.js.map +0 -1
  408. package/lib/index.modern.js +0 -2210
  409. package/lib/index.modern.js.map +0 -1
  410. package/lib/interfaces/index.d.ts +0 -4
  411. package/lib/utils/index.d.ts +0 -11
  412. package/lib/utils/objects/deepClone.d.ts +0 -5
  413. package/lib/utils/objects/index.d.ts +0 -42
  414. package/lib/utils/objects/isArrowFn.d.ts +0 -1
  415. package/lib/utils/objects/methodsOf.d.ts +0 -5
@@ -0,0 +1,508 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Metadata = void 0;
4
+ require("reflect-metadata");
5
+ const classOf_1 = require("../utils/objects/classOf");
6
+ /**
7
+ * Metadata key
8
+ * @private
9
+ * @type {string}
10
+ */
11
+ const DESIGN_PARAM_TYPES = "design:paramtypes";
12
+ /**
13
+ * Metadata key
14
+ * @private
15
+ * @type {string}
16
+ */
17
+ const DESIGN_TYPE = "design:type";
18
+ /**
19
+ * Metadata key
20
+ * @private
21
+ * @type {string}
22
+ */
23
+ const DESIGN_RETURN_TYPE = "design:returntype";
24
+ /**
25
+ * Properties collections
26
+ * @private
27
+ * @type {string}
28
+ */
29
+ const PROPERTIES = new Map();
30
+ /**
31
+ * @stable
32
+ */
33
+ class Metadata {
34
+ /**
35
+ * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
36
+ * @param key A key used to store and retrieve metadata.
37
+ * @param target The target object on which the metadata is defined.
38
+ * @param propertyKey The property key for the target.
39
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
40
+ * @example
41
+ *
42
+ * ```typescript
43
+ * class Example {
44
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
45
+ * // static staticProperty;
46
+ * // property;
47
+ *
48
+ * static staticMethod(p) { }
49
+ * method(p) { }
50
+ * }
51
+ *
52
+ * // constructor
53
+ * result = Metadata.get("custom:annotation", Example);
54
+ *
55
+ * // property (on constructor)
56
+ * result = Metadata.get("custom:annotation", Example, "staticProperty");
57
+ *
58
+ * // property (on prototype)
59
+ * result = Metadata.get("custom:annotation", Example.prototype, "property");
60
+ *
61
+ * // method (on constructor)
62
+ * result = Metadata.get("custom:annotation", Example, "staticMethod");
63
+ *
64
+ * // method (on prototype)
65
+ * result = Metadata.get("custom:annotation", Example.prototype, "method");
66
+ * ```
67
+ *
68
+ */
69
+ static get(key, target, propertyKey) {
70
+ return Reflect.getMetadata(key, (0, classOf_1.classOf)(target), propertyKey);
71
+ }
72
+ /**
73
+ * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
74
+ * @param key A key used to store and retrieve metadata.
75
+ * @param target The target object on which the metadata is defined.
76
+ * @param propertyKey The property key for the target.
77
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
78
+ * @example
79
+ *
80
+ * ```typescript
81
+ * class Example {
82
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
83
+ * // static staticProperty;
84
+ * // property;
85
+ *
86
+ * static staticMethod(p) { }
87
+ * method(p) { }
88
+ * }
89
+ *
90
+ * // constructor
91
+ * result = Metadata.getOwn("custom:annotation", Example);
92
+ *
93
+ * // property (on constructor)
94
+ * result = Metadata.getOwn("custom:annotation", Example, "staticProperty");
95
+ *
96
+ * // property (on prototype)
97
+ * result = Metadata.getOwn("custom:annotation", Example.prototype, "property");
98
+ *
99
+ * // method (on constructor)
100
+ * result = Metadata.getOwn("custom:annotation", Example, "staticMethod");
101
+ *
102
+ * // method (on prototype)
103
+ * result = Metadata.getOwn("custom:annotation", Example.prototype, "method");
104
+ * ```
105
+ *
106
+ */
107
+ static getOwn(key, target, propertyKey) {
108
+ return Reflect.getOwnMetadata(key, (0, classOf_1.classOf)(target), propertyKey);
109
+ }
110
+ /**
111
+ * Gets the metadata value for the provided metadata DESIGN_TYPE on the target object or its prototype chain.
112
+ * @param target The target object on which the metadata is defined.
113
+ * @param propertyKey The property key for the target.
114
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
115
+ * @example
116
+ *
117
+ * ```typescript
118
+ * class Example {
119
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
120
+ * // static staticProperty;
121
+ * // property;
122
+ *
123
+ * static staticMethod(p) { }
124
+ * method(p) { }
125
+ * }
126
+ *
127
+ * // on contructor
128
+ * result = Metadata.getType(Example);
129
+ *
130
+ * // property (on constructor)
131
+ * result = Metadata.getType(Example, "staticProperty");
132
+ *
133
+ * // method (on constructor)
134
+ * result = Metadata.getType(Example, "staticMethod");
135
+ * ```
136
+ *
137
+ */
138
+ static getType(target, propertyKey) {
139
+ return Reflect.getMetadata(DESIGN_TYPE, target, propertyKey);
140
+ }
141
+ /**
142
+ * Gets the metadata value for the provided metadata DESIGN_TYPE on the target object or its prototype chain.
143
+ * @param target The target object on which the metadata is defined.
144
+ * @param propertyKey The property key for the target.
145
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
146
+ * @example
147
+ *
148
+ * ```typescript
149
+ * class Example {
150
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
151
+ * // static staticProperty;
152
+ * // property;
153
+ *
154
+ * static staticMethod(p) { }
155
+ * method(p) { }
156
+ * }
157
+ *
158
+ * // on contructor
159
+ * result = Metadata.getOwnType(Example);
160
+ *
161
+ * // property (on constructor)
162
+ * result = Metadata.getOwnType(Example, "staticProperty");
163
+ *
164
+ * // method (on constructor)
165
+ * result = Metadata.getOwnType(Example, "staticMethod");
166
+ * ```
167
+ *
168
+ */
169
+ static getOwnType(target, propertyKey) {
170
+ return Reflect.getMetadata(DESIGN_TYPE, target, propertyKey);
171
+ }
172
+ /**
173
+ * Gets the metadata value for the provided metadata DESIGN_RETURN_TYPE on the target object or its prototype chain.
174
+ * @param target The target object on which the metadata is defined.
175
+ * @param propertyKey The property key for the target.
176
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
177
+ * @example
178
+ *
179
+ * ```typescript
180
+ * class Example {
181
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
182
+ * // static staticProperty;
183
+ * // property;
184
+ *
185
+ * static staticMethod(p) { }
186
+ * method(p) { }
187
+ * }
188
+ *
189
+ * // on contructor
190
+ * result = Metadata.getReturnType(Example);
191
+ *
192
+ * // property (on constructor)
193
+ * result = Metadata.getReturnType(Example, "staticProperty");
194
+ *
195
+ * // method (on constructor)
196
+ * result = Metadata.getReturnType(Example, "staticMethod");
197
+ * ```
198
+ *
199
+ */
200
+ static getReturnType(target, propertyKey) {
201
+ return Reflect.getMetadata(DESIGN_RETURN_TYPE, target, propertyKey);
202
+ }
203
+ /**
204
+ * Gets the metadata value for the provided metadata DESIGN_RETURN_TYPE on the target object or its prototype chain.
205
+ * @param target The target object on which the metadata is defined.
206
+ * @param propertyKey The property key for the target.
207
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
208
+ * @example
209
+ *
210
+ * ```typescript
211
+ * class Example {
212
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
213
+ * // static staticProperty;
214
+ * // property;
215
+ *
216
+ * static staticMethod(p) { }
217
+ * method(p) { }
218
+ * }
219
+ *
220
+ * // on contructor
221
+ * result = Metadata.getOwnReturnType(Example);
222
+ *
223
+ * // property (on constructor)
224
+ * result = Metadata.getOwnReturnType(Example, "staticProperty");
225
+ *
226
+ * // method (on constructor)
227
+ * result = Metadata.getOwnReturnType(Example, "staticMethod");
228
+ * ```
229
+ *
230
+ */
231
+ static getOwnReturnType(target, propertyKey) {
232
+ return Reflect.getOwnMetadata(DESIGN_RETURN_TYPE, target, propertyKey);
233
+ }
234
+ /**
235
+ * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
236
+ * @param key A key used to store and retrieve metadata.
237
+ * @param target The target object on which the metadata is defined.
238
+ * @param propertyKey The property key for the target.
239
+ * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
240
+ * @example
241
+ *
242
+ * ```typescript
243
+ * class Example {
244
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
245
+ * // static staticProperty;
246
+ * // property;
247
+ *
248
+ * static staticMethod(p) { }
249
+ * method(p) { }
250
+ * }
251
+ *
252
+ * // constructor
253
+ * result = Metadata.has("custom:annotation", Example);
254
+ *
255
+ * // property (on constructor)
256
+ * result = Metadata.has("custom:annotation", Example, "staticProperty");
257
+ *
258
+ * // property (on prototype)
259
+ * result = Metadata.has("custom:annotation", Example.prototype, "property");
260
+ *
261
+ * // method (on constructor)
262
+ * result = Metadata.has("custom:annotation", Example, "staticMethod");
263
+ *
264
+ * // method (on prototype)
265
+ * result = Metadata.has("custom:annotation", Example.prototype, "method");
266
+ * ```
267
+ *
268
+ */
269
+ static has(key, target, propertyKey) {
270
+ try {
271
+ return Reflect.hasMetadata(key, (0, classOf_1.classOf)(target), propertyKey);
272
+ }
273
+ catch (er) { }
274
+ return false;
275
+ }
276
+ /**
277
+ * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
278
+ * @param key A key used to store and retrieve metadata.
279
+ * @param target The target object on which the metadata is defined.
280
+ * @param propertyKey The property key for the target.
281
+ * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
282
+ * @example
283
+ *
284
+ * ```typescript
285
+ * class Example {
286
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
287
+ * // static staticProperty;
288
+ * // property;
289
+ *
290
+ * static staticMethod(p) { }
291
+ * method(p) { }
292
+ * }
293
+ *
294
+ * // constructor
295
+ * result = Metadata.has("custom:annotation", Example);
296
+ *
297
+ * // property (on constructor)
298
+ * result = Metadata.hasOwn("custom:annotation", Example, "staticProperty");
299
+ *
300
+ * // property (on prototype)
301
+ * result = Metadata.hasOwn("custom:annotation", Example.prototype, "property");
302
+ *
303
+ * // method (on constructor)
304
+ * result = Metadata.hasOwn("custom:annotation", Example, "staticMethod");
305
+ *
306
+ * // method (on prototype)
307
+ * result = Metadata.hasOwn("custom:annotation", Example.prototype, "method");
308
+ * ```
309
+ *
310
+ */
311
+ static hasOwn(key, target, propertyKey) {
312
+ return Reflect.hasOwnMetadata(key, (0, classOf_1.classOf)(target), propertyKey);
313
+ }
314
+ /**
315
+ * Deletes the metadata entry from the target object with the provided key.
316
+ * @param key A key used to store and retrieve metadata.
317
+ * @param target The target object on which the metadata is defined.
318
+ * @param propertyKey The property key for the target.
319
+ * @returns `true` if the metadata entry was found and deleted; otherwise, false.
320
+ * @example
321
+ *
322
+ * ```typescript
323
+ * class Example {
324
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
325
+ * // static staticProperty;
326
+ * // property;
327
+ *
328
+ * static staticMethod(p) { }
329
+ * method(p) { }
330
+ * }
331
+ *
332
+ * // constructor
333
+ * result = Metadata.delete("custom:annotation", Example);
334
+ *
335
+ * // property (on constructor)
336
+ * result = Metadata.delete("custom:annotation", Example, "staticProperty");
337
+ *
338
+ * // property (on prototype)
339
+ * result = Metadata.delete("custom:annotation", Example.prototype, "property");
340
+ *
341
+ * // method (on constructor)
342
+ * result = Metadata.delete("custom:annotation", Example, "staticMethod");
343
+ *
344
+ * // method (on prototype)
345
+ * result = Metadata.delete("custom:annotation", Example.prototype, "method");
346
+ * ```
347
+ *
348
+ */
349
+ static delete(key, target, propertyKey) {
350
+ return Reflect.deleteMetadata(key, (0, classOf_1.classOf)(target), propertyKey);
351
+ }
352
+ /**
353
+ * Set the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.
354
+ * @param target The target object on which the metadata is defined.
355
+ * @param propertyKey The property key for the target.
356
+ * @param value A value that contains attached metadata.
357
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
358
+ * @example
359
+ *
360
+ * ```typescript
361
+ * class Example {
362
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
363
+ * // static staticProperty;
364
+ * // property;
365
+ *
366
+ * static staticMethod(p) { }
367
+ * method(p) { }
368
+ * }
369
+ *
370
+ * // on contructor
371
+ * result = Metadata.setParamTypes(Example, undefined, [Object]);
372
+ *
373
+ * // property (on constructor)
374
+ * result = Metadata.setParamTypes(Example, "staticProperty", [Object]);
375
+ *
376
+ * // property (on prototype)
377
+ * result = Metadata.setParamTypes(Example.prototype, "property", [Object]);
378
+ *
379
+ * // method (on constructor)
380
+ * result = Metadata.setParamTypes(Example, "staticMethod", [Object]);
381
+ *
382
+ * // method (on prototype)
383
+ * result = Metadata.setParamTypes(Example.prototype, "method", [Object]);
384
+ * ```
385
+ *
386
+ */
387
+ static setParamTypes(target, propertyKey, value) {
388
+ return this.set(DESIGN_PARAM_TYPES, value, target.prototype, propertyKey);
389
+ }
390
+ /**
391
+ * Define a unique metadata entry on the target.
392
+ * @param key A key used to store and retrieve metadata.
393
+ * @param value A value that contains attached metadata.
394
+ * @param target The target object on which to define metadata.
395
+ * @param propertyKey The property key for the target.
396
+ * @example
397
+ *
398
+ * ```typescript
399
+ * class Example {
400
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
401
+ * // static staticProperty;
402
+ * // property;
403
+ *
404
+ * static staticMethod(p) { }
405
+ * method(p) { }
406
+ * }
407
+ *
408
+ * // constructor
409
+ * Reflect.defineMetadata("custom:annotation", options, Example);
410
+ *
411
+ * // property (on constructor)
412
+ * Reflect.defineMetadata("custom:annotation", Number, Example, "staticProperty");
413
+ *
414
+ * // property (on prototype)
415
+ * Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "property");
416
+ *
417
+ * // method (on constructor)
418
+ * Reflect.defineMetadata("custom:annotation", Number, Example, "staticMethod");
419
+ *
420
+ * // method (on prototype)
421
+ * Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "method");
422
+ *
423
+ * // decorator factory as metadata-producing annotation.
424
+ * function MyAnnotation(options): PropertyDecorator {
425
+ * return (target, key) => Reflect.defineMetadata("custom:annotation", options, target, key);
426
+ * }
427
+ * ```
428
+ *
429
+ */
430
+ static set(key, value, target, propertyKey) {
431
+ const targets = PROPERTIES.has(key) ? PROPERTIES.get(key) || [] : [];
432
+ const classConstructor = (0, classOf_1.classOf)(target);
433
+ if (targets.indexOf(classConstructor) === -1) {
434
+ targets.push(classConstructor);
435
+ PROPERTIES.set(key, targets);
436
+ }
437
+ Reflect.defineMetadata(key, value, (0, classOf_1.classOf)(target), propertyKey);
438
+ }
439
+ /**
440
+ * Gets the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.
441
+ * @param targetPrototype
442
+ * @param propertyKey The property key for the target.
443
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
444
+ * @example
445
+ *
446
+ * ```typescript
447
+ * class Example {
448
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
449
+ * // static staticProperty;
450
+ * // property;
451
+ *
452
+ * static staticMethod(p) { }
453
+ * method(p) { }
454
+ * }
455
+ *
456
+ * // on contructor
457
+ * result = Metadata.getParamTypes(Example.prototype);
458
+ *
459
+ * // property (on constructor)
460
+ * result = Metadata.getParamTypes(Example.prototype, "staticProperty");
461
+ *
462
+ * // method (on constructor)
463
+ * result = Metadata.getParamTypes(Example.prototype, "staticMethod");
464
+ * ```
465
+ *
466
+ */
467
+ static getParamTypes(targetPrototype, propertyKey) {
468
+ return Reflect.getMetadata(DESIGN_PARAM_TYPES, targetPrototype, propertyKey) || [];
469
+ }
470
+ /**
471
+ * Gets the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.
472
+ * @param target The target object on which the metadata is defined.
473
+ * @param propertyKey The property key for the target.
474
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
475
+ * @example
476
+ *
477
+ * ```typescript
478
+ * class Example {
479
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
480
+ * // static staticProperty;
481
+ * // property;
482
+ *
483
+ * static staticMethod(p) { }
484
+ * method(p) { }
485
+ * }
486
+ *
487
+ * // on contructor
488
+ * result = Metadata.getParamTypes(Example);
489
+ *
490
+ * // property (on constructor)
491
+ * result = Metadata.getParamTypes(Example, "staticProperty");
492
+ *
493
+ * // method (on constructor)
494
+ * result = Metadata.getParamTypes(Example, "staticMethod");
495
+ * ```
496
+ *
497
+ */
498
+ static getOwnParamTypes(target, propertyKey) {
499
+ return Reflect.getOwnMetadata(DESIGN_PARAM_TYPES, target, propertyKey) || [];
500
+ }
501
+ }
502
+ exports.Metadata = Metadata;
503
+ /**
504
+ * Get all metadata for a metadataKey.
505
+ * @param metadataKey
506
+ */
507
+ Metadata.getTargetsFromPropertyKey = (metadataKey) => PROPERTIES.has(metadataKey) ? PROPERTIES.get(metadataKey) || [] : [];
508
+ //# sourceMappingURL=Metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Metadata.js","sourceRoot":"","sources":["../../../src/domain/Metadata.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;AAC1B,sDAAiD;AAEjD;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C;;;;GAIG;AACH,MAAM,WAAW,GAAG,aAAa,CAAC;AAClC;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAU,GAAgC,IAAI,GAAG,EAA0B,CAAC;AAElF;;GAEG;AACH,MAAa,QAAQ;IACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,MAAM,CAAC,GAAG,CAAC,GAAW,EAAE,MAAW,EAAE,WAA6B;QAChE,OAAO,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAA,iBAAO,EAAC,MAAM,CAAC,EAAE,WAAY,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,MAAM,CAAC,MAAM,CAAC,GAAW,EAAE,MAAW,EAAE,WAA6B;QACnE,OAAO,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,IAAA,iBAAO,EAAC,MAAM,CAAC,EAAE,WAAY,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,OAAO,CAAC,MAAW,EAAE,WAA6B;QACvD,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,WAAY,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,UAAU,CAAC,MAAW,EAAE,WAA6B;QAC1D,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,WAAY,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,aAAa,CAAC,MAAW,EAAE,WAA6B;QAC7D,OAAO,OAAO,CAAC,WAAW,CAAC,kBAAkB,EAAE,MAAM,EAAE,WAAY,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAW,EAAE,WAA6B;QAChE,OAAO,OAAO,CAAC,cAAc,CAAC,kBAAkB,EAAE,MAAM,EAAE,WAAY,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,MAAM,CAAC,GAAG,CAAC,GAAW,EAAE,MAAW,EAAE,WAA6B;QAChE,IAAI;YACF,OAAO,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAA,iBAAO,EAAC,MAAM,CAAC,EAAE,WAAY,CAAC,CAAC;SAChE;QAAC,OAAO,EAAE,EAAE,GAAE;QAEf,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,MAAM,CAAC,MAAM,CAAC,GAAW,EAAE,MAAW,EAAE,WAA6B;QACnE,OAAO,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,IAAA,iBAAO,EAAC,MAAM,CAAC,EAAE,WAAY,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,MAAM,CAAC,MAAM,CAAC,GAAW,EAAE,MAAW,EAAE,WAA6B;QACnE,OAAO,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,IAAA,iBAAO,EAAC,MAAM,CAAC,EAAE,WAAY,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,MAAM,CAAC,aAAa,CAAC,MAAW,EAAE,WAA4B,EAAE,KAAU;QACxE,OAAO,IAAI,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC5E,CAAC;IASD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,MAAM,CAAC,GAAG,CAAC,GAAW,EAAE,KAAU,EAAE,MAAW,EAAE,WAA6B;QAC5E,MAAM,OAAO,GAAU,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5E,MAAM,gBAAgB,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC;QAEzC,IAAI,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE;YAC5C,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC/B,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;SAC9B;QAED,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,IAAA,iBAAO,EAAC,MAAM,CAAC,EAAE,WAAY,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,aAAa,CAAC,eAAoB,EAAE,WAA6B;QACtE,OAAO,OAAO,CAAC,WAAW,CAAC,kBAAkB,EAAE,eAAe,EAAE,WAAY,CAAC,IAAI,EAAE,CAAC;IACtF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAW,EAAE,WAA6B;QAChE,OAAO,OAAO,CAAC,cAAc,CAAC,kBAAkB,EAAE,MAAM,EAAE,WAAY,CAAC,IAAI,EAAE,CAAC;IAChF,CAAC;;AAxeH,4BAyeC;AA1HC;;;GAGG;AACI,kCAAyB,GAAG,CAAC,WAA4B,EAAS,EAAE,CACzE,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC","sourcesContent":["import \"reflect-metadata\";\nimport {classOf} from \"../utils/objects/classOf\";\n\n/**\n * Metadata key\n * @private\n * @type {string}\n */\nconst DESIGN_PARAM_TYPES = \"design:paramtypes\";\n/**\n * Metadata key\n * @private\n * @type {string}\n */\nconst DESIGN_TYPE = \"design:type\";\n/**\n * Metadata key\n * @private\n * @type {string}\n */\nconst DESIGN_RETURN_TYPE = \"design:returntype\";\n\n/**\n * Properties collections\n * @private\n * @type {string}\n */\nconst PROPERTIES: Map<string | symbol, any[]> = new Map<string | symbol, any[]>();\n\n/**\n * @stable\n */\nexport class Metadata {\n /**\n * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\n * @param key A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Metadata.get(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Metadata.get(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Metadata.get(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Metadata.get(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Metadata.get(\"custom:annotation\", Example.prototype, \"method\");\n * ```\n *\n */\n static get(key: string, target: any, propertyKey?: string | symbol): any {\n return Reflect.getMetadata(key, classOf(target), propertyKey!);\n }\n\n /**\n * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\n * @param key A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Metadata.getOwn(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Metadata.getOwn(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Metadata.getOwn(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Metadata.getOwn(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Metadata.getOwn(\"custom:annotation\", Example.prototype, \"method\");\n * ```\n *\n */\n static getOwn(key: string, target: any, propertyKey?: string | symbol): any {\n return Reflect.getOwnMetadata(key, classOf(target), propertyKey!);\n }\n\n /**\n * Gets the metadata value for the provided metadata DESIGN_TYPE on the target object or its prototype chain.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // on contructor\n * result = Metadata.getType(Example);\n *\n * // property (on constructor)\n * result = Metadata.getType(Example, \"staticProperty\");\n *\n * // method (on constructor)\n * result = Metadata.getType(Example, \"staticMethod\");\n * ```\n *\n */\n static getType(target: any, propertyKey?: string | symbol): any {\n return Reflect.getMetadata(DESIGN_TYPE, target, propertyKey!);\n }\n\n /**\n * Gets the metadata value for the provided metadata DESIGN_TYPE on the target object or its prototype chain.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // on contructor\n * result = Metadata.getOwnType(Example);\n *\n * // property (on constructor)\n * result = Metadata.getOwnType(Example, \"staticProperty\");\n *\n * // method (on constructor)\n * result = Metadata.getOwnType(Example, \"staticMethod\");\n * ```\n *\n */\n static getOwnType(target: any, propertyKey?: string | symbol): any {\n return Reflect.getMetadata(DESIGN_TYPE, target, propertyKey!);\n }\n\n /**\n * Gets the metadata value for the provided metadata DESIGN_RETURN_TYPE on the target object or its prototype chain.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // on contructor\n * result = Metadata.getReturnType(Example);\n *\n * // property (on constructor)\n * result = Metadata.getReturnType(Example, \"staticProperty\");\n *\n * // method (on constructor)\n * result = Metadata.getReturnType(Example, \"staticMethod\");\n * ```\n *\n */\n static getReturnType(target: any, propertyKey?: string | symbol): any {\n return Reflect.getMetadata(DESIGN_RETURN_TYPE, target, propertyKey!);\n }\n\n /**\n * Gets the metadata value for the provided metadata DESIGN_RETURN_TYPE on the target object or its prototype chain.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // on contructor\n * result = Metadata.getOwnReturnType(Example);\n *\n * // property (on constructor)\n * result = Metadata.getOwnReturnType(Example, \"staticProperty\");\n *\n * // method (on constructor)\n * result = Metadata.getOwnReturnType(Example, \"staticMethod\");\n * ```\n *\n */\n static getOwnReturnType(target: any, propertyKey?: string | symbol): any {\n return Reflect.getOwnMetadata(DESIGN_RETURN_TYPE, target, propertyKey!);\n }\n\n /**\n * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\n * @param key A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey The property key for the target.\n * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Metadata.has(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Metadata.has(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Metadata.has(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Metadata.has(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Metadata.has(\"custom:annotation\", Example.prototype, \"method\");\n * ```\n *\n */\n static has(key: string, target: any, propertyKey?: string | symbol): boolean {\n try {\n return Reflect.hasMetadata(key, classOf(target), propertyKey!);\n } catch (er) {}\n\n return false;\n }\n\n /**\n * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\n * @param key A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey The property key for the target.\n * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Metadata.has(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Metadata.hasOwn(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Metadata.hasOwn(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Metadata.hasOwn(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Metadata.hasOwn(\"custom:annotation\", Example.prototype, \"method\");\n * ```\n *\n */\n static hasOwn(key: string, target: any, propertyKey?: string | symbol): boolean {\n return Reflect.hasOwnMetadata(key, classOf(target), propertyKey!);\n }\n\n /**\n * Deletes the metadata entry from the target object with the provided key.\n * @param key A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey The property key for the target.\n * @returns `true` if the metadata entry was found and deleted; otherwise, false.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Metadata.delete(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Metadata.delete(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Metadata.delete(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Metadata.delete(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Metadata.delete(\"custom:annotation\", Example.prototype, \"method\");\n * ```\n *\n */\n static delete(key: string, target: any, propertyKey?: string | symbol): boolean {\n return Reflect.deleteMetadata(key, classOf(target), propertyKey!);\n }\n\n /**\n * Set the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey The property key for the target.\n * @param value A value that contains attached metadata.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // on contructor\n * result = Metadata.setParamTypes(Example, undefined, [Object]);\n *\n * // property (on constructor)\n * result = Metadata.setParamTypes(Example, \"staticProperty\", [Object]);\n *\n * // property (on prototype)\n * result = Metadata.setParamTypes(Example.prototype, \"property\", [Object]);\n *\n * // method (on constructor)\n * result = Metadata.setParamTypes(Example, \"staticMethod\", [Object]);\n *\n * // method (on prototype)\n * result = Metadata.setParamTypes(Example.prototype, \"method\", [Object]);\n * ```\n *\n */\n static setParamTypes(target: any, propertyKey: string | symbol, value: any): void {\n return this.set(DESIGN_PARAM_TYPES, value, target.prototype, propertyKey);\n }\n\n /**\n * Get all metadata for a metadataKey.\n * @param metadataKey\n */\n static getTargetsFromPropertyKey = (metadataKey: string | symbol): any[] =>\n PROPERTIES.has(metadataKey) ? PROPERTIES.get(metadataKey) || [] : [];\n\n /**\n * Define a unique metadata entry on the target.\n * @param key A key used to store and retrieve metadata.\n * @param value A value that contains attached metadata.\n * @param target The target object on which to define metadata.\n * @param propertyKey The property key for the target.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * Reflect.defineMetadata(\"custom:annotation\", options, Example);\n *\n * // property (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", Number, Example, \"staticProperty\");\n *\n * // property (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", Number, Example.prototype, \"property\");\n *\n * // method (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", Number, Example, \"staticMethod\");\n *\n * // method (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", Number, Example.prototype, \"method\");\n *\n * // decorator factory as metadata-producing annotation.\n * function MyAnnotation(options): PropertyDecorator {\n * return (target, key) => Reflect.defineMetadata(\"custom:annotation\", options, target, key);\n * }\n * ```\n *\n */\n static set(key: string, value: any, target: any, propertyKey?: string | symbol): void {\n const targets: any[] = PROPERTIES.has(key) ? PROPERTIES.get(key) || [] : [];\n const classConstructor = classOf(target);\n\n if (targets.indexOf(classConstructor) === -1) {\n targets.push(classConstructor);\n PROPERTIES.set(key, targets);\n }\n\n Reflect.defineMetadata(key, value, classOf(target), propertyKey!);\n }\n\n /**\n * Gets the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.\n * @param targetPrototype\n * @param propertyKey The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // on contructor\n * result = Metadata.getParamTypes(Example.prototype);\n *\n * // property (on constructor)\n * result = Metadata.getParamTypes(Example.prototype, \"staticProperty\");\n *\n * // method (on constructor)\n * result = Metadata.getParamTypes(Example.prototype, \"staticMethod\");\n * ```\n *\n */\n static getParamTypes(targetPrototype: any, propertyKey?: string | symbol): any[] {\n return Reflect.getMetadata(DESIGN_PARAM_TYPES, targetPrototype, propertyKey!) || [];\n }\n\n /**\n * Gets the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * ```typescript\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // on contructor\n * result = Metadata.getParamTypes(Example);\n *\n * // property (on constructor)\n * result = Metadata.getParamTypes(Example, \"staticProperty\");\n *\n * // method (on constructor)\n * result = Metadata.getParamTypes(Example, \"staticMethod\");\n * ```\n *\n */\n static getOwnParamTypes(target: any, propertyKey?: string | symbol): any[] {\n return Reflect.getOwnMetadata(DESIGN_PARAM_TYPES, target, propertyKey!) || [];\n }\n}\n"]}