@tsed/core 6.88.1 → 6.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (510) hide show
  1. package/lib/{decorators → cjs/decorators}/configurable.d.ts +0 -0
  2. package/lib/cjs/decorators/configurable.js +18 -0
  3. package/lib/cjs/decorators/configurable.js.map +1 -0
  4. package/lib/{decorators → cjs/decorators}/deprecated.d.ts +0 -0
  5. package/lib/cjs/decorators/deprecated.js +43 -0
  6. package/lib/cjs/decorators/deprecated.js.map +1 -0
  7. package/lib/{decorators → cjs/decorators}/enumerable.d.ts +0 -0
  8. package/lib/cjs/decorators/enumerable.js +18 -0
  9. package/lib/cjs/decorators/enumerable.js.map +1 -0
  10. package/lib/{decorators → cjs/decorators}/index.d.ts +0 -0
  11. package/lib/cjs/decorators/index.js +18 -0
  12. package/lib/cjs/decorators/index.js.map +1 -0
  13. package/lib/{decorators → cjs/decorators}/notConfigurable.d.ts +0 -0
  14. package/lib/cjs/decorators/notConfigurable.js +13 -0
  15. package/lib/cjs/decorators/notConfigurable.js.map +1 -0
  16. package/lib/{decorators → cjs/decorators}/notEnumerable.d.ts +0 -0
  17. package/lib/cjs/decorators/notEnumerable.js +13 -0
  18. package/lib/cjs/decorators/notEnumerable.js.map +1 -0
  19. package/lib/{decorators → cjs/decorators}/readOnly.d.ts +0 -0
  20. package/lib/cjs/decorators/readOnly.js +13 -0
  21. package/lib/cjs/decorators/readOnly.js.map +1 -0
  22. package/lib/{decorators → cjs/decorators}/storeFn.d.ts +0 -0
  23. package/lib/cjs/decorators/storeFn.js +22 -0
  24. package/lib/cjs/decorators/storeFn.js.map +1 -0
  25. package/lib/{decorators → cjs/decorators}/storeMerge.d.ts +0 -0
  26. package/lib/cjs/decorators/storeMerge.js +11 -0
  27. package/lib/cjs/decorators/storeMerge.js.map +1 -0
  28. package/lib/{decorators → cjs/decorators}/storeSet.d.ts +0 -0
  29. package/lib/cjs/decorators/storeSet.js +11 -0
  30. package/lib/cjs/decorators/storeSet.js.map +1 -0
  31. package/lib/{decorators → cjs/decorators}/writable.d.ts +0 -0
  32. package/lib/cjs/decorators/writable.js +18 -0
  33. package/lib/cjs/decorators/writable.js.map +1 -0
  34. package/lib/{domain → cjs/domain}/AnyToPromise.d.ts +0 -0
  35. package/lib/cjs/domain/AnyToPromise.js +148 -0
  36. package/lib/cjs/domain/AnyToPromise.js.map +1 -0
  37. package/lib/{domain → cjs/domain}/DecoratorTypes.d.ts +0 -0
  38. package/lib/cjs/domain/DecoratorTypes.js +15 -0
  39. package/lib/cjs/domain/DecoratorTypes.js.map +1 -0
  40. package/lib/{domain → cjs/domain}/Env.d.ts +0 -0
  41. package/lib/cjs/domain/Env.js +19 -0
  42. package/lib/cjs/domain/Env.js.map +1 -0
  43. package/lib/{domain → cjs/domain}/Hooks.d.ts +0 -0
  44. package/lib/cjs/domain/Hooks.js +89 -0
  45. package/lib/cjs/domain/Hooks.js.map +1 -0
  46. package/lib/{domain → cjs/domain}/Metadata.d.ts +0 -0
  47. package/lib/cjs/domain/Metadata.js +508 -0
  48. package/lib/cjs/domain/Metadata.js.map +1 -0
  49. package/lib/{domain → cjs/domain}/Store.d.ts +0 -0
  50. package/lib/cjs/domain/Store.js +157 -0
  51. package/lib/cjs/domain/Store.js.map +1 -0
  52. package/lib/{domain → cjs/domain}/Type.d.ts +0 -0
  53. package/lib/cjs/domain/Type.js +7 -0
  54. package/lib/cjs/domain/Type.js.map +1 -0
  55. package/lib/{domain → cjs/domain}/index.d.ts +0 -0
  56. package/lib/cjs/domain/index.js +11 -0
  57. package/lib/cjs/domain/index.js.map +1 -0
  58. package/lib/{errors → cjs/errors}/UnsupportedDecoratorType.d.ts +0 -0
  59. package/lib/cjs/errors/UnsupportedDecoratorType.js +21 -0
  60. package/lib/cjs/errors/UnsupportedDecoratorType.js.map +1 -0
  61. package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
  62. package/lib/cjs/index.js +9 -0
  63. package/lib/cjs/index.js.map +1 -0
  64. package/lib/{interfaces → cjs/interfaces}/AnyDecorator.d.ts +0 -0
  65. package/lib/cjs/interfaces/AnyDecorator.js +3 -0
  66. package/lib/cjs/interfaces/AnyDecorator.js.map +1 -0
  67. package/lib/{interfaces → cjs/interfaces}/DecoratorParameters.d.ts +0 -0
  68. package/lib/cjs/interfaces/DecoratorParameters.js +3 -0
  69. package/lib/cjs/interfaces/DecoratorParameters.js.map +1 -0
  70. package/lib/{interfaces → cjs/interfaces}/HashOf.d.ts +0 -0
  71. package/lib/cjs/interfaces/HashOf.js +3 -0
  72. package/lib/cjs/interfaces/HashOf.js.map +1 -0
  73. package/lib/{interfaces → cjs/interfaces}/MetadataTypes.d.ts +0 -0
  74. package/lib/cjs/interfaces/MetadataTypes.js +3 -0
  75. package/lib/cjs/interfaces/MetadataTypes.js.map +1 -0
  76. package/lib/{interfaces → cjs/interfaces}/ValueOf.d.ts +0 -0
  77. package/lib/cjs/interfaces/ValueOf.js +3 -0
  78. package/lib/cjs/interfaces/ValueOf.js.map +1 -0
  79. package/lib/{interfaces → cjs/interfaces}/index.d.ts +0 -0
  80. package/lib/cjs/interfaces/index.js +3 -0
  81. package/lib/cjs/interfaces/index.js.map +1 -0
  82. package/lib/{utils → cjs/utils}/catchError.d.ts +0 -0
  83. package/lib/cjs/utils/catchError.js +22 -0
  84. package/lib/cjs/utils/catchError.js.map +1 -0
  85. package/lib/{utils → cjs/utils}/decorators/decorateMethodsOf.d.ts +0 -0
  86. package/lib/cjs/utils/decorators/decorateMethodsOf.js +23 -0
  87. package/lib/cjs/utils/decorators/decorateMethodsOf.js.map +1 -0
  88. package/lib/{utils → cjs/utils}/decorators/decoratorArgs.d.ts +0 -0
  89. package/lib/cjs/utils/decorators/decoratorArgs.js +9 -0
  90. package/lib/cjs/utils/decorators/decoratorArgs.js.map +1 -0
  91. package/lib/{utils → cjs/utils}/decorators/decoratorTypeOf.d.ts +0 -0
  92. package/lib/cjs/utils/decorators/decoratorTypeOf.js +23 -0
  93. package/lib/cjs/utils/decorators/decoratorTypeOf.js.map +1 -0
  94. package/lib/{utils → cjs/utils}/decorators/inheritedDescriptorOf.d.ts +0 -0
  95. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js +15 -0
  96. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  97. package/lib/{utils → cjs/utils}/decorators/useDecorators.d.ts +0 -0
  98. package/lib/cjs/utils/decorators/useDecorators.js +14 -0
  99. package/lib/cjs/utils/decorators/useDecorators.js.map +1 -0
  100. package/lib/{utils → cjs/utils}/decorators/useMethodDecorators.d.ts +0 -0
  101. package/lib/cjs/utils/decorators/useMethodDecorators.js +15 -0
  102. package/lib/cjs/utils/decorators/useMethodDecorators.js.map +1 -0
  103. package/lib/cjs/utils/http/getHostInfoFromPort.d.ts +6 -0
  104. package/lib/cjs/utils/http/getHostInfoFromPort.js +21 -0
  105. package/lib/cjs/utils/http/getHostInfoFromPort.js.map +1 -0
  106. package/lib/{utils → cjs/utils}/imports/importPackage.d.ts +0 -0
  107. package/lib/cjs/utils/imports/importPackage.js +35 -0
  108. package/lib/cjs/utils/imports/importPackage.js.map +1 -0
  109. package/lib/{utils → cjs/utils}/index.d.ts +1 -0
  110. package/lib/cjs/utils/index.js +19 -0
  111. package/lib/cjs/utils/index.js.map +1 -0
  112. package/lib/{utils → cjs/utils}/objects/ancestorOf.d.ts +0 -0
  113. package/lib/cjs/utils/objects/ancestorOf.js +12 -0
  114. package/lib/cjs/utils/objects/ancestorOf.js.map +1 -0
  115. package/lib/{utils → cjs/utils}/objects/ancestorsOf.d.ts +0 -0
  116. package/lib/cjs/utils/objects/ancestorsOf.js +22 -0
  117. package/lib/cjs/utils/objects/ancestorsOf.js.map +1 -0
  118. package/lib/{utils → cjs/utils}/objects/classOf.d.ts +0 -0
  119. package/lib/cjs/utils/objects/classOf.js +23 -0
  120. package/lib/cjs/utils/objects/classOf.js.map +1 -0
  121. package/lib/{utils → cjs/utils}/objects/cleanObject.d.ts +0 -0
  122. package/lib/cjs/utils/objects/cleanObject.js +24 -0
  123. package/lib/cjs/utils/objects/cleanObject.js.map +1 -0
  124. package/lib/{utils → cjs/utils}/objects/constructorOf.d.ts +0 -0
  125. package/lib/cjs/utils/objects/constructorOf.js +20 -0
  126. package/lib/cjs/utils/objects/constructorOf.js.map +1 -0
  127. package/lib/{utils → cjs/utils}/objects/createInstance.d.ts +0 -0
  128. package/lib/cjs/utils/objects/createInstance.js +9 -0
  129. package/lib/cjs/utils/objects/createInstance.js.map +1 -0
  130. package/lib/{utils → cjs/utils}/objects/deepClone.d.ts +0 -0
  131. package/lib/cjs/utils/objects/deepClone.js +57 -0
  132. package/lib/cjs/utils/objects/deepClone.js.map +1 -0
  133. package/lib/{utils → cjs/utils}/objects/deepExtends.d.ts +0 -0
  134. package/lib/cjs/utils/objects/deepExtends.js +79 -0
  135. package/lib/cjs/utils/objects/deepExtends.js.map +1 -0
  136. package/lib/{utils → cjs/utils}/objects/deepMerge.d.ts +0 -0
  137. package/lib/cjs/utils/objects/deepMerge.js +63 -0
  138. package/lib/cjs/utils/objects/deepMerge.js.map +1 -0
  139. package/lib/{utils → cjs/utils}/objects/descriptorOf.d.ts +0 -0
  140. package/lib/cjs/utils/objects/descriptorOf.js +19 -0
  141. package/lib/cjs/utils/objects/descriptorOf.js.map +1 -0
  142. package/lib/{utils → cjs/utils}/objects/getClassOrSymbol.d.ts +0 -0
  143. package/lib/cjs/utils/objects/getClassOrSymbol.js +10 -0
  144. package/lib/cjs/utils/objects/getClassOrSymbol.js.map +1 -0
  145. package/lib/{utils → cjs/utils}/objects/getConstructorArgNames.d.ts +0 -0
  146. package/lib/cjs/utils/objects/getConstructorArgNames.js +9 -0
  147. package/lib/cjs/utils/objects/getConstructorArgNames.js.map +1 -0
  148. package/lib/{utils → cjs/utils}/objects/getEnumerableKeys.d.ts +0 -0
  149. package/lib/cjs/utils/objects/getEnumerableKeys.js +20 -0
  150. package/lib/cjs/utils/objects/getEnumerableKeys.js.map +1 -0
  151. package/lib/{utils → cjs/utils}/objects/getValue.d.ts +0 -0
  152. package/lib/cjs/utils/objects/getValue.js +49 -0
  153. package/lib/cjs/utils/objects/getValue.js.map +1 -0
  154. package/lib/{utils → cjs/utils}/objects/index.d.ts +0 -0
  155. package/lib/cjs/utils/objects/index.js +47 -0
  156. package/lib/cjs/utils/objects/index.js.map +1 -0
  157. package/lib/{utils → cjs/utils}/objects/isArray.d.ts +0 -0
  158. package/lib/cjs/utils/objects/isArray.js +23 -0
  159. package/lib/cjs/utils/objects/isArray.js.map +1 -0
  160. package/lib/{utils → cjs/utils}/objects/isArrowFn.d.ts +0 -0
  161. package/lib/cjs/utils/objects/isArrowFn.js +9 -0
  162. package/lib/cjs/utils/objects/isArrowFn.js.map +1 -0
  163. package/lib/{utils → cjs/utils}/objects/isBoolean.d.ts +0 -0
  164. package/lib/cjs/utils/objects/isBoolean.js +17 -0
  165. package/lib/cjs/utils/objects/isBoolean.js.map +1 -0
  166. package/lib/{utils → cjs/utils}/objects/isClass.d.ts +0 -0
  167. package/lib/cjs/utils/objects/isClass.js +26 -0
  168. package/lib/cjs/utils/objects/isClass.js.map +1 -0
  169. package/lib/{utils → cjs/utils}/objects/isCollection.d.ts +0 -0
  170. package/lib/cjs/utils/objects/isCollection.js +22 -0
  171. package/lib/cjs/utils/objects/isCollection.js.map +1 -0
  172. package/lib/{utils → cjs/utils}/objects/isDate.d.ts +0 -0
  173. package/lib/cjs/utils/objects/isDate.js +13 -0
  174. package/lib/cjs/utils/objects/isDate.js.map +1 -0
  175. package/lib/{utils → cjs/utils}/objects/isEmpty.d.ts +0 -0
  176. package/lib/cjs/utils/objects/isEmpty.js +14 -0
  177. package/lib/cjs/utils/objects/isEmpty.js.map +1 -0
  178. package/lib/{utils → cjs/utils}/objects/isEnumerable.d.ts +0 -0
  179. package/lib/cjs/utils/objects/isEnumerable.js +22 -0
  180. package/lib/cjs/utils/objects/isEnumerable.js.map +1 -0
  181. package/lib/{utils → cjs/utils}/objects/isFunction.d.ts +0 -0
  182. package/lib/cjs/utils/objects/isFunction.js +8 -0
  183. package/lib/cjs/utils/objects/isFunction.js.map +1 -0
  184. package/lib/{utils → cjs/utils}/objects/isInheritedFrom.d.ts +0 -0
  185. package/lib/cjs/utils/objects/isInheritedFrom.js +26 -0
  186. package/lib/cjs/utils/objects/isInheritedFrom.js.map +1 -0
  187. package/lib/{utils → cjs/utils}/objects/isNil.d.ts +0 -0
  188. package/lib/cjs/utils/objects/isNil.js +8 -0
  189. package/lib/cjs/utils/objects/isNil.js.map +1 -0
  190. package/lib/{utils → cjs/utils}/objects/isNumber.d.ts +0 -0
  191. package/lib/cjs/utils/objects/isNumber.js +17 -0
  192. package/lib/cjs/utils/objects/isNumber.js.map +1 -0
  193. package/lib/{utils → cjs/utils}/objects/isObject.d.ts +0 -0
  194. package/lib/cjs/utils/objects/isObject.js +8 -0
  195. package/lib/cjs/utils/objects/isObject.js.map +1 -0
  196. package/lib/{utils → cjs/utils}/objects/isObservable.d.ts +0 -0
  197. package/lib/cjs/utils/objects/isObservable.js +8 -0
  198. package/lib/cjs/utils/objects/isObservable.js.map +1 -0
  199. package/lib/{utils → cjs/utils}/objects/isPlainObject.d.ts +0 -0
  200. package/lib/cjs/utils/objects/isPlainObject.js +18 -0
  201. package/lib/cjs/utils/objects/isPlainObject.js.map +1 -0
  202. package/lib/{utils → cjs/utils}/objects/isPrimitive.d.ts +0 -0
  203. package/lib/cjs/utils/objects/isPrimitive.js +30 -0
  204. package/lib/cjs/utils/objects/isPrimitive.js.map +1 -0
  205. package/lib/{utils → cjs/utils}/objects/isPromise.d.ts +0 -0
  206. package/lib/cjs/utils/objects/isPromise.js +16 -0
  207. package/lib/cjs/utils/objects/isPromise.js.map +1 -0
  208. package/lib/{utils → cjs/utils}/objects/isProtectedKey.d.ts +0 -0
  209. package/lib/cjs/utils/objects/isProtectedKey.js +12 -0
  210. package/lib/cjs/utils/objects/isProtectedKey.js.map +1 -0
  211. package/lib/{utils → cjs/utils}/objects/isSerializable.d.ts +0 -0
  212. package/lib/cjs/utils/objects/isSerializable.js +13 -0
  213. package/lib/cjs/utils/objects/isSerializable.js.map +1 -0
  214. package/lib/{utils → cjs/utils}/objects/isStream.d.ts +0 -0
  215. package/lib/cjs/utils/objects/isStream.js +8 -0
  216. package/lib/cjs/utils/objects/isStream.js.map +1 -0
  217. package/lib/{utils → cjs/utils}/objects/isString.d.ts +0 -0
  218. package/lib/cjs/utils/objects/isString.js +16 -0
  219. package/lib/cjs/utils/objects/isString.js.map +1 -0
  220. package/lib/{utils → cjs/utils}/objects/isSymbol.d.ts +0 -0
  221. package/lib/cjs/utils/objects/isSymbol.js +16 -0
  222. package/lib/cjs/utils/objects/isSymbol.js.map +1 -0
  223. package/lib/{utils → cjs/utils}/objects/methodsOf.d.ts +0 -0
  224. package/lib/cjs/utils/objects/methodsOf.js +25 -0
  225. package/lib/cjs/utils/objects/methodsOf.js.map +1 -0
  226. package/lib/{utils → cjs/utils}/objects/nameOf.d.ts +0 -0
  227. package/lib/cjs/utils/objects/nameOf.js +32 -0
  228. package/lib/cjs/utils/objects/nameOf.js.map +1 -0
  229. package/lib/{utils → cjs/utils}/objects/objectKeys.d.ts +0 -0
  230. package/lib/cjs/utils/objects/objectKeys.js +9 -0
  231. package/lib/cjs/utils/objects/objectKeys.js.map +1 -0
  232. package/lib/{utils → cjs/utils}/objects/primitiveOf.d.ts +0 -0
  233. package/lib/cjs/utils/objects/primitiveOf.js +20 -0
  234. package/lib/cjs/utils/objects/primitiveOf.js.map +1 -0
  235. package/lib/{utils → cjs/utils}/objects/prototypeOf.d.ts +0 -0
  236. package/lib/cjs/utils/objects/prototypeOf.js +14 -0
  237. package/lib/cjs/utils/objects/prototypeOf.js.map +1 -0
  238. package/lib/{utils → cjs/utils}/objects/setValue.d.ts +0 -0
  239. package/lib/cjs/utils/objects/setValue.js +34 -0
  240. package/lib/cjs/utils/objects/setValue.js.map +1 -0
  241. package/lib/{utils → cjs/utils}/objects/toMap.d.ts +0 -0
  242. package/lib/cjs/utils/objects/toMap.js +32 -0
  243. package/lib/cjs/utils/objects/toMap.js.map +1 -0
  244. package/lib/{utils → cjs/utils}/objects/toStringConstructor.d.ts +0 -0
  245. package/lib/cjs/utils/objects/toStringConstructor.js +12 -0
  246. package/lib/cjs/utils/objects/toStringConstructor.js.map +1 -0
  247. package/lib/{utils → cjs/utils}/proxyDelegation.d.ts +0 -0
  248. package/lib/cjs/utils/proxyDelegation.js +54 -0
  249. package/lib/cjs/utils/proxyDelegation.js.map +1 -0
  250. package/lib/{utils → cjs/utils}/uniq.d.ts +0 -0
  251. package/lib/cjs/utils/uniq.js +16 -0
  252. package/lib/cjs/utils/uniq.js.map +1 -0
  253. package/lib/esm/decorators/configurable.js +14 -0
  254. package/lib/esm/decorators/configurable.js.map +1 -0
  255. package/lib/esm/decorators/deprecated.js +39 -0
  256. package/lib/esm/decorators/deprecated.js.map +1 -0
  257. package/lib/esm/decorators/enumerable.js +14 -0
  258. package/lib/esm/decorators/enumerable.js.map +1 -0
  259. package/lib/esm/decorators/index.js +15 -0
  260. package/lib/esm/decorators/index.js.map +1 -0
  261. package/lib/esm/decorators/notConfigurable.js +9 -0
  262. package/lib/esm/decorators/notConfigurable.js.map +1 -0
  263. package/lib/esm/decorators/notEnumerable.js +9 -0
  264. package/lib/esm/decorators/notEnumerable.js.map +1 -0
  265. package/lib/esm/decorators/readOnly.js +9 -0
  266. package/lib/esm/decorators/readOnly.js.map +1 -0
  267. package/lib/esm/decorators/storeFn.js +18 -0
  268. package/lib/esm/decorators/storeFn.js.map +1 -0
  269. package/lib/esm/decorators/storeMerge.js +7 -0
  270. package/lib/esm/decorators/storeMerge.js.map +1 -0
  271. package/lib/esm/decorators/storeSet.js +7 -0
  272. package/lib/esm/decorators/storeSet.js.map +1 -0
  273. package/lib/esm/decorators/writable.js +14 -0
  274. package/lib/esm/decorators/writable.js.map +1 -0
  275. package/lib/esm/domain/AnyToPromise.js +144 -0
  276. package/lib/esm/domain/AnyToPromise.js.map +1 -0
  277. package/lib/esm/domain/DecoratorTypes.js +12 -0
  278. package/lib/esm/domain/DecoratorTypes.js.map +1 -0
  279. package/lib/esm/domain/Env.js +16 -0
  280. package/lib/esm/domain/Env.js.map +1 -0
  281. package/lib/esm/domain/Hooks.js +85 -0
  282. package/lib/esm/domain/Hooks.js.map +1 -0
  283. package/lib/esm/domain/Metadata.js +504 -0
  284. package/lib/esm/domain/Metadata.js.map +1 -0
  285. package/lib/esm/domain/Store.js +153 -0
  286. package/lib/esm/domain/Store.js.map +1 -0
  287. package/lib/esm/domain/Type.js +4 -0
  288. package/lib/esm/domain/Type.js.map +1 -0
  289. package/lib/esm/domain/index.js +8 -0
  290. package/lib/esm/domain/index.js.map +1 -0
  291. package/lib/esm/errors/UnsupportedDecoratorType.js +17 -0
  292. package/lib/esm/errors/UnsupportedDecoratorType.js.map +1 -0
  293. package/lib/esm/index.js +6 -0
  294. package/lib/esm/index.js.map +1 -0
  295. package/lib/esm/interfaces/AnyDecorator.js +2 -0
  296. package/lib/esm/interfaces/AnyDecorator.js.map +1 -0
  297. package/lib/esm/interfaces/DecoratorParameters.js +2 -0
  298. package/lib/esm/interfaces/DecoratorParameters.js.map +1 -0
  299. package/lib/esm/interfaces/HashOf.js +2 -0
  300. package/lib/esm/interfaces/HashOf.js.map +1 -0
  301. package/lib/esm/interfaces/MetadataTypes.js +2 -0
  302. package/lib/esm/interfaces/MetadataTypes.js.map +1 -0
  303. package/lib/esm/interfaces/ValueOf.js +2 -0
  304. package/lib/esm/interfaces/ValueOf.js.map +1 -0
  305. package/lib/esm/interfaces/index.js +2 -0
  306. package/lib/esm/interfaces/index.js.map +1 -0
  307. package/lib/esm/utils/catchError.js +17 -0
  308. package/lib/esm/utils/catchError.js.map +1 -0
  309. package/lib/esm/utils/decorators/decorateMethodsOf.js +19 -0
  310. package/lib/esm/utils/decorators/decorateMethodsOf.js.map +1 -0
  311. package/lib/esm/utils/decorators/decoratorArgs.js +5 -0
  312. package/lib/esm/utils/decorators/decoratorArgs.js.map +1 -0
  313. package/lib/esm/utils/decorators/decoratorTypeOf.js +19 -0
  314. package/lib/esm/utils/decorators/decoratorTypeOf.js.map +1 -0
  315. package/lib/esm/utils/decorators/inheritedDescriptorOf.js +11 -0
  316. package/lib/esm/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  317. package/lib/esm/utils/decorators/useDecorators.js +10 -0
  318. package/lib/esm/utils/decorators/useDecorators.js.map +1 -0
  319. package/lib/esm/utils/decorators/useMethodDecorators.js +10 -0
  320. package/lib/esm/utils/decorators/useMethodDecorators.js.map +1 -0
  321. package/lib/esm/utils/http/getHostInfoFromPort.js +17 -0
  322. package/lib/esm/utils/http/getHostInfoFromPort.js.map +1 -0
  323. package/lib/esm/utils/imports/importPackage.js +12 -0
  324. package/lib/esm/utils/imports/importPackage.js.map +1 -0
  325. package/lib/esm/utils/index.js +16 -0
  326. package/lib/esm/utils/index.js.map +1 -0
  327. package/lib/esm/utils/objects/ancestorOf.js +7 -0
  328. package/lib/esm/utils/objects/ancestorOf.js.map +1 -0
  329. package/lib/esm/utils/objects/ancestorsOf.js +18 -0
  330. package/lib/esm/utils/objects/ancestorsOf.js.map +1 -0
  331. package/lib/esm/utils/objects/classOf.js +18 -0
  332. package/lib/esm/utils/objects/classOf.js.map +1 -0
  333. package/lib/esm/utils/objects/cleanObject.js +20 -0
  334. package/lib/esm/utils/objects/cleanObject.js.map +1 -0
  335. package/lib/esm/utils/objects/constructorOf.js +15 -0
  336. package/lib/esm/utils/objects/constructorOf.js.map +1 -0
  337. package/lib/esm/utils/objects/createInstance.js +5 -0
  338. package/lib/esm/utils/objects/createInstance.js.map +1 -0
  339. package/lib/esm/utils/objects/deepClone.js +53 -0
  340. package/lib/esm/utils/objects/deepClone.js.map +1 -0
  341. package/lib/esm/utils/objects/deepExtends.js +75 -0
  342. package/lib/esm/utils/objects/deepExtends.js.map +1 -0
  343. package/lib/esm/utils/objects/deepMerge.js +58 -0
  344. package/lib/esm/utils/objects/deepMerge.js.map +1 -0
  345. package/lib/esm/utils/objects/descriptorOf.js +14 -0
  346. package/lib/esm/utils/objects/descriptorOf.js.map +1 -0
  347. package/lib/esm/utils/objects/getClassOrSymbol.js +6 -0
  348. package/lib/esm/utils/objects/getClassOrSymbol.js.map +1 -0
  349. package/lib/esm/utils/objects/getConstructorArgNames.js +5 -0
  350. package/lib/esm/utils/objects/getConstructorArgNames.js.map +1 -0
  351. package/lib/esm/utils/objects/getEnumerableKeys.js +16 -0
  352. package/lib/esm/utils/objects/getEnumerableKeys.js.map +1 -0
  353. package/lib/esm/utils/objects/getValue.js +45 -0
  354. package/lib/esm/utils/objects/getValue.js.map +1 -0
  355. package/lib/esm/utils/objects/index.js +44 -0
  356. package/lib/esm/utils/objects/index.js.map +1 -0
  357. package/lib/esm/utils/objects/isArray.js +18 -0
  358. package/lib/esm/utils/objects/isArray.js.map +1 -0
  359. package/lib/esm/utils/objects/isArrowFn.js +5 -0
  360. package/lib/esm/utils/objects/isArrowFn.js.map +1 -0
  361. package/lib/esm/utils/objects/isBoolean.js +12 -0
  362. package/lib/esm/utils/objects/isBoolean.js.map +1 -0
  363. package/lib/esm/utils/objects/isClass.js +22 -0
  364. package/lib/esm/utils/objects/isClass.js.map +1 -0
  365. package/lib/esm/utils/objects/isCollection.js +18 -0
  366. package/lib/esm/utils/objects/isCollection.js.map +1 -0
  367. package/lib/esm/utils/objects/isDate.js +9 -0
  368. package/lib/esm/utils/objects/isDate.js.map +1 -0
  369. package/lib/esm/utils/objects/isEmpty.js +10 -0
  370. package/lib/esm/utils/objects/isEmpty.js.map +1 -0
  371. package/lib/esm/utils/objects/isEnumerable.js +18 -0
  372. package/lib/esm/utils/objects/isEnumerable.js.map +1 -0
  373. package/lib/esm/utils/objects/isFunction.js +4 -0
  374. package/lib/esm/utils/objects/isFunction.js.map +1 -0
  375. package/lib/esm/utils/objects/isInheritedFrom.js +22 -0
  376. package/lib/esm/utils/objects/isInheritedFrom.js.map +1 -0
  377. package/lib/esm/utils/objects/isNil.js +4 -0
  378. package/lib/esm/utils/objects/isNil.js.map +1 -0
  379. package/lib/esm/utils/objects/isNumber.js +12 -0
  380. package/lib/esm/utils/objects/isNumber.js.map +1 -0
  381. package/lib/esm/utils/objects/isObject.js +4 -0
  382. package/lib/esm/utils/objects/isObject.js.map +1 -0
  383. package/lib/esm/utils/objects/isObservable.js +4 -0
  384. package/lib/esm/utils/objects/isObservable.js.map +1 -0
  385. package/lib/esm/utils/objects/isPlainObject.js +13 -0
  386. package/lib/esm/utils/objects/isPlainObject.js.map +1 -0
  387. package/lib/esm/utils/objects/isPrimitive.js +24 -0
  388. package/lib/esm/utils/objects/isPrimitive.js.map +1 -0
  389. package/lib/esm/utils/objects/isPromise.js +12 -0
  390. package/lib/esm/utils/objects/isPromise.js.map +1 -0
  391. package/lib/esm/utils/objects/isProtectedKey.js +8 -0
  392. package/lib/esm/utils/objects/isProtectedKey.js.map +1 -0
  393. package/lib/esm/utils/objects/isSerializable.js +9 -0
  394. package/lib/esm/utils/objects/isSerializable.js.map +1 -0
  395. package/lib/esm/utils/objects/isStream.js +4 -0
  396. package/lib/esm/utils/objects/isStream.js.map +1 -0
  397. package/lib/esm/utils/objects/isString.js +11 -0
  398. package/lib/esm/utils/objects/isString.js.map +1 -0
  399. package/lib/esm/utils/objects/isSymbol.js +11 -0
  400. package/lib/esm/utils/objects/isSymbol.js.map +1 -0
  401. package/lib/esm/utils/objects/methodsOf.js +21 -0
  402. package/lib/esm/utils/objects/methodsOf.js.map +1 -0
  403. package/lib/esm/utils/objects/nameOf.js +26 -0
  404. package/lib/esm/utils/objects/nameOf.js.map +1 -0
  405. package/lib/esm/utils/objects/objectKeys.js +5 -0
  406. package/lib/esm/utils/objects/objectKeys.js.map +1 -0
  407. package/lib/esm/utils/objects/primitiveOf.js +16 -0
  408. package/lib/esm/utils/objects/primitiveOf.js.map +1 -0
  409. package/lib/esm/utils/objects/prototypeOf.js +10 -0
  410. package/lib/esm/utils/objects/prototypeOf.js.map +1 -0
  411. package/lib/esm/utils/objects/setValue.js +30 -0
  412. package/lib/esm/utils/objects/setValue.js.map +1 -0
  413. package/lib/esm/utils/objects/toMap.js +28 -0
  414. package/lib/esm/utils/objects/toMap.js.map +1 -0
  415. package/lib/esm/utils/objects/toStringConstructor.js +8 -0
  416. package/lib/esm/utils/objects/toStringConstructor.js.map +1 -0
  417. package/lib/esm/utils/proxyDelegation.js +50 -0
  418. package/lib/esm/utils/proxyDelegation.js.map +1 -0
  419. package/lib/esm/utils/uniq.js +11 -0
  420. package/lib/esm/utils/uniq.js.map +1 -0
  421. package/lib/types/decorators/configurable.d.ts +2 -0
  422. package/lib/types/decorators/deprecated.d.ts +32 -0
  423. package/lib/types/decorators/enumerable.d.ts +2 -0
  424. package/lib/types/decorators/index.d.ts +14 -0
  425. package/lib/types/decorators/notConfigurable.d.ts +2 -0
  426. package/lib/types/decorators/notEnumerable.d.ts +2 -0
  427. package/lib/types/decorators/readOnly.d.ts +2 -0
  428. package/lib/types/decorators/storeFn.d.ts +9 -0
  429. package/lib/types/decorators/storeMerge.d.ts +1 -0
  430. package/lib/types/decorators/storeSet.d.ts +1 -0
  431. package/lib/types/decorators/writable.d.ts +2 -0
  432. package/lib/types/domain/AnyToPromise.d.ts +42 -0
  433. package/lib/types/domain/DecoratorTypes.d.ts +10 -0
  434. package/lib/types/domain/Env.d.ts +13 -0
  435. package/lib/types/domain/Hooks.d.ts +45 -0
  436. package/lib/types/domain/Metadata.d.ts +442 -0
  437. package/lib/types/domain/Store.d.ts +69 -0
  438. package/lib/types/domain/Type.d.ts +11 -0
  439. package/lib/types/domain/index.d.ts +7 -0
  440. package/lib/types/errors/UnsupportedDecoratorType.d.ts +5 -0
  441. package/lib/types/index.d.ts +6 -0
  442. package/lib/types/interfaces/AnyDecorator.d.ts +1 -0
  443. package/lib/types/interfaces/DecoratorParameters.d.ts +3 -0
  444. package/lib/types/interfaces/HashOf.d.ts +1 -0
  445. package/lib/types/interfaces/MetadataTypes.d.ts +5 -0
  446. package/lib/types/interfaces/ValueOf.d.ts +1 -0
  447. package/lib/types/interfaces/index.d.ts +4 -0
  448. package/lib/types/utils/catchError.d.ts +2 -0
  449. package/lib/types/utils/decorators/decorateMethodsOf.d.ts +1 -0
  450. package/lib/types/utils/decorators/decoratorArgs.d.ts +2 -0
  451. package/lib/types/utils/decorators/decoratorTypeOf.d.ts +2 -0
  452. package/lib/types/utils/decorators/inheritedDescriptorOf.d.ts +1 -0
  453. package/lib/types/utils/decorators/useDecorators.d.ts +2 -0
  454. package/lib/types/utils/decorators/useMethodDecorators.d.ts +3 -0
  455. package/lib/types/utils/http/getHostInfoFromPort.d.ts +6 -0
  456. package/lib/types/utils/imports/importPackage.d.ts +1 -0
  457. package/lib/types/utils/index.d.ts +13 -0
  458. package/lib/types/utils/objects/ancestorOf.d.ts +2 -0
  459. package/lib/types/utils/objects/ancestorsOf.d.ts +6 -0
  460. package/lib/types/utils/objects/classOf.d.ts +13 -0
  461. package/lib/types/utils/objects/cleanObject.d.ts +6 -0
  462. package/lib/types/utils/objects/constructorOf.d.ts +11 -0
  463. package/lib/types/utils/objects/createInstance.d.ts +1 -0
  464. package/lib/types/utils/objects/deepClone.d.ts +6 -0
  465. package/lib/types/utils/objects/deepExtends.d.ts +10 -0
  466. package/lib/types/utils/objects/deepMerge.d.ts +9 -0
  467. package/lib/types/utils/objects/descriptorOf.d.ts +8 -0
  468. package/lib/types/utils/objects/getClassOrSymbol.d.ts +1 -0
  469. package/lib/types/utils/objects/getConstructorArgNames.d.ts +1 -0
  470. package/lib/types/utils/objects/getEnumerableKeys.d.ts +5 -0
  471. package/lib/types/utils/objects/getValue.d.ts +32 -0
  472. package/lib/types/utils/objects/index.d.ts +43 -0
  473. package/lib/types/utils/objects/isArray.d.ts +13 -0
  474. package/lib/types/utils/objects/isArrowFn.d.ts +1 -0
  475. package/lib/types/utils/objects/isBoolean.d.ts +7 -0
  476. package/lib/types/utils/objects/isClass.d.ts +1 -0
  477. package/lib/types/utils/objects/isCollection.d.ts +6 -0
  478. package/lib/types/utils/objects/isDate.d.ts +6 -0
  479. package/lib/types/utils/objects/isEmpty.d.ts +6 -0
  480. package/lib/types/utils/objects/isEnumerable.d.ts +6 -0
  481. package/lib/types/utils/objects/isFunction.d.ts +1 -0
  482. package/lib/types/utils/objects/isInheritedFrom.d.ts +1 -0
  483. package/lib/types/utils/objects/isNil.d.ts +1 -0
  484. package/lib/types/utils/objects/isNumber.d.ts +7 -0
  485. package/lib/types/utils/objects/isObject.d.ts +1 -0
  486. package/lib/types/utils/objects/isObservable.d.ts +1 -0
  487. package/lib/types/utils/objects/isPlainObject.d.ts +7 -0
  488. package/lib/types/utils/objects/isPrimitive.d.ts +14 -0
  489. package/lib/types/utils/objects/isPromise.d.ts +7 -0
  490. package/lib/types/utils/objects/isProtectedKey.d.ts +5 -0
  491. package/lib/types/utils/objects/isSerializable.d.ts +1 -0
  492. package/lib/types/utils/objects/isStream.d.ts +1 -0
  493. package/lib/types/utils/objects/isString.d.ts +6 -0
  494. package/lib/types/utils/objects/isSymbol.d.ts +6 -0
  495. package/lib/types/utils/objects/methodsOf.d.ts +5 -0
  496. package/lib/types/utils/objects/nameOf.d.ts +14 -0
  497. package/lib/types/utils/objects/objectKeys.d.ts +1 -0
  498. package/lib/types/utils/objects/primitiveOf.d.ts +1 -0
  499. package/lib/types/utils/objects/prototypeOf.d.ts +6 -0
  500. package/lib/types/utils/objects/setValue.d.ts +1 -0
  501. package/lib/types/utils/objects/toMap.d.ts +3 -0
  502. package/lib/types/utils/objects/toStringConstructor.d.ts +1 -0
  503. package/lib/types/utils/proxyDelegation.d.ts +33 -0
  504. package/lib/types/utils/uniq.d.ts +2 -0
  505. package/package.json +10 -6
  506. package/tsconfig.compile.esm.json +23 -0
  507. package/lib/index.js +0 -2317
  508. package/lib/index.js.map +0 -1
  509. package/lib/index.modern.js +0 -2207
  510. package/lib/index.modern.js.map +0 -1
@@ -0,0 +1,153 @@
1
+ import { DecoratorTypes } from "../domain/DecoratorTypes";
2
+ import { decoratorTypeOf } from "../utils/decorators/decoratorTypeOf";
3
+ import { deepClone } from "../utils/objects/deepClone";
4
+ import { deepMerge } from "../utils/objects/deepMerge";
5
+ import { descriptorOf } from "../utils/objects/descriptorOf";
6
+ import { isSymbol } from "../utils/objects/isSymbol";
7
+ import { nameOf } from "../utils/objects/nameOf";
8
+ import { Metadata } from "./Metadata";
9
+ /**
10
+ * @ignore
11
+ */
12
+ export const CLASS_STORE = "tsed:class:store";
13
+ /**
14
+ * @ignore
15
+ */
16
+ export const METHOD_STORE = "tsed:method:store";
17
+ /**
18
+ * @ignore
19
+ */
20
+ export const PROPERTY_STORE = "tsed:property:store";
21
+ /**
22
+ * @ignore
23
+ */
24
+ export const PARAM_STORE = "tsed:param:store";
25
+ const stores = new Map();
26
+ function storeGet(key, ...args) {
27
+ if (isSymbol(args[0])) {
28
+ if (!stores.has(args[0])) {
29
+ stores.set(args[0], new Store());
30
+ }
31
+ return stores.get(args[0]);
32
+ }
33
+ else {
34
+ const registry = Metadata;
35
+ if (!registry.hasOwn(key, ...args)) {
36
+ registry.set(key, new Store(), ...args);
37
+ }
38
+ return registry.getOwn(key, ...args);
39
+ }
40
+ }
41
+ function defineStore(args) {
42
+ const [target, propertyKey, descriptor] = args;
43
+ switch (decoratorTypeOf(args)) {
44
+ case DecoratorTypes.PARAM_CTOR:
45
+ case DecoratorTypes.PARAM_STC:
46
+ case DecoratorTypes.PARAM:
47
+ const store = storeGet(PARAM_STORE, target, propertyKey);
48
+ if (!store.has("" + descriptor)) {
49
+ store.set("" + descriptor, new Store());
50
+ }
51
+ return store.get("" + descriptor);
52
+ case DecoratorTypes.PROP:
53
+ case DecoratorTypes.PROP_STC:
54
+ return storeGet(PROPERTY_STORE, target, propertyKey);
55
+ case DecoratorTypes.METHOD:
56
+ case DecoratorTypes.METHOD_STC:
57
+ return storeGet(METHOD_STORE, target, propertyKey);
58
+ case DecoratorTypes.CLASS:
59
+ return storeGet(CLASS_STORE, target);
60
+ }
61
+ }
62
+ export class Store {
63
+ constructor() {
64
+ this._entries = new Map();
65
+ }
66
+ /**
67
+ * Create or get a Store from args {target + methodName + descriptor}
68
+ * @param args
69
+ * @returns {Store}
70
+ */
71
+ static from(...args) {
72
+ return defineStore(args);
73
+ }
74
+ /**
75
+ * Create store on the method.
76
+ * @param target
77
+ * @param {string} propertyKey
78
+ * @returns {Store}
79
+ */
80
+ static fromMethod(target, propertyKey) {
81
+ return Store.from(target, propertyKey, descriptorOf(target, propertyKey));
82
+ }
83
+ static mergeStoreFrom(target, source, ...args) {
84
+ const store = Store.from(target, ...args);
85
+ Store.from(source, ...args)._entries.forEach((value, key) => {
86
+ store.merge(key, value);
87
+ });
88
+ return store;
89
+ }
90
+ static mergeStoreMethodFrom(target, source, propertyKey) {
91
+ return this.mergeStoreFrom(target, source, propertyKey, descriptorOf(target, propertyKey));
92
+ }
93
+ /**
94
+ * The get() method returns a specified element from a Map object.
95
+ * @param key Required. The key of the element to return from the Map object.
96
+ * @param defaultValue
97
+ * @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.
98
+ */
99
+ get(key, defaultValue) {
100
+ return this._entries.get(nameOf(key)) || defaultValue;
101
+ }
102
+ /**
103
+ * The has() method returns a boolean indicating whether an element with the specified key exists or not.
104
+ * @param key
105
+ * @returns {boolean}
106
+ */
107
+ has(key) {
108
+ return this._entries.has(nameOf(key));
109
+ }
110
+ /**
111
+ * The set() method adds or updates an element with a specified key and value to a Map object.
112
+ * @param key Required. The key of the element to add to the Map object.
113
+ * @param metadata Required. The value of the element to add to the Map object.
114
+ */
115
+ set(key, metadata) {
116
+ this._entries.set(nameOf(key), metadata);
117
+ return this;
118
+ }
119
+ /**
120
+ * The delete() method removes the specified element from a Map object.
121
+ * @param key Required. The key of the element to remove from the Map object.
122
+ * @returns {boolean} Returns true if an element in the Map object existed and has been removed, or false if the element does not exist.
123
+ */
124
+ delete(key) {
125
+ return this._entries.delete(nameOf(key));
126
+ }
127
+ /**
128
+ * Merge given value with existing value.
129
+ * @param key
130
+ * @param value
131
+ * @param inverse Change the merge order. Get the existing value and apply over given value
132
+ * @returns {Store}
133
+ */
134
+ merge(key, value, inverse = false) {
135
+ let _value_ = this.get(key);
136
+ if (_value_) {
137
+ value = deepClone(value);
138
+ _value_ = deepClone(_value_);
139
+ value = inverse ? deepMerge(value, _value_) : deepMerge(_value_, value);
140
+ }
141
+ this.set(key, value);
142
+ return this;
143
+ }
144
+ toJson() {
145
+ return [...this._entries.entries()].reduce((obj, [key, value]) => {
146
+ return {
147
+ ...obj,
148
+ [key]: value
149
+ };
150
+ }, {});
151
+ }
152
+ }
153
+ //# sourceMappingURL=Store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/domain/Store.ts"],"names":[],"mappings":"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","sourcesContent":["import {DecoratorTypes} from \"../domain/DecoratorTypes\";\nimport {decoratorTypeOf} from \"../utils/decorators/decoratorTypeOf\";\nimport {deepClone} from \"../utils/objects/deepClone\";\nimport {deepMerge} from \"../utils/objects/deepMerge\";\nimport {descriptorOf} from \"../utils/objects/descriptorOf\";\nimport {isSymbol} from \"../utils/objects/isSymbol\";\nimport {nameOf} from \"../utils/objects/nameOf\";\nimport {Metadata} from \"./Metadata\";\nimport type {Type} from \"./Type\";\n\n/**\n * @ignore\n */\nexport const CLASS_STORE = \"tsed:class:store\";\n/**\n * @ignore\n */\nexport const METHOD_STORE = \"tsed:method:store\";\n/**\n * @ignore\n */\nexport const PROPERTY_STORE = \"tsed:property:store\";\n/**\n * @ignore\n */\nexport const PARAM_STORE = \"tsed:param:store\";\n\nconst stores = new Map<symbol, Store>();\n\nfunction storeGet(key: string, ...args: any[]): Store {\n if (isSymbol(args[0])) {\n if (!stores.has(args[0])) {\n stores.set(args[0], new Store());\n }\n\n return stores.get(args[0])!;\n } else {\n const registry = Metadata as any;\n\n if (!registry.hasOwn(key, ...args)) {\n registry.set(key, new Store(), ...args);\n }\n\n return registry.getOwn(key, ...args);\n }\n}\n\nfunction defineStore(args: any[]): Store {\n const [target, propertyKey, descriptor] = args;\n\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.PARAM_CTOR:\n case DecoratorTypes.PARAM_STC:\n case DecoratorTypes.PARAM:\n const store = storeGet(PARAM_STORE, target, propertyKey);\n if (!store.has(\"\" + descriptor)) {\n store.set(\"\" + descriptor, new Store());\n }\n\n return store.get(\"\" + descriptor);\n case DecoratorTypes.PROP:\n case DecoratorTypes.PROP_STC:\n return storeGet(PROPERTY_STORE, target, propertyKey);\n case DecoratorTypes.METHOD:\n case DecoratorTypes.METHOD_STC:\n return storeGet(METHOD_STORE, target, propertyKey);\n case DecoratorTypes.CLASS:\n return storeGet(CLASS_STORE, target);\n }\n}\n\nexport class Store {\n private _entries = new Map<string, any>();\n /**\n * Create or get a Store from args {target + methodName + descriptor}\n * @param args\n * @returns {Store}\n */\n static from(...args: any[]): Store {\n return defineStore(args);\n }\n\n /**\n * Create store on the method.\n * @param target\n * @param {string} propertyKey\n * @returns {Store}\n */\n static fromMethod(target: any, propertyKey: string | symbol): Store {\n return Store.from(target, propertyKey, descriptorOf(target, propertyKey));\n }\n\n static mergeStoreFrom(target: Type<any>, source: Type<any>, ...args: any[]) {\n const store = Store.from(target, ...args);\n\n Store.from(source, ...args)._entries.forEach((value, key) => {\n store.merge(key, value);\n });\n\n return store;\n }\n\n static mergeStoreMethodFrom(target: Type<any>, source: Type<any>, propertyKey: string | symbol) {\n return this.mergeStoreFrom(target, source, propertyKey, descriptorOf(target, propertyKey));\n }\n\n /**\n * The get() method returns a specified element from a Map object.\n * @param key Required. The key of the element to return from the Map object.\n * @param defaultValue\n * @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.\n */\n get<T = any>(key: any, defaultValue?: any): T {\n return this._entries.get(nameOf(key)) || defaultValue;\n }\n\n /**\n * The has() method returns a boolean indicating whether an element with the specified key exists or not.\n * @param key\n * @returns {boolean}\n */\n has(key: any): boolean {\n return this._entries.has(nameOf(key));\n }\n\n /**\n * The set() method adds or updates an element with a specified key and value to a Map object.\n * @param key Required. The key of the element to add to the Map object.\n * @param metadata Required. The value of the element to add to the Map object.\n */\n set(key: any, metadata: any): Store {\n this._entries.set(nameOf(key), metadata);\n\n return this;\n }\n\n /**\n * The delete() method removes the specified element from a Map object.\n * @param key Required. The key of the element to remove from the Map object.\n * @returns {boolean} Returns true if an element in the Map object existed and has been removed, or false if the element does not exist.\n */\n delete(key: string): boolean {\n return this._entries.delete(nameOf(key));\n }\n\n /**\n * Merge given value with existing value.\n * @param key\n * @param value\n * @param inverse Change the merge order. Get the existing value and apply over given value\n * @returns {Store}\n */\n merge(key: any, value: any, inverse: boolean = false): Store {\n let _value_ = this.get(key);\n\n if (_value_) {\n value = deepClone(value);\n _value_ = deepClone(_value_);\n value = inverse ? deepMerge(value, _value_) : deepMerge(_value_, value);\n }\n\n this.set(key, value);\n\n return this;\n }\n\n toJson() {\n return [...this._entries.entries()].reduce((obj, [key, value]) => {\n return {\n ...obj,\n [key]: value\n };\n }, {});\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export const Type = Function;
2
+ // @ts-ignore
3
+ global.Type = Type;
4
+ //# sourceMappingURL=Type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Type.js","sourceRoot":"","sources":["../../../src/domain/Type.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC;AAE7B,aAAa;AACb,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC","sourcesContent":["/**\n * An example of a `Type` is `MyCustomComponent` filters, which in JavaScript is be represented by\n * the `MyCustomComponent` constructor function.\n */\n// tslint:disable-next-line: variable-name\n/**\n *\n */\nexport interface Type<T = any> extends Function {\n new (...args: any[]): T;\n}\n\nexport const Type = Function;\n\n// @ts-ignore\nglobal.Type = Type;\n"]}
@@ -0,0 +1,8 @@
1
+ export * from "./DecoratorTypes";
2
+ export * from "./Env";
3
+ export * from "./Hooks";
4
+ export * from "./Metadata";
5
+ export * from "./Store";
6
+ export * from "./Type";
7
+ export * from "./AnyToPromise";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC","sourcesContent":["export * from \"./DecoratorTypes\";\nexport * from \"./Env\";\nexport * from \"./Hooks\";\nexport * from \"./Metadata\";\nexport * from \"./Store\";\nexport * from \"./Type\";\nexport * from \"./AnyToPromise\";\n"]}
@@ -0,0 +1,17 @@
1
+ import { classOf, decoratorTypeOf, nameOf } from "../utils";
2
+ export class UnsupportedDecoratorType extends Error {
3
+ constructor(decorator, args) {
4
+ super(UnsupportedDecoratorType.buildMessage(decorator, args));
5
+ }
6
+ static buildMessage(decorator, args) {
7
+ const [target, propertyKey, index] = args;
8
+ const bindingType = decoratorTypeOf(args);
9
+ const shortBinding = bindingType.split("/")[0];
10
+ const param = shortBinding === "parameter" ? ".[" + index + "]" : "";
11
+ const cstr = shortBinding === "parameter" ? ".constructor" : "";
12
+ const method = propertyKey ? "." + propertyKey : cstr;
13
+ const path = nameOf(classOf(target)) + method + param;
14
+ return `${decorator.name} cannot be used as ${bindingType} decorator on ${path}`;
15
+ }
16
+ }
17
+ //# sourceMappingURL=UnsupportedDecoratorType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnsupportedDecoratorType.js","sourceRoot":"","sources":["../../../src/errors/UnsupportedDecoratorType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;AAE1D,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IAGjD,YAAY,SAAc,EAAE,IAAW;QACrC,KAAK,CAAC,wBAAwB,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,SAAc,EAAE,IAAW;QACrD,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;QAE1C,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,MAAM,IAAI,GAAG,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;QAEtD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;QAEtD,OAAO,GAAG,SAAS,CAAC,IAAI,sBAAsB,WAAW,iBAAiB,IAAI,EAAE,CAAC;IACnF,CAAC;CACF","sourcesContent":["import {classOf, decoratorTypeOf, nameOf} from \"../utils\";\n\nexport class UnsupportedDecoratorType extends Error {\n name: \"UNSUPPORTED_DECORATOR_TYPE\";\n\n constructor(decorator: any, args: any[]) {\n super(UnsupportedDecoratorType.buildMessage(decorator, args));\n }\n\n private static buildMessage(decorator: any, args: any[]): string {\n const [target, propertyKey, index] = args;\n\n const bindingType = decoratorTypeOf(args);\n const shortBinding = bindingType.split(\"/\")[0];\n const param = shortBinding === \"parameter\" ? \".[\" + index + \"]\" : \"\";\n const cstr = shortBinding === \"parameter\" ? \".constructor\" : \"\";\n const method = propertyKey ? \".\" + propertyKey : cstr;\n\n const path = nameOf(classOf(target)) + method + param;\n\n return `${decorator.name} cannot be used as ${bindingType} decorator on ${path}`;\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import "reflect-metadata";
2
+ export * from "./utils";
3
+ export * from "./domain";
4
+ export * from "./errors/UnsupportedDecoratorType";
5
+ export * from "./decorators";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAG1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,mCAAmC,CAAC;AAClD,cAAc,cAAc,CAAC","sourcesContent":["import \"reflect-metadata\";\n\nexport type {DecoratorParameters, DecoratorMethodParameters, StaticMethodDecorator, MetadataTypes, ValueOf, HashOf} from \"./interfaces\";\nexport * from \"./utils\";\nexport * from \"./domain\";\nexport * from \"./errors/UnsupportedDecoratorType\";\nexport * from \"./decorators\";\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AnyDecorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnyDecorator.js","sourceRoot":"","sources":["../../../src/interfaces/AnyDecorator.ts"],"names":[],"mappings":"","sourcesContent":["export type AnyDecorator = any | ClassDecorator | MethodDecorator | PropertyDescriptor | ParameterDecorator;\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DecoratorParameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoratorParameters.js","sourceRoot":"","sources":["../../../src/interfaces/DecoratorParameters.ts"],"names":[],"mappings":"","sourcesContent":["export type DecoratorParameters = [any, string | symbol, number | PropertyDescriptor];\nexport type DecoratorMethodParameters = [any, string | symbol, PropertyDescriptor];\n\nexport type StaticMethodDecorator = <TFunction extends Function, T>(\n target: TFunction,\n propertyKey: string | symbol,\n descriptor: TypedPropertyDescriptor<T>\n) => TypedPropertyDescriptor<T> | void;\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HashOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HashOf.js","sourceRoot":"","sources":["../../../src/interfaces/HashOf.ts"],"names":[],"mappings":"","sourcesContent":["export type HashOf<T> = Record<string, T>;\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MetadataTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetadataTypes.js","sourceRoot":"","sources":["../../../src/interfaces/MetadataTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type {Type} from \"../domain/Type\";\n\nexport interface MetadataTypes<T = any, C = any> {\n type?: Type<T> | T;\n collectionType?: Type<C> | C;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ValueOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValueOf.js","sourceRoot":"","sources":["../../../src/interfaces/ValueOf.ts"],"names":[],"mappings":"","sourcesContent":["export type ValueOf<T> = T[keyof T];\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"","sourcesContent":["export type {DecoratorParameters, DecoratorMethodParameters, StaticMethodDecorator} from \"./DecoratorParameters\";\nexport type {MetadataTypes} from \"./MetadataTypes\";\nexport type {ValueOf} from \"./ValueOf\";\nexport type {HashOf} from \"./HashOf\";\n"]}
@@ -0,0 +1,17 @@
1
+ export function catchError(cb) {
2
+ try {
3
+ cb();
4
+ }
5
+ catch (er) {
6
+ return er;
7
+ }
8
+ }
9
+ export async function catchAsyncError(cb) {
10
+ try {
11
+ await cb();
12
+ }
13
+ catch (er) {
14
+ return er;
15
+ }
16
+ }
17
+ //# sourceMappingURL=catchError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catchError.js","sourceRoot":"","sources":["../../../src/utils/catchError.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAkB,EAAY;IACtD,IAAI;QACF,EAAE,EAAE,CAAC;KACN;IAAC,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAkB,EAAY;IACjE,IAAI;QACF,MAAM,EAAE,EAAE,CAAC;KACZ;IAAC,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,CAAC;KACX;AACH,CAAC","sourcesContent":["export function catchError<T extends Error>(cb: Function): T | undefined {\n try {\n cb();\n } catch (er) {\n return er;\n }\n}\n\nexport async function catchAsyncError<T extends Error>(cb: Function): Promise<T | undefined> {\n try {\n await cb();\n } catch (er) {\n return er;\n }\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { classOf } from "../objects/classOf";
2
+ import { methodsOf } from "../objects/methodsOf";
3
+ import { prototypeOf } from "../objects/prototypeOf";
4
+ import { descriptorOf } from "../objects/descriptorOf";
5
+ import { Store } from "../../domain/Store";
6
+ export function decorateMethodsOf(klass, decorator) {
7
+ methodsOf(klass).forEach(({ target, propertyKey }) => {
8
+ if (target !== classOf(klass)) {
9
+ Object.defineProperty(prototypeOf(klass), propertyKey, {
10
+ value(...args) {
11
+ return prototypeOf(target)[propertyKey].apply(this, args);
12
+ }
13
+ });
14
+ Store.mergeStoreMethodFrom(klass, target, propertyKey);
15
+ }
16
+ decorator(prototypeOf(klass), propertyKey, descriptorOf(klass, propertyKey));
17
+ });
18
+ }
19
+ //# sourceMappingURL=decorateMethodsOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorateMethodsOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decorateMethodsOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAEzC,MAAM,UAAU,iBAAiB,CAAC,KAAU,EAAE,SAAc;IAC1D,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,EAAE,EAAE;QACjD,IAAI,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,EAAE;YAC7B,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE;gBACrD,KAAK,CAAC,GAAG,IAAW;oBAClB,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAC5D,CAAC;aACF,CAAC,CAAC;YAEH,KAAK,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;SACxD;QAED,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {classOf} from \"../objects/classOf\";\nimport {methodsOf} from \"../objects/methodsOf\";\nimport {prototypeOf} from \"../objects/prototypeOf\";\nimport {descriptorOf} from \"../objects/descriptorOf\";\nimport {Store} from \"../../domain/Store\";\n\nexport function decorateMethodsOf(klass: any, decorator: any) {\n methodsOf(klass).forEach(({target, propertyKey}) => {\n if (target !== classOf(klass)) {\n Object.defineProperty(prototypeOf(klass), propertyKey, {\n value(...args: any[]) {\n return prototypeOf(target)[propertyKey].apply(this, args);\n }\n });\n\n Store.mergeStoreMethodFrom(klass, target, propertyKey);\n }\n\n decorator(prototypeOf(klass), propertyKey, descriptorOf(klass, propertyKey));\n });\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { descriptorOf } from "../objects/descriptorOf";
2
+ export function decoratorArgs(target, propertyKey) {
3
+ return [target, propertyKey, descriptorOf(target, propertyKey)];
4
+ }
5
+ //# sourceMappingURL=decoratorArgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decoratorArgs.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decoratorArgs.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAErD,MAAM,UAAU,aAAa,CAAC,MAAW,EAAE,WAAmB;IAC5D,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,MAAM,EAAE,WAAW,CAAE,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import {DecoratorParameters} from \"../../interfaces/DecoratorParameters\";\nimport {descriptorOf} from \"../objects/descriptorOf\";\n\nexport function decoratorArgs(target: any, propertyKey: string): DecoratorParameters {\n return [target, propertyKey, descriptorOf(target, propertyKey)!];\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { DecoratorTypes } from "../../domain/DecoratorTypes";
2
+ import { classOf } from "../objects/classOf";
3
+ export function decoratorTypeOf(args) {
4
+ const [target, propertyKey, descriptor] = args;
5
+ const staticType = (type) => {
6
+ return target !== classOf(target) ? type : `${type}.static`;
7
+ };
8
+ if (typeof descriptor === "number") {
9
+ return propertyKey ? staticType("parameter") : "parameter.constructor";
10
+ }
11
+ if (descriptor && descriptor.value) {
12
+ return staticType("method");
13
+ }
14
+ if ((propertyKey && descriptor === undefined) || descriptor) {
15
+ return staticType("property");
16
+ }
17
+ return DecoratorTypes.CLASS;
18
+ }
19
+ //# sourceMappingURL=decoratorTypeOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decoratorTypeOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decoratorTypeOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAE3C,MAAM,UAAU,eAAe,CAAC,IAAW;IACzC,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;IAE/C,MAAM,UAAU,GAAG,CAAC,IAAY,EAAO,EAAE;QACvC,OAAO,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,SAAS,CAAC;IAC9D,CAAC,CAAC;IAEF,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAClC,OAAO,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC;KACxE;IAED,IAAI,UAAU,IAAI,UAAU,CAAC,KAAK,EAAE;QAClC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;KAC7B;IAED,IAAI,CAAC,WAAW,IAAI,UAAU,KAAK,SAAS,CAAC,IAAI,UAAU,EAAE;QAC3D,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;KAC/B;IAED,OAAO,cAAc,CAAC,KAAK,CAAC;AAC9B,CAAC","sourcesContent":["import {DecoratorTypes} from \"../../domain/DecoratorTypes\";\nimport {classOf} from \"../objects/classOf\";\n\nexport function decoratorTypeOf(args: any[]): DecoratorTypes {\n const [target, propertyKey, descriptor] = args;\n\n const staticType = (type: string): any => {\n return target !== classOf(target) ? type : `${type}.static`;\n };\n\n if (typeof descriptor === \"number\") {\n return propertyKey ? staticType(\"parameter\") : \"parameter.constructor\";\n }\n\n if (descriptor && descriptor.value) {\n return staticType(\"method\");\n }\n\n if ((propertyKey && descriptor === undefined) || descriptor) {\n return staticType(\"property\");\n }\n\n return DecoratorTypes.CLASS;\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { ancestorsOf } from "../objects/ancestorsOf";
2
+ export function inheritedDescriptorOf(target, propertyKey) {
3
+ for (const klass of ancestorsOf(target)) {
4
+ const descriptor = Object.getOwnPropertyDescriptor((klass && klass.prototype) || klass, propertyKey);
5
+ if (descriptor) {
6
+ return descriptor;
7
+ }
8
+ }
9
+ return undefined;
10
+ }
11
+ //# sourceMappingURL=inheritedDescriptorOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inheritedDescriptorOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/inheritedDescriptorOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,qBAAqB,CAAC,MAAW,EAAE,WAAmB;IACpE,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;QACvC,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,KAAK,EAAE,WAAW,CAAE,CAAC;QAEtG,IAAI,UAAU,EAAE;YACd,OAAO,UAAU,CAAC;SACnB;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import {ancestorsOf} from \"../objects/ancestorsOf\";\n\nexport function inheritedDescriptorOf(target: any, propertyKey: string): PropertyDescriptor | undefined {\n for (const klass of ancestorsOf(target)) {\n const descriptor = Object.getOwnPropertyDescriptor((klass && klass.prototype) || klass, propertyKey)!;\n\n if (descriptor) {\n return descriptor;\n }\n }\n\n return undefined;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ export function useDecorators(...decorators) {
2
+ return (...args) => {
3
+ decorators
4
+ .filter((o) => !!o)
5
+ .forEach((decorator) => {
6
+ decorator(...args);
7
+ });
8
+ };
9
+ }
10
+ //# sourceMappingURL=useDecorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDecorators.js","sourceRoot":"","sources":["../../../../src/utils/decorators/useDecorators.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,aAAa,CAAC,GAAG,UAA0B;IACzD,OAAO,CAAC,GAAG,IAAyB,EAAE,EAAE;QACtC,UAAU;aACP,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aACvB,OAAO,CAAC,CAAC,SAAmB,EAAE,EAAE;YAC/B,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {DecoratorParameters} from \"../../interfaces/DecoratorParameters\";\nimport {AnyDecorator} from \"../../interfaces/AnyDecorator\";\n\nexport function useDecorators(...decorators: AnyDecorator[]): any {\n return (...args: DecoratorParameters) => {\n decorators\n .filter((o: any) => !!o)\n .forEach((decorator: Function) => {\n decorator(...args);\n });\n };\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { descriptorOf } from "../objects/descriptorOf";
2
+ export function useMethodDecorator(decorator) {
3
+ return (target, propertyKey) => decorator(target, propertyKey, descriptorOf(target, propertyKey));
4
+ }
5
+ export function useMethodDecorators(...decorators) {
6
+ return (target, propertyKey) => {
7
+ decorators.filter(Boolean).forEach((decorator) => decorator(target, propertyKey, descriptorOf(target, propertyKey)));
8
+ };
9
+ }
10
+ //# sourceMappingURL=useMethodDecorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMethodDecorators.js","sourceRoot":"","sources":["../../../../src/utils/decorators/useMethodDecorators.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAErD,MAAM,UAAU,kBAAkB,CAAC,SAAuB;IACxD,OAAO,CAAC,MAAW,EAAE,WAA4B,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAC1H,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,GAAG,UAA0B;IAC/D,OAAO,CAAC,MAAW,EAAE,WAA4B,EAAE,EAAE;QACnD,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACvH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {AnyDecorator} from \"../../interfaces/AnyDecorator\";\nimport {descriptorOf} from \"../objects/descriptorOf\";\n\nexport function useMethodDecorator(decorator: AnyDecorator) {\n return (target: any, propertyKey: string | symbol) => decorator(target, propertyKey, descriptorOf(target, propertyKey));\n}\n\nexport function useMethodDecorators(...decorators: AnyDecorator[]) {\n return (target: any, propertyKey: string | symbol) => {\n decorators.filter(Boolean).forEach((decorator) => decorator(target, propertyKey, descriptorOf(target, propertyKey)));\n };\n}\n"]}
@@ -0,0 +1,17 @@
1
+ export function getHostInfoFromPort(protocol, addressPort) {
2
+ let address = "0.0.0.0";
3
+ let port = addressPort;
4
+ if (typeof addressPort === "string" && addressPort.indexOf(":") > -1) {
5
+ [address, port] = addressPort.split(":");
6
+ port = +port;
7
+ }
8
+ return {
9
+ protocol,
10
+ address,
11
+ port: port,
12
+ toString() {
13
+ return [`${this.protocol}://${this.address}`, typeof this.port === "number" && this.port].filter(Boolean).join(":");
14
+ }
15
+ };
16
+ }
17
+ //# sourceMappingURL=getHostInfoFromPort.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getHostInfoFromPort.js","sourceRoot":"","sources":["../../../../src/utils/http/getHostInfoFromPort.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,WAAgB;IACpE,IAAI,OAAO,GAAG,SAAS,CAAC;IACxB,IAAI,IAAI,GAAG,WAAW,CAAC;IAEvB,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE;QACpE,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,GAAG,CAAC,IAAI,CAAC;KACd;IAED,OAAO;QACL,QAAQ;QACR,OAAO;QACP,IAAI,EAAE,IAAc;QACpB,QAAQ;YACN,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["export function getHostInfoFromPort(protocol: string, addressPort: any) {\n let address = \"0.0.0.0\";\n let port = addressPort;\n\n if (typeof addressPort === \"string\" && addressPort.indexOf(\":\") > -1) {\n [address, port] = addressPort.split(\":\");\n port = +port;\n }\n\n return {\n protocol,\n address,\n port: port as number,\n toString() {\n return [`${this.protocol}://${this.address}`, typeof this.port === \"number\" && this.port].filter(Boolean).join(\":\");\n }\n };\n}\n"]}
@@ -0,0 +1,12 @@
1
+ export async function importPackage(packageName, loaderFn = () => import(packageName), optional = false) {
2
+ try {
3
+ return await loaderFn();
4
+ }
5
+ catch (e) {
6
+ if (!optional) {
7
+ throw new Error(`The "${packageName}\" package is missing.`);
8
+ }
9
+ return {};
10
+ }
11
+ }
12
+ //# sourceMappingURL=importPackage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importPackage.js","sourceRoot":"","sources":["../../../../src/utils/imports/importPackage.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,WAAmB,EAAE,WAAqB,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ,GAAG,KAAK;IACvH,IAAI;QACF,OAAO,MAAM,QAAQ,EAAE,CAAC;KACzB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,QAAQ,WAAW,wBAAwB,CAAC,CAAC;SAC9D;QAED,OAAO,EAAE,CAAC;KACX;AACH,CAAC","sourcesContent":["export async function importPackage(packageName: string, loaderFn: Function = () => import(packageName), optional = false) {\n try {\n return await loaderFn();\n } catch (e) {\n if (!optional) {\n throw new Error(`The \"${packageName}\\\" package is missing.`);\n }\n\n return {};\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ export * from "./catchError";
2
+ export * from "./proxyDelegation";
3
+ export * from "./uniq";
4
+ export * from "./imports/importPackage";
5
+ // methods
6
+ export * from "./decorators/decorateMethodsOf";
7
+ export * from "./decorators/decoratorArgs";
8
+ export * from "./decorators/decoratorTypeOf";
9
+ export * from "./objects/descriptorOf";
10
+ export * from "./decorators/inheritedDescriptorOf";
11
+ export * from "./decorators/useDecorators";
12
+ export * from "./decorators/useMethodDecorators";
13
+ // objects
14
+ export * from "./objects";
15
+ export * from "./http/getHostInfoFromPort";
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,yBAAyB,CAAC;AAExC,UAAU;AACV,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AAEjD,UAAU;AACV,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC","sourcesContent":["export * from \"./catchError\";\nexport * from \"./proxyDelegation\";\nexport * from \"./uniq\";\nexport * from \"./imports/importPackage\";\n\n// methods\nexport * from \"./decorators/decorateMethodsOf\";\nexport * from \"./decorators/decoratorArgs\";\nexport * from \"./decorators/decoratorTypeOf\";\nexport * from \"./objects/descriptorOf\";\nexport * from \"./decorators/inheritedDescriptorOf\";\nexport * from \"./decorators/useDecorators\";\nexport * from \"./decorators/useMethodDecorators\";\n\n// objects\nexport * from \"./objects\";\nexport * from \"./http/getHostInfoFromPort\";\n"]}
@@ -0,0 +1,7 @@
1
+ export function ancestorOf(target) {
2
+ return target && Object.getPrototypeOf(target);
3
+ }
4
+ export function getInheritedClass(target) {
5
+ return ancestorOf(target);
6
+ }
7
+ //# sourceMappingURL=ancestorOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ancestorOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/ancestorOf.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,MAAW;IACpC,OAAO,MAAM,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAW;IAC3C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["export function ancestorOf(target: any): any {\n return target && Object.getPrototypeOf(target);\n}\n\nexport function getInheritedClass(target: any): any {\n return ancestorOf(target);\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { classOf } from "./classOf";
2
+ import { getInheritedClass } from "./ancestorOf";
3
+ import { nameOf } from "./nameOf";
4
+ /**
5
+ *
6
+ * @param target
7
+ * @returns {Array}
8
+ */
9
+ export function ancestorsOf(target) {
10
+ const classes = [];
11
+ let currentTarget = classOf(target);
12
+ while (currentTarget && nameOf(currentTarget) !== "") {
13
+ classes.unshift(currentTarget);
14
+ currentTarget = getInheritedClass(currentTarget);
15
+ }
16
+ return classes;
17
+ }
18
+ //# sourceMappingURL=ancestorsOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ancestorsOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/ancestorsOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAEhC;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAAW;IACrC,MAAM,OAAO,GAAG,EAAE,CAAC;IAEnB,IAAI,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEpC,OAAO,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE;QACpD,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC/B,aAAa,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;KAClD;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import {classOf} from \"./classOf\";\nimport {getInheritedClass} from \"./ancestorOf\";\nimport {nameOf} from \"./nameOf\";\n\n/**\n *\n * @param target\n * @returns {Array}\n */\nexport function ancestorsOf(target: any) {\n const classes = [];\n\n let currentTarget = classOf(target);\n\n while (currentTarget && nameOf(currentTarget) !== \"\") {\n classes.unshift(currentTarget);\n currentTarget = getInheritedClass(currentTarget);\n }\n\n return classes;\n}\n"]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Get the provide constructor if target is an instance.
3
+ * @param target
4
+ * @returns {*}
5
+ */
6
+ export function getClass(target) {
7
+ return target.prototype ? target : target.constructor;
8
+ }
9
+ /**
10
+ * Get the provide constructor if target is an instance.
11
+ * @param target
12
+ * @returns {*}
13
+ * @alias getClass
14
+ */
15
+ export function classOf(target) {
16
+ return getClass(target);
17
+ }
18
+ //# sourceMappingURL=classOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/classOf.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAW;IAClC,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;AACxD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,MAAW;IACjC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["/**\n * Get the provide constructor if target is an instance.\n * @param target\n * @returns {*}\n */\nexport function getClass(target: any): any {\n return target.prototype ? target : target.constructor;\n}\n\n/**\n * Get the provide constructor if target is an instance.\n * @param target\n * @returns {*}\n * @alias getClass\n */\nexport function classOf(target: any) {\n return getClass(target);\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import { isProtectedKey } from "./isProtectedKey";
2
+ /**
3
+ * Remove undefined value
4
+ * @param obj
5
+ * @param ignore
6
+ */
7
+ export function cleanObject(obj, ignore = []) {
8
+ return Object.entries(obj).reduce((obj, [key, value]) => {
9
+ if (isProtectedKey(key) || ignore.includes(key)) {
10
+ return obj;
11
+ }
12
+ return value === undefined
13
+ ? obj
14
+ : {
15
+ ...obj,
16
+ [key]: value
17
+ };
18
+ }, {});
19
+ }
20
+ //# sourceMappingURL=cleanObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanObject.js","sourceRoot":"","sources":["../../../../src/utils/objects/cleanObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,GAAQ,EAAE,SAAmB,EAAE;IACzD,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACtD,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC/C,OAAO,GAAG,CAAC;SACZ;QAED,OAAO,KAAK,KAAK,SAAS;YACxB,CAAC,CAAC,GAAG;YACL,CAAC,CAAC;gBACE,GAAG,GAAG;gBACN,CAAC,GAAG,CAAC,EAAE,KAAK;aACb,CAAC;IACR,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC","sourcesContent":["import {isProtectedKey} from \"./isProtectedKey\";\n/**\n * Remove undefined value\n * @param obj\n * @param ignore\n */\nexport function cleanObject(obj: any, ignore: string[] = []): any {\n return Object.entries(obj).reduce((obj, [key, value]) => {\n if (isProtectedKey(key) || ignore.includes(key)) {\n return obj;\n }\n\n return value === undefined\n ? obj\n : {\n ...obj,\n [key]: value\n };\n }, {});\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Get the class constructor
3
+ * @param target
4
+ */
5
+ export function getConstructor(target) {
6
+ return typeof target === "function" ? target : target.constructor;
7
+ }
8
+ /**
9
+ * Get the class constructor
10
+ * @param target
11
+ */
12
+ export function constructorOf(target) {
13
+ return getConstructor(target);
14
+ }
15
+ //# sourceMappingURL=constructorOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constructorOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/constructorOf.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAW;IACxC,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;AACpE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,MAAW;IACvC,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC","sourcesContent":["import type {Type} from \"../../domain/Type\";\n\n/**\n * Get the class constructor\n * @param target\n */\nexport function getConstructor(target: any): Type<any> {\n return typeof target === \"function\" ? target : target.constructor;\n}\n\n/**\n * Get the class constructor\n * @param target\n */\nexport function constructorOf(target: any): Type<any> {\n return getConstructor(target);\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { classOf } from "./classOf";
2
+ export function createInstance(obj) {
3
+ return obj ? (classOf(obj) !== Object ? Object.create(obj) : {}) : {};
4
+ }
5
+ //# sourceMappingURL=createInstance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createInstance.js","sourceRoot":"","sources":["../../../../src/utils/objects/createInstance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,cAAc,CAAC,GAAQ;IACrC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACxE,CAAC","sourcesContent":["import {classOf} from \"./classOf\";\n\nexport function createInstance(obj: any) {\n return obj ? (classOf(obj) !== Object ? Object.create(obj) : {}) : {};\n}\n"]}