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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/jest.config.js +14 -0
  2. package/lib/cjs/decorators/configurable.js +14 -0
  3. package/lib/cjs/decorators/configurable.js.map +1 -0
  4. package/lib/cjs/decorators/deprecated.js +44 -0
  5. package/lib/cjs/decorators/deprecated.js.map +1 -0
  6. package/lib/cjs/decorators/enumerable.js +14 -0
  7. package/lib/cjs/decorators/enumerable.js.map +1 -0
  8. package/lib/cjs/decorators/notConfigurable.js +9 -0
  9. package/lib/cjs/decorators/notConfigurable.js.map +1 -0
  10. package/lib/cjs/decorators/notEnumerable.js +9 -0
  11. package/lib/cjs/decorators/notEnumerable.js.map +1 -0
  12. package/lib/cjs/decorators/readOnly.js +9 -0
  13. package/lib/cjs/decorators/readOnly.js.map +1 -0
  14. package/lib/cjs/decorators/storeFn.js +22 -0
  15. package/lib/cjs/decorators/storeFn.js.map +1 -0
  16. package/lib/cjs/decorators/storeMerge.js +11 -0
  17. package/lib/cjs/decorators/storeMerge.js.map +1 -0
  18. package/lib/cjs/decorators/storeSet.js +11 -0
  19. package/lib/cjs/decorators/storeSet.js.map +1 -0
  20. package/lib/cjs/decorators/writable.js +14 -0
  21. package/lib/cjs/decorators/writable.js.map +1 -0
  22. package/lib/cjs/domain/AnyToPromise.js +148 -0
  23. package/lib/cjs/domain/AnyToPromise.js.map +1 -0
  24. package/lib/cjs/domain/DecoratorTypes.js +15 -0
  25. package/lib/cjs/domain/DecoratorTypes.js.map +1 -0
  26. package/lib/cjs/domain/Env.js +19 -0
  27. package/lib/cjs/domain/Env.js.map +1 -0
  28. package/lib/cjs/domain/Hooks.js +89 -0
  29. package/lib/cjs/domain/Hooks.js.map +1 -0
  30. package/lib/cjs/domain/Metadata.js +508 -0
  31. package/lib/cjs/domain/Metadata.js.map +1 -0
  32. package/lib/cjs/domain/Store.js +157 -0
  33. package/lib/cjs/domain/Store.js.map +1 -0
  34. package/lib/cjs/domain/Type.js +7 -0
  35. package/lib/cjs/domain/Type.js.map +1 -0
  36. package/lib/cjs/errors/UnsupportedDecoratorType.js +23 -0
  37. package/lib/cjs/errors/UnsupportedDecoratorType.js.map +1 -0
  38. package/lib/cjs/index.js +85 -0
  39. package/lib/cjs/index.js.map +1 -0
  40. package/lib/cjs/interfaces/AnyDecorator.js +3 -0
  41. package/lib/cjs/interfaces/AnyDecorator.js.map +1 -0
  42. package/lib/cjs/interfaces/DecoratorParameters.js +3 -0
  43. package/lib/cjs/interfaces/DecoratorParameters.js.map +1 -0
  44. package/lib/cjs/interfaces/HashOf.js +3 -0
  45. package/lib/cjs/interfaces/HashOf.js.map +1 -0
  46. package/lib/cjs/interfaces/MetadataTypes.js +3 -0
  47. package/lib/cjs/interfaces/MetadataTypes.js.map +1 -0
  48. package/lib/cjs/interfaces/ValueOf.js +3 -0
  49. package/lib/cjs/interfaces/ValueOf.js.map +1 -0
  50. package/lib/cjs/package.json +3 -0
  51. package/lib/cjs/utils/catchError.js +22 -0
  52. package/lib/cjs/utils/catchError.js.map +1 -0
  53. package/lib/cjs/utils/decorators/decorateMethodsOf.js +24 -0
  54. package/lib/cjs/utils/decorators/decorateMethodsOf.js.map +1 -0
  55. package/lib/cjs/utils/decorators/decoratorArgs.js +9 -0
  56. package/lib/cjs/utils/decorators/decoratorArgs.js.map +1 -0
  57. package/lib/cjs/utils/decorators/decoratorTypeOf.js +23 -0
  58. package/lib/cjs/utils/decorators/decoratorTypeOf.js.map +1 -0
  59. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js +15 -0
  60. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  61. package/lib/cjs/utils/decorators/useDecorators.js +14 -0
  62. package/lib/cjs/utils/decorators/useDecorators.js.map +1 -0
  63. package/lib/cjs/utils/decorators/useMethodDecorators.js +15 -0
  64. package/lib/cjs/utils/decorators/useMethodDecorators.js.map +1 -0
  65. package/lib/cjs/utils/http/getHostInfoFromPort.js +21 -0
  66. package/lib/cjs/utils/http/getHostInfoFromPort.js.map +1 -0
  67. package/lib/cjs/utils/imports/importPackage.js +39 -0
  68. package/lib/cjs/utils/imports/importPackage.js.map +1 -0
  69. package/lib/cjs/utils/objects/ancestorOf.js +12 -0
  70. package/lib/cjs/utils/objects/ancestorOf.js.map +1 -0
  71. package/lib/cjs/utils/objects/ancestorsOf.js +22 -0
  72. package/lib/cjs/utils/objects/ancestorsOf.js.map +1 -0
  73. package/lib/cjs/utils/objects/classOf.js +23 -0
  74. package/lib/cjs/utils/objects/classOf.js.map +1 -0
  75. package/lib/cjs/utils/objects/cleanObject.js +24 -0
  76. package/lib/cjs/utils/objects/cleanObject.js.map +1 -0
  77. package/lib/cjs/utils/objects/constructorOf.js +20 -0
  78. package/lib/cjs/utils/objects/constructorOf.js.map +1 -0
  79. package/lib/cjs/utils/objects/createInstance.js +9 -0
  80. package/lib/cjs/utils/objects/createInstance.js.map +1 -0
  81. package/lib/cjs/utils/objects/deepClone.js +63 -0
  82. package/lib/cjs/utils/objects/deepClone.js.map +1 -0
  83. package/lib/cjs/utils/objects/deepMerge.js +63 -0
  84. package/lib/cjs/utils/objects/deepMerge.js.map +1 -0
  85. package/lib/cjs/utils/objects/descriptorOf.js +19 -0
  86. package/lib/cjs/utils/objects/descriptorOf.js.map +1 -0
  87. package/lib/cjs/utils/objects/getClassOrSymbol.js +10 -0
  88. package/lib/cjs/utils/objects/getClassOrSymbol.js.map +1 -0
  89. package/lib/cjs/utils/objects/getConstructorArgNames.js +14 -0
  90. package/lib/cjs/utils/objects/getConstructorArgNames.js.map +1 -0
  91. package/lib/cjs/utils/objects/getEnumerableKeys.js +20 -0
  92. package/lib/cjs/utils/objects/getEnumerableKeys.js.map +1 -0
  93. package/lib/cjs/utils/objects/getValue.js +49 -0
  94. package/lib/cjs/utils/objects/getValue.js.map +1 -0
  95. package/lib/cjs/utils/objects/isArray.js +23 -0
  96. package/lib/cjs/utils/objects/isArray.js.map +1 -0
  97. package/lib/cjs/utils/objects/isArrowFn.js +9 -0
  98. package/lib/cjs/utils/objects/isArrowFn.js.map +1 -0
  99. package/lib/cjs/utils/objects/isBoolean.js +17 -0
  100. package/lib/cjs/utils/objects/isBoolean.js.map +1 -0
  101. package/lib/cjs/utils/objects/isBuffer.js +13 -0
  102. package/lib/cjs/utils/objects/isBuffer.js.map +1 -0
  103. package/lib/cjs/utils/objects/isClass.js +28 -0
  104. package/lib/cjs/utils/objects/isClass.js.map +1 -0
  105. package/lib/cjs/utils/objects/isCollection.js +22 -0
  106. package/lib/cjs/utils/objects/isCollection.js.map +1 -0
  107. package/lib/cjs/utils/objects/isDate.js +13 -0
  108. package/lib/cjs/utils/objects/isDate.js.map +1 -0
  109. package/lib/cjs/utils/objects/isEmpty.js +14 -0
  110. package/lib/cjs/utils/objects/isEmpty.js.map +1 -0
  111. package/lib/cjs/utils/objects/isEnumerable.js +22 -0
  112. package/lib/cjs/utils/objects/isEnumerable.js.map +1 -0
  113. package/lib/cjs/utils/objects/isFunction.js +8 -0
  114. package/lib/cjs/utils/objects/isFunction.js.map +1 -0
  115. package/lib/cjs/utils/objects/isInheritedFrom.js +26 -0
  116. package/lib/cjs/utils/objects/isInheritedFrom.js.map +1 -0
  117. package/lib/cjs/utils/objects/isNil.js +8 -0
  118. package/lib/cjs/utils/objects/isNil.js.map +1 -0
  119. package/lib/cjs/utils/objects/isNumber.js +17 -0
  120. package/lib/cjs/utils/objects/isNumber.js.map +1 -0
  121. package/lib/cjs/utils/objects/isObject.js +8 -0
  122. package/lib/cjs/utils/objects/isObject.js.map +1 -0
  123. package/lib/cjs/utils/objects/isObservable.js +8 -0
  124. package/lib/cjs/utils/objects/isObservable.js.map +1 -0
  125. package/lib/cjs/utils/objects/isPlainObject.js +18 -0
  126. package/lib/cjs/utils/objects/isPlainObject.js.map +1 -0
  127. package/lib/cjs/utils/objects/isPrimitive.js +30 -0
  128. package/lib/cjs/utils/objects/isPrimitive.js.map +1 -0
  129. package/lib/cjs/utils/objects/isPromise.js +16 -0
  130. package/lib/cjs/utils/objects/isPromise.js.map +1 -0
  131. package/lib/cjs/utils/objects/isProtectedKey.js +12 -0
  132. package/lib/cjs/utils/objects/isProtectedKey.js.map +1 -0
  133. package/lib/cjs/utils/objects/isSerializable.js +13 -0
  134. package/lib/cjs/utils/objects/isSerializable.js.map +1 -0
  135. package/lib/cjs/utils/objects/isStream.js +8 -0
  136. package/lib/cjs/utils/objects/isStream.js.map +1 -0
  137. package/lib/cjs/utils/objects/isString.js +16 -0
  138. package/lib/cjs/utils/objects/isString.js.map +1 -0
  139. package/lib/cjs/utils/objects/isSymbol.js +16 -0
  140. package/lib/cjs/utils/objects/isSymbol.js.map +1 -0
  141. package/lib/cjs/utils/objects/methodsOf.js +25 -0
  142. package/lib/cjs/utils/objects/methodsOf.js.map +1 -0
  143. package/lib/cjs/utils/objects/nameOf.js +32 -0
  144. package/lib/cjs/utils/objects/nameOf.js.map +1 -0
  145. package/lib/cjs/utils/objects/objectKeys.js +9 -0
  146. package/lib/cjs/utils/objects/objectKeys.js.map +1 -0
  147. package/lib/cjs/utils/objects/primitiveOf.js +20 -0
  148. package/lib/cjs/utils/objects/primitiveOf.js.map +1 -0
  149. package/lib/cjs/utils/objects/prototypeOf.js +14 -0
  150. package/lib/cjs/utils/objects/prototypeOf.js.map +1 -0
  151. package/lib/cjs/utils/objects/setValue.js +34 -0
  152. package/lib/cjs/utils/objects/setValue.js.map +1 -0
  153. package/lib/cjs/utils/objects/toMap.js +32 -0
  154. package/lib/cjs/utils/objects/toMap.js.map +1 -0
  155. package/lib/cjs/utils/objects/toStringConstructor.js +12 -0
  156. package/lib/cjs/utils/objects/toStringConstructor.js.map +1 -0
  157. package/lib/cjs/utils/proxyDelegation.js +54 -0
  158. package/lib/cjs/utils/proxyDelegation.js.map +1 -0
  159. package/lib/cjs/utils/uniq.js +16 -0
  160. package/lib/cjs/utils/uniq.js.map +1 -0
  161. package/lib/esm/decorators/configurable.js +10 -0
  162. package/lib/esm/decorators/configurable.js.map +1 -0
  163. package/lib/esm/decorators/deprecated.js +40 -0
  164. package/lib/esm/decorators/deprecated.js.map +1 -0
  165. package/lib/esm/decorators/enumerable.js +10 -0
  166. package/lib/esm/decorators/enumerable.js.map +1 -0
  167. package/lib/esm/decorators/notConfigurable.js +5 -0
  168. package/lib/esm/decorators/notConfigurable.js.map +1 -0
  169. package/lib/esm/decorators/notEnumerable.js +5 -0
  170. package/lib/esm/decorators/notEnumerable.js.map +1 -0
  171. package/lib/esm/decorators/readOnly.js +5 -0
  172. package/lib/esm/decorators/readOnly.js.map +1 -0
  173. package/lib/esm/decorators/storeFn.js +18 -0
  174. package/lib/esm/decorators/storeFn.js.map +1 -0
  175. package/lib/esm/decorators/storeMerge.js +7 -0
  176. package/lib/esm/decorators/storeMerge.js.map +1 -0
  177. package/lib/esm/decorators/storeSet.js +7 -0
  178. package/lib/esm/decorators/storeSet.js.map +1 -0
  179. package/lib/esm/decorators/writable.js +10 -0
  180. package/lib/esm/decorators/writable.js.map +1 -0
  181. package/lib/esm/domain/AnyToPromise.js +144 -0
  182. package/lib/esm/domain/AnyToPromise.js.map +1 -0
  183. package/lib/esm/domain/DecoratorTypes.js +12 -0
  184. package/lib/esm/domain/DecoratorTypes.js.map +1 -0
  185. package/lib/esm/domain/Env.js +16 -0
  186. package/lib/esm/domain/Env.js.map +1 -0
  187. package/lib/esm/domain/Hooks.js +85 -0
  188. package/lib/esm/domain/Hooks.js.map +1 -0
  189. package/lib/esm/domain/Metadata.js +504 -0
  190. package/lib/esm/domain/Metadata.js.map +1 -0
  191. package/lib/esm/domain/Store.js +153 -0
  192. package/lib/esm/domain/Store.js.map +1 -0
  193. package/lib/esm/domain/Type.js +4 -0
  194. package/lib/esm/domain/Type.js.map +1 -0
  195. package/lib/esm/errors/UnsupportedDecoratorType.js +19 -0
  196. package/lib/esm/errors/UnsupportedDecoratorType.js.map +1 -0
  197. package/lib/esm/index.js +82 -0
  198. package/lib/esm/index.js.map +1 -0
  199. package/lib/esm/interfaces/AnyDecorator.js +2 -0
  200. package/lib/esm/interfaces/AnyDecorator.js.map +1 -0
  201. package/lib/esm/interfaces/DecoratorParameters.js +2 -0
  202. package/lib/esm/interfaces/DecoratorParameters.js.map +1 -0
  203. package/lib/esm/interfaces/HashOf.js +2 -0
  204. package/lib/esm/interfaces/HashOf.js.map +1 -0
  205. package/lib/esm/interfaces/MetadataTypes.js +2 -0
  206. package/lib/esm/interfaces/MetadataTypes.js.map +1 -0
  207. package/lib/esm/interfaces/ValueOf.js +2 -0
  208. package/lib/esm/interfaces/ValueOf.js.map +1 -0
  209. package/lib/esm/package.json +3 -0
  210. package/lib/esm/utils/catchError.js +17 -0
  211. package/lib/esm/utils/catchError.js.map +1 -0
  212. package/lib/esm/utils/decorators/decorateMethodsOf.js +20 -0
  213. package/lib/esm/utils/decorators/decorateMethodsOf.js.map +1 -0
  214. package/lib/esm/utils/decorators/decoratorArgs.js +5 -0
  215. package/lib/esm/utils/decorators/decoratorArgs.js.map +1 -0
  216. package/lib/esm/utils/decorators/decoratorTypeOf.js +19 -0
  217. package/lib/esm/utils/decorators/decoratorTypeOf.js.map +1 -0
  218. package/lib/esm/utils/decorators/inheritedDescriptorOf.js +11 -0
  219. package/lib/esm/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  220. package/lib/esm/utils/decorators/useDecorators.js +10 -0
  221. package/lib/esm/utils/decorators/useDecorators.js.map +1 -0
  222. package/lib/esm/utils/decorators/useMethodDecorators.js +10 -0
  223. package/lib/esm/utils/decorators/useMethodDecorators.js.map +1 -0
  224. package/lib/esm/utils/http/getHostInfoFromPort.js +17 -0
  225. package/lib/esm/utils/http/getHostInfoFromPort.js.map +1 -0
  226. package/lib/esm/utils/imports/importPackage.js +12 -0
  227. package/lib/esm/utils/imports/importPackage.js.map +1 -0
  228. package/lib/esm/utils/objects/ancestorOf.js +7 -0
  229. package/lib/esm/utils/objects/ancestorOf.js.map +1 -0
  230. package/lib/esm/utils/objects/ancestorsOf.js +18 -0
  231. package/lib/esm/utils/objects/ancestorsOf.js.map +1 -0
  232. package/lib/esm/utils/objects/classOf.js +18 -0
  233. package/lib/esm/utils/objects/classOf.js.map +1 -0
  234. package/lib/esm/utils/objects/cleanObject.js +20 -0
  235. package/lib/esm/utils/objects/cleanObject.js.map +1 -0
  236. package/lib/esm/utils/objects/constructorOf.js +15 -0
  237. package/lib/esm/utils/objects/constructorOf.js.map +1 -0
  238. package/lib/esm/utils/objects/createInstance.js +5 -0
  239. package/lib/esm/utils/objects/createInstance.js.map +1 -0
  240. package/lib/esm/utils/objects/deepClone.js +59 -0
  241. package/lib/esm/utils/objects/deepClone.js.map +1 -0
  242. package/lib/esm/utils/objects/deepMerge.js +58 -0
  243. package/lib/esm/utils/objects/deepMerge.js.map +1 -0
  244. package/lib/esm/utils/objects/descriptorOf.js +14 -0
  245. package/lib/esm/utils/objects/descriptorOf.js.map +1 -0
  246. package/lib/esm/utils/objects/getClassOrSymbol.js +6 -0
  247. package/lib/esm/utils/objects/getClassOrSymbol.js.map +1 -0
  248. package/lib/esm/utils/objects/getConstructorArgNames.js +10 -0
  249. package/lib/esm/utils/objects/getConstructorArgNames.js.map +1 -0
  250. package/lib/esm/utils/objects/getEnumerableKeys.js +16 -0
  251. package/lib/esm/utils/objects/getEnumerableKeys.js.map +1 -0
  252. package/lib/esm/utils/objects/getValue.js +45 -0
  253. package/lib/esm/utils/objects/getValue.js.map +1 -0
  254. package/lib/esm/utils/objects/isArray.js +18 -0
  255. package/lib/esm/utils/objects/isArray.js.map +1 -0
  256. package/lib/esm/utils/objects/isArrowFn.js +5 -0
  257. package/lib/esm/utils/objects/isArrowFn.js.map +1 -0
  258. package/lib/esm/utils/objects/isBoolean.js +12 -0
  259. package/lib/esm/utils/objects/isBoolean.js.map +1 -0
  260. package/lib/esm/utils/objects/isBuffer.js +9 -0
  261. package/lib/esm/utils/objects/isBuffer.js.map +1 -0
  262. package/lib/esm/utils/objects/isClass.js +24 -0
  263. package/lib/esm/utils/objects/isClass.js.map +1 -0
  264. package/lib/esm/utils/objects/isCollection.js +18 -0
  265. package/lib/esm/utils/objects/isCollection.js.map +1 -0
  266. package/lib/esm/utils/objects/isDate.js +9 -0
  267. package/lib/esm/utils/objects/isDate.js.map +1 -0
  268. package/lib/esm/utils/objects/isEmpty.js +10 -0
  269. package/lib/esm/utils/objects/isEmpty.js.map +1 -0
  270. package/lib/esm/utils/objects/isEnumerable.js +18 -0
  271. package/lib/esm/utils/objects/isEnumerable.js.map +1 -0
  272. package/lib/esm/utils/objects/isFunction.js +4 -0
  273. package/lib/esm/utils/objects/isFunction.js.map +1 -0
  274. package/lib/esm/utils/objects/isInheritedFrom.js +22 -0
  275. package/lib/esm/utils/objects/isInheritedFrom.js.map +1 -0
  276. package/lib/esm/utils/objects/isNil.js +4 -0
  277. package/lib/esm/utils/objects/isNil.js.map +1 -0
  278. package/lib/esm/utils/objects/isNumber.js +12 -0
  279. package/lib/esm/utils/objects/isNumber.js.map +1 -0
  280. package/lib/esm/utils/objects/isObject.js +4 -0
  281. package/lib/esm/utils/objects/isObject.js.map +1 -0
  282. package/lib/esm/utils/objects/isObservable.js +4 -0
  283. package/lib/esm/utils/objects/isObservable.js.map +1 -0
  284. package/lib/esm/utils/objects/isPlainObject.js +13 -0
  285. package/lib/esm/utils/objects/isPlainObject.js.map +1 -0
  286. package/lib/esm/utils/objects/isPrimitive.js +24 -0
  287. package/lib/esm/utils/objects/isPrimitive.js.map +1 -0
  288. package/lib/esm/utils/objects/isPromise.js +12 -0
  289. package/lib/esm/utils/objects/isPromise.js.map +1 -0
  290. package/lib/esm/utils/objects/isProtectedKey.js +8 -0
  291. package/lib/esm/utils/objects/isProtectedKey.js.map +1 -0
  292. package/lib/esm/utils/objects/isSerializable.js +9 -0
  293. package/lib/esm/utils/objects/isSerializable.js.map +1 -0
  294. package/lib/esm/utils/objects/isStream.js +4 -0
  295. package/lib/esm/utils/objects/isStream.js.map +1 -0
  296. package/lib/esm/utils/objects/isString.js +11 -0
  297. package/lib/esm/utils/objects/isString.js.map +1 -0
  298. package/lib/esm/utils/objects/isSymbol.js +11 -0
  299. package/lib/esm/utils/objects/isSymbol.js.map +1 -0
  300. package/lib/esm/utils/objects/methodsOf.js +21 -0
  301. package/lib/esm/utils/objects/methodsOf.js.map +1 -0
  302. package/lib/esm/utils/objects/nameOf.js +26 -0
  303. package/lib/esm/utils/objects/nameOf.js.map +1 -0
  304. package/lib/esm/utils/objects/objectKeys.js +5 -0
  305. package/lib/esm/utils/objects/objectKeys.js.map +1 -0
  306. package/lib/esm/utils/objects/primitiveOf.js +16 -0
  307. package/lib/esm/utils/objects/primitiveOf.js.map +1 -0
  308. package/lib/esm/utils/objects/prototypeOf.js +10 -0
  309. package/lib/esm/utils/objects/prototypeOf.js.map +1 -0
  310. package/lib/esm/utils/objects/setValue.js +30 -0
  311. package/lib/esm/utils/objects/setValue.js.map +1 -0
  312. package/lib/esm/utils/objects/toMap.js +28 -0
  313. package/lib/esm/utils/objects/toMap.js.map +1 -0
  314. package/lib/esm/utils/objects/toStringConstructor.js +8 -0
  315. package/lib/esm/utils/objects/toStringConstructor.js.map +1 -0
  316. package/lib/esm/utils/proxyDelegation.js +50 -0
  317. package/lib/esm/utils/proxyDelegation.js.map +1 -0
  318. package/lib/esm/utils/uniq.js +11 -0
  319. package/lib/esm/utils/uniq.js.map +1 -0
  320. package/lib/{decorators → types/decorators}/configurable.d.ts +0 -1
  321. package/lib/{decorators → types/decorators}/deprecated.d.ts +0 -0
  322. package/lib/{decorators → types/decorators}/enumerable.d.ts +0 -1
  323. package/lib/{decorators → types/decorators}/notConfigurable.d.ts +0 -1
  324. package/lib/{decorators → types/decorators}/notEnumerable.d.ts +0 -1
  325. package/lib/{decorators → types/decorators}/readOnly.d.ts +0 -1
  326. package/lib/{decorators → types/decorators}/storeFn.d.ts +0 -0
  327. package/lib/{decorators → types/decorators}/storeMerge.d.ts +0 -0
  328. package/lib/{decorators → types/decorators}/storeSet.d.ts +0 -0
  329. package/lib/{decorators → types/decorators}/writable.d.ts +0 -1
  330. package/lib/{domain → types/domain}/AnyToPromise.d.ts +0 -0
  331. package/lib/{domain → types/domain}/DecoratorTypes.d.ts +0 -0
  332. package/lib/{domain → types/domain}/Env.d.ts +0 -0
  333. package/lib/{domain → types/domain}/Hooks.d.ts +0 -0
  334. package/lib/{domain → types/domain}/Metadata.d.ts +0 -0
  335. package/lib/{domain → types/domain}/Store.d.ts +0 -0
  336. package/lib/{domain → types/domain}/Type.d.ts +0 -0
  337. package/lib/{errors → types/errors}/UnsupportedDecoratorType.d.ts +0 -0
  338. package/lib/types/index.d.ts +81 -0
  339. package/lib/{interfaces → types/interfaces}/AnyDecorator.d.ts +0 -0
  340. package/lib/{interfaces → types/interfaces}/DecoratorParameters.d.ts +0 -0
  341. package/lib/{interfaces → types/interfaces}/HashOf.d.ts +0 -0
  342. package/lib/{interfaces → types/interfaces}/MetadataTypes.d.ts +0 -0
  343. package/lib/{interfaces → types/interfaces}/ValueOf.d.ts +0 -0
  344. package/lib/{utils → types/utils}/catchError.d.ts +0 -0
  345. package/lib/{utils → types/utils}/decorators/decorateMethodsOf.d.ts +0 -0
  346. package/lib/{utils → types/utils}/decorators/decoratorArgs.d.ts +0 -0
  347. package/lib/{utils → types/utils}/decorators/decoratorTypeOf.d.ts +0 -0
  348. package/lib/{utils → types/utils}/decorators/inheritedDescriptorOf.d.ts +0 -0
  349. package/lib/{utils → types/utils}/decorators/useDecorators.d.ts +0 -0
  350. package/lib/{utils → types/utils}/decorators/useMethodDecorators.d.ts +0 -0
  351. package/lib/types/utils/http/getHostInfoFromPort.d.ts +6 -0
  352. package/lib/types/utils/imports/importPackage.d.ts +1 -0
  353. package/lib/{utils → types/utils}/objects/ancestorOf.d.ts +0 -0
  354. package/lib/{utils → types/utils}/objects/ancestorsOf.d.ts +0 -0
  355. package/lib/{utils → types/utils}/objects/classOf.d.ts +0 -0
  356. package/lib/{utils → types/utils}/objects/cleanObject.d.ts +0 -0
  357. package/lib/{utils → types/utils}/objects/constructorOf.d.ts +0 -0
  358. package/lib/{utils → types/utils}/objects/createInstance.d.ts +0 -0
  359. package/lib/types/utils/objects/deepClone.d.ts +6 -0
  360. package/lib/{utils → types/utils}/objects/deepMerge.d.ts +1 -1
  361. package/lib/{utils → types/utils}/objects/descriptorOf.d.ts +1 -0
  362. package/lib/{utils → types/utils}/objects/getClassOrSymbol.d.ts +0 -0
  363. package/lib/{utils → types/utils}/objects/getConstructorArgNames.d.ts +0 -0
  364. package/lib/{utils → types/utils}/objects/getEnumerableKeys.d.ts +0 -0
  365. package/lib/{utils → types/utils}/objects/getValue.d.ts +0 -0
  366. package/lib/{utils → types/utils}/objects/isArray.d.ts +0 -0
  367. package/lib/types/utils/objects/isArrowFn.d.ts +1 -0
  368. package/lib/{utils → types/utils}/objects/isBoolean.d.ts +0 -0
  369. package/lib/types/utils/objects/isBuffer.d.ts +7 -0
  370. package/lib/{utils → types/utils}/objects/isClass.d.ts +0 -0
  371. package/lib/{utils → types/utils}/objects/isCollection.d.ts +0 -0
  372. package/lib/{utils → types/utils}/objects/isDate.d.ts +0 -0
  373. package/lib/{utils → types/utils}/objects/isEmpty.d.ts +0 -0
  374. package/lib/{utils → types/utils}/objects/isEnumerable.d.ts +0 -0
  375. package/lib/{utils → types/utils}/objects/isFunction.d.ts +0 -0
  376. package/lib/{utils → types/utils}/objects/isInheritedFrom.d.ts +0 -0
  377. package/lib/{utils → types/utils}/objects/isNil.d.ts +0 -0
  378. package/lib/{utils → types/utils}/objects/isNumber.d.ts +0 -0
  379. package/lib/{utils → types/utils}/objects/isObject.d.ts +0 -0
  380. package/lib/{utils → types/utils}/objects/isObservable.d.ts +0 -0
  381. package/lib/{utils → types/utils}/objects/isPlainObject.d.ts +0 -0
  382. package/lib/{utils → types/utils}/objects/isPrimitive.d.ts +0 -0
  383. package/lib/{utils → types/utils}/objects/isPromise.d.ts +0 -0
  384. package/lib/{utils → types/utils}/objects/isProtectedKey.d.ts +0 -0
  385. package/lib/{utils → types/utils}/objects/isSerializable.d.ts +0 -0
  386. package/lib/{utils → types/utils}/objects/isStream.d.ts +0 -0
  387. package/lib/{utils → types/utils}/objects/isString.d.ts +0 -0
  388. package/lib/{utils → types/utils}/objects/isSymbol.d.ts +0 -0
  389. package/lib/types/utils/objects/methodsOf.d.ts +9 -0
  390. package/lib/{utils → types/utils}/objects/nameOf.d.ts +0 -0
  391. package/lib/{utils → types/utils}/objects/objectKeys.d.ts +0 -0
  392. package/lib/{utils → types/utils}/objects/primitiveOf.d.ts +0 -0
  393. package/lib/{utils → types/utils}/objects/prototypeOf.d.ts +0 -0
  394. package/lib/{utils → types/utils}/objects/setValue.d.ts +0 -0
  395. package/lib/{utils → types/utils}/objects/toMap.d.ts +0 -0
  396. package/lib/{utils → types/utils}/objects/toStringConstructor.d.ts +0 -0
  397. package/lib/{utils → types/utils}/proxyDelegation.d.ts +0 -0
  398. package/lib/{utils → types/utils}/uniq.d.ts +0 -0
  399. package/package.json +16 -12
  400. package/readme.md +1 -2
  401. package/tsconfig.compile.esm.json +12 -0
  402. package/lib/decorators/index.d.ts +0 -14
  403. package/lib/domain/Entity.d.ts +0 -97
  404. package/lib/domain/index.d.ts +0 -8
  405. package/lib/index.d.ts +0 -6
  406. package/lib/index.js +0 -2298
  407. package/lib/index.js.map +0 -1
  408. package/lib/index.modern.js +0 -2210
  409. package/lib/index.modern.js.map +0 -1
  410. package/lib/interfaces/index.d.ts +0 -4
  411. package/lib/utils/index.d.ts +0 -11
  412. package/lib/utils/objects/deepClone.d.ts +0 -5
  413. package/lib/utils/objects/index.d.ts +0 -42
  414. package/lib/utils/objects/isArrowFn.d.ts +0 -1
  415. package/lib/utils/objects/methodsOf.d.ts +0 -5
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEnumerable = void 0;
4
+ const inheritedDescriptorOf_1 = require("../decorators/inheritedDescriptorOf");
5
+ const classOf_1 = require("./classOf");
6
+ /**
7
+ *
8
+ * @param obj
9
+ * @param key
10
+ */
11
+ function isEnumerable(obj, key) {
12
+ const klass = (0, classOf_1.classOf)(obj);
13
+ if (klass) {
14
+ const descriptor = (0, inheritedDescriptorOf_1.inheritedDescriptorOf)(klass, key);
15
+ if (descriptor) {
16
+ return descriptor.enumerable;
17
+ }
18
+ }
19
+ return Object.prototype.propertyIsEnumerable.call(obj, key);
20
+ }
21
+ exports.isEnumerable = isEnumerable;
22
+ //# sourceMappingURL=isEnumerable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isEnumerable.js","sourceRoot":"","sources":["../../../../src/utils/objects/isEnumerable.ts"],"names":[],"mappings":";;;AAAA,+EAA0E;AAC1E,uCAAkC;AAElC;;;;GAIG;AACH,SAAgB,YAAY,CAAC,GAAQ,EAAE,GAAW;IAChD,MAAM,KAAK,GAAG,IAAA,iBAAO,EAAC,GAAG,CAAC,CAAC;IAE3B,IAAI,KAAK,EAAE;QACT,MAAM,UAAU,GAAG,IAAA,6CAAqB,EAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAErD,IAAI,UAAU,EAAE;YACd,OAAO,UAAU,CAAC,UAAU,CAAC;SAC9B;KACF;IAED,OAAO,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC9D,CAAC;AAZD,oCAYC","sourcesContent":["import {inheritedDescriptorOf} from \"../decorators/inheritedDescriptorOf\";\nimport {classOf} from \"./classOf\";\n\n/**\n *\n * @param obj\n * @param key\n */\nexport function isEnumerable(obj: any, key: string) {\n const klass = classOf(obj);\n\n if (klass) {\n const descriptor = inheritedDescriptorOf(klass, key);\n\n if (descriptor) {\n return descriptor.enumerable;\n }\n }\n\n return Object.prototype.propertyIsEnumerable.call(obj, key);\n}\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFunction = void 0;
4
+ function isFunction(target) {
5
+ return typeof target === "function";
6
+ }
7
+ exports.isFunction = isFunction;
8
+ //# sourceMappingURL=isFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isFunction.js","sourceRoot":"","sources":["../../../../src/utils/objects/isFunction.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,MAAW;IACpC,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC;AACtC,CAAC;AAFD,gCAEC","sourcesContent":["export function isFunction(target: any): target is Function {\n return typeof target === \"function\";\n}\n"]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isInheritedFrom = void 0;
4
+ const classOf_1 = require("./classOf");
5
+ const ancestorOf_1 = require("./ancestorOf");
6
+ const nameOf_1 = require("./nameOf");
7
+ function isInheritedFrom(target, from, deep = 5) {
8
+ if (!target || !from) {
9
+ return false;
10
+ }
11
+ target = (0, classOf_1.classOf)(target);
12
+ from = (0, classOf_1.classOf)(from);
13
+ while ((0, nameOf_1.nameOf)(target) !== "") {
14
+ if (!deep) {
15
+ return false;
16
+ }
17
+ if (target === from) {
18
+ return true;
19
+ }
20
+ target = (0, ancestorOf_1.ancestorOf)(target);
21
+ deep--;
22
+ }
23
+ return false;
24
+ }
25
+ exports.isInheritedFrom = isInheritedFrom;
26
+ //# sourceMappingURL=isInheritedFrom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isInheritedFrom.js","sourceRoot":"","sources":["../../../../src/utils/objects/isInheritedFrom.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAClC,6CAAwC;AACxC,qCAAgC;AAEhC,SAAgB,eAAe,CAAC,MAAW,EAAE,IAAS,EAAE,IAAI,GAAG,CAAC;IAC9D,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE;QACpB,OAAO,KAAK,CAAC;KACd;IAED,MAAM,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC;IACzB,IAAI,GAAG,IAAA,iBAAO,EAAC,IAAI,CAAC,CAAC;IAErB,OAAO,IAAA,eAAM,EAAC,MAAM,CAAC,KAAK,EAAE,EAAE;QAC5B,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,KAAK,CAAC;SACd;QACD,IAAI,MAAM,KAAK,IAAI,EAAE;YACnB,OAAO,IAAI,CAAC;SACb;QAED,MAAM,GAAG,IAAA,uBAAU,EAAC,MAAM,CAAC,CAAC;QAC5B,IAAI,EAAE,CAAC;KACR;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AArBD,0CAqBC","sourcesContent":["import {classOf} from \"./classOf\";\nimport {ancestorOf} from \"./ancestorOf\";\nimport {nameOf} from \"./nameOf\";\n\nexport function isInheritedFrom(target: any, from: any, deep = 5): boolean {\n if (!target || !from) {\n return false;\n }\n\n target = classOf(target);\n from = classOf(from);\n\n while (nameOf(target) !== \"\") {\n if (!deep) {\n return false;\n }\n if (target === from) {\n return true;\n }\n\n target = ancestorOf(target);\n deep--;\n }\n\n return false;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNil = void 0;
4
+ function isNil(value) {
5
+ return value === undefined || value === null;
6
+ }
7
+ exports.isNil = isNil;
8
+ //# sourceMappingURL=isNil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isNil.js","sourceRoot":"","sources":["../../../../src/utils/objects/isNil.ts"],"names":[],"mappings":";;;AAAA,SAAgB,KAAK,CAAC,KAAU;IAC9B,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;AAC/C,CAAC;AAFD,sBAEC","sourcesContent":["export function isNil(value: any): boolean {\n return value === undefined || value === null;\n}\n"]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNumberOrNumberClass = exports.isNumber = void 0;
4
+ /**
5
+ *
6
+ * @param target
7
+ * @returns {boolean}
8
+ */
9
+ function isNumber(target) {
10
+ return typeof target === "number";
11
+ }
12
+ exports.isNumber = isNumber;
13
+ function isNumberOrNumberClass(target) {
14
+ return typeof target === "number" || target instanceof Number || target === Number;
15
+ }
16
+ exports.isNumberOrNumberClass = isNumberOrNumberClass;
17
+ //# sourceMappingURL=isNumber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isNumber.js","sourceRoot":"","sources":["../../../../src/utils/objects/isNumber.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,MAAW;IAClC,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC;AACpC,CAAC;AAFD,4BAEC;AAED,SAAgB,qBAAqB,CAAC,MAAW;IAC/C,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,YAAY,MAAM,IAAI,MAAM,KAAK,MAAM,CAAC;AACrF,CAAC;AAFD,sDAEC","sourcesContent":["/**\n *\n * @param target\n * @returns {boolean}\n */\nexport function isNumber(target: any): target is number {\n return typeof target === \"number\";\n}\n\nexport function isNumberOrNumberClass(target: any): target is number {\n return typeof target === \"number\" || target instanceof Number || target === Number;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isObject = void 0;
4
+ function isObject(target) {
5
+ return typeof target === "object";
6
+ }
7
+ exports.isObject = isObject;
8
+ //# sourceMappingURL=isObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isObject.js","sourceRoot":"","sources":["../../../../src/utils/objects/isObject.ts"],"names":[],"mappings":";;;AAAA,SAAgB,QAAQ,CAAC,MAAW;IAClC,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC;AACpC,CAAC;AAFD,4BAEC","sourcesContent":["export function isObject(target: any): target is object {\n return typeof target === \"object\";\n}\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isObservable = void 0;
4
+ function isObservable(obj) {
5
+ return !!obj && typeof obj.lift === "function" && typeof obj.subscribe === "function";
6
+ }
7
+ exports.isObservable = isObservable;
8
+ //# sourceMappingURL=isObservable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isObservable.js","sourceRoot":"","sources":["../../../../src/utils/objects/isObservable.ts"],"names":[],"mappings":";;;AAAA,SAAgB,YAAY,CAAI,GAAQ;IACtC,OAAO,CAAC,CAAC,GAAG,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC;AACxF,CAAC;AAFD,oCAEC","sourcesContent":["export function isObservable<T>(obj: any): boolean {\n return !!obj && typeof obj.lift === \"function\" && typeof obj.subscribe === \"function\";\n}\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPlainObject = exports.isClassObject = void 0;
4
+ const classOf_1 = require("./classOf");
5
+ /**
6
+ *
7
+ * @param target
8
+ * @returns {boolean}
9
+ */
10
+ function isClassObject(target) {
11
+ return target === Object;
12
+ }
13
+ exports.isClassObject = isClassObject;
14
+ function isPlainObject(target) {
15
+ return isClassObject((0, classOf_1.classOf)(target)) && target !== Object;
16
+ }
17
+ exports.isPlainObject = isPlainObject;
18
+ //# sourceMappingURL=isPlainObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isPlainObject.js","sourceRoot":"","sources":["../../../../src/utils/objects/isPlainObject.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC;;;;GAIG;AACH,SAAgB,aAAa,CAAC,MAAW;IACvC,OAAO,MAAM,KAAK,MAAM,CAAC;AAC3B,CAAC;AAFD,sCAEC;AAED,SAAgB,aAAa,CAAC,MAAW;IACvC,OAAO,aAAa,CAAC,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC,IAAI,MAAM,KAAK,MAAM,CAAC;AAC7D,CAAC;AAFD,sCAEC","sourcesContent":["import {classOf} from \"./classOf\";\n\n/**\n *\n * @param target\n * @returns {boolean}\n */\nexport function isClassObject(target: any): target is Object {\n return target === Object;\n}\n\nexport function isPlainObject(target: any): boolean {\n return isClassObject(classOf(target)) && target !== Object;\n}\n"]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPrimitiveClass = exports.isPrimitive = exports.isPrimitiveOrPrimitiveClass = void 0;
4
+ const isBoolean_1 = require("./isBoolean");
5
+ const isNumber_1 = require("./isNumber");
6
+ const isString_1 = require("./isString");
7
+ /**
8
+ * Return true if the given obj is a primitive.
9
+ * @param target
10
+ * @returns {boolean}
11
+ * @ignore
12
+ */
13
+ function isPrimitiveOrPrimitiveClass(target) {
14
+ return (0, isString_1.isStringOrStringClass)(target) || (0, isNumber_1.isNumberOrNumberClass)(target) || (0, isBoolean_1.isBooleanOrBooleanClass)(target);
15
+ }
16
+ exports.isPrimitiveOrPrimitiveClass = isPrimitiveOrPrimitiveClass;
17
+ /**
18
+ * Return true if the given obj is a primitive.
19
+ * @param target
20
+ * @returns {boolean}
21
+ */
22
+ function isPrimitive(target) {
23
+ return (0, isString_1.isString)(target) || (0, isNumber_1.isNumber)(target) || (0, isBoolean_1.isBoolean)(target);
24
+ }
25
+ exports.isPrimitive = isPrimitive;
26
+ function isPrimitiveClass(target) {
27
+ return [String, Number, Boolean].includes(target);
28
+ }
29
+ exports.isPrimitiveClass = isPrimitiveClass;
30
+ //# sourceMappingURL=isPrimitive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isPrimitive.js","sourceRoot":"","sources":["../../../../src/utils/objects/isPrimitive.ts"],"names":[],"mappings":";;;AAAA,2CAA+D;AAC/D,yCAA2D;AAC3D,yCAA2D;AAE3D;;;;;GAKG;AACH,SAAgB,2BAA2B,CAAC,MAAW;IACrD,OAAO,IAAA,gCAAqB,EAAC,MAAM,CAAC,IAAI,IAAA,gCAAqB,EAAC,MAAM,CAAC,IAAI,IAAA,mCAAuB,EAAC,MAAM,CAAC,CAAC;AAC3G,CAAC;AAFD,kEAEC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAC,MAAW;IACrC,OAAO,IAAA,mBAAQ,EAAC,MAAM,CAAC,IAAI,IAAA,mBAAQ,EAAC,MAAM,CAAC,IAAI,IAAA,qBAAS,EAAC,MAAM,CAAC,CAAC;AACnE,CAAC;AAFD,kCAEC;AAED,SAAgB,gBAAgB,CAAC,MAAW;IAC1C,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC;AAFD,4CAEC","sourcesContent":["import {isBoolean, isBooleanOrBooleanClass} from \"./isBoolean\";\nimport {isNumber, isNumberOrNumberClass} from \"./isNumber\";\nimport {isString, isStringOrStringClass} from \"./isString\";\n\n/**\n * Return true if the given obj is a primitive.\n * @param target\n * @returns {boolean}\n * @ignore\n */\nexport function isPrimitiveOrPrimitiveClass(target: any): boolean {\n return isStringOrStringClass(target) || isNumberOrNumberClass(target) || isBooleanOrBooleanClass(target);\n}\n\n/**\n * Return true if the given obj is a primitive.\n * @param target\n * @returns {boolean}\n */\nexport function isPrimitive(target: any): boolean {\n return isString(target) || isNumber(target) || isBoolean(target);\n}\n\nexport function isPrimitiveClass(target: any) {\n return [String, Number, Boolean].includes(target);\n}\n"]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPromise = void 0;
4
+ /**
5
+ * Tests to see if the object is an ES2015 (ES6) Promise
6
+ * @see {@link https://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects}
7
+ * @param target
8
+ * @returns {boolean}
9
+ */
10
+ function isPromise(target) {
11
+ return (target === Promise ||
12
+ target instanceof Promise ||
13
+ (!!target && typeof target.subscribe !== "function" && typeof target.then === "function"));
14
+ }
15
+ exports.isPromise = isPromise;
16
+ //# sourceMappingURL=isPromise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isPromise.js","sourceRoot":"","sources":["../../../../src/utils/objects/isPromise.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,SAAS,CAAU,MAAW;IAC5C,OAAO,CACL,MAAM,KAAK,OAAO;QAClB,MAAM,YAAY,OAAO;QACzB,CAAC,CAAC,CAAC,MAAM,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,CAC1F,CAAC;AACJ,CAAC;AAND,8BAMC","sourcesContent":["/**\n * Tests to see if the object is an ES2015 (ES6) Promise\n * @see {@link https://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects}\n * @param target\n * @returns {boolean}\n */\nexport function isPromise<T = any>(target: any): target is Promise<T> {\n return (\n target === Promise ||\n target instanceof Promise ||\n (!!target && typeof target.subscribe !== \"function\" && typeof target.then === \"function\")\n );\n}\n"]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isProtectedKey = void 0;
4
+ /**
5
+ * Prevent prototype pollution vulnerability
6
+ * @param key
7
+ */
8
+ function isProtectedKey(key) {
9
+ return ["__proto__", "constructor", "prototype"].includes(key);
10
+ }
11
+ exports.isProtectedKey = isProtectedKey;
12
+ //# sourceMappingURL=isProtectedKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isProtectedKey.js","sourceRoot":"","sources":["../../../../src/utils/objects/isProtectedKey.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,cAAc,CAAC,GAAW;IACxC,OAAO,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACjE,CAAC;AAFD,wCAEC","sourcesContent":["/**\n * Prevent prototype pollution vulnerability\n * @param key\n */\nexport function isProtectedKey(key: string) {\n return [\"__proto__\", \"constructor\", \"prototype\"].includes(key);\n}\n"]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isSerializable = void 0;
4
+ const isStream_1 = require("./isStream");
5
+ const isBoolean_1 = require("./isBoolean");
6
+ const isNumber_1 = require("./isNumber");
7
+ const isString_1 = require("./isString");
8
+ const isNil_1 = require("./isNil");
9
+ function isSerializable(data) {
10
+ return !(Buffer.isBuffer(data) || (0, isStream_1.isStream)(data) || (0, isBoolean_1.isBoolean)(data) || (0, isNumber_1.isNumber)(data) || (0, isString_1.isString)(data) || (0, isNil_1.isNil)(data));
11
+ }
12
+ exports.isSerializable = isSerializable;
13
+ //# sourceMappingURL=isSerializable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSerializable.js","sourceRoot":"","sources":["../../../../src/utils/objects/isSerializable.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,2CAAsC;AACtC,yCAAoC;AACpC,yCAAoC;AACpC,mCAA8B;AAE9B,SAAgB,cAAc,CAAC,IAAS;IACtC,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAA,mBAAQ,EAAC,IAAI,CAAC,IAAI,IAAA,qBAAS,EAAC,IAAI,CAAC,IAAI,IAAA,mBAAQ,EAAC,IAAI,CAAC,IAAI,IAAA,mBAAQ,EAAC,IAAI,CAAC,IAAI,IAAA,aAAK,EAAC,IAAI,CAAC,CAAC,CAAC;AAC1H,CAAC;AAFD,wCAEC","sourcesContent":["import {isStream} from \"./isStream\";\nimport {isBoolean} from \"./isBoolean\";\nimport {isNumber} from \"./isNumber\";\nimport {isString} from \"./isString\";\nimport {isNil} from \"./isNil\";\n\nexport function isSerializable(data: any) {\n return !(Buffer.isBuffer(data) || isStream(data) || isBoolean(data) || isNumber(data) || isString(data) || isNil(data));\n}\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStream = void 0;
4
+ function isStream(obj) {
5
+ return obj !== null && typeof obj === "object" && typeof obj.pipe === "function";
6
+ }
7
+ exports.isStream = isStream;
8
+ //# sourceMappingURL=isStream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isStream.js","sourceRoot":"","sources":["../../../../src/utils/objects/isStream.ts"],"names":[],"mappings":";;;AAAA,SAAgB,QAAQ,CAAC,GAAQ;IAC/B,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC;AACnF,CAAC;AAFD,4BAEC","sourcesContent":["export function isStream(obj: any): boolean {\n return obj !== null && typeof obj === \"object\" && typeof obj.pipe === \"function\";\n}\n"]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStringOrStringClass = exports.isString = void 0;
4
+ /**
5
+ * @param target
6
+ * @returns {boolean}
7
+ */
8
+ function isString(target) {
9
+ return typeof target === "string";
10
+ }
11
+ exports.isString = isString;
12
+ function isStringOrStringClass(target) {
13
+ return typeof target === "string" || target instanceof String || target === String;
14
+ }
15
+ exports.isStringOrStringClass = isStringOrStringClass;
16
+ //# sourceMappingURL=isString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isString.js","sourceRoot":"","sources":["../../../../src/utils/objects/isString.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,QAAQ,CAAC,MAAW;IAClC,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC;AACpC,CAAC;AAFD,4BAEC;AAED,SAAgB,qBAAqB,CAAC,MAAW;IAC/C,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,YAAY,MAAM,IAAI,MAAM,KAAK,MAAM,CAAC;AACrF,CAAC;AAFD,sDAEC","sourcesContent":["/**\n * @param target\n * @returns {boolean}\n */\nexport function isString(target: any): target is string {\n return typeof target === \"string\";\n}\n\nexport function isStringOrStringClass(target: any): target is string {\n return typeof target === \"string\" || target instanceof String || target === String;\n}\n"]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isSymbolOrSymbolClass = exports.isSymbol = void 0;
4
+ /**
5
+ *
6
+ * @param target
7
+ */
8
+ function isSymbol(target) {
9
+ return typeof target === "symbol";
10
+ }
11
+ exports.isSymbol = isSymbol;
12
+ function isSymbolOrSymbolClass(target) {
13
+ return typeof target === "symbol" || target instanceof Symbol || target === Symbol;
14
+ }
15
+ exports.isSymbolOrSymbolClass = isSymbolOrSymbolClass;
16
+ //# sourceMappingURL=isSymbol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSymbol.js","sourceRoot":"","sources":["../../../../src/utils/objects/isSymbol.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,QAAQ,CAAC,MAAW;IAClC,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC;AACpC,CAAC;AAFD,4BAEC;AAED,SAAgB,qBAAqB,CAAC,MAAW;IAC/C,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,YAAY,MAAM,IAAI,MAAM,KAAK,MAAM,CAAC;AACrF,CAAC;AAFD,sDAEC","sourcesContent":["/**\n *\n * @param target\n */\nexport function isSymbol(target: any): target is symbol {\n return typeof target === \"symbol\";\n}\n\nexport function isSymbolOrSymbolClass(target: any): target is symbol {\n return typeof target === \"symbol\" || target instanceof Symbol || target === Symbol;\n}\n"]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.methodsOf = void 0;
4
+ const classOf_1 = require("./classOf");
5
+ const ancestorsOf_1 = require("./ancestorsOf");
6
+ const prototypeOf_1 = require("./prototypeOf");
7
+ /**
8
+ * Return all methods for a given class.
9
+ * @param target
10
+ */
11
+ function methodsOf(target) {
12
+ const methods = new Map();
13
+ target = (0, classOf_1.classOf)(target);
14
+ (0, ancestorsOf_1.ancestorsOf)(target).forEach((target) => {
15
+ const keys = Reflect.ownKeys((0, prototypeOf_1.prototypeOf)(target));
16
+ keys.forEach((propertyKey) => {
17
+ if (propertyKey !== "constructor") {
18
+ methods.set(propertyKey, { target, propertyKey });
19
+ }
20
+ });
21
+ });
22
+ return Array.from(methods.values());
23
+ }
24
+ exports.methodsOf = methodsOf;
25
+ //# sourceMappingURL=methodsOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methodsOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/methodsOf.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAClC,+CAA0C;AAC1C,+CAA0C;AAG1C;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAW;IACnC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAC1B,MAAM,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC;IAEzB,IAAA,yBAAW,EAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAA,yBAAW,EAAC,MAAM,CAAC,CAAC,CAAC;QAElD,IAAI,CAAC,OAAO,CAAC,CAAC,WAAmB,EAAE,EAAE;YACnC,IAAI,WAAW,KAAK,aAAa,EAAE;gBACjC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAC,MAAM,EAAE,WAAW,EAAC,CAAC,CAAC;aACjD;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACtC,CAAC;AAfD,8BAeC","sourcesContent":["import {classOf} from \"./classOf\";\nimport {ancestorsOf} from \"./ancestorsOf\";\nimport {prototypeOf} from \"./prototypeOf\";\nimport {Type} from \"../../domain/Type\";\n\n/**\n * Return all methods for a given class.\n * @param target\n */\nexport function methodsOf(target: any): {target: Type; propertyKey: string}[] {\n const methods = new Map();\n target = classOf(target);\n\n ancestorsOf(target).forEach((target) => {\n const keys = Reflect.ownKeys(prototypeOf(target));\n\n keys.forEach((propertyKey: string) => {\n if (propertyKey !== \"constructor\") {\n methods.set(propertyKey, {target, propertyKey});\n }\n });\n });\n\n return Array.from(methods.values());\n}\n"]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nameOf = exports.nameOfSymbol = exports.nameOfClass = void 0;
4
+ /**
5
+ * Get the provide name.
6
+ * @param targetClass
7
+ */
8
+ function nameOfClass(targetClass) {
9
+ return typeof targetClass === "function" ? targetClass.name : targetClass.constructor.name;
10
+ }
11
+ exports.nameOfClass = nameOfClass;
12
+ /**
13
+ * Get symbol name.
14
+ * @param sym
15
+ */
16
+ const nameOfSymbol = (sym) => sym.toString().replace("Symbol(", "").replace(")", "");
17
+ exports.nameOfSymbol = nameOfSymbol;
18
+ /**
19
+ * Get object name
20
+ */
21
+ function nameOf(obj) {
22
+ switch (typeof obj) {
23
+ default:
24
+ return "" + obj;
25
+ case "symbol":
26
+ return (0, exports.nameOfSymbol)(obj);
27
+ case "function":
28
+ return nameOfClass(obj);
29
+ }
30
+ }
31
+ exports.nameOf = nameOf;
32
+ //# sourceMappingURL=nameOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nameOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/nameOf.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,WAAW,CAAC,WAAgB;IAC1C,OAAO,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC;AAC7F,CAAC;AAFD,kCAEC;AAED;;;GAGG;AACI,MAAM,YAAY,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAA/F,QAAA,YAAY,gBAAmF;AAE5G;;GAEG;AACH,SAAgB,MAAM,CAAC,GAAQ;IAC7B,QAAQ,OAAO,GAAG,EAAE;QAClB;YACE,OAAO,EAAE,GAAG,GAAG,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,IAAA,oBAAY,EAAC,GAAG,CAAC,CAAC;QAC3B,KAAK,UAAU;YACb,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;KAC3B;AACH,CAAC;AATD,wBASC","sourcesContent":["/**\n * Get the provide name.\n * @param targetClass\n */\nexport function nameOfClass(targetClass: any): string {\n return typeof targetClass === \"function\" ? targetClass.name : targetClass.constructor.name;\n}\n\n/**\n * Get symbol name.\n * @param sym\n */\nexport const nameOfSymbol = (sym: symbol): string => sym.toString().replace(\"Symbol(\", \"\").replace(\")\", \"\");\n\n/**\n * Get object name\n */\nexport function nameOf(obj: any): string {\n switch (typeof obj) {\n default:\n return \"\" + obj;\n case \"symbol\":\n return nameOfSymbol(obj);\n case \"function\":\n return nameOfClass(obj);\n }\n}\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.objectKeys = void 0;
4
+ const isProtectedKey_1 = require("./isProtectedKey");
5
+ function objectKeys(obj) {
6
+ return Object.keys(obj).filter((key) => !(0, isProtectedKey_1.isProtectedKey)(key));
7
+ }
8
+ exports.objectKeys = objectKeys;
9
+ //# sourceMappingURL=objectKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectKeys.js","sourceRoot":"","sources":["../../../../src/utils/objects/objectKeys.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAEhD,SAAgB,UAAU,CAAC,GAAQ;IACjC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAA,+BAAc,EAAC,GAAG,CAAC,CAAC,CAAC;AAChE,CAAC;AAFD,gCAEC","sourcesContent":["import {isProtectedKey} from \"./isProtectedKey\";\n\nexport function objectKeys(obj: any): string[] {\n return Object.keys(obj).filter((key) => !isProtectedKey(key));\n}\n"]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.primitiveOf = void 0;
4
+ const isBoolean_1 = require("./isBoolean");
5
+ const isNumber_1 = require("./isNumber");
6
+ const isString_1 = require("./isString");
7
+ function primitiveOf(target) {
8
+ if ((0, isString_1.isStringOrStringClass)(target)) {
9
+ return "string";
10
+ }
11
+ if ((0, isNumber_1.isNumberOrNumberClass)(target)) {
12
+ return "number";
13
+ }
14
+ if ((0, isBoolean_1.isBooleanOrBooleanClass)(target)) {
15
+ return "boolean";
16
+ }
17
+ return "any";
18
+ }
19
+ exports.primitiveOf = primitiveOf;
20
+ //# sourceMappingURL=primitiveOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitiveOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/primitiveOf.ts"],"names":[],"mappings":";;;AAAA,2CAA+D;AAC/D,yCAA2D;AAC3D,yCAA2D;AAE3D,SAAgB,WAAW,CAAC,MAAW;IACrC,IAAI,IAAA,gCAAqB,EAAC,MAAM,CAAC,EAAE;QACjC,OAAO,QAAQ,CAAC;KACjB;IAED,IAAI,IAAA,gCAAqB,EAAC,MAAM,CAAC,EAAE;QACjC,OAAO,QAAQ,CAAC;KACjB;IAED,IAAI,IAAA,mCAAuB,EAAC,MAAM,CAAC,EAAE;QACnC,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAdD,kCAcC","sourcesContent":["import {isBoolean, isBooleanOrBooleanClass} from \"./isBoolean\";\nimport {isNumber, isNumberOrNumberClass} from \"./isNumber\";\nimport {isString, isStringOrStringClass} from \"./isString\";\n\nexport function primitiveOf(target: any): \"string\" | \"number\" | \"boolean\" | \"any\" {\n if (isStringOrStringClass(target)) {\n return \"string\";\n }\n\n if (isNumberOrNumberClass(target)) {\n return \"number\";\n }\n\n if (isBooleanOrBooleanClass(target)) {\n return \"boolean\";\n }\n\n return \"any\";\n}\n"]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prototypeOf = void 0;
4
+ const classOf_1 = require("./classOf");
5
+ /**
6
+ * Return the prototype of the given class.
7
+ * @param target
8
+ * @returns {any}
9
+ */
10
+ function prototypeOf(target) {
11
+ return (0, classOf_1.classOf)(target) === target ? target.prototype : target;
12
+ }
13
+ exports.prototypeOf = prototypeOf;
14
+ //# sourceMappingURL=prototypeOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prototypeOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/prototypeOf.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC;;;;GAIG;AACH,SAAgB,WAAW,CAAC,MAAW;IACrC,OAAO,IAAA,iBAAO,EAAC,MAAM,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AAChE,CAAC;AAFD,kCAEC","sourcesContent":["import {classOf} from \"./classOf\";\n\n/**\n * Return the prototype of the given class.\n * @param target\n * @returns {any}\n */\nexport function prototypeOf(target: any) {\n return classOf(target) === target ? target.prototype : target;\n}\n"]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setValue = void 0;
4
+ const isProtectedKey_1 = require("./isProtectedKey");
5
+ function setValue(scope, expression, value, separator = ".") {
6
+ const keys = expression.split(separator);
7
+ const setValue = (key, add) => {
8
+ if ((0, isProtectedKey_1.isProtectedKey)(key)) {
9
+ return false;
10
+ }
11
+ if (add) {
12
+ if (typeof scope.set === "function") {
13
+ scope.set(key, value);
14
+ }
15
+ else {
16
+ scope[key] = value;
17
+ }
18
+ return false;
19
+ }
20
+ if (typeof scope.set === "function") {
21
+ if (!scope.has(key)) {
22
+ scope.set(key, {});
23
+ }
24
+ scope = scope.get(key);
25
+ }
26
+ else {
27
+ scope = scope[key] = scope[key] || {};
28
+ }
29
+ return true;
30
+ };
31
+ while (setValue(keys.shift(), !keys.length)) { }
32
+ }
33
+ exports.setValue = setValue;
34
+ //# sourceMappingURL=setValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setValue.js","sourceRoot":"","sources":["../../../../src/utils/objects/setValue.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAEhD,SAAgB,QAAQ,CAAC,KAAU,EAAE,UAAkB,EAAE,KAAU,EAAE,SAAS,GAAG,GAAG;IAClF,MAAM,IAAI,GAAa,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,GAAY,EAAE,EAAE;QAC7C,IAAI,IAAA,+BAAc,EAAC,GAAG,CAAC,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QAED,IAAI,GAAG,EAAE;YACP,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,UAAU,EAAE;gBACnC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;aACvB;iBAAM;gBACL,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aACpB;YAED,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,UAAU,EAAE;YACnC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACnB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;aACpB;YAED,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SACxB;aAAM;YACL,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;SACvC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAE;AAClD,CAAC;AAhCD,4BAgCC","sourcesContent":["import {isProtectedKey} from \"./isProtectedKey\";\n\nexport function setValue(scope: any, expression: string, value: any, separator = \".\") {\n const keys: string[] = expression.split(separator);\n\n const setValue = (key: string, add: boolean) => {\n if (isProtectedKey(key)) {\n return false;\n }\n\n if (add) {\n if (typeof scope.set === \"function\") {\n scope.set(key, value);\n } else {\n scope[key] = value;\n }\n\n return false;\n }\n\n if (typeof scope.set === \"function\") {\n if (!scope.has(key)) {\n scope.set(key, {});\n }\n\n scope = scope.get(key);\n } else {\n scope = scope[key] = scope[key] || {};\n }\n\n return true;\n };\n\n while (setValue(keys.shift()!, !keys.length)) {}\n}\n"]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toMap = void 0;
4
+ const isArray_1 = require("./isArray");
5
+ const isString_1 = require("./isString");
6
+ function createIdentityFn(keyOrFn) {
7
+ if (!keyOrFn) {
8
+ return (v, k) => String(k);
9
+ }
10
+ if ((0, isString_1.isString)(keyOrFn)) {
11
+ return (item) => {
12
+ return item[keyOrFn];
13
+ };
14
+ }
15
+ return keyOrFn;
16
+ }
17
+ function toMap(input, keyOrFn) {
18
+ if ((0, isArray_1.isArray)(input)) {
19
+ const identity = createIdentityFn(keyOrFn || "id");
20
+ return input.reduce((map, value, index) => {
21
+ const ids = [].concat(identity(value, index));
22
+ ids.forEach((id) => map.set(id, value));
23
+ return map;
24
+ }, new Map());
25
+ }
26
+ const identity = createIdentityFn(keyOrFn);
27
+ return Object.entries(input).reduce((map, [key, value]) => {
28
+ return map.set(identity(value, key), value);
29
+ }, new Map());
30
+ }
31
+ exports.toMap = toMap;
32
+ //# sourceMappingURL=toMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toMap.js","sourceRoot":"","sources":["../../../../src/utils/objects/toMap.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAClC,yCAAoC;AAKpC,SAAS,gBAAgB,CAAI,OAA0B;IACrD,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAC5B;IAED,IAAI,IAAA,mBAAQ,EAAC,OAAO,CAAC,EAAE;QACrB,OAAO,CAAC,IAAS,EAAE,EAAE;YACnB,OAAO,IAAI,CAAC,OAAiB,CAAC,CAAC;QACjC,CAAC,CAAC;KACH;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAgB,KAAK,CAAqC,KAAyB,EAAE,OAA0B;IAC7G,IAAI,IAAA,iBAAO,EAAI,KAAK,CAAC,EAAE;QACrB,MAAM,QAAQ,GAAG,gBAAgB,CAAI,OAAO,IAAI,IAAI,CAAC,CAAC;QACtD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACxC,MAAM,GAAG,GAAI,EAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;YAE5D,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;YAExC,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;KACf;IAED,MAAM,QAAQ,GAAG,gBAAgB,CAAI,OAAO,CAAC,CAAC;IAE9C,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACxD,OAAO,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAU,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAChB,CAAC;AAjBD,sBAiBC","sourcesContent":["import {isArray} from \"./isArray\";\nimport {isString} from \"./isString\";\n\nexport type ToMapIdentityCB<V> = (item: V, index: string | number) => string | string[];\nexport type ToMapIdentity<V> = string | ToMapIdentityCB<V>;\n\nfunction createIdentityFn<V>(keyOrFn?: ToMapIdentity<V>): ToMapIdentityCB<V> {\n if (!keyOrFn) {\n return (v, k) => String(k);\n }\n\n if (isString(keyOrFn)) {\n return (item: any) => {\n return item[keyOrFn as string];\n };\n }\n\n return keyOrFn;\n}\n\nexport function toMap<K extends keyof any = any, V = any>(input: Record<K, V> | V[], keyOrFn?: ToMapIdentity<V>): Map<K, V> {\n if (isArray<V>(input)) {\n const identity = createIdentityFn<V>(keyOrFn || \"id\");\n return input.reduce((map, value, index) => {\n const ids = ([] as string[]).concat(identity(value, index));\n\n ids.forEach((id) => map.set(id, value));\n\n return map;\n }, new Map());\n }\n\n const identity = createIdentityFn<V>(keyOrFn);\n\n return Object.entries(input).reduce((map, [key, value]) => {\n return map.set(identity(value as V, key), value);\n }, new Map());\n}\n"]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toStringConstructor = void 0;
4
+ const constructorOf_1 = require("./constructorOf");
5
+ function toStringConstructor(target) {
6
+ const ctr = (0, constructorOf_1.constructorOf)(target);
7
+ const strings = ctr.toString().split("\n");
8
+ const ctrString = strings.find((s) => s.indexOf("constructor(") > -1) || "constructor()";
9
+ return `${ctrString.replace("{", "").trim()}`;
10
+ }
11
+ exports.toStringConstructor = toStringConstructor;
12
+ //# sourceMappingURL=toStringConstructor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toStringConstructor.js","sourceRoot":"","sources":["../../../../src/utils/objects/toStringConstructor.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAE9C,SAAgB,mBAAmB,CAAC,MAAW;IAC7C,MAAM,GAAG,GAAG,IAAA,6BAAa,EAAC,MAAM,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC;IAEzF,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;AAChD,CAAC;AAND,kDAMC","sourcesContent":["import {constructorOf} from \"./constructorOf\";\n\nexport function toStringConstructor(target: any): string {\n const ctr = constructorOf(target);\n const strings = ctr.toString().split(\"\\n\");\n const ctrString = strings.find((s) => s.indexOf(\"constructor(\") > -1) || \"constructor()\";\n\n return `${ctrString.replace(\"{\", \"\").trim()}`;\n}\n"]}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.proxyDelegation = void 0;
4
+ const uniq_1 = require("./uniq");
5
+ /**
6
+ * Create a complete and iterable trap.
7
+ * @param self
8
+ * @param options
9
+ * @ignore
10
+ */
11
+ function proxyDelegation(self, options = {}) {
12
+ const { handlers = {}, remove, ownKeys } = options;
13
+ const get = options.getter || ((target, propertyKey) => target.get(propertyKey));
14
+ const set = options.setter || ((target, propertyKey, value) => !!target.set(propertyKey, value));
15
+ const itsOwnProp = (target, p) => Reflect.has(target, p) || typeof p === "symbol";
16
+ return new Proxy(self, {
17
+ getOwnPropertyDescriptor(target, p) {
18
+ return Reflect.getOwnPropertyDescriptor(target, p);
19
+ },
20
+ has(target, p) {
21
+ if (itsOwnProp(target, p)) {
22
+ return Reflect.has(target, p);
23
+ }
24
+ return get(target, p) !== undefined;
25
+ },
26
+ get(target, p, receiver) {
27
+ if (itsOwnProp(target, p)) {
28
+ return Reflect.get(target, p, receiver);
29
+ }
30
+ return get(target, p);
31
+ },
32
+ set(target, p, value, receiver) {
33
+ if (itsOwnProp(target, p)) {
34
+ return Reflect.set(target, p, value, receiver);
35
+ }
36
+ return !!set(target, p, value, receiver);
37
+ },
38
+ deleteProperty(target, p) {
39
+ if (itsOwnProp(target, p) || !remove) {
40
+ return Reflect.deleteProperty(target, p);
41
+ }
42
+ return remove(target, p);
43
+ },
44
+ defineProperty(target, p, attributes) {
45
+ return Reflect.defineProperty(target, p, attributes);
46
+ },
47
+ ownKeys(target) {
48
+ return (0, uniq_1.uniq)(Reflect.ownKeys(target).concat((ownKeys && ownKeys(target)) || []));
49
+ },
50
+ ...handlers
51
+ });
52
+ }
53
+ exports.proxyDelegation = proxyDelegation;
54
+ //# sourceMappingURL=proxyDelegation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxyDelegation.js","sourceRoot":"","sources":["../../../src/utils/proxyDelegation.ts"],"names":[],"mappings":";;;AAAA,iCAA4B;AA4B5B;;;;;GAKG;AACH,SAAgB,eAAe,CAAyB,IAAS,EAAE,UAA8B,EAAE;IACjG,MAAM,EAAC,QAAQ,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,EAAC,GAAG,OAAO,CAAC;IACjD,MAAM,GAAG,GAA0B,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,MAAW,EAAE,WAAwB,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1H,MAAM,GAAG,GACP,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,MAAW,EAAE,WAAwB,EAAE,KAAU,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;IAE9G,MAAM,UAAU,GAAG,CAAC,MAAW,EAAE,CAAc,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC;IAEpG,OAAO,IAAI,KAAK,CAAI,IAAI,EAAE;QACxB,wBAAwB,CAAC,MAAW,EAAE,CAAc;YAClD,OAAO,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACrD,CAAC;QAED,GAAG,CAAC,MAAW,EAAE,CAAc;YAC7B,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE;gBACzB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;aAC/B;YAED,OAAO,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC;QACtC,CAAC;QAED,GAAG,CAAC,MAAW,EAAE,CAAc,EAAE,QAAa;YAC5C,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE;gBACzB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;aACzC;YAED,OAAO,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACxB,CAAC;QAED,GAAG,CAAC,MAAW,EAAE,CAAc,EAAE,KAAU,EAAE,QAAa;YACxD,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE;gBACzB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;aAChD;YAED,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QAClD,CAAC;QAED,cAAc,CAAC,MAAW,EAAE,CAAc;YACxC,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE;gBACpC,OAAO,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;aAC1C;YAED,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,cAAc,CAAC,MAAW,EAAE,CAAc,EAAE,UAA8B;YACxE,OAAO,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,CAAC,MAAW;YACjB,OAAO,IAAA,WAAI,EAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAClF,CAAC;QACD,GAAG,QAAQ;KACZ,CAAC,CAAC;AACL,CAAC;AAtDD,0CAsDC","sourcesContent":["import {uniq} from \"./uniq\";\n/**\n * @ignore\n */\nexport type ProxyDelegationGetter<T = any> = (target: T, property: PropertyKey) => any | undefined;\n/**\n * @ignore\n */\nexport type ProxyDelegationRemove<T = any> = (target: T, property: PropertyKey) => any;\n/**\n * @ignore\n */\nexport type ProxyDelegationSetter<T = any> = (target: T, property: PropertyKey, value: any, receiver: any) => any;\n/**\n * @ignore\n */\nexport type ProxyDelegationOwnKeys<T = any> = (target: T) => (string | symbol)[];\n/**\n * @ignore\n */\nexport interface ProxyDelegation<T extends object> {\n handlers?: ProxyHandler<T>;\n getter?: ProxyDelegationGetter<T>;\n setter?: ProxyDelegationSetter<T>;\n remove?: ProxyDelegationRemove<T>;\n ownKeys?: ProxyDelegationOwnKeys<T>;\n}\n\n/**\n * Create a complete and iterable trap.\n * @param self\n * @param options\n * @ignore\n */\nexport function proxyDelegation<T extends object = any>(self: any, options: ProxyDelegation<T> = {}) {\n const {handlers = {}, remove, ownKeys} = options;\n const get: ProxyDelegationGetter = options.getter || ((target: any, propertyKey: PropertyKey) => target.get(propertyKey));\n const set: ProxyDelegationSetter =\n options.setter || ((target: any, propertyKey: PropertyKey, value: any) => !!target.set(propertyKey, value));\n\n const itsOwnProp = (target: any, p: PropertyKey) => Reflect.has(target, p) || typeof p === \"symbol\";\n\n return new Proxy<T>(self, {\n getOwnPropertyDescriptor(target: any, p: PropertyKey): PropertyDescriptor | undefined {\n return Reflect.getOwnPropertyDescriptor(target, p);\n },\n\n has(target: any, p: PropertyKey): boolean {\n if (itsOwnProp(target, p)) {\n return Reflect.has(target, p);\n }\n\n return get(target, p) !== undefined;\n },\n\n get(target: any, p: PropertyKey, receiver: any): any {\n if (itsOwnProp(target, p)) {\n return Reflect.get(target, p, receiver);\n }\n\n return get(target, p);\n },\n\n set(target: any, p: PropertyKey, value: any, receiver: any): boolean {\n if (itsOwnProp(target, p)) {\n return Reflect.set(target, p, value, receiver);\n }\n\n return !!set(target, p as any, value, receiver);\n },\n\n deleteProperty(target: any, p: PropertyKey): boolean {\n if (itsOwnProp(target, p) || !remove) {\n return Reflect.deleteProperty(target, p);\n }\n\n return remove(target, p);\n },\n\n defineProperty(target: any, p: PropertyKey, attributes: PropertyDescriptor): boolean {\n return Reflect.defineProperty(target, p, attributes);\n },\n\n ownKeys(target: any) {\n return uniq(Reflect.ownKeys(target).concat((ownKeys && ownKeys(target)) || []));\n },\n ...handlers\n });\n}\n"]}