@tsed/core 7.0.0-alpha.1 → 7.0.0-beta.10

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 +5 -1
  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/objects/getInheritedClass.d.ts → types/utils/objects/ancestorOf.d.ts} +1 -0
  354. package/lib/{utils/objects/ancestorOf.d.ts → 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/types/utils/objects/isSerializable.d.ts +1 -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 +15 -8
  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 -2271
  407. package/lib/index.js.map +0 -1
  408. package/lib/index.modern.js +0 -2185
  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 -40
  414. package/lib/utils/objects/isArrowFn.d.ts +0 -1
  415. package/lib/utils/objects/methodsOf.d.ts +0 -5
@@ -0,0 +1,504 @@
1
+ import "reflect-metadata";
2
+ import { classOf } from "../utils/objects/classOf.js";
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Metadata.js","sourceRoot":"","sources":["../../../src/domain/Metadata.ts"],"names":[],"mappings":"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","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"]}