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

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 (424) hide show
  1. package/lib/cjs/decorators/configurable.js +18 -0
  2. package/lib/cjs/decorators/configurable.js.map +1 -0
  3. package/lib/cjs/decorators/deprecated.js +43 -0
  4. package/lib/cjs/decorators/deprecated.js.map +1 -0
  5. package/lib/cjs/decorators/enumerable.js +18 -0
  6. package/lib/cjs/decorators/enumerable.js.map +1 -0
  7. package/lib/cjs/decorators/index.js +18 -0
  8. package/lib/cjs/decorators/index.js.map +1 -0
  9. package/lib/cjs/decorators/notConfigurable.js +13 -0
  10. package/lib/cjs/decorators/notConfigurable.js.map +1 -0
  11. package/lib/cjs/decorators/notEnumerable.js +13 -0
  12. package/lib/cjs/decorators/notEnumerable.js.map +1 -0
  13. package/lib/cjs/decorators/readOnly.js +13 -0
  14. package/lib/cjs/decorators/readOnly.js.map +1 -0
  15. package/lib/cjs/decorators/storeFn.js +22 -0
  16. package/lib/cjs/decorators/storeFn.js.map +1 -0
  17. package/lib/cjs/decorators/storeMerge.js +11 -0
  18. package/lib/cjs/decorators/storeMerge.js.map +1 -0
  19. package/lib/cjs/decorators/storeSet.js +11 -0
  20. package/lib/cjs/decorators/storeSet.js.map +1 -0
  21. package/lib/cjs/decorators/writable.js +18 -0
  22. package/lib/cjs/decorators/writable.js.map +1 -0
  23. package/lib/cjs/domain/AnyToPromise.js +148 -0
  24. package/lib/cjs/domain/AnyToPromise.js.map +1 -0
  25. package/lib/cjs/domain/DecoratorTypes.js +15 -0
  26. package/lib/cjs/domain/DecoratorTypes.js.map +1 -0
  27. package/lib/cjs/domain/Env.js +19 -0
  28. package/lib/cjs/domain/Env.js.map +1 -0
  29. package/lib/cjs/domain/Hooks.js +89 -0
  30. package/lib/cjs/domain/Hooks.js.map +1 -0
  31. package/lib/cjs/domain/Metadata.js +508 -0
  32. package/lib/cjs/domain/Metadata.js.map +1 -0
  33. package/lib/cjs/domain/Store.js +157 -0
  34. package/lib/cjs/domain/Store.js.map +1 -0
  35. package/lib/cjs/domain/Type.js +7 -0
  36. package/lib/cjs/domain/Type.js.map +1 -0
  37. package/lib/cjs/domain/index.js +11 -0
  38. package/lib/cjs/domain/index.js.map +1 -0
  39. package/lib/cjs/errors/UnsupportedDecoratorType.js +21 -0
  40. package/lib/cjs/errors/UnsupportedDecoratorType.js.map +1 -0
  41. package/lib/cjs/index.js +9 -0
  42. package/lib/cjs/index.js.map +1 -0
  43. package/lib/cjs/interfaces/AnyDecorator.js +3 -0
  44. package/lib/cjs/interfaces/AnyDecorator.js.map +1 -0
  45. package/lib/cjs/interfaces/DecoratorParameters.js +3 -0
  46. package/lib/cjs/interfaces/DecoratorParameters.js.map +1 -0
  47. package/lib/cjs/interfaces/HashOf.js +3 -0
  48. package/lib/cjs/interfaces/HashOf.js.map +1 -0
  49. package/lib/cjs/interfaces/MetadataTypes.js +3 -0
  50. package/lib/cjs/interfaces/MetadataTypes.js.map +1 -0
  51. package/lib/cjs/interfaces/ValueOf.js +3 -0
  52. package/lib/cjs/interfaces/ValueOf.js.map +1 -0
  53. package/lib/cjs/interfaces/index.js +3 -0
  54. package/lib/cjs/interfaces/index.js.map +1 -0
  55. package/lib/cjs/utils/catchError.js +22 -0
  56. package/lib/cjs/utils/catchError.js.map +1 -0
  57. package/lib/cjs/utils/decorators/decorateMethodsOf.js +23 -0
  58. package/lib/cjs/utils/decorators/decorateMethodsOf.js.map +1 -0
  59. package/lib/cjs/utils/decorators/decoratorArgs.js +9 -0
  60. package/lib/cjs/utils/decorators/decoratorArgs.js.map +1 -0
  61. package/lib/cjs/utils/decorators/decoratorTypeOf.js +23 -0
  62. package/lib/cjs/utils/decorators/decoratorTypeOf.js.map +1 -0
  63. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js +15 -0
  64. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  65. package/lib/cjs/utils/decorators/useDecorators.js +14 -0
  66. package/lib/cjs/utils/decorators/useDecorators.js.map +1 -0
  67. package/lib/cjs/utils/decorators/useMethodDecorators.js +15 -0
  68. package/lib/cjs/utils/decorators/useMethodDecorators.js.map +1 -0
  69. package/lib/cjs/utils/http/getHostInfoFromPort.js +21 -0
  70. package/lib/cjs/utils/http/getHostInfoFromPort.js.map +1 -0
  71. package/lib/cjs/utils/imports/importPackage.js +35 -0
  72. package/lib/cjs/utils/imports/importPackage.js.map +1 -0
  73. package/lib/cjs/utils/index.js +19 -0
  74. package/lib/cjs/utils/index.js.map +1 -0
  75. package/lib/cjs/utils/objects/ancestorOf.js +12 -0
  76. package/lib/cjs/utils/objects/ancestorOf.js.map +1 -0
  77. package/lib/cjs/utils/objects/ancestorsOf.js +22 -0
  78. package/lib/cjs/utils/objects/ancestorsOf.js.map +1 -0
  79. package/lib/cjs/utils/objects/classOf.js +23 -0
  80. package/lib/cjs/utils/objects/classOf.js.map +1 -0
  81. package/lib/cjs/utils/objects/cleanObject.js +24 -0
  82. package/lib/cjs/utils/objects/cleanObject.js.map +1 -0
  83. package/lib/cjs/utils/objects/constructorOf.js +20 -0
  84. package/lib/cjs/utils/objects/constructorOf.js.map +1 -0
  85. package/lib/cjs/utils/objects/createInstance.js +9 -0
  86. package/lib/cjs/utils/objects/createInstance.js.map +1 -0
  87. package/lib/cjs/utils/objects/deepClone.js +57 -0
  88. package/lib/cjs/utils/objects/deepClone.js.map +1 -0
  89. package/lib/cjs/utils/objects/deepMerge.js +63 -0
  90. package/lib/cjs/utils/objects/deepMerge.js.map +1 -0
  91. package/lib/cjs/utils/objects/descriptorOf.js +19 -0
  92. package/lib/cjs/utils/objects/descriptorOf.js.map +1 -0
  93. package/lib/cjs/utils/objects/getClassOrSymbol.js +10 -0
  94. package/lib/cjs/utils/objects/getClassOrSymbol.js.map +1 -0
  95. package/lib/cjs/utils/objects/getConstructorArgNames.js +9 -0
  96. package/lib/cjs/utils/objects/getConstructorArgNames.js.map +1 -0
  97. package/lib/cjs/utils/objects/getEnumerableKeys.js +20 -0
  98. package/lib/cjs/utils/objects/getEnumerableKeys.js.map +1 -0
  99. package/lib/cjs/utils/objects/getValue.js +49 -0
  100. package/lib/cjs/utils/objects/getValue.js.map +1 -0
  101. package/lib/cjs/utils/objects/index.js +46 -0
  102. package/lib/cjs/utils/objects/index.js.map +1 -0
  103. package/lib/cjs/utils/objects/isArray.js +23 -0
  104. package/lib/cjs/utils/objects/isArray.js.map +1 -0
  105. package/lib/cjs/utils/objects/isArrowFn.js +9 -0
  106. package/lib/cjs/utils/objects/isArrowFn.js.map +1 -0
  107. package/lib/cjs/utils/objects/isBoolean.js +17 -0
  108. package/lib/cjs/utils/objects/isBoolean.js.map +1 -0
  109. package/lib/cjs/utils/objects/isClass.js +26 -0
  110. package/lib/cjs/utils/objects/isClass.js.map +1 -0
  111. package/lib/cjs/utils/objects/isCollection.js +22 -0
  112. package/lib/cjs/utils/objects/isCollection.js.map +1 -0
  113. package/lib/cjs/utils/objects/isDate.js +13 -0
  114. package/lib/cjs/utils/objects/isDate.js.map +1 -0
  115. package/lib/cjs/utils/objects/isEmpty.js +14 -0
  116. package/lib/cjs/utils/objects/isEmpty.js.map +1 -0
  117. package/lib/cjs/utils/objects/isEnumerable.js +22 -0
  118. package/lib/cjs/utils/objects/isEnumerable.js.map +1 -0
  119. package/lib/cjs/utils/objects/isFunction.js +8 -0
  120. package/lib/cjs/utils/objects/isFunction.js.map +1 -0
  121. package/lib/cjs/utils/objects/isInheritedFrom.js +26 -0
  122. package/lib/cjs/utils/objects/isInheritedFrom.js.map +1 -0
  123. package/lib/cjs/utils/objects/isNil.js +8 -0
  124. package/lib/cjs/utils/objects/isNil.js.map +1 -0
  125. package/lib/cjs/utils/objects/isNumber.js +17 -0
  126. package/lib/cjs/utils/objects/isNumber.js.map +1 -0
  127. package/lib/cjs/utils/objects/isObject.js +8 -0
  128. package/lib/cjs/utils/objects/isObject.js.map +1 -0
  129. package/lib/cjs/utils/objects/isObservable.js +8 -0
  130. package/lib/cjs/utils/objects/isObservable.js.map +1 -0
  131. package/lib/cjs/utils/objects/isPlainObject.js +18 -0
  132. package/lib/cjs/utils/objects/isPlainObject.js.map +1 -0
  133. package/lib/cjs/utils/objects/isPrimitive.js +30 -0
  134. package/lib/cjs/utils/objects/isPrimitive.js.map +1 -0
  135. package/lib/cjs/utils/objects/isPromise.js +16 -0
  136. package/lib/cjs/utils/objects/isPromise.js.map +1 -0
  137. package/lib/cjs/utils/objects/isProtectedKey.js +12 -0
  138. package/lib/cjs/utils/objects/isProtectedKey.js.map +1 -0
  139. package/lib/cjs/utils/objects/isSerializable.js +13 -0
  140. package/lib/cjs/utils/objects/isSerializable.js.map +1 -0
  141. package/lib/cjs/utils/objects/isStream.js +8 -0
  142. package/lib/cjs/utils/objects/isStream.js.map +1 -0
  143. package/lib/cjs/utils/objects/isString.js +16 -0
  144. package/lib/cjs/utils/objects/isString.js.map +1 -0
  145. package/lib/cjs/utils/objects/isSymbol.js +16 -0
  146. package/lib/cjs/utils/objects/isSymbol.js.map +1 -0
  147. package/lib/cjs/utils/objects/methodsOf.js +25 -0
  148. package/lib/cjs/utils/objects/methodsOf.js.map +1 -0
  149. package/lib/cjs/utils/objects/nameOf.js +32 -0
  150. package/lib/cjs/utils/objects/nameOf.js.map +1 -0
  151. package/lib/cjs/utils/objects/objectKeys.js +9 -0
  152. package/lib/cjs/utils/objects/objectKeys.js.map +1 -0
  153. package/lib/cjs/utils/objects/primitiveOf.js +20 -0
  154. package/lib/cjs/utils/objects/primitiveOf.js.map +1 -0
  155. package/lib/cjs/utils/objects/prototypeOf.js +14 -0
  156. package/lib/cjs/utils/objects/prototypeOf.js.map +1 -0
  157. package/lib/cjs/utils/objects/setValue.js +34 -0
  158. package/lib/cjs/utils/objects/setValue.js.map +1 -0
  159. package/lib/cjs/utils/objects/toMap.js +32 -0
  160. package/lib/cjs/utils/objects/toMap.js.map +1 -0
  161. package/lib/cjs/utils/objects/toStringConstructor.js +12 -0
  162. package/lib/cjs/utils/objects/toStringConstructor.js.map +1 -0
  163. package/lib/cjs/utils/proxyDelegation.js +54 -0
  164. package/lib/cjs/utils/proxyDelegation.js.map +1 -0
  165. package/lib/cjs/utils/uniq.js +16 -0
  166. package/lib/cjs/utils/uniq.js.map +1 -0
  167. package/lib/esm/decorators/configurable.js +14 -0
  168. package/lib/esm/decorators/configurable.js.map +1 -0
  169. package/lib/esm/decorators/deprecated.js +39 -0
  170. package/lib/esm/decorators/deprecated.js.map +1 -0
  171. package/lib/esm/decorators/enumerable.js +14 -0
  172. package/lib/esm/decorators/enumerable.js.map +1 -0
  173. package/lib/esm/decorators/index.js +15 -0
  174. package/lib/esm/decorators/index.js.map +1 -0
  175. package/lib/esm/decorators/notConfigurable.js +9 -0
  176. package/lib/esm/decorators/notConfigurable.js.map +1 -0
  177. package/lib/esm/decorators/notEnumerable.js +9 -0
  178. package/lib/esm/decorators/notEnumerable.js.map +1 -0
  179. package/lib/esm/decorators/readOnly.js +9 -0
  180. package/lib/esm/decorators/readOnly.js.map +1 -0
  181. package/lib/esm/decorators/storeFn.js +18 -0
  182. package/lib/esm/decorators/storeFn.js.map +1 -0
  183. package/lib/esm/decorators/storeMerge.js +7 -0
  184. package/lib/esm/decorators/storeMerge.js.map +1 -0
  185. package/lib/esm/decorators/storeSet.js +7 -0
  186. package/lib/esm/decorators/storeSet.js.map +1 -0
  187. package/lib/esm/decorators/writable.js +14 -0
  188. package/lib/esm/decorators/writable.js.map +1 -0
  189. package/lib/esm/domain/AnyToPromise.js +144 -0
  190. package/lib/esm/domain/AnyToPromise.js.map +1 -0
  191. package/lib/esm/domain/DecoratorTypes.js +12 -0
  192. package/lib/esm/domain/DecoratorTypes.js.map +1 -0
  193. package/lib/esm/domain/Env.js +16 -0
  194. package/lib/esm/domain/Env.js.map +1 -0
  195. package/lib/esm/domain/Hooks.js +85 -0
  196. package/lib/esm/domain/Hooks.js.map +1 -0
  197. package/lib/esm/domain/Metadata.js +504 -0
  198. package/lib/esm/domain/Metadata.js.map +1 -0
  199. package/lib/esm/domain/Store.js +153 -0
  200. package/lib/esm/domain/Store.js.map +1 -0
  201. package/lib/esm/domain/Type.js +4 -0
  202. package/lib/esm/domain/Type.js.map +1 -0
  203. package/lib/esm/domain/index.js +8 -0
  204. package/lib/esm/domain/index.js.map +1 -0
  205. package/lib/esm/errors/UnsupportedDecoratorType.js +17 -0
  206. package/lib/esm/errors/UnsupportedDecoratorType.js.map +1 -0
  207. package/lib/esm/index.js +6 -0
  208. package/lib/esm/index.js.map +1 -0
  209. package/lib/esm/interfaces/AnyDecorator.js +2 -0
  210. package/lib/esm/interfaces/AnyDecorator.js.map +1 -0
  211. package/lib/esm/interfaces/DecoratorParameters.js +2 -0
  212. package/lib/esm/interfaces/DecoratorParameters.js.map +1 -0
  213. package/lib/esm/interfaces/HashOf.js +2 -0
  214. package/lib/esm/interfaces/HashOf.js.map +1 -0
  215. package/lib/esm/interfaces/MetadataTypes.js +2 -0
  216. package/lib/esm/interfaces/MetadataTypes.js.map +1 -0
  217. package/lib/esm/interfaces/ValueOf.js +2 -0
  218. package/lib/esm/interfaces/ValueOf.js.map +1 -0
  219. package/lib/esm/interfaces/index.js +2 -0
  220. package/lib/esm/interfaces/index.js.map +1 -0
  221. package/lib/esm/utils/catchError.js +17 -0
  222. package/lib/esm/utils/catchError.js.map +1 -0
  223. package/lib/esm/utils/decorators/decorateMethodsOf.js +19 -0
  224. package/lib/esm/utils/decorators/decorateMethodsOf.js.map +1 -0
  225. package/lib/esm/utils/decorators/decoratorArgs.js +5 -0
  226. package/lib/esm/utils/decorators/decoratorArgs.js.map +1 -0
  227. package/lib/esm/utils/decorators/decoratorTypeOf.js +19 -0
  228. package/lib/esm/utils/decorators/decoratorTypeOf.js.map +1 -0
  229. package/lib/esm/utils/decorators/inheritedDescriptorOf.js +11 -0
  230. package/lib/esm/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  231. package/lib/esm/utils/decorators/useDecorators.js +10 -0
  232. package/lib/esm/utils/decorators/useDecorators.js.map +1 -0
  233. package/lib/esm/utils/decorators/useMethodDecorators.js +10 -0
  234. package/lib/esm/utils/decorators/useMethodDecorators.js.map +1 -0
  235. package/lib/esm/utils/http/getHostInfoFromPort.js +17 -0
  236. package/lib/esm/utils/http/getHostInfoFromPort.js.map +1 -0
  237. package/lib/esm/utils/imports/importPackage.js +12 -0
  238. package/lib/esm/utils/imports/importPackage.js.map +1 -0
  239. package/lib/esm/utils/index.js +16 -0
  240. package/lib/esm/utils/index.js.map +1 -0
  241. package/lib/esm/utils/objects/ancestorOf.js +7 -0
  242. package/lib/esm/utils/objects/ancestorOf.js.map +1 -0
  243. package/lib/esm/utils/objects/ancestorsOf.js +18 -0
  244. package/lib/esm/utils/objects/ancestorsOf.js.map +1 -0
  245. package/lib/esm/utils/objects/classOf.js +18 -0
  246. package/lib/esm/utils/objects/classOf.js.map +1 -0
  247. package/lib/esm/utils/objects/cleanObject.js +20 -0
  248. package/lib/esm/utils/objects/cleanObject.js.map +1 -0
  249. package/lib/esm/utils/objects/constructorOf.js +15 -0
  250. package/lib/esm/utils/objects/constructorOf.js.map +1 -0
  251. package/lib/esm/utils/objects/createInstance.js +5 -0
  252. package/lib/esm/utils/objects/createInstance.js.map +1 -0
  253. package/lib/esm/utils/objects/deepClone.js +53 -0
  254. package/lib/esm/utils/objects/deepClone.js.map +1 -0
  255. package/lib/esm/utils/objects/deepMerge.js +58 -0
  256. package/lib/esm/utils/objects/deepMerge.js.map +1 -0
  257. package/lib/esm/utils/objects/descriptorOf.js +14 -0
  258. package/lib/esm/utils/objects/descriptorOf.js.map +1 -0
  259. package/lib/esm/utils/objects/getClassOrSymbol.js +6 -0
  260. package/lib/esm/utils/objects/getClassOrSymbol.js.map +1 -0
  261. package/lib/esm/utils/objects/getConstructorArgNames.js +5 -0
  262. package/lib/esm/utils/objects/getConstructorArgNames.js.map +1 -0
  263. package/lib/esm/utils/objects/getEnumerableKeys.js +16 -0
  264. package/lib/esm/utils/objects/getEnumerableKeys.js.map +1 -0
  265. package/lib/esm/utils/objects/getValue.js +45 -0
  266. package/lib/esm/utils/objects/getValue.js.map +1 -0
  267. package/lib/esm/utils/objects/index.js +43 -0
  268. package/lib/esm/utils/objects/index.js.map +1 -0
  269. package/lib/esm/utils/objects/isArray.js +18 -0
  270. package/lib/esm/utils/objects/isArray.js.map +1 -0
  271. package/lib/esm/utils/objects/isArrowFn.js +5 -0
  272. package/lib/esm/utils/objects/isArrowFn.js.map +1 -0
  273. package/lib/esm/utils/objects/isBoolean.js +12 -0
  274. package/lib/esm/utils/objects/isBoolean.js.map +1 -0
  275. package/lib/esm/utils/objects/isClass.js +22 -0
  276. package/lib/esm/utils/objects/isClass.js.map +1 -0
  277. package/lib/esm/utils/objects/isCollection.js +18 -0
  278. package/lib/esm/utils/objects/isCollection.js.map +1 -0
  279. package/lib/esm/utils/objects/isDate.js +9 -0
  280. package/lib/esm/utils/objects/isDate.js.map +1 -0
  281. package/lib/esm/utils/objects/isEmpty.js +10 -0
  282. package/lib/esm/utils/objects/isEmpty.js.map +1 -0
  283. package/lib/esm/utils/objects/isEnumerable.js +18 -0
  284. package/lib/esm/utils/objects/isEnumerable.js.map +1 -0
  285. package/lib/esm/utils/objects/isFunction.js +4 -0
  286. package/lib/esm/utils/objects/isFunction.js.map +1 -0
  287. package/lib/esm/utils/objects/isInheritedFrom.js +22 -0
  288. package/lib/esm/utils/objects/isInheritedFrom.js.map +1 -0
  289. package/lib/esm/utils/objects/isNil.js +4 -0
  290. package/lib/esm/utils/objects/isNil.js.map +1 -0
  291. package/lib/esm/utils/objects/isNumber.js +12 -0
  292. package/lib/esm/utils/objects/isNumber.js.map +1 -0
  293. package/lib/esm/utils/objects/isObject.js +4 -0
  294. package/lib/esm/utils/objects/isObject.js.map +1 -0
  295. package/lib/esm/utils/objects/isObservable.js +4 -0
  296. package/lib/esm/utils/objects/isObservable.js.map +1 -0
  297. package/lib/esm/utils/objects/isPlainObject.js +13 -0
  298. package/lib/esm/utils/objects/isPlainObject.js.map +1 -0
  299. package/lib/esm/utils/objects/isPrimitive.js +24 -0
  300. package/lib/esm/utils/objects/isPrimitive.js.map +1 -0
  301. package/lib/esm/utils/objects/isPromise.js +12 -0
  302. package/lib/esm/utils/objects/isPromise.js.map +1 -0
  303. package/lib/esm/utils/objects/isProtectedKey.js +8 -0
  304. package/lib/esm/utils/objects/isProtectedKey.js.map +1 -0
  305. package/lib/esm/utils/objects/isSerializable.js +9 -0
  306. package/lib/esm/utils/objects/isSerializable.js.map +1 -0
  307. package/lib/esm/utils/objects/isStream.js +4 -0
  308. package/lib/esm/utils/objects/isStream.js.map +1 -0
  309. package/lib/esm/utils/objects/isString.js +11 -0
  310. package/lib/esm/utils/objects/isString.js.map +1 -0
  311. package/lib/esm/utils/objects/isSymbol.js +11 -0
  312. package/lib/esm/utils/objects/isSymbol.js.map +1 -0
  313. package/lib/esm/utils/objects/methodsOf.js +21 -0
  314. package/lib/esm/utils/objects/methodsOf.js.map +1 -0
  315. package/lib/esm/utils/objects/nameOf.js +26 -0
  316. package/lib/esm/utils/objects/nameOf.js.map +1 -0
  317. package/lib/esm/utils/objects/objectKeys.js +5 -0
  318. package/lib/esm/utils/objects/objectKeys.js.map +1 -0
  319. package/lib/esm/utils/objects/primitiveOf.js +16 -0
  320. package/lib/esm/utils/objects/primitiveOf.js.map +1 -0
  321. package/lib/esm/utils/objects/prototypeOf.js +10 -0
  322. package/lib/esm/utils/objects/prototypeOf.js.map +1 -0
  323. package/lib/esm/utils/objects/setValue.js +30 -0
  324. package/lib/esm/utils/objects/setValue.js.map +1 -0
  325. package/lib/esm/utils/objects/toMap.js +28 -0
  326. package/lib/esm/utils/objects/toMap.js.map +1 -0
  327. package/lib/esm/utils/objects/toStringConstructor.js +8 -0
  328. package/lib/esm/utils/objects/toStringConstructor.js.map +1 -0
  329. package/lib/esm/utils/proxyDelegation.js +50 -0
  330. package/lib/esm/utils/proxyDelegation.js.map +1 -0
  331. package/lib/esm/utils/uniq.js +11 -0
  332. package/lib/esm/utils/uniq.js.map +1 -0
  333. package/lib/{decorators → types/decorators}/configurable.d.ts +0 -0
  334. package/lib/{decorators → types/decorators}/deprecated.d.ts +0 -0
  335. package/lib/{decorators → types/decorators}/enumerable.d.ts +0 -0
  336. package/lib/{decorators → types/decorators}/index.d.ts +0 -0
  337. package/lib/{decorators → types/decorators}/notConfigurable.d.ts +0 -0
  338. package/lib/{decorators → types/decorators}/notEnumerable.d.ts +0 -0
  339. package/lib/{decorators → types/decorators}/readOnly.d.ts +0 -0
  340. package/lib/{decorators → types/decorators}/storeFn.d.ts +0 -0
  341. package/lib/{decorators → types/decorators}/storeMerge.d.ts +0 -0
  342. package/lib/{decorators → types/decorators}/storeSet.d.ts +0 -0
  343. package/lib/{decorators → types/decorators}/writable.d.ts +0 -0
  344. package/lib/{domain → types/domain}/AnyToPromise.d.ts +0 -0
  345. package/lib/{domain → types/domain}/DecoratorTypes.d.ts +0 -0
  346. package/lib/{domain → types/domain}/Env.d.ts +0 -0
  347. package/lib/{domain → types/domain}/Hooks.d.ts +0 -0
  348. package/lib/{domain → types/domain}/Metadata.d.ts +0 -0
  349. package/lib/{domain → types/domain}/Store.d.ts +5 -1
  350. package/lib/{domain → types/domain}/Type.d.ts +0 -0
  351. package/lib/{domain → types/domain}/index.d.ts +0 -1
  352. package/lib/{errors → types/errors}/UnsupportedDecoratorType.d.ts +0 -0
  353. package/lib/{index.d.ts → types/index.d.ts} +0 -0
  354. package/lib/{interfaces → types/interfaces}/AnyDecorator.d.ts +0 -0
  355. package/lib/{interfaces → types/interfaces}/DecoratorParameters.d.ts +0 -0
  356. package/lib/{interfaces → types/interfaces}/HashOf.d.ts +0 -0
  357. package/lib/{interfaces → types/interfaces}/MetadataTypes.d.ts +0 -0
  358. package/lib/{interfaces → types/interfaces}/ValueOf.d.ts +0 -0
  359. package/lib/{interfaces → types/interfaces}/index.d.ts +0 -0
  360. package/lib/{utils → types/utils}/catchError.d.ts +0 -0
  361. package/lib/{utils → types/utils}/decorators/decorateMethodsOf.d.ts +0 -0
  362. package/lib/{utils → types/utils}/decorators/decoratorArgs.d.ts +0 -0
  363. package/lib/{utils → types/utils}/decorators/decoratorTypeOf.d.ts +0 -0
  364. package/lib/{utils → types/utils}/decorators/inheritedDescriptorOf.d.ts +0 -0
  365. package/lib/{utils → types/utils}/decorators/useDecorators.d.ts +0 -0
  366. package/lib/{utils → types/utils}/decorators/useMethodDecorators.d.ts +0 -0
  367. package/lib/types/utils/http/getHostInfoFromPort.d.ts +6 -0
  368. package/lib/types/utils/imports/importPackage.d.ts +1 -0
  369. package/lib/{utils → types/utils}/index.d.ts +2 -0
  370. package/lib/{utils/objects/getInheritedClass.d.ts → types/utils/objects/ancestorOf.d.ts} +1 -0
  371. package/lib/{utils/objects/ancestorOf.d.ts → types/utils/objects/ancestorsOf.d.ts} +0 -0
  372. package/lib/{utils → types/utils}/objects/classOf.d.ts +0 -0
  373. package/lib/{utils → types/utils}/objects/cleanObject.d.ts +0 -0
  374. package/lib/{utils → types/utils}/objects/constructorOf.d.ts +0 -0
  375. package/lib/{utils → types/utils}/objects/createInstance.d.ts +0 -0
  376. package/lib/types/utils/objects/deepClone.d.ts +6 -0
  377. package/lib/{utils → types/utils}/objects/deepMerge.d.ts +0 -0
  378. package/lib/{utils → types/utils}/objects/descriptorOf.d.ts +1 -0
  379. package/lib/{utils → types/utils}/objects/getClassOrSymbol.d.ts +0 -0
  380. package/lib/{utils → types/utils}/objects/getConstructorArgNames.d.ts +0 -0
  381. package/lib/{utils → types/utils}/objects/getEnumerableKeys.d.ts +0 -0
  382. package/lib/{utils → types/utils}/objects/getValue.d.ts +0 -0
  383. package/lib/{utils → types/utils}/objects/index.d.ts +3 -1
  384. package/lib/{utils → types/utils}/objects/isArray.d.ts +0 -0
  385. package/lib/types/utils/objects/isArrowFn.d.ts +1 -0
  386. package/lib/{utils → types/utils}/objects/isBoolean.d.ts +0 -0
  387. package/lib/{utils → types/utils}/objects/isClass.d.ts +0 -0
  388. package/lib/{utils → types/utils}/objects/isCollection.d.ts +0 -0
  389. package/lib/{utils → types/utils}/objects/isDate.d.ts +0 -0
  390. package/lib/{utils → types/utils}/objects/isEmpty.d.ts +0 -0
  391. package/lib/{utils → types/utils}/objects/isEnumerable.d.ts +0 -0
  392. package/lib/{utils → types/utils}/objects/isFunction.d.ts +0 -0
  393. package/lib/{utils → types/utils}/objects/isInheritedFrom.d.ts +0 -0
  394. package/lib/{utils → types/utils}/objects/isNil.d.ts +0 -0
  395. package/lib/{utils → types/utils}/objects/isNumber.d.ts +0 -0
  396. package/lib/{utils → types/utils}/objects/isObject.d.ts +0 -0
  397. package/lib/{utils → types/utils}/objects/isObservable.d.ts +0 -0
  398. package/lib/{utils → types/utils}/objects/isPlainObject.d.ts +0 -0
  399. package/lib/{utils → types/utils}/objects/isPrimitive.d.ts +0 -0
  400. package/lib/{utils → types/utils}/objects/isPromise.d.ts +0 -0
  401. package/lib/{utils → types/utils}/objects/isProtectedKey.d.ts +0 -0
  402. package/lib/types/utils/objects/isSerializable.d.ts +1 -0
  403. package/lib/{utils → types/utils}/objects/isStream.d.ts +0 -0
  404. package/lib/{utils → types/utils}/objects/isString.d.ts +0 -0
  405. package/lib/{utils → types/utils}/objects/isSymbol.d.ts +0 -0
  406. package/lib/{utils → types/utils}/objects/methodsOf.d.ts +0 -0
  407. package/lib/{utils → types/utils}/objects/nameOf.d.ts +0 -0
  408. package/lib/{utils → types/utils}/objects/objectKeys.d.ts +0 -0
  409. package/lib/{utils → types/utils}/objects/primitiveOf.d.ts +0 -0
  410. package/lib/{utils → types/utils}/objects/prototypeOf.d.ts +0 -0
  411. package/lib/{utils → types/utils}/objects/setValue.d.ts +0 -0
  412. package/lib/{utils → types/utils}/objects/toMap.d.ts +0 -0
  413. package/lib/{utils → types/utils}/objects/toStringConstructor.d.ts +0 -0
  414. package/lib/{utils → types/utils}/proxyDelegation.d.ts +0 -0
  415. package/lib/{utils → types/utils}/uniq.d.ts +0 -0
  416. package/package.json +11 -7
  417. package/tsconfig.compile.esm.json +23 -0
  418. package/lib/domain/Entity.d.ts +0 -97
  419. package/lib/index.js +0 -2271
  420. package/lib/index.js.map +0 -1
  421. package/lib/index.modern.js +0 -2185
  422. package/lib/index.modern.js.map +0 -1
  423. package/lib/utils/objects/deepClone.d.ts +0 -5
  424. package/lib/utils/objects/isArrowFn.d.ts +0 -1
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @module common/core
3
+ */
4
+ import { descriptorOf } from "../utils";
5
+ /** */
6
+ export function Configurable(value = true) {
7
+ return (target, propertyKey) => {
8
+ const descriptor = descriptorOf(target, propertyKey) || { writable: true, enumerable: true };
9
+ descriptor.configurable = value;
10
+ Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
11
+ return descriptor;
12
+ };
13
+ }
14
+ //# sourceMappingURL=configurable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurable.js","sourceRoot":"","sources":["../../../src/decorators/configurable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAEtC,MAAM;AAEN,MAAM,UAAU,YAAY,CAAC,QAAiB,IAAI;IAChD,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;QAC3F,UAAU,CAAC,YAAY,GAAG,KAAK,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {descriptorOf} from \"../utils\";\n\n/** */\n\nexport function Configurable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {writable: true, enumerable: true};\n descriptor.configurable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.
3
+ *
4
+ * ```typescript
5
+ * provide Foo {
6
+ *
7
+ * @Deprecated("Foo.method: Use Foo.method2 instead")
8
+ * public method() {
9
+ *
10
+ * }
11
+ * ```
12
+ *
13
+ * When called, @Deprecated() will return a function that will emit a `DeprecationWarning` using the `process.on('warning')` event.
14
+ * By default, this warning will be emitted and printed to `stderr` exactly once, the first time it is called. After the warning is emitted, the wrapped method is called.
15
+ *
16
+ * If either the `--no-deprecation` or `--no-warnings` command line flags are used, or if the `process.noDeprecation`
17
+ * property is set to `true` prior to the first deprecation warning, the `@Deprecated()` decorators does nothing.
18
+ *
19
+ * If the `--trace-deprecation` or `--trace-warnings` command line flags are set, or the `process.traceDeprecation`
20
+ * property is set to `true`, a warning and a stack trace are printed to stderr the first time the deprecated function is called.
21
+ *
22
+ * If the `--throw-deprecation` command line flag is set, or the `process.throwDeprecation` property is set to `true`,
23
+ * then an exception will be thrown when the deprecated function is called.
24
+ *
25
+ * The `--throw-deprecation` command line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation`
26
+ * and `process.traceDeprecation`.
27
+ *
28
+ * @param message
29
+ * @returns {Function}
30
+ * @decorator
31
+ */
32
+ export function Deprecated(message) {
33
+ return (target, targetKey, descriptor) => {
34
+ const originalMethod = descriptor.value;
35
+ descriptor.value = require("util").deprecate(originalMethod, message);
36
+ return descriptor;
37
+ };
38
+ }
39
+ //# sourceMappingURL=deprecated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../src/decorators/deprecated.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,CAAC,MAAiB,EAAE,SAAiB,EAAE,UAAwC,EAAE,EAAE;QACxF,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAEtE,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {Type} from \"../domain/Type\";\n\n/**\n * The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.\n *\n * ```typescript\n * provide Foo {\n *\n * @Deprecated(\"Foo.method: Use Foo.method2 instead\")\n * public method() {\n *\n * }\n * ```\n *\n * When called, @Deprecated() will return a function that will emit a `DeprecationWarning` using the `process.on('warning')` event.\n * By default, this warning will be emitted and printed to `stderr` exactly once, the first time it is called. After the warning is emitted, the wrapped method is called.\n *\n * If either the `--no-deprecation` or `--no-warnings` command line flags are used, or if the `process.noDeprecation`\n * property is set to `true` prior to the first deprecation warning, the `@Deprecated()` decorators does nothing.\n *\n * If the `--trace-deprecation` or `--trace-warnings` command line flags are set, or the `process.traceDeprecation`\n * property is set to `true`, a warning and a stack trace are printed to stderr the first time the deprecated function is called.\n *\n * If the `--throw-deprecation` command line flag is set, or the `process.throwDeprecation` property is set to `true`,\n * then an exception will be thrown when the deprecated function is called.\n *\n * The `--throw-deprecation` command line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation`\n * and `process.traceDeprecation`.\n *\n * @param message\n * @returns {Function}\n * @decorator\n */\nexport function Deprecated(message: string): Function {\n return (target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<any>) => {\n const originalMethod = descriptor.value;\n\n descriptor.value = require(\"util\").deprecate(originalMethod, message);\n\n return descriptor;\n };\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @module common/core
3
+ */
4
+ import { descriptorOf } from "../utils";
5
+ /** */
6
+ export function Enumerable(value = true) {
7
+ return (target, propertyKey) => {
8
+ const descriptor = descriptorOf(target, propertyKey) || { writable: true, configurable: true };
9
+ descriptor.enumerable = value;
10
+ Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
11
+ return descriptor;
12
+ };
13
+ }
14
+ //# sourceMappingURL=enumerable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enumerable.js","sourceRoot":"","sources":["../../../src/decorators/enumerable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAEtC,MAAM;AAEN,MAAM,UAAU,UAAU,CAAC,QAAiB,IAAI;IAC9C,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC;QAC7F,UAAU,CAAC,UAAU,GAAG,KAAK,CAAC;QAC9B,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {descriptorOf} from \"../utils\";\n\n/** */\n\nexport function Enumerable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {writable: true, configurable: true};\n descriptor.enumerable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @module common/core
3
+ */
4
+ /** */
5
+ export * from "./deprecated";
6
+ export * from "./configurable";
7
+ export * from "./enumerable";
8
+ export * from "./writable";
9
+ export * from "./readOnly";
10
+ export * from "./notConfigurable";
11
+ export * from "./notEnumerable";
12
+ export * from "./storeSet";
13
+ export * from "./storeMerge";
14
+ export * from "./storeFn";
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM;AACN,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC","sourcesContent":["/**\n * @module common/core\n */\n/** */\nexport * from \"./deprecated\";\nexport * from \"./configurable\";\nexport * from \"./enumerable\";\nexport * from \"./writable\";\nexport * from \"./readOnly\";\nexport * from \"./notConfigurable\";\nexport * from \"./notEnumerable\";\nexport * from \"./storeSet\";\nexport * from \"./storeMerge\";\nexport * from \"./storeFn\";\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @module common/core
3
+ */
4
+ import { Configurable } from "./configurable";
5
+ /** */
6
+ export function NotConfigurable() {
7
+ return Configurable(false);
8
+ }
9
+ //# sourceMappingURL=notConfigurable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notConfigurable.js","sourceRoot":"","sources":["../../../src/decorators/notConfigurable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,MAAM;AACN,MAAM,UAAU,eAAe;IAC7B,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {Configurable} from \"./configurable\";\n/** */\nexport function NotConfigurable(): Function {\n return Configurable(false);\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @module common/core
3
+ */
4
+ import { Enumerable } from "./enumerable";
5
+ /** */
6
+ export function NotEnumerable() {
7
+ return Enumerable(false);
8
+ }
9
+ //# sourceMappingURL=notEnumerable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notEnumerable.js","sourceRoot":"","sources":["../../../src/decorators/notEnumerable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,MAAM;AACN,MAAM,UAAU,aAAa;IAC3B,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {Enumerable} from \"./enumerable\";\n/** */\nexport function NotEnumerable(): Function {\n return Enumerable(false);\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @module common/core
3
+ */
4
+ import { Writable } from "./writable";
5
+ /** */
6
+ export function Readonly() {
7
+ return Writable(false);
8
+ }
9
+ //# sourceMappingURL=readOnly.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../src/decorators/readOnly.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,MAAM;AACN,MAAM,UAAU,QAAQ;IACtB,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {Writable} from \"./writable\";\n/** */\nexport function Readonly(): Function {\n return Writable(false);\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { Store } from "../domain/Store";
2
+ /**
3
+ * Create a store correctly configured from the parameters given by the decorator.
4
+ * The `fn` can return a decorator that will be initialized with the parameters (target, propertyKey, descriptor).
5
+ * @param {(store: Store, parameters: DecoratorParameters) => void} fn
6
+ * @returns {Function}
7
+ */
8
+ export function StoreFn(fn) {
9
+ return (...parameters) => {
10
+ const store = Store.from(...parameters);
11
+ const result = fn(store, parameters);
12
+ if (typeof result === "function") {
13
+ result(...parameters);
14
+ }
15
+ return parameters[2];
16
+ };
17
+ }
18
+ //# sourceMappingURL=storeFn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storeFn.js","sourceRoot":"","sources":["../../../src/decorators/storeFn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,EAA2D;IACjF,OAAO,CAAC,GAAG,UAAiB,EAAO,EAAE;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;QACxC,MAAM,MAAM,GAAQ,EAAE,CAAC,KAAK,EAAE,UAAiC,CAAC,CAAC;QACjE,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;YAChC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC;SACvB;QAED,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {Store} from \"../domain/Store\";\nimport {DecoratorParameters} from \"../interfaces/DecoratorParameters\";\n\n/**\n * Create a store correctly configured from the parameters given by the decorator.\n * The `fn` can return a decorator that will be initialized with the parameters (target, propertyKey, descriptor).\n * @param {(store: Store, parameters: DecoratorParameters) => void} fn\n * @returns {Function}\n */\nexport function StoreFn(fn: (store: Store, parameters: DecoratorParameters) => void): Function {\n return (...parameters: any[]): any => {\n const store = Store.from(...parameters);\n const result: any = fn(store, parameters as DecoratorParameters);\n if (typeof result === \"function\") {\n result(...parameters);\n }\n\n return parameters[2];\n };\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import { StoreFn } from "./storeFn";
2
+ export function StoreMerge(key, value) {
3
+ return StoreFn((store) => {
4
+ store.merge(key, value);
5
+ });
6
+ }
7
+ //# sourceMappingURL=storeMerge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storeMerge.js","sourceRoot":"","sources":["../../../src/decorators/storeMerge.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,UAAU,CAAC,GAAQ,EAAE,KAAU;IAC7C,OAAO,OAAO,CAAC,CAAC,KAAY,EAAE,EAAE;QAC9B,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Store} from \"../domain/Store\";\nimport {StoreFn} from \"./storeFn\";\n\nexport function StoreMerge(key: any, value: any): Function {\n return StoreFn((store: Store) => {\n store.merge(key, value);\n });\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import { StoreFn } from "./storeFn";
2
+ export function StoreSet(key, value) {
3
+ return StoreFn((store) => {
4
+ store.set(key, value);
5
+ });
6
+ }
7
+ //# sourceMappingURL=storeSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storeSet.js","sourceRoot":"","sources":["../../../src/decorators/storeSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,QAAQ,CAAC,GAAQ,EAAE,KAAU;IAC3C,OAAO,OAAO,CAAC,CAAC,KAAY,EAAE,EAAE;QAC9B,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Store} from \"../domain/Store\";\nimport {StoreFn} from \"./storeFn\";\n\nexport function StoreSet(key: any, value: any): Function {\n return StoreFn((store: Store) => {\n store.set(key, value);\n });\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @module common/core
3
+ */
4
+ import { descriptorOf } from "../utils";
5
+ /** */
6
+ export function Writable(value = true) {
7
+ return (target, propertyKey) => {
8
+ const descriptor = descriptorOf(target, propertyKey) || { configurable: true, enumerable: true };
9
+ descriptor.writable = value;
10
+ Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
11
+ return descriptor;
12
+ };
13
+ }
14
+ //# sourceMappingURL=writable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writable.js","sourceRoot":"","sources":["../../../src/decorators/writable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAEtC,MAAM;AAEN,MAAM,UAAU,QAAQ,CAAC,QAAiB,IAAI;IAC5C,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;QAC/F,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC5B,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {descriptorOf} from \"../utils\";\n\n/** */\n\nexport function Writable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {configurable: true, enumerable: true};\n descriptor.writable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
@@ -0,0 +1,144 @@
1
+ var _AnyToPromise_resolves, _AnyToPromise_rejects, _AnyToPromise_hasNextFunction, _AnyToPromise_promise;
2
+ import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
3
+ import { isObservable } from "../utils/objects/isObservable";
4
+ import { isPromise } from "../utils/objects/isPromise";
5
+ import { isStream } from "../utils/objects/isStream";
6
+ /**
7
+ * @ignore
8
+ */
9
+ function isResponse(obj) {
10
+ return obj.data && obj.headers && obj.status && obj.statusText;
11
+ }
12
+ /**
13
+ * @ignore
14
+ */
15
+ export var AnyToPromiseStatus;
16
+ (function (AnyToPromiseStatus) {
17
+ AnyToPromiseStatus["PENDING"] = "PENDING";
18
+ AnyToPromiseStatus["CANCELED"] = "CANCELED";
19
+ AnyToPromiseStatus["RESOLVED"] = "RESOLVED";
20
+ AnyToPromiseStatus["REJECTED"] = "REJECTED";
21
+ })(AnyToPromiseStatus || (AnyToPromiseStatus = {}));
22
+ export var AnyToPromiseResponseTypes;
23
+ (function (AnyToPromiseResponseTypes) {
24
+ AnyToPromiseResponseTypes["STREAM"] = "STREAM";
25
+ AnyToPromiseResponseTypes["BUFFER"] = "BUFFER";
26
+ AnyToPromiseResponseTypes["DATA"] = "DATA";
27
+ })(AnyToPromiseResponseTypes || (AnyToPromiseResponseTypes = {}));
28
+ export class AnyToPromise {
29
+ constructor({ hasNextFunction = false } = {}) {
30
+ this.status = AnyToPromiseStatus.PENDING;
31
+ _AnyToPromise_resolves.set(this, void 0);
32
+ _AnyToPromise_rejects.set(this, void 0);
33
+ _AnyToPromise_hasNextFunction.set(this, false);
34
+ _AnyToPromise_promise.set(this, void 0);
35
+ __classPrivateFieldSet(this, _AnyToPromise_hasNextFunction, hasNextFunction, "f");
36
+ __classPrivateFieldSet(this, _AnyToPromise_promise, new Promise((resolve, reject) => {
37
+ __classPrivateFieldSet(this, _AnyToPromise_resolves, resolve, "f");
38
+ __classPrivateFieldSet(this, _AnyToPromise_rejects, reject, "f");
39
+ }), "f");
40
+ }
41
+ isDone() {
42
+ return this.status !== AnyToPromiseStatus.PENDING;
43
+ }
44
+ get next() {
45
+ __classPrivateFieldSet(this, _AnyToPromise_hasNextFunction, true, "f");
46
+ return (error) => {
47
+ if (this.isDone()) {
48
+ return;
49
+ }
50
+ return error ? this.reject(error) : this.resolve({ type: AnyToPromiseResponseTypes.DATA });
51
+ };
52
+ }
53
+ /**
54
+ *
55
+ */
56
+ async call(cb) {
57
+ if (this.isDone()) {
58
+ return this;
59
+ }
60
+ try {
61
+ this.handle(cb());
62
+ }
63
+ catch (er) {
64
+ this.reject(er);
65
+ }
66
+ return __classPrivateFieldGet(this, _AnyToPromise_promise, "f");
67
+ }
68
+ reject(er) {
69
+ if (this.isDone()) {
70
+ return;
71
+ }
72
+ this.done(AnyToPromiseStatus.REJECTED);
73
+ __classPrivateFieldGet(this, _AnyToPromise_rejects, "f").call(this, er);
74
+ }
75
+ resolve(response = {}) {
76
+ if (this.isDone()) {
77
+ return;
78
+ }
79
+ this.done(AnyToPromiseStatus.RESOLVED);
80
+ __classPrivateFieldGet(this, _AnyToPromise_resolves, "f").call(this, { ...response, state: AnyToPromiseStatus.RESOLVED });
81
+ }
82
+ destroy() { }
83
+ cancel() {
84
+ if (this.isDone()) {
85
+ return;
86
+ }
87
+ this.done(AnyToPromiseStatus.CANCELED);
88
+ return __classPrivateFieldGet(this, _AnyToPromise_resolves, "f").call(this, { state: AnyToPromiseStatus.CANCELED });
89
+ }
90
+ done(status) {
91
+ this.destroy();
92
+ this.status = status;
93
+ }
94
+ handle(process, additionalProps = {}) {
95
+ if (this.isDone()) {
96
+ return;
97
+ }
98
+ if (process) {
99
+ if (this.isCanceledResponse(process)) {
100
+ // ABANDON
101
+ return this.cancel();
102
+ }
103
+ if (isObservable(process)) {
104
+ process = process.toPromise();
105
+ }
106
+ if (isResponse(process)) {
107
+ return this.handle(process.data, {
108
+ ...additionalProps,
109
+ status: process.status,
110
+ headers: process.headers
111
+ });
112
+ }
113
+ if (isStream(process)) {
114
+ return this.resolve({ ...additionalProps, type: AnyToPromiseResponseTypes.STREAM, data: process });
115
+ }
116
+ if (isStream(process) || Buffer.isBuffer(process)) {
117
+ return this.resolve({ ...additionalProps, type: AnyToPromiseResponseTypes.BUFFER, data: process });
118
+ }
119
+ if (isPromise(process)) {
120
+ return process
121
+ .then((result) => this.handle(result, additionalProps))
122
+ .catch((error) => {
123
+ if (error.response && isResponse(error.response)) {
124
+ return this.handle(error.response);
125
+ }
126
+ return this.reject(error);
127
+ });
128
+ }
129
+ }
130
+ if (!__classPrivateFieldGet(this, _AnyToPromise_hasNextFunction, "f")) {
131
+ // no next function and empty response
132
+ return this.resolve({
133
+ ...additionalProps,
134
+ data: process,
135
+ type: AnyToPromiseResponseTypes.DATA
136
+ });
137
+ }
138
+ }
139
+ isCanceledResponse(process) {
140
+ return process === AnyToPromiseStatus.CANCELED;
141
+ }
142
+ }
143
+ _AnyToPromise_resolves = new WeakMap(), _AnyToPromise_rejects = new WeakMap(), _AnyToPromise_hasNextFunction = new WeakMap(), _AnyToPromise_promise = new WeakMap();
144
+ //# sourceMappingURL=AnyToPromise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnyToPromise.js","sourceRoot":"","sources":["../../../src/domain/AnyToPromise.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,2BAA2B,CAAC;AAEnD;;GAEG;AACH,SAAS,UAAU,CAAC,GAAQ;IAC1B,OAAO,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;AACvB,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAED,MAAM,CAAN,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACnC,8CAAiB,CAAA;IACjB,8CAAiB,CAAA;IACjB,0CAAa,CAAA;AACf,CAAC,EAJW,yBAAyB,KAAzB,yBAAyB,QAIpC;AAUD,MAAM,OAAO,YAAY;IAUvB,YAAY,EAAC,eAAe,GAAG,KAAK,KAAiC,EAAE;QAThE,WAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC;QA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AQ,CAAC;IACjD,CAAC;CACF","sourcesContent":["import {isObservable} from \"../utils/objects/isObservable\";\nimport {isPromise} from \"../utils/objects/isPromise\";\nimport {isStream} from \"../utils/objects/isStream\";\n\n/**\n * @ignore\n */\nfunction isResponse(obj: any) {\n return obj.data && obj.headers && obj.status && obj.statusText;\n}\n\n/**\n * @ignore\n */\nexport enum AnyToPromiseStatus {\n PENDING = \"PENDING\",\n CANCELED = \"CANCELED\",\n RESOLVED = \"RESOLVED\",\n REJECTED = \"REJECTED\"\n}\n\nexport enum AnyToPromiseResponseTypes {\n STREAM = \"STREAM\",\n BUFFER = \"BUFFER\",\n DATA = \"DATA\"\n}\n\nexport interface AnyPromiseResult<T = any> {\n state: AnyToPromiseStatus;\n type: AnyToPromiseResponseTypes;\n status?: number;\n headers?: Record<string, any>;\n data: T;\n}\n\nexport class AnyToPromise<T = any> {\n public status = AnyToPromiseStatus.PENDING;\n public args: any[];\n\n #resolves: any;\n #rejects: any;\n #hasNextFunction = false;\n\n readonly #promise: Promise<AnyPromiseResult<T>>;\n\n constructor({hasNextFunction = false}: {hasNextFunction?: boolean} = {}) {\n this.#hasNextFunction = hasNextFunction;\n\n this.#promise = new Promise((resolve: any, reject: any) => {\n this.#resolves = resolve;\n this.#rejects = reject;\n });\n }\n\n isDone(): boolean {\n return this.status !== AnyToPromiseStatus.PENDING;\n }\n\n get next() {\n this.#hasNextFunction = true;\n\n return (error?: any) => {\n if (this.isDone()) {\n return;\n }\n\n return error ? this.reject(error) : this.resolve({type: AnyToPromiseResponseTypes.DATA});\n };\n }\n\n /**\n *\n */\n async call(cb: Function): Promise<AnyPromiseResult<T>> {\n if (this.isDone()) {\n return this as any;\n }\n\n try {\n this.handle(cb());\n } catch (er) {\n this.reject(er);\n }\n\n return this.#promise;\n }\n\n reject(er: any) {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.REJECTED);\n\n this.#rejects(er);\n }\n\n resolve(response: any = {}) {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.RESOLVED);\n\n this.#resolves({...response, state: AnyToPromiseStatus.RESOLVED});\n }\n\n destroy() {}\n\n cancel() {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.CANCELED);\n\n return this.#resolves({state: AnyToPromiseStatus.CANCELED});\n }\n\n done(status: AnyToPromiseStatus) {\n this.destroy();\n this.status = status;\n }\n\n handle(process: any, additionalProps = {}): any {\n if (this.isDone()) {\n return;\n }\n\n if (process) {\n if (this.isCanceledResponse(process)) {\n // ABANDON\n return this.cancel();\n }\n\n if (isObservable(process)) {\n process = process.toPromise();\n }\n\n if (isResponse(process)) {\n return this.handle(process.data, {\n ...additionalProps,\n status: process.status,\n headers: process.headers\n });\n }\n\n if (isStream(process)) {\n return this.resolve({...additionalProps, type: AnyToPromiseResponseTypes.STREAM, data: process});\n }\n if (isStream(process) || Buffer.isBuffer(process)) {\n return this.resolve({...additionalProps, type: AnyToPromiseResponseTypes.BUFFER, data: process});\n }\n\n if (isPromise(process)) {\n return process\n .then((result: any) => this.handle(result, additionalProps))\n .catch((error: any) => {\n if (error.response && isResponse(error.response)) {\n return this.handle(error.response);\n }\n return this.reject(error);\n });\n }\n }\n\n if (!this.#hasNextFunction) {\n // no next function and empty response\n return this.resolve({\n ...additionalProps,\n data: process,\n type: AnyToPromiseResponseTypes.DATA\n });\n }\n }\n\n protected isCanceledResponse(process: any) {\n return process === AnyToPromiseStatus.CANCELED;\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ export var DecoratorTypes;
2
+ (function (DecoratorTypes) {
3
+ DecoratorTypes["PARAM"] = "parameter";
4
+ DecoratorTypes["PARAM_CTOR"] = "parameter.constructor";
5
+ DecoratorTypes["PARAM_STC"] = "parameter.static";
6
+ DecoratorTypes["PROP"] = "property";
7
+ DecoratorTypes["PROP_STC"] = "property.static";
8
+ DecoratorTypes["METHOD"] = "method";
9
+ DecoratorTypes["METHOD_STC"] = "method.static";
10
+ DecoratorTypes["CLASS"] = "class";
11
+ })(DecoratorTypes || (DecoratorTypes = {}));
12
+ //# sourceMappingURL=DecoratorTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoratorTypes.js","sourceRoot":"","sources":["../../../src/domain/DecoratorTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,sDAAoC,CAAA;IACpC,gDAA8B,CAAA;IAC9B,mCAAiB,CAAA;IACjB,8CAA4B,CAAA;IAC5B,mCAAiB,CAAA;IACjB,8CAA4B,CAAA;IAC5B,iCAAe,CAAA;AACjB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB","sourcesContent":["export enum DecoratorTypes {\n PARAM = \"parameter\",\n PARAM_CTOR = \"parameter.constructor\",\n PARAM_STC = \"parameter.static\",\n PROP = \"property\",\n PROP_STC = \"property.static\",\n METHOD = \"method\",\n METHOD_STC = \"method.static\",\n CLASS = \"class\"\n}\n"]}
@@ -0,0 +1,16 @@
1
+ /**
2
+ *
3
+ */
4
+ export var Env;
5
+ (function (Env) {
6
+ Env["PROD"] = "production";
7
+ Env["DEV"] = "development";
8
+ Env["TEST"] = "test";
9
+ })(Env || (Env = {}));
10
+ /**
11
+ * Fallback
12
+ * @type {Env}
13
+ */
14
+ // tslint:disable-next-line: variable-name
15
+ export const EnvTypes = Env;
16
+ //# sourceMappingURL=Env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Env.js","sourceRoot":"","sources":["../../../src/domain/Env.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,GAIX;AAJD,WAAY,GAAG;IACb,0BAAmB,CAAA;IACnB,0BAAmB,CAAA;IACnB,oBAAa,CAAA;AACf,CAAC,EAJW,GAAG,KAAH,GAAG,QAId;AAED;;;GAGG;AACH,0CAA0C;AAC1C,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC","sourcesContent":["/**\n *\n */\nexport enum Env {\n PROD = \"production\",\n DEV = \"development\",\n TEST = \"test\"\n}\n\n/**\n * Fallback\n * @type {Env}\n */\n// tslint:disable-next-line: variable-name\nexport const EnvTypes = Env;\n"]}
@@ -0,0 +1,85 @@
1
+ export class Hooks {
2
+ constructor() {
3
+ this.listeners = new Map();
4
+ }
5
+ /**
6
+ * Listen a hook event
7
+ * @param event
8
+ * @param cb
9
+ */
10
+ on(event, cb) {
11
+ if (!this.listeners.has(event)) {
12
+ this.listeners.set(event, []);
13
+ }
14
+ this.listeners.get(event).push(cb);
15
+ return this;
16
+ }
17
+ /**
18
+ * Remove a listener attached to an event
19
+ * @param event
20
+ * @param cb
21
+ */
22
+ off(event, cb) {
23
+ if (this.listeners.has(event)) {
24
+ this.listeners.set(event, this.listeners.get(event).filter((item) => item === cb));
25
+ }
26
+ return this;
27
+ }
28
+ /**
29
+ * Trigger an event and call listener.
30
+ * @param event
31
+ * @param args
32
+ * @param callThis
33
+ */
34
+ emit(event, args = [], callThis = null) {
35
+ if (this.listeners.has(event)) {
36
+ for (const cb of this.listeners.get(event)) {
37
+ cb.call(callThis, ...args);
38
+ }
39
+ }
40
+ }
41
+ /**
42
+ * Trigger an event, listener alter given value and return it.
43
+ * @param event
44
+ * @param value
45
+ * @param args
46
+ * @param callThis
47
+ */
48
+ alter(event, value, args = [], callThis = null) {
49
+ if (this.listeners.has(event)) {
50
+ for (const cb of this.listeners.get(event)) {
51
+ value = cb.call(callThis, value, ...args);
52
+ }
53
+ }
54
+ return value;
55
+ }
56
+ /**
57
+ * Trigger an event and call async listener.
58
+ * @param event
59
+ * @param args
60
+ * @param callThis
61
+ */
62
+ async asyncEmit(event, args = [], callThis = null) {
63
+ if (this.listeners.has(event)) {
64
+ for (const cb of this.listeners.get(event)) {
65
+ await cb.call(callThis, ...args);
66
+ }
67
+ }
68
+ }
69
+ /**
70
+ * Trigger an event, async listener alter given value and return it.
71
+ * @param event
72
+ * @param value
73
+ * @param args
74
+ * @param callThis
75
+ */
76
+ async asyncAlter(event, value, args = [], callThis = null) {
77
+ if (this.listeners.has(event)) {
78
+ for (const cb of this.listeners.get(event)) {
79
+ value = await cb.call(callThis, value, ...args);
80
+ }
81
+ }
82
+ return value;
83
+ }
84
+ }
85
+ //# sourceMappingURL=Hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hooks.js","sourceRoot":"","sources":["../../../src/domain/Hooks.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,KAAK;IAAlB;QACU,cAAS,GAA4B,IAAI,GAAG,EAAE,CAAC;IA8FzD,CAAC;IA5FC;;;;OAIG;IACH,EAAE,CAAC,KAAa,EAAE,EAAY;QAC5B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;SAC/B;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,KAAa,EAAE,EAAY;QAC7B,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,GAAG,CAChB,KAAK,EACL,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CACzD,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAa,EAAE,OAAc,EAAE,EAAE,WAAgB,IAAI;QACxD,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC7B,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC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sourcesContent":["export class Hooks {\n private listeners: Map<string, Function[]> = new Map();\n\n /**\n * Listen a hook event\n * @param event\n * @param cb\n */\n on(event: string, cb: Function) {\n if (!this.listeners.has(event)) {\n this.listeners.set(event, []);\n }\n\n this.listeners.get(event)!.push(cb);\n\n return this;\n }\n\n /**\n * Remove a listener attached to an event\n * @param event\n * @param cb\n */\n off(event: string, cb: Function) {\n if (this.listeners.has(event)) {\n this.listeners.set(\n event,\n this.listeners.get(event)!.filter((item) => item === cb)\n );\n }\n\n return this;\n }\n\n /**\n * Trigger an event and call listener.\n * @param event\n * @param args\n * @param callThis\n */\n emit(event: string, args: any[] = [], callThis: any = null): void {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n cb.call(callThis, ...args);\n }\n }\n }\n\n /**\n * Trigger an event, listener alter given value and return it.\n * @param event\n * @param value\n * @param args\n * @param callThis\n */\n alter(event: string, value: any, args: any[] = [], callThis: any = null): any {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n value = cb.call(callThis, value, ...args);\n }\n }\n\n return value;\n }\n\n /**\n * Trigger an event and call async listener.\n * @param event\n * @param args\n * @param callThis\n */\n async asyncEmit(event: string, args: any[] = [], callThis: any = null): Promise<void> {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n await cb.call(callThis, ...args);\n }\n }\n }\n\n /**\n * Trigger an event, async listener alter given value and return it.\n * @param event\n * @param value\n * @param args\n * @param callThis\n */\n async asyncAlter(event: string, value: any, args: string[] = [], callThis: any = null): Promise<any> {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n value = await cb.call(callThis, value, ...args);\n }\n }\n\n return value;\n }\n}\n"]}