@tsed/core 6.88.1 → 6.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (504) hide show
  1. package/lib/{decorators → cjs/decorators}/configurable.d.ts +0 -0
  2. package/lib/cjs/decorators/configurable.js +18 -0
  3. package/lib/cjs/decorators/configurable.js.map +1 -0
  4. package/lib/{decorators → cjs/decorators}/deprecated.d.ts +0 -0
  5. package/lib/cjs/decorators/deprecated.js +43 -0
  6. package/lib/cjs/decorators/deprecated.js.map +1 -0
  7. package/lib/{decorators → cjs/decorators}/enumerable.d.ts +0 -0
  8. package/lib/cjs/decorators/enumerable.js +18 -0
  9. package/lib/cjs/decorators/enumerable.js.map +1 -0
  10. package/lib/{decorators → cjs/decorators}/index.d.ts +0 -0
  11. package/lib/cjs/decorators/index.js +18 -0
  12. package/lib/cjs/decorators/index.js.map +1 -0
  13. package/lib/{decorators → cjs/decorators}/notConfigurable.d.ts +0 -0
  14. package/lib/cjs/decorators/notConfigurable.js +13 -0
  15. package/lib/cjs/decorators/notConfigurable.js.map +1 -0
  16. package/lib/{decorators → cjs/decorators}/notEnumerable.d.ts +0 -0
  17. package/lib/cjs/decorators/notEnumerable.js +13 -0
  18. package/lib/cjs/decorators/notEnumerable.js.map +1 -0
  19. package/lib/{decorators → cjs/decorators}/readOnly.d.ts +0 -0
  20. package/lib/cjs/decorators/readOnly.js +13 -0
  21. package/lib/cjs/decorators/readOnly.js.map +1 -0
  22. package/lib/{decorators → cjs/decorators}/storeFn.d.ts +0 -0
  23. package/lib/cjs/decorators/storeFn.js +22 -0
  24. package/lib/cjs/decorators/storeFn.js.map +1 -0
  25. package/lib/{decorators → cjs/decorators}/storeMerge.d.ts +0 -0
  26. package/lib/cjs/decorators/storeMerge.js +11 -0
  27. package/lib/cjs/decorators/storeMerge.js.map +1 -0
  28. package/lib/{decorators → cjs/decorators}/storeSet.d.ts +0 -0
  29. package/lib/cjs/decorators/storeSet.js +11 -0
  30. package/lib/cjs/decorators/storeSet.js.map +1 -0
  31. package/lib/{decorators → cjs/decorators}/writable.d.ts +0 -0
  32. package/lib/cjs/decorators/writable.js +18 -0
  33. package/lib/cjs/decorators/writable.js.map +1 -0
  34. package/lib/{domain → cjs/domain}/AnyToPromise.d.ts +0 -0
  35. package/lib/cjs/domain/AnyToPromise.js +148 -0
  36. package/lib/cjs/domain/AnyToPromise.js.map +1 -0
  37. package/lib/{domain → cjs/domain}/DecoratorTypes.d.ts +0 -0
  38. package/lib/cjs/domain/DecoratorTypes.js +15 -0
  39. package/lib/cjs/domain/DecoratorTypes.js.map +1 -0
  40. package/lib/{domain → cjs/domain}/Env.d.ts +0 -0
  41. package/lib/cjs/domain/Env.js +19 -0
  42. package/lib/cjs/domain/Env.js.map +1 -0
  43. package/lib/{domain → cjs/domain}/Hooks.d.ts +0 -0
  44. package/lib/cjs/domain/Hooks.js +89 -0
  45. package/lib/cjs/domain/Hooks.js.map +1 -0
  46. package/lib/{domain → cjs/domain}/Metadata.d.ts +0 -0
  47. package/lib/cjs/domain/Metadata.js +508 -0
  48. package/lib/cjs/domain/Metadata.js.map +1 -0
  49. package/lib/{domain → cjs/domain}/Store.d.ts +0 -0
  50. package/lib/cjs/domain/Store.js +157 -0
  51. package/lib/cjs/domain/Store.js.map +1 -0
  52. package/lib/{domain → cjs/domain}/Type.d.ts +0 -0
  53. package/lib/cjs/domain/Type.js +7 -0
  54. package/lib/cjs/domain/Type.js.map +1 -0
  55. package/lib/{domain → cjs/domain}/index.d.ts +0 -0
  56. package/lib/cjs/domain/index.js +11 -0
  57. package/lib/cjs/domain/index.js.map +1 -0
  58. package/lib/{errors → cjs/errors}/UnsupportedDecoratorType.d.ts +0 -0
  59. package/lib/cjs/errors/UnsupportedDecoratorType.js +21 -0
  60. package/lib/cjs/errors/UnsupportedDecoratorType.js.map +1 -0
  61. package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
  62. package/lib/cjs/index.js +9 -0
  63. package/lib/cjs/index.js.map +1 -0
  64. package/lib/{interfaces → cjs/interfaces}/AnyDecorator.d.ts +0 -0
  65. package/lib/cjs/interfaces/AnyDecorator.js +3 -0
  66. package/lib/cjs/interfaces/AnyDecorator.js.map +1 -0
  67. package/lib/{interfaces → cjs/interfaces}/DecoratorParameters.d.ts +0 -0
  68. package/lib/cjs/interfaces/DecoratorParameters.js +3 -0
  69. package/lib/cjs/interfaces/DecoratorParameters.js.map +1 -0
  70. package/lib/{interfaces → cjs/interfaces}/HashOf.d.ts +0 -0
  71. package/lib/cjs/interfaces/HashOf.js +3 -0
  72. package/lib/cjs/interfaces/HashOf.js.map +1 -0
  73. package/lib/{interfaces → cjs/interfaces}/MetadataTypes.d.ts +0 -0
  74. package/lib/cjs/interfaces/MetadataTypes.js +3 -0
  75. package/lib/cjs/interfaces/MetadataTypes.js.map +1 -0
  76. package/lib/{interfaces → cjs/interfaces}/ValueOf.d.ts +0 -0
  77. package/lib/cjs/interfaces/ValueOf.js +3 -0
  78. package/lib/cjs/interfaces/ValueOf.js.map +1 -0
  79. package/lib/{interfaces → cjs/interfaces}/index.d.ts +0 -0
  80. package/lib/cjs/interfaces/index.js +3 -0
  81. package/lib/cjs/interfaces/index.js.map +1 -0
  82. package/lib/{utils → cjs/utils}/catchError.d.ts +0 -0
  83. package/lib/cjs/utils/catchError.js +22 -0
  84. package/lib/cjs/utils/catchError.js.map +1 -0
  85. package/lib/{utils → cjs/utils}/decorators/decorateMethodsOf.d.ts +0 -0
  86. package/lib/cjs/utils/decorators/decorateMethodsOf.js +23 -0
  87. package/lib/cjs/utils/decorators/decorateMethodsOf.js.map +1 -0
  88. package/lib/{utils → cjs/utils}/decorators/decoratorArgs.d.ts +0 -0
  89. package/lib/cjs/utils/decorators/decoratorArgs.js +9 -0
  90. package/lib/cjs/utils/decorators/decoratorArgs.js.map +1 -0
  91. package/lib/{utils → cjs/utils}/decorators/decoratorTypeOf.d.ts +0 -0
  92. package/lib/cjs/utils/decorators/decoratorTypeOf.js +23 -0
  93. package/lib/cjs/utils/decorators/decoratorTypeOf.js.map +1 -0
  94. package/lib/{utils → cjs/utils}/decorators/inheritedDescriptorOf.d.ts +0 -0
  95. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js +15 -0
  96. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  97. package/lib/{utils → cjs/utils}/decorators/useDecorators.d.ts +0 -0
  98. package/lib/cjs/utils/decorators/useDecorators.js +14 -0
  99. package/lib/cjs/utils/decorators/useDecorators.js.map +1 -0
  100. package/lib/{utils → cjs/utils}/decorators/useMethodDecorators.d.ts +0 -0
  101. package/lib/cjs/utils/decorators/useMethodDecorators.js +15 -0
  102. package/lib/cjs/utils/decorators/useMethodDecorators.js.map +1 -0
  103. package/lib/{utils → cjs/utils}/imports/importPackage.d.ts +0 -0
  104. package/lib/cjs/utils/imports/importPackage.js +35 -0
  105. package/lib/cjs/utils/imports/importPackage.js.map +1 -0
  106. package/lib/{utils → cjs/utils}/index.d.ts +0 -0
  107. package/lib/cjs/utils/index.js +18 -0
  108. package/lib/cjs/utils/index.js.map +1 -0
  109. package/lib/{utils → cjs/utils}/objects/ancestorOf.d.ts +0 -0
  110. package/lib/cjs/utils/objects/ancestorOf.js +12 -0
  111. package/lib/cjs/utils/objects/ancestorOf.js.map +1 -0
  112. package/lib/{utils → cjs/utils}/objects/ancestorsOf.d.ts +0 -0
  113. package/lib/cjs/utils/objects/ancestorsOf.js +22 -0
  114. package/lib/cjs/utils/objects/ancestorsOf.js.map +1 -0
  115. package/lib/{utils → cjs/utils}/objects/classOf.d.ts +0 -0
  116. package/lib/cjs/utils/objects/classOf.js +23 -0
  117. package/lib/cjs/utils/objects/classOf.js.map +1 -0
  118. package/lib/{utils → cjs/utils}/objects/cleanObject.d.ts +0 -0
  119. package/lib/cjs/utils/objects/cleanObject.js +24 -0
  120. package/lib/cjs/utils/objects/cleanObject.js.map +1 -0
  121. package/lib/{utils → cjs/utils}/objects/constructorOf.d.ts +0 -0
  122. package/lib/cjs/utils/objects/constructorOf.js +20 -0
  123. package/lib/cjs/utils/objects/constructorOf.js.map +1 -0
  124. package/lib/{utils → cjs/utils}/objects/createInstance.d.ts +0 -0
  125. package/lib/cjs/utils/objects/createInstance.js +9 -0
  126. package/lib/cjs/utils/objects/createInstance.js.map +1 -0
  127. package/lib/{utils → cjs/utils}/objects/deepClone.d.ts +0 -0
  128. package/lib/cjs/utils/objects/deepClone.js +57 -0
  129. package/lib/cjs/utils/objects/deepClone.js.map +1 -0
  130. package/lib/{utils → cjs/utils}/objects/deepExtends.d.ts +0 -0
  131. package/lib/cjs/utils/objects/deepExtends.js +79 -0
  132. package/lib/cjs/utils/objects/deepExtends.js.map +1 -0
  133. package/lib/{utils → cjs/utils}/objects/deepMerge.d.ts +0 -0
  134. package/lib/cjs/utils/objects/deepMerge.js +63 -0
  135. package/lib/cjs/utils/objects/deepMerge.js.map +1 -0
  136. package/lib/{utils → cjs/utils}/objects/descriptorOf.d.ts +0 -0
  137. package/lib/cjs/utils/objects/descriptorOf.js +19 -0
  138. package/lib/cjs/utils/objects/descriptorOf.js.map +1 -0
  139. package/lib/{utils → cjs/utils}/objects/getClassOrSymbol.d.ts +0 -0
  140. package/lib/cjs/utils/objects/getClassOrSymbol.js +10 -0
  141. package/lib/cjs/utils/objects/getClassOrSymbol.js.map +1 -0
  142. package/lib/{utils → cjs/utils}/objects/getConstructorArgNames.d.ts +0 -0
  143. package/lib/cjs/utils/objects/getConstructorArgNames.js +9 -0
  144. package/lib/cjs/utils/objects/getConstructorArgNames.js.map +1 -0
  145. package/lib/{utils → cjs/utils}/objects/getEnumerableKeys.d.ts +0 -0
  146. package/lib/cjs/utils/objects/getEnumerableKeys.js +20 -0
  147. package/lib/cjs/utils/objects/getEnumerableKeys.js.map +1 -0
  148. package/lib/{utils → cjs/utils}/objects/getValue.d.ts +0 -0
  149. package/lib/cjs/utils/objects/getValue.js +49 -0
  150. package/lib/cjs/utils/objects/getValue.js.map +1 -0
  151. package/lib/{utils → cjs/utils}/objects/index.d.ts +0 -0
  152. package/lib/cjs/utils/objects/index.js +47 -0
  153. package/lib/cjs/utils/objects/index.js.map +1 -0
  154. package/lib/{utils → cjs/utils}/objects/isArray.d.ts +0 -0
  155. package/lib/cjs/utils/objects/isArray.js +23 -0
  156. package/lib/cjs/utils/objects/isArray.js.map +1 -0
  157. package/lib/{utils → cjs/utils}/objects/isArrowFn.d.ts +0 -0
  158. package/lib/cjs/utils/objects/isArrowFn.js +9 -0
  159. package/lib/cjs/utils/objects/isArrowFn.js.map +1 -0
  160. package/lib/{utils → cjs/utils}/objects/isBoolean.d.ts +0 -0
  161. package/lib/cjs/utils/objects/isBoolean.js +17 -0
  162. package/lib/cjs/utils/objects/isBoolean.js.map +1 -0
  163. package/lib/{utils → cjs/utils}/objects/isClass.d.ts +0 -0
  164. package/lib/cjs/utils/objects/isClass.js +26 -0
  165. package/lib/cjs/utils/objects/isClass.js.map +1 -0
  166. package/lib/{utils → cjs/utils}/objects/isCollection.d.ts +0 -0
  167. package/lib/cjs/utils/objects/isCollection.js +22 -0
  168. package/lib/cjs/utils/objects/isCollection.js.map +1 -0
  169. package/lib/{utils → cjs/utils}/objects/isDate.d.ts +0 -0
  170. package/lib/cjs/utils/objects/isDate.js +13 -0
  171. package/lib/cjs/utils/objects/isDate.js.map +1 -0
  172. package/lib/{utils → cjs/utils}/objects/isEmpty.d.ts +0 -0
  173. package/lib/cjs/utils/objects/isEmpty.js +14 -0
  174. package/lib/cjs/utils/objects/isEmpty.js.map +1 -0
  175. package/lib/{utils → cjs/utils}/objects/isEnumerable.d.ts +0 -0
  176. package/lib/cjs/utils/objects/isEnumerable.js +22 -0
  177. package/lib/cjs/utils/objects/isEnumerable.js.map +1 -0
  178. package/lib/{utils → cjs/utils}/objects/isFunction.d.ts +0 -0
  179. package/lib/cjs/utils/objects/isFunction.js +8 -0
  180. package/lib/cjs/utils/objects/isFunction.js.map +1 -0
  181. package/lib/{utils → cjs/utils}/objects/isInheritedFrom.d.ts +0 -0
  182. package/lib/cjs/utils/objects/isInheritedFrom.js +26 -0
  183. package/lib/cjs/utils/objects/isInheritedFrom.js.map +1 -0
  184. package/lib/{utils → cjs/utils}/objects/isNil.d.ts +0 -0
  185. package/lib/cjs/utils/objects/isNil.js +8 -0
  186. package/lib/cjs/utils/objects/isNil.js.map +1 -0
  187. package/lib/{utils → cjs/utils}/objects/isNumber.d.ts +0 -0
  188. package/lib/cjs/utils/objects/isNumber.js +17 -0
  189. package/lib/cjs/utils/objects/isNumber.js.map +1 -0
  190. package/lib/{utils → cjs/utils}/objects/isObject.d.ts +0 -0
  191. package/lib/cjs/utils/objects/isObject.js +8 -0
  192. package/lib/cjs/utils/objects/isObject.js.map +1 -0
  193. package/lib/{utils → cjs/utils}/objects/isObservable.d.ts +0 -0
  194. package/lib/cjs/utils/objects/isObservable.js +8 -0
  195. package/lib/cjs/utils/objects/isObservable.js.map +1 -0
  196. package/lib/{utils → cjs/utils}/objects/isPlainObject.d.ts +0 -0
  197. package/lib/cjs/utils/objects/isPlainObject.js +18 -0
  198. package/lib/cjs/utils/objects/isPlainObject.js.map +1 -0
  199. package/lib/{utils → cjs/utils}/objects/isPrimitive.d.ts +0 -0
  200. package/lib/cjs/utils/objects/isPrimitive.js +30 -0
  201. package/lib/cjs/utils/objects/isPrimitive.js.map +1 -0
  202. package/lib/{utils → cjs/utils}/objects/isPromise.d.ts +0 -0
  203. package/lib/cjs/utils/objects/isPromise.js +16 -0
  204. package/lib/cjs/utils/objects/isPromise.js.map +1 -0
  205. package/lib/{utils → cjs/utils}/objects/isProtectedKey.d.ts +0 -0
  206. package/lib/cjs/utils/objects/isProtectedKey.js +12 -0
  207. package/lib/cjs/utils/objects/isProtectedKey.js.map +1 -0
  208. package/lib/{utils → cjs/utils}/objects/isSerializable.d.ts +0 -0
  209. package/lib/cjs/utils/objects/isSerializable.js +13 -0
  210. package/lib/cjs/utils/objects/isSerializable.js.map +1 -0
  211. package/lib/{utils → cjs/utils}/objects/isStream.d.ts +0 -0
  212. package/lib/cjs/utils/objects/isStream.js +8 -0
  213. package/lib/cjs/utils/objects/isStream.js.map +1 -0
  214. package/lib/{utils → cjs/utils}/objects/isString.d.ts +0 -0
  215. package/lib/cjs/utils/objects/isString.js +16 -0
  216. package/lib/cjs/utils/objects/isString.js.map +1 -0
  217. package/lib/{utils → cjs/utils}/objects/isSymbol.d.ts +0 -0
  218. package/lib/cjs/utils/objects/isSymbol.js +16 -0
  219. package/lib/cjs/utils/objects/isSymbol.js.map +1 -0
  220. package/lib/{utils → cjs/utils}/objects/methodsOf.d.ts +0 -0
  221. package/lib/cjs/utils/objects/methodsOf.js +25 -0
  222. package/lib/cjs/utils/objects/methodsOf.js.map +1 -0
  223. package/lib/{utils → cjs/utils}/objects/nameOf.d.ts +0 -0
  224. package/lib/cjs/utils/objects/nameOf.js +32 -0
  225. package/lib/cjs/utils/objects/nameOf.js.map +1 -0
  226. package/lib/{utils → cjs/utils}/objects/objectKeys.d.ts +0 -0
  227. package/lib/cjs/utils/objects/objectKeys.js +9 -0
  228. package/lib/cjs/utils/objects/objectKeys.js.map +1 -0
  229. package/lib/{utils → cjs/utils}/objects/primitiveOf.d.ts +0 -0
  230. package/lib/cjs/utils/objects/primitiveOf.js +20 -0
  231. package/lib/cjs/utils/objects/primitiveOf.js.map +1 -0
  232. package/lib/{utils → cjs/utils}/objects/prototypeOf.d.ts +0 -0
  233. package/lib/cjs/utils/objects/prototypeOf.js +14 -0
  234. package/lib/cjs/utils/objects/prototypeOf.js.map +1 -0
  235. package/lib/{utils → cjs/utils}/objects/setValue.d.ts +0 -0
  236. package/lib/cjs/utils/objects/setValue.js +34 -0
  237. package/lib/cjs/utils/objects/setValue.js.map +1 -0
  238. package/lib/{utils → cjs/utils}/objects/toMap.d.ts +0 -0
  239. package/lib/cjs/utils/objects/toMap.js +32 -0
  240. package/lib/cjs/utils/objects/toMap.js.map +1 -0
  241. package/lib/{utils → cjs/utils}/objects/toStringConstructor.d.ts +0 -0
  242. package/lib/cjs/utils/objects/toStringConstructor.js +12 -0
  243. package/lib/cjs/utils/objects/toStringConstructor.js.map +1 -0
  244. package/lib/{utils → cjs/utils}/proxyDelegation.d.ts +0 -0
  245. package/lib/cjs/utils/proxyDelegation.js +54 -0
  246. package/lib/cjs/utils/proxyDelegation.js.map +1 -0
  247. package/lib/{utils → cjs/utils}/uniq.d.ts +0 -0
  248. package/lib/cjs/utils/uniq.js +16 -0
  249. package/lib/cjs/utils/uniq.js.map +1 -0
  250. package/lib/esm/decorators/configurable.js +14 -0
  251. package/lib/esm/decorators/configurable.js.map +1 -0
  252. package/lib/esm/decorators/deprecated.js +39 -0
  253. package/lib/esm/decorators/deprecated.js.map +1 -0
  254. package/lib/esm/decorators/enumerable.js +14 -0
  255. package/lib/esm/decorators/enumerable.js.map +1 -0
  256. package/lib/esm/decorators/index.js +15 -0
  257. package/lib/esm/decorators/index.js.map +1 -0
  258. package/lib/esm/decorators/notConfigurable.js +9 -0
  259. package/lib/esm/decorators/notConfigurable.js.map +1 -0
  260. package/lib/esm/decorators/notEnumerable.js +9 -0
  261. package/lib/esm/decorators/notEnumerable.js.map +1 -0
  262. package/lib/esm/decorators/readOnly.js +9 -0
  263. package/lib/esm/decorators/readOnly.js.map +1 -0
  264. package/lib/esm/decorators/storeFn.js +18 -0
  265. package/lib/esm/decorators/storeFn.js.map +1 -0
  266. package/lib/esm/decorators/storeMerge.js +7 -0
  267. package/lib/esm/decorators/storeMerge.js.map +1 -0
  268. package/lib/esm/decorators/storeSet.js +7 -0
  269. package/lib/esm/decorators/storeSet.js.map +1 -0
  270. package/lib/esm/decorators/writable.js +14 -0
  271. package/lib/esm/decorators/writable.js.map +1 -0
  272. package/lib/esm/domain/AnyToPromise.js +144 -0
  273. package/lib/esm/domain/AnyToPromise.js.map +1 -0
  274. package/lib/esm/domain/DecoratorTypes.js +12 -0
  275. package/lib/esm/domain/DecoratorTypes.js.map +1 -0
  276. package/lib/esm/domain/Env.js +16 -0
  277. package/lib/esm/domain/Env.js.map +1 -0
  278. package/lib/esm/domain/Hooks.js +85 -0
  279. package/lib/esm/domain/Hooks.js.map +1 -0
  280. package/lib/esm/domain/Metadata.js +504 -0
  281. package/lib/esm/domain/Metadata.js.map +1 -0
  282. package/lib/esm/domain/Store.js +153 -0
  283. package/lib/esm/domain/Store.js.map +1 -0
  284. package/lib/esm/domain/Type.js +4 -0
  285. package/lib/esm/domain/Type.js.map +1 -0
  286. package/lib/esm/domain/index.js +8 -0
  287. package/lib/esm/domain/index.js.map +1 -0
  288. package/lib/esm/errors/UnsupportedDecoratorType.js +17 -0
  289. package/lib/esm/errors/UnsupportedDecoratorType.js.map +1 -0
  290. package/lib/esm/index.js +6 -0
  291. package/lib/esm/index.js.map +1 -0
  292. package/lib/esm/interfaces/AnyDecorator.js +2 -0
  293. package/lib/esm/interfaces/AnyDecorator.js.map +1 -0
  294. package/lib/esm/interfaces/DecoratorParameters.js +2 -0
  295. package/lib/esm/interfaces/DecoratorParameters.js.map +1 -0
  296. package/lib/esm/interfaces/HashOf.js +2 -0
  297. package/lib/esm/interfaces/HashOf.js.map +1 -0
  298. package/lib/esm/interfaces/MetadataTypes.js +2 -0
  299. package/lib/esm/interfaces/MetadataTypes.js.map +1 -0
  300. package/lib/esm/interfaces/ValueOf.js +2 -0
  301. package/lib/esm/interfaces/ValueOf.js.map +1 -0
  302. package/lib/esm/interfaces/index.js +2 -0
  303. package/lib/esm/interfaces/index.js.map +1 -0
  304. package/lib/esm/utils/catchError.js +17 -0
  305. package/lib/esm/utils/catchError.js.map +1 -0
  306. package/lib/esm/utils/decorators/decorateMethodsOf.js +19 -0
  307. package/lib/esm/utils/decorators/decorateMethodsOf.js.map +1 -0
  308. package/lib/esm/utils/decorators/decoratorArgs.js +5 -0
  309. package/lib/esm/utils/decorators/decoratorArgs.js.map +1 -0
  310. package/lib/esm/utils/decorators/decoratorTypeOf.js +19 -0
  311. package/lib/esm/utils/decorators/decoratorTypeOf.js.map +1 -0
  312. package/lib/esm/utils/decorators/inheritedDescriptorOf.js +11 -0
  313. package/lib/esm/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  314. package/lib/esm/utils/decorators/useDecorators.js +10 -0
  315. package/lib/esm/utils/decorators/useDecorators.js.map +1 -0
  316. package/lib/esm/utils/decorators/useMethodDecorators.js +10 -0
  317. package/lib/esm/utils/decorators/useMethodDecorators.js.map +1 -0
  318. package/lib/esm/utils/imports/importPackage.js +12 -0
  319. package/lib/esm/utils/imports/importPackage.js.map +1 -0
  320. package/lib/esm/utils/index.js +15 -0
  321. package/lib/esm/utils/index.js.map +1 -0
  322. package/lib/esm/utils/objects/ancestorOf.js +7 -0
  323. package/lib/esm/utils/objects/ancestorOf.js.map +1 -0
  324. package/lib/esm/utils/objects/ancestorsOf.js +18 -0
  325. package/lib/esm/utils/objects/ancestorsOf.js.map +1 -0
  326. package/lib/esm/utils/objects/classOf.js +18 -0
  327. package/lib/esm/utils/objects/classOf.js.map +1 -0
  328. package/lib/esm/utils/objects/cleanObject.js +20 -0
  329. package/lib/esm/utils/objects/cleanObject.js.map +1 -0
  330. package/lib/esm/utils/objects/constructorOf.js +15 -0
  331. package/lib/esm/utils/objects/constructorOf.js.map +1 -0
  332. package/lib/esm/utils/objects/createInstance.js +5 -0
  333. package/lib/esm/utils/objects/createInstance.js.map +1 -0
  334. package/lib/esm/utils/objects/deepClone.js +53 -0
  335. package/lib/esm/utils/objects/deepClone.js.map +1 -0
  336. package/lib/esm/utils/objects/deepExtends.js +75 -0
  337. package/lib/esm/utils/objects/deepExtends.js.map +1 -0
  338. package/lib/esm/utils/objects/deepMerge.js +58 -0
  339. package/lib/esm/utils/objects/deepMerge.js.map +1 -0
  340. package/lib/esm/utils/objects/descriptorOf.js +14 -0
  341. package/lib/esm/utils/objects/descriptorOf.js.map +1 -0
  342. package/lib/esm/utils/objects/getClassOrSymbol.js +6 -0
  343. package/lib/esm/utils/objects/getClassOrSymbol.js.map +1 -0
  344. package/lib/esm/utils/objects/getConstructorArgNames.js +5 -0
  345. package/lib/esm/utils/objects/getConstructorArgNames.js.map +1 -0
  346. package/lib/esm/utils/objects/getEnumerableKeys.js +16 -0
  347. package/lib/esm/utils/objects/getEnumerableKeys.js.map +1 -0
  348. package/lib/esm/utils/objects/getValue.js +45 -0
  349. package/lib/esm/utils/objects/getValue.js.map +1 -0
  350. package/lib/esm/utils/objects/index.js +44 -0
  351. package/lib/esm/utils/objects/index.js.map +1 -0
  352. package/lib/esm/utils/objects/isArray.js +18 -0
  353. package/lib/esm/utils/objects/isArray.js.map +1 -0
  354. package/lib/esm/utils/objects/isArrowFn.js +5 -0
  355. package/lib/esm/utils/objects/isArrowFn.js.map +1 -0
  356. package/lib/esm/utils/objects/isBoolean.js +12 -0
  357. package/lib/esm/utils/objects/isBoolean.js.map +1 -0
  358. package/lib/esm/utils/objects/isClass.js +22 -0
  359. package/lib/esm/utils/objects/isClass.js.map +1 -0
  360. package/lib/esm/utils/objects/isCollection.js +18 -0
  361. package/lib/esm/utils/objects/isCollection.js.map +1 -0
  362. package/lib/esm/utils/objects/isDate.js +9 -0
  363. package/lib/esm/utils/objects/isDate.js.map +1 -0
  364. package/lib/esm/utils/objects/isEmpty.js +10 -0
  365. package/lib/esm/utils/objects/isEmpty.js.map +1 -0
  366. package/lib/esm/utils/objects/isEnumerable.js +18 -0
  367. package/lib/esm/utils/objects/isEnumerable.js.map +1 -0
  368. package/lib/esm/utils/objects/isFunction.js +4 -0
  369. package/lib/esm/utils/objects/isFunction.js.map +1 -0
  370. package/lib/esm/utils/objects/isInheritedFrom.js +22 -0
  371. package/lib/esm/utils/objects/isInheritedFrom.js.map +1 -0
  372. package/lib/esm/utils/objects/isNil.js +4 -0
  373. package/lib/esm/utils/objects/isNil.js.map +1 -0
  374. package/lib/esm/utils/objects/isNumber.js +12 -0
  375. package/lib/esm/utils/objects/isNumber.js.map +1 -0
  376. package/lib/esm/utils/objects/isObject.js +4 -0
  377. package/lib/esm/utils/objects/isObject.js.map +1 -0
  378. package/lib/esm/utils/objects/isObservable.js +4 -0
  379. package/lib/esm/utils/objects/isObservable.js.map +1 -0
  380. package/lib/esm/utils/objects/isPlainObject.js +13 -0
  381. package/lib/esm/utils/objects/isPlainObject.js.map +1 -0
  382. package/lib/esm/utils/objects/isPrimitive.js +24 -0
  383. package/lib/esm/utils/objects/isPrimitive.js.map +1 -0
  384. package/lib/esm/utils/objects/isPromise.js +12 -0
  385. package/lib/esm/utils/objects/isPromise.js.map +1 -0
  386. package/lib/esm/utils/objects/isProtectedKey.js +8 -0
  387. package/lib/esm/utils/objects/isProtectedKey.js.map +1 -0
  388. package/lib/esm/utils/objects/isSerializable.js +9 -0
  389. package/lib/esm/utils/objects/isSerializable.js.map +1 -0
  390. package/lib/esm/utils/objects/isStream.js +4 -0
  391. package/lib/esm/utils/objects/isStream.js.map +1 -0
  392. package/lib/esm/utils/objects/isString.js +11 -0
  393. package/lib/esm/utils/objects/isString.js.map +1 -0
  394. package/lib/esm/utils/objects/isSymbol.js +11 -0
  395. package/lib/esm/utils/objects/isSymbol.js.map +1 -0
  396. package/lib/esm/utils/objects/methodsOf.js +21 -0
  397. package/lib/esm/utils/objects/methodsOf.js.map +1 -0
  398. package/lib/esm/utils/objects/nameOf.js +26 -0
  399. package/lib/esm/utils/objects/nameOf.js.map +1 -0
  400. package/lib/esm/utils/objects/objectKeys.js +5 -0
  401. package/lib/esm/utils/objects/objectKeys.js.map +1 -0
  402. package/lib/esm/utils/objects/primitiveOf.js +16 -0
  403. package/lib/esm/utils/objects/primitiveOf.js.map +1 -0
  404. package/lib/esm/utils/objects/prototypeOf.js +10 -0
  405. package/lib/esm/utils/objects/prototypeOf.js.map +1 -0
  406. package/lib/esm/utils/objects/setValue.js +30 -0
  407. package/lib/esm/utils/objects/setValue.js.map +1 -0
  408. package/lib/esm/utils/objects/toMap.js +28 -0
  409. package/lib/esm/utils/objects/toMap.js.map +1 -0
  410. package/lib/esm/utils/objects/toStringConstructor.js +8 -0
  411. package/lib/esm/utils/objects/toStringConstructor.js.map +1 -0
  412. package/lib/esm/utils/proxyDelegation.js +50 -0
  413. package/lib/esm/utils/proxyDelegation.js.map +1 -0
  414. package/lib/esm/utils/uniq.js +11 -0
  415. package/lib/esm/utils/uniq.js.map +1 -0
  416. package/lib/types/decorators/configurable.d.ts +2 -0
  417. package/lib/types/decorators/deprecated.d.ts +32 -0
  418. package/lib/types/decorators/enumerable.d.ts +2 -0
  419. package/lib/types/decorators/index.d.ts +14 -0
  420. package/lib/types/decorators/notConfigurable.d.ts +2 -0
  421. package/lib/types/decorators/notEnumerable.d.ts +2 -0
  422. package/lib/types/decorators/readOnly.d.ts +2 -0
  423. package/lib/types/decorators/storeFn.d.ts +9 -0
  424. package/lib/types/decorators/storeMerge.d.ts +1 -0
  425. package/lib/types/decorators/storeSet.d.ts +1 -0
  426. package/lib/types/decorators/writable.d.ts +2 -0
  427. package/lib/types/domain/AnyToPromise.d.ts +42 -0
  428. package/lib/types/domain/DecoratorTypes.d.ts +10 -0
  429. package/lib/types/domain/Env.d.ts +13 -0
  430. package/lib/types/domain/Hooks.d.ts +45 -0
  431. package/lib/types/domain/Metadata.d.ts +442 -0
  432. package/lib/types/domain/Store.d.ts +69 -0
  433. package/lib/types/domain/Type.d.ts +11 -0
  434. package/lib/types/domain/index.d.ts +7 -0
  435. package/lib/types/errors/UnsupportedDecoratorType.d.ts +5 -0
  436. package/lib/types/index.d.ts +6 -0
  437. package/lib/types/interfaces/AnyDecorator.d.ts +1 -0
  438. package/lib/types/interfaces/DecoratorParameters.d.ts +3 -0
  439. package/lib/types/interfaces/HashOf.d.ts +1 -0
  440. package/lib/types/interfaces/MetadataTypes.d.ts +5 -0
  441. package/lib/types/interfaces/ValueOf.d.ts +1 -0
  442. package/lib/types/interfaces/index.d.ts +4 -0
  443. package/lib/types/utils/catchError.d.ts +2 -0
  444. package/lib/types/utils/decorators/decorateMethodsOf.d.ts +1 -0
  445. package/lib/types/utils/decorators/decoratorArgs.d.ts +2 -0
  446. package/lib/types/utils/decorators/decoratorTypeOf.d.ts +2 -0
  447. package/lib/types/utils/decorators/inheritedDescriptorOf.d.ts +1 -0
  448. package/lib/types/utils/decorators/useDecorators.d.ts +2 -0
  449. package/lib/types/utils/decorators/useMethodDecorators.d.ts +3 -0
  450. package/lib/types/utils/imports/importPackage.d.ts +1 -0
  451. package/lib/types/utils/index.d.ts +12 -0
  452. package/lib/types/utils/objects/ancestorOf.d.ts +2 -0
  453. package/lib/types/utils/objects/ancestorsOf.d.ts +6 -0
  454. package/lib/types/utils/objects/classOf.d.ts +13 -0
  455. package/lib/types/utils/objects/cleanObject.d.ts +6 -0
  456. package/lib/types/utils/objects/constructorOf.d.ts +11 -0
  457. package/lib/types/utils/objects/createInstance.d.ts +1 -0
  458. package/lib/types/utils/objects/deepClone.d.ts +6 -0
  459. package/lib/types/utils/objects/deepExtends.d.ts +10 -0
  460. package/lib/types/utils/objects/deepMerge.d.ts +9 -0
  461. package/lib/types/utils/objects/descriptorOf.d.ts +8 -0
  462. package/lib/types/utils/objects/getClassOrSymbol.d.ts +1 -0
  463. package/lib/types/utils/objects/getConstructorArgNames.d.ts +1 -0
  464. package/lib/types/utils/objects/getEnumerableKeys.d.ts +5 -0
  465. package/lib/types/utils/objects/getValue.d.ts +32 -0
  466. package/lib/types/utils/objects/index.d.ts +43 -0
  467. package/lib/types/utils/objects/isArray.d.ts +13 -0
  468. package/lib/types/utils/objects/isArrowFn.d.ts +1 -0
  469. package/lib/types/utils/objects/isBoolean.d.ts +7 -0
  470. package/lib/types/utils/objects/isClass.d.ts +1 -0
  471. package/lib/types/utils/objects/isCollection.d.ts +6 -0
  472. package/lib/types/utils/objects/isDate.d.ts +6 -0
  473. package/lib/types/utils/objects/isEmpty.d.ts +6 -0
  474. package/lib/types/utils/objects/isEnumerable.d.ts +6 -0
  475. package/lib/types/utils/objects/isFunction.d.ts +1 -0
  476. package/lib/types/utils/objects/isInheritedFrom.d.ts +1 -0
  477. package/lib/types/utils/objects/isNil.d.ts +1 -0
  478. package/lib/types/utils/objects/isNumber.d.ts +7 -0
  479. package/lib/types/utils/objects/isObject.d.ts +1 -0
  480. package/lib/types/utils/objects/isObservable.d.ts +1 -0
  481. package/lib/types/utils/objects/isPlainObject.d.ts +7 -0
  482. package/lib/types/utils/objects/isPrimitive.d.ts +14 -0
  483. package/lib/types/utils/objects/isPromise.d.ts +7 -0
  484. package/lib/types/utils/objects/isProtectedKey.d.ts +5 -0
  485. package/lib/types/utils/objects/isSerializable.d.ts +1 -0
  486. package/lib/types/utils/objects/isStream.d.ts +1 -0
  487. package/lib/types/utils/objects/isString.d.ts +6 -0
  488. package/lib/types/utils/objects/isSymbol.d.ts +6 -0
  489. package/lib/types/utils/objects/methodsOf.d.ts +5 -0
  490. package/lib/types/utils/objects/nameOf.d.ts +14 -0
  491. package/lib/types/utils/objects/objectKeys.d.ts +1 -0
  492. package/lib/types/utils/objects/primitiveOf.d.ts +1 -0
  493. package/lib/types/utils/objects/prototypeOf.d.ts +6 -0
  494. package/lib/types/utils/objects/setValue.d.ts +1 -0
  495. package/lib/types/utils/objects/toMap.d.ts +3 -0
  496. package/lib/types/utils/objects/toStringConstructor.d.ts +1 -0
  497. package/lib/types/utils/proxyDelegation.d.ts +33 -0
  498. package/lib/types/utils/uniq.d.ts +2 -0
  499. package/package.json +10 -6
  500. package/tsconfig.compile.esm.json +23 -0
  501. package/lib/index.js +0 -2317
  502. package/lib/index.js.map +0 -1
  503. package/lib/index.modern.js +0 -2207
  504. package/lib/index.modern.js.map +0 -1
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Get the class constructor
3
+ * @param target
4
+ */
5
+ export function getConstructor(target) {
6
+ return typeof target === "function" ? target : target.constructor;
7
+ }
8
+ /**
9
+ * Get the class constructor
10
+ * @param target
11
+ */
12
+ export function constructorOf(target) {
13
+ return getConstructor(target);
14
+ }
15
+ //# sourceMappingURL=constructorOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constructorOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/constructorOf.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAW;IACxC,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;AACpE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,MAAW;IACvC,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC","sourcesContent":["import type {Type} from \"../../domain/Type\";\n\n/**\n * Get the class constructor\n * @param target\n */\nexport function getConstructor(target: any): Type<any> {\n return typeof target === \"function\" ? target : target.constructor;\n}\n\n/**\n * Get the class constructor\n * @param target\n */\nexport function constructorOf(target: any): Type<any> {\n return getConstructor(target);\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { classOf } from "./classOf";
2
+ export function createInstance(obj) {
3
+ return obj ? (classOf(obj) !== Object ? Object.create(obj) : {}) : {};
4
+ }
5
+ //# sourceMappingURL=createInstance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createInstance.js","sourceRoot":"","sources":["../../../../src/utils/objects/createInstance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,cAAc,CAAC,GAAQ;IACrC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACxE,CAAC","sourcesContent":["import {classOf} from \"./classOf\";\n\nexport function createInstance(obj: any) {\n return obj ? (classOf(obj) !== Object ? Object.create(obj) : {}) : {};\n}\n"]}
@@ -0,0 +1,53 @@
1
+ import { isArray } from "./isArray";
2
+ import { isDate } from "./isDate";
3
+ import { isFunction } from "./isFunction";
4
+ import { isNil } from "./isNil";
5
+ import { isPrimitive } from "./isPrimitive";
6
+ import { isSymbol } from "./isSymbol";
7
+ const isBasicType = (source) => isNil(source) || isPrimitive(source) || isSymbol(source) || isFunction(source);
8
+ /**
9
+ * Return a cloned value
10
+ * @param source
11
+ * @param stack
12
+ */
13
+ export function deepClone(source, stack = new WeakMap()) {
14
+ let dest;
15
+ if (isBasicType(source)) {
16
+ return source;
17
+ }
18
+ if (isDate(source)) {
19
+ return new Date(source);
20
+ }
21
+ const stacked = stack.get(source);
22
+ if (stacked) {
23
+ // See issue #1619
24
+ // istanbul ignore next
25
+ process.env.TSED_TRACK_CIRCULAR_REF && console.trace("Circular ref detected on deepClone", stacked);
26
+ return stacked;
27
+ }
28
+ if (isArray(source)) {
29
+ dest = [];
30
+ }
31
+ else {
32
+ dest = {};
33
+ stack.set(source, dest);
34
+ }
35
+ for (const key in source) {
36
+ // Use getOwnPropertyDescriptor instead of source[key] to prevent from triggering setter/getter.
37
+ const descriptor = Object.getOwnPropertyDescriptor(source, key);
38
+ if (descriptor) {
39
+ if (!isFunction(descriptor.value)) {
40
+ dest[key] = deepClone(descriptor.value, stack);
41
+ }
42
+ else {
43
+ Object.defineProperty(dest, key, descriptor);
44
+ }
45
+ }
46
+ }
47
+ if (!isArray(source)) {
48
+ const prototype = Reflect.getPrototypeOf(source);
49
+ Reflect.setPrototypeOf(dest, prototype);
50
+ }
51
+ return dest;
52
+ }
53
+ //# sourceMappingURL=deepClone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepClone.js","sourceRoot":"","sources":["../../../../src/utils/objects/deepClone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,WAAW,GAAG,CAAC,MAAW,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAEpH;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,MAAW,EAAE,KAAK,GAAG,IAAI,OAAO,EAAE;IAC1D,IAAI,IAAS,CAAC;IAEd,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;QACvB,OAAO,MAAM,CAAC;KACf;IAED,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE;QAClB,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;KACzB;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAElC,IAAI,OAAO,EAAE;QACX,kBAAkB;QAClB,uBAAuB;QACvB,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;QACpG,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;QACnB,IAAI,GAAG,EAAE,CAAC;KACX;SAAM;QACL,IAAI,GAAG,EAAE,CAAC;QACV,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KACzB;IAED,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACxB,gGAAgG;QAChG,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAE,CAAC;QAEjE,IAAI,UAAU,EAAE;YACd,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;gBACjC,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;aAChD;iBAAM;gBACL,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;aAC9C;SACF;KACF;IAED,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACpB,MAAM,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACjD,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;KACzC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {isArray} from \"./isArray\";\nimport {isDate} from \"./isDate\";\nimport {isFunction} from \"./isFunction\";\nimport {isNil} from \"./isNil\";\nimport {isPrimitive} from \"./isPrimitive\";\nimport {isSymbol} from \"./isSymbol\";\n\nconst isBasicType = (source: any) => isNil(source) || isPrimitive(source) || isSymbol(source) || isFunction(source);\n\n/**\n * Return a cloned value\n * @param source\n * @param stack\n */\nexport function deepClone(source: any, stack = new WeakMap()): any {\n let dest: any;\n\n if (isBasicType(source)) {\n return source;\n }\n\n if (isDate(source)) {\n return new Date(source);\n }\n\n const stacked = stack.get(source);\n\n if (stacked) {\n // See issue #1619\n // istanbul ignore next\n process.env.TSED_TRACK_CIRCULAR_REF && console.trace(\"Circular ref detected on deepClone\", stacked);\n return stacked;\n }\n\n if (isArray(source)) {\n dest = [];\n } else {\n dest = {};\n stack.set(source, dest);\n }\n\n for (const key in source) {\n // Use getOwnPropertyDescriptor instead of source[key] to prevent from triggering setter/getter.\n const descriptor = Object.getOwnPropertyDescriptor(source, key)!;\n\n if (descriptor) {\n if (!isFunction(descriptor.value)) {\n dest[key] = deepClone(descriptor.value, stack);\n } else {\n Object.defineProperty(dest, key, descriptor);\n }\n }\n }\n\n if (!isArray(source)) {\n const prototype = Reflect.getPrototypeOf(source);\n Reflect.setPrototypeOf(dest, prototype);\n }\n\n return dest;\n}\n"]}
@@ -0,0 +1,75 @@
1
+ import { createInstance } from "./createInstance";
2
+ import { isArrayOrArrayClass } from "./isArray";
3
+ import { isPrimitive } from "./isPrimitive";
4
+ import { objectKeys } from "./objectKeys";
5
+ function reducer() {
6
+ return (collection, value) => {
7
+ collection.indexOf(value) === -1 && collection.push(value);
8
+ return collection;
9
+ };
10
+ }
11
+ /**
12
+ * Deep extends a model with another one.
13
+ * @param out
14
+ * @param obj
15
+ * @param reducers
16
+ * @returns {any}
17
+ * @deprecated Since 2021-07-16. Use deepMerge instead of
18
+ */
19
+ export function deepExtends(out, obj, reducers = {}) {
20
+ if (obj === undefined || obj === null) {
21
+ return out;
22
+ }
23
+ if (isPrimitive(obj) || typeof obj === "symbol" || typeof obj === "function") {
24
+ return obj;
25
+ }
26
+ if (isArrayOrArrayClass(obj)) {
27
+ out = out || [];
28
+ }
29
+ else {
30
+ out = out || createInstance(obj);
31
+ }
32
+ const defaultReducer = reducers["default"] ? reducers["default"] : reducer();
33
+ const set = (key, value) => {
34
+ if (isArrayOrArrayClass(obj)) {
35
+ out.indexOf(value) === -1 && out.push(value);
36
+ }
37
+ else {
38
+ out[key] = value;
39
+ }
40
+ };
41
+ objectKeys(obj).forEach((key) => {
42
+ let value = obj[key];
43
+ // istanbul ignore next
44
+ if (value === undefined || value === null) {
45
+ return;
46
+ }
47
+ // istanbul ignore next
48
+ if (value === "" && out[key] !== "") {
49
+ return;
50
+ }
51
+ if (isPrimitive(value) || typeof value === "function") {
52
+ set(key, value);
53
+ return;
54
+ }
55
+ if (isArrayOrArrayClass(value)) {
56
+ value = value.map((value) => deepExtends(undefined, value));
57
+ set(key, []
58
+ .concat(out[key] || [], value)
59
+ .reduce((collection, value) => (reducers[key] ? reducers[key](collection, value) : defaultReducer(collection, value)), []));
60
+ return;
61
+ }
62
+ // Object
63
+ if (isArrayOrArrayClass(obj)) {
64
+ set(key, deepExtends(undefined, value, reducers));
65
+ }
66
+ else {
67
+ set(key, deepExtends(out[key], value, reducers));
68
+ }
69
+ });
70
+ if (isArrayOrArrayClass(out)) {
71
+ out.reduce((collection, value) => defaultReducer(collection, value), []);
72
+ }
73
+ return out;
74
+ }
75
+ //# sourceMappingURL=deepExtends.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepExtends.js","sourceRoot":"","sources":["../../../../src/utils/objects/deepExtends.ts"],"names":[],"mappings":"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","sourcesContent":["import {createInstance} from \"./createInstance\";\nimport {isArrayOrArrayClass} from \"./isArray\";\nimport {isPrimitive} from \"./isPrimitive\";\nimport {objectKeys} from \"./objectKeys\";\n\nexport type DeepExtendsReducers = Record<string, (collection: any[], value: any) => any>;\n\nfunction reducer() {\n return (collection: any[], value: any) => {\n collection.indexOf(value) === -1 && collection.push(value);\n\n return collection;\n };\n}\n\n/**\n * Deep extends a model with another one.\n * @param out\n * @param obj\n * @param reducers\n * @returns {any}\n * @deprecated Since 2021-07-16. Use deepMerge instead of\n */\nexport function deepExtends(out: any, obj: any, reducers: DeepExtendsReducers = {}): any {\n if (obj === undefined || obj === null) {\n return out;\n }\n\n if (isPrimitive(obj) || typeof obj === \"symbol\" || typeof obj === \"function\") {\n return obj;\n }\n\n if (isArrayOrArrayClass(obj)) {\n out = out || [];\n } else {\n out = out || createInstance(obj);\n }\n\n const defaultReducer = reducers[\"default\"] ? reducers[\"default\"] : reducer();\n\n const set = (key: string | number, value: any) => {\n if (isArrayOrArrayClass(obj)) {\n out.indexOf(value) === -1 && out.push(value);\n } else {\n out[key] = value;\n }\n };\n\n objectKeys(obj).forEach((key) => {\n let value = obj[key];\n\n // istanbul ignore next\n if (value === undefined || value === null) {\n return;\n }\n\n // istanbul ignore next\n if (value === \"\" && out[key] !== \"\") {\n return;\n }\n\n if (isPrimitive(value) || typeof value === \"function\") {\n set(key, value);\n\n return;\n }\n\n if (isArrayOrArrayClass(value)) {\n value = value.map((value: any) => deepExtends(undefined, value));\n\n set(\n key,\n []\n .concat(out[key] || [], value)\n .reduce(\n (collection: any[], value: any) => (reducers[key] ? reducers[key](collection, value) : defaultReducer(collection, value)),\n []\n )\n );\n\n return;\n }\n\n // Object\n if (isArrayOrArrayClass(obj)) {\n set(key, deepExtends(undefined, value, reducers));\n } else {\n set(key, deepExtends(out[key], value, reducers));\n }\n });\n\n if (isArrayOrArrayClass(out)) {\n out.reduce((collection: any[], value: any) => defaultReducer(collection, value), []);\n }\n\n return out;\n}\n"]}
@@ -0,0 +1,58 @@
1
+ import { createInstance } from "./createInstance";
2
+ import { isFunction } from "./isFunction";
3
+ import { isPrimitive } from "./isPrimitive";
4
+ import { isSymbol } from "./isSymbol";
5
+ import { objectKeys } from "./objectKeys";
6
+ export function mergeReducerBuilder(cb) {
7
+ return (collection, value, options) => {
8
+ const index = collection.findIndex((item) => cb(item, value));
9
+ if (index === -1) {
10
+ return [...collection, value];
11
+ }
12
+ collection[index] = deepMerge(collection[index], value, options);
13
+ return collection;
14
+ };
15
+ }
16
+ const defaultReducer = mergeReducerBuilder((a, b) => a === b);
17
+ function getReducer({ reducers, parentKey }) {
18
+ if (!reducers) {
19
+ return defaultReducer;
20
+ }
21
+ if (parentKey && reducers[parentKey]) {
22
+ return reducers[parentKey];
23
+ }
24
+ return reducers["default"] || defaultReducer;
25
+ }
26
+ function shouldReturnObj(obj, source) {
27
+ return isPrimitive(obj) || isSymbol(obj) || isFunction(obj) || source === undefined;
28
+ }
29
+ function shouldReturnSource(obj, source) {
30
+ return obj === undefined || obj === null || (obj === "" && source !== "");
31
+ }
32
+ export function deepMerge(source, obj, options = {}) {
33
+ if (shouldReturnSource(obj, source)) {
34
+ return source;
35
+ }
36
+ if (shouldReturnObj(obj, source)) {
37
+ return obj;
38
+ }
39
+ if (Array.isArray(source)) {
40
+ const reducer = getReducer(options);
41
+ return [].concat(obj).reduce((out, value) => reducer(out, value, options), [...source]);
42
+ }
43
+ return [...objectKeys(source), ...objectKeys(obj)].reduce((out, key) => {
44
+ const src = source && source[key];
45
+ const value = deepMerge(src, obj && obj[key], {
46
+ ...options,
47
+ parentKey: key
48
+ });
49
+ if (options.cleanUndefinedProps && value === undefined) {
50
+ return out;
51
+ }
52
+ return {
53
+ ...out,
54
+ [key]: value
55
+ };
56
+ }, createInstance(source));
57
+ }
58
+ //# sourceMappingURL=deepMerge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepMerge.js","sourceRoot":"","sources":["../../../../src/utils/objects/deepMerge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAWxC,MAAM,UAAU,mBAAmB,CAAC,EAAyB;IAC3D,OAAO,CAAC,UAAiB,EAAE,KAAU,EAAE,OAAyB,EAAE,EAAE;QAClE,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QAE9D,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,OAAO,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,CAAC;SAC/B;QAED,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAEjE,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAE9D,SAAS,UAAU,CAAC,EAAC,QAAQ,EAAE,SAAS,EAAmB;IACzD,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,cAAc,CAAC;KACvB;IAED,IAAI,SAAS,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE;QACpC,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC;KAC5B;IAED,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,cAAc,CAAC;AAC/C,CAAC;AAED,SAAS,eAAe,CAAC,GAAQ,EAAE,MAAW;IAC5C,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,MAAM,KAAK,SAAS,CAAC;AACtF,CAAC;AAED,SAAS,kBAAkB,CAAC,GAAQ,EAAE,MAAW;IAC/C,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,GAAG,KAAK,EAAE,IAAI,MAAM,KAAK,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,MAAe,EACf,GAAY,EACZ,UAA4B,EAAE;IAE9B,IAAI,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE;QACnC,OAAO,MAAa,CAAC;KACtB;IAED,IAAI,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE;QAChC,OAAO,GAAG,CAAC;KACZ;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAEpC,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAU,EAAE,KAAU,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;KACrG;IAED,OAAO,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAQ,EAAE,GAAW,EAAE,EAAE;QAClF,MAAM,GAAG,GAAG,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;YAC5C,GAAG,OAAO;YACV,SAAS,EAAE,GAAG;SACf,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,mBAAmB,IAAI,KAAK,KAAK,SAAS,EAAE;YACtD,OAAO,GAAG,CAAC;SACZ;QAED,OAAO;YACL,GAAG,GAAG;YACN,CAAC,GAAG,CAAC,EAAE,KAAK;SACb,CAAC;IACJ,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import {createInstance} from \"./createInstance\";\nimport {isFunction} from \"./isFunction\";\nimport {isPrimitive} from \"./isPrimitive\";\nimport {isSymbol} from \"./isSymbol\";\nimport {objectKeys} from \"./objectKeys\";\n\nexport type DeepMergeReducerCB = (collection: any[], value: any, options?: DeepMergeOptions) => any;\nexport type DeepMergeComparatorCB = (item: any, ref: any) => boolean;\n\nexport interface DeepMergeOptions {\n reducers?: Record<string, DeepMergeReducerCB>;\n parentKey?: string;\n cleanUndefinedProps?: boolean;\n}\n\nexport function mergeReducerBuilder(cb: DeepMergeComparatorCB) {\n return (collection: any[], value: any, options: DeepMergeOptions) => {\n const index = collection.findIndex((item) => cb(item, value));\n\n if (index === -1) {\n return [...collection, value];\n }\n\n collection[index] = deepMerge(collection[index], value, options);\n\n return collection;\n };\n}\n\nconst defaultReducer = mergeReducerBuilder((a, b) => a === b);\n\nfunction getReducer({reducers, parentKey}: DeepMergeOptions) {\n if (!reducers) {\n return defaultReducer;\n }\n\n if (parentKey && reducers[parentKey]) {\n return reducers[parentKey];\n }\n\n return reducers[\"default\"] || defaultReducer;\n}\n\nfunction shouldReturnObj(obj: any, source: any) {\n return isPrimitive(obj) || isSymbol(obj) || isFunction(obj) || source === undefined;\n}\n\nfunction shouldReturnSource(obj: any, source: any) {\n return obj === undefined || obj === null || (obj === \"\" && source !== \"\");\n}\n\nexport function deepMerge<T extends any = any, C extends any = any>(\n source: T & any,\n obj: C & any,\n options: DeepMergeOptions = {}\n): (T & C) | undefined | null {\n if (shouldReturnSource(obj, source)) {\n return source as any;\n }\n\n if (shouldReturnObj(obj, source)) {\n return obj;\n }\n\n if (Array.isArray(source)) {\n const reducer = getReducer(options);\n\n return [].concat(obj).reduce((out: any[], value: any) => reducer(out, value, options), [...source]);\n }\n\n return [...objectKeys(source), ...objectKeys(obj)].reduce((out: any, key: string) => {\n const src = source && source[key];\n const value = deepMerge(src, obj && obj[key], {\n ...options,\n parentKey: key\n });\n\n if (options.cleanUndefinedProps && value === undefined) {\n return out;\n }\n\n return {\n ...out,\n [key]: value\n };\n }, createInstance(source));\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Return the descriptor for a given class and propertyKey
3
+ * @param target
4
+ * @param {string} propertyKey
5
+ * @returns {PropertyDescriptor}
6
+ */
7
+ export function descriptorOf(target, propertyKey) {
8
+ return Object.getOwnPropertyDescriptor((target && target.prototype) || target, propertyKey);
9
+ }
10
+ export function isMethodDescriptor(target, propertyKey) {
11
+ var _a;
12
+ return (_a = descriptorOf(target, propertyKey)) === null || _a === void 0 ? void 0 : _a.value;
13
+ }
14
+ //# sourceMappingURL=descriptorOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptorOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/descriptorOf.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,MAAW,EAAE,WAA4B;IACpE,OAAO,MAAM,CAAC,wBAAwB,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,CAAE,CAAC;AAC/F,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAW,EAAE,WAA4B;;IAC1E,OAAO,MAAA,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,0CAAE,KAAK,CAAC;AAClD,CAAC","sourcesContent":["/**\n * Return the descriptor for a given class and propertyKey\n * @param target\n * @param {string} propertyKey\n * @returns {PropertyDescriptor}\n */\nexport function descriptorOf(target: any, propertyKey: string | symbol): PropertyDescriptor {\n return Object.getOwnPropertyDescriptor((target && target.prototype) || target, propertyKey)!;\n}\n\nexport function isMethodDescriptor(target: any, propertyKey: string | symbol) {\n return descriptorOf(target, propertyKey)?.value;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { classOf } from "./classOf";
2
+ import { isClass } from "./isClass";
3
+ export function getClassOrSymbol(target) {
4
+ return isClass(target) ? classOf(target) : target;
5
+ }
6
+ //# sourceMappingURL=getClassOrSymbol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getClassOrSymbol.js","sourceRoot":"","sources":["../../../../src/utils/objects/getClassOrSymbol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,gBAAgB,CAAC,MAAW;IAC1C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACpD,CAAC","sourcesContent":["import {classOf} from \"./classOf\";\nimport {isClass} from \"./isClass\";\n\nexport function getClassOrSymbol(target: any): any {\n return isClass(target) ? classOf(target) : target;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { toStringConstructor } from "./toStringConstructor";
2
+ export function getConstructorArgNames(target) {
3
+ return toStringConstructor(target).replace("constructor(", "").replace(")", "").split(", ").filter(Boolean);
4
+ }
5
+ //# sourceMappingURL=getConstructorArgNames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getConstructorArgNames.js","sourceRoot":"","sources":["../../../../src/utils/objects/getConstructorArgNames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,MAAM,UAAU,sBAAsB,CAAC,MAAW;IAChD,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC9G,CAAC","sourcesContent":["import {toStringConstructor} from \"./toStringConstructor\";\n\nexport function getConstructorArgNames(target: any) {\n return toStringConstructor(target).replace(\"constructor(\", \"\").replace(\")\", \"\").split(\", \").filter(Boolean);\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { isEnumerable } from "./isEnumerable";
2
+ import { isProtectedKey } from "./isProtectedKey";
3
+ /**
4
+ * Return all enumerable keys of the given object
5
+ * @param obj
6
+ */
7
+ export function getEnumerableKeys(obj) {
8
+ const keys = [];
9
+ for (const key in obj) {
10
+ if (!isProtectedKey(key) && isEnumerable(obj, key)) {
11
+ keys.push(key);
12
+ }
13
+ }
14
+ return keys;
15
+ }
16
+ //# sourceMappingURL=getEnumerableKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEnumerableKeys.js","sourceRoot":"","sources":["../../../../src/utils/objects/getEnumerableKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAQ;IACxC,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACrB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;YAClD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAChB;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {isEnumerable} from \"./isEnumerable\";\nimport {isProtectedKey} from \"./isProtectedKey\";\n\n/**\n * Return all enumerable keys of the given object\n * @param obj\n */\nexport function getEnumerableKeys(obj: any) {\n const keys: string[] = [];\n\n for (const key in obj) {\n if (!isProtectedKey(key) && isEnumerable(obj, key)) {\n keys.push(key);\n }\n }\n\n return keys;\n}\n"]}
@@ -0,0 +1,45 @@
1
+ import { isFunction } from "./isFunction";
2
+ import { isObject } from "./isObject";
3
+ import { isString } from "./isString";
4
+ const mapOptions = (args) => {
5
+ const [expression, scope, defaultValue, separator = "."] = args;
6
+ if (isObject(scope) || isString(expression)) {
7
+ return {
8
+ expression,
9
+ scope,
10
+ defaultValue,
11
+ separator
12
+ };
13
+ }
14
+ return {
15
+ expression: scope,
16
+ scope: expression,
17
+ defaultValue,
18
+ separator
19
+ };
20
+ };
21
+ export function getValue(...args) {
22
+ const options = mapOptions(args);
23
+ let scope = options.scope;
24
+ const { expression, defaultValue, separator } = options;
25
+ if (!expression) {
26
+ return scope;
27
+ }
28
+ if (!scope) {
29
+ return defaultValue;
30
+ }
31
+ const keys = expression.split(separator);
32
+ const getValue = (key) => {
33
+ if (scope) {
34
+ if (scope[key] !== undefined || key in scope) {
35
+ return scope[key];
36
+ }
37
+ if (isFunction(scope.get)) {
38
+ return scope.get(key);
39
+ }
40
+ }
41
+ };
42
+ while ((scope = getValue(keys.shift())) && keys.length) { }
43
+ return scope === undefined ? defaultValue : scope;
44
+ }
45
+ //# sourceMappingURL=getValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getValue.js","sourceRoot":"","sources":["../../../../src/utils/objects/getValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,UAAU,GAAG,CAAC,IAAW,EAAE,EAAE;IACjC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;IAEhE,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,EAAE;QAC3C,OAAO;YACL,UAAU;YACV,KAAK;YACL,YAAY;YACZ,SAAS;SACV,CAAC;KACH;IAED,OAAO;QACL,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,UAAU;QACjB,YAAY;QACZ,SAAS;KACV,CAAC;AACJ,CAAC,CAAC;AAkCF,MAAM,UAAU,QAAQ,CAAC,GAAG,IAAW;IACrC,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC1B,MAAM,EAAC,UAAU,EAAE,YAAY,EAAE,SAAS,EAAC,GAAG,OAAO,CAAC;IAEtD,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,YAAY,CAAC;KACrB;IAED,MAAM,IAAI,GAAa,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE;QAC/B,IAAI,KAAK,EAAE;YACT,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,GAAG,IAAI,KAAK,EAAE;gBAC5C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;aACnB;YAED,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;gBACzB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACvB;SACF;IACH,CAAC,CAAC;IAEF,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAG,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,GAAE;IAE3D,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC;AACpD,CAAC","sourcesContent":["import {isFunction} from \"./isFunction\";\nimport {isObject} from \"./isObject\";\nimport {isString} from \"./isString\";\n\nconst mapOptions = (args: any[]) => {\n const [expression, scope, defaultValue, separator = \".\"] = args;\n\n if (isObject(scope) || isString(expression)) {\n return {\n expression,\n scope,\n defaultValue,\n separator\n };\n }\n\n return {\n expression: scope,\n scope: expression,\n defaultValue,\n separator\n };\n};\n\n/**\n * Get value from scope\n * @param {string} expression\n * @param scope\n * @returns {any}\n */\nexport function getValue<T = any>(scope: any, expression: string | undefined): T | undefined;\n/**\n * Get value from scope\n * @param {string} expression\n * @param scope\n * @param defaultValue\n * @param separator\n * @returns {any}\n */\nexport function getValue<T = any>(scope: any, expression: string | undefined, defaultValue: T, separator?: string): T;\n/**\n * Get value from scope\n * @param {string} expression\n * @param scope\n * @returns {any}\n */\nexport function getValue<T = any>(expression: string | undefined, scope: any): T | undefined;\n/**\n * Get value from scope\n * @param {string} expression\n * @param scope\n * @param defaultValue\n * @param separator\n * @returns {any}\n */\nexport function getValue<T = any>(expression: string | undefined, scope: any, defaultValue: T, separator?: string): T;\nexport function getValue(...args: any[]) {\n const options = mapOptions(args);\n let scope = options.scope;\n const {expression, defaultValue, separator} = options;\n\n if (!expression) {\n return scope;\n }\n\n if (!scope) {\n return defaultValue;\n }\n\n const keys: string[] = expression.split(separator);\n\n const getValue = (key: string) => {\n if (scope) {\n if (scope[key] !== undefined || key in scope) {\n return scope[key];\n }\n\n if (isFunction(scope.get)) {\n return scope.get(key);\n }\n }\n };\n\n while ((scope = getValue(keys.shift()!)) && keys.length) {}\n\n return scope === undefined ? defaultValue : scope;\n}\n"]}
@@ -0,0 +1,44 @@
1
+ export * from "./ancestorOf";
2
+ export * from "./ancestorsOf";
3
+ export * from "./classOf";
4
+ export * from "./cleanObject";
5
+ export * from "./constructorOf";
6
+ export * from "./deepClone";
7
+ export * from "./deepExtends";
8
+ export * from "./deepMerge";
9
+ export * from "./getClassOrSymbol";
10
+ export * from "./getConstructorArgNames";
11
+ export * from "./getEnumerableKeys";
12
+ export * from "./ancestorOf";
13
+ export * from "./getValue";
14
+ export * from "./isArray";
15
+ export * from "./isArrowFn";
16
+ export * from "./isBoolean";
17
+ export * from "./isClass";
18
+ export * from "./isCollection";
19
+ export * from "./isDate";
20
+ export * from "./isEmpty";
21
+ export * from "./isEnumerable";
22
+ export * from "./isFunction";
23
+ export * from "./isInheritedFrom";
24
+ export * from "./isNil";
25
+ export * from "./isNumber";
26
+ export * from "./isObject";
27
+ export * from "./isObservable";
28
+ export * from "./isPlainObject";
29
+ export * from "./isPrimitive";
30
+ export * from "./isPromise";
31
+ export * from "./isProtectedKey";
32
+ export * from "./isStream";
33
+ export * from "./isString";
34
+ export * from "./isSymbol";
35
+ export * from "./isSerializable";
36
+ export * from "./methodsOf";
37
+ export * from "./nameOf";
38
+ export * from "./objectKeys";
39
+ export * from "./primitiveOf";
40
+ export * from "./prototypeOf";
41
+ export * from "./setValue";
42
+ export * from "./toMap";
43
+ export * from "./toStringConstructor";
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/objects/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC","sourcesContent":["export * from \"./ancestorOf\";\nexport * from \"./ancestorsOf\";\nexport * from \"./classOf\";\nexport * from \"./cleanObject\";\nexport * from \"./constructorOf\";\nexport * from \"./deepClone\";\nexport * from \"./deepExtends\";\nexport * from \"./deepMerge\";\nexport * from \"./getClassOrSymbol\";\nexport * from \"./getConstructorArgNames\";\nexport * from \"./getEnumerableKeys\";\nexport * from \"./ancestorOf\";\nexport * from \"./getValue\";\nexport * from \"./isArray\";\nexport * from \"./isArrowFn\";\nexport * from \"./isBoolean\";\nexport * from \"./isClass\";\nexport * from \"./isCollection\";\nexport * from \"./isDate\";\nexport * from \"./isEmpty\";\nexport * from \"./isEnumerable\";\nexport * from \"./isFunction\";\nexport * from \"./isInheritedFrom\";\nexport * from \"./isNil\";\nexport * from \"./isNumber\";\nexport * from \"./isObject\";\nexport * from \"./isObservable\";\nexport * from \"./isPlainObject\";\nexport * from \"./isPrimitive\";\nexport * from \"./isPromise\";\nexport * from \"./isProtectedKey\";\nexport * from \"./isStream\";\nexport * from \"./isString\";\nexport * from \"./isSymbol\";\nexport * from \"./isSerializable\";\nexport * from \"./methodsOf\";\nexport * from \"./nameOf\";\nexport * from \"./objectKeys\";\nexport * from \"./primitiveOf\";\nexport * from \"./prototypeOf\";\nexport * from \"./setValue\";\nexport * from \"./toMap\";\nexport * from \"./toStringConstructor\";\n"]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Return true if value is an array
3
+ * @param target
4
+ * @returns {boolean}
5
+ */
6
+ export function isArray(target) {
7
+ return Array.isArray(target);
8
+ }
9
+ /**
10
+ * Return true if the clazz is an array.
11
+ * @param target
12
+ * @returns {boolean}
13
+ * @ignore
14
+ */
15
+ export function isArrayOrArrayClass(target) {
16
+ return target === Array || isArray(target);
17
+ }
18
+ //# sourceMappingURL=isArray.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isArray.js","sourceRoot":"","sources":["../../../../src/utils/objects/isArray.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAU,MAAe;IAC9C,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAU,MAAe;IAC1D,OAAO,MAAM,KAAK,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["/**\n * Return true if value is an array\n * @param target\n * @returns {boolean}\n */\nexport function isArray<T = any>(target: unknown): target is T[] {\n return Array.isArray(target);\n}\n\n/**\n * Return true if the clazz is an array.\n * @param target\n * @returns {boolean}\n * @ignore\n */\nexport function isArrayOrArrayClass<T = any>(target: unknown): target is T[] {\n return target === Array || isArray(target);\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { isFunction } from "./isFunction";
2
+ export function isArrowFn(target) {
3
+ return target && isFunction(target) && !target.prototype;
4
+ }
5
+ //# sourceMappingURL=isArrowFn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isArrowFn.js","sourceRoot":"","sources":["../../../../src/utils/objects/isArrowFn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,UAAU,SAAS,CAAC,MAAW;IACnC,OAAO,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;AAC3D,CAAC","sourcesContent":["import {isFunction} from \"./isFunction\";\n\nexport function isArrowFn(target: any): target is Function {\n return target && isFunction(target) && !target.prototype;\n}\n"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ *
3
+ * @param target
4
+ * @returns {boolean}
5
+ */
6
+ export function isBoolean(target) {
7
+ return typeof target === "boolean" || target instanceof Boolean || target === Boolean;
8
+ }
9
+ export function isBooleanOrBooleanClass(target) {
10
+ return typeof target === "boolean" || target instanceof Boolean || target === Boolean;
11
+ }
12
+ //# sourceMappingURL=isBoolean.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isBoolean.js","sourceRoot":"","sources":["../../../../src/utils/objects/isBoolean.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,MAAW;IACnC,OAAO,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,YAAY,OAAO,IAAI,MAAM,KAAK,OAAO,CAAC;AACxF,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAW;IACjD,OAAO,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,YAAY,OAAO,IAAI,MAAM,KAAK,OAAO,CAAC;AACxF,CAAC","sourcesContent":["/**\n *\n * @param target\n * @returns {boolean}\n */\nexport function isBoolean(target: any): target is boolean {\n return typeof target === \"boolean\" || target instanceof Boolean || target === Boolean;\n}\n\nexport function isBooleanOrBooleanClass(target: any): target is boolean {\n return typeof target === \"boolean\" || target instanceof Boolean || target === Boolean;\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import { isArrayOrArrayClass } from "./isArray";
2
+ import { isArrowFn } from "./isArrowFn";
3
+ import { isDate } from "./isDate";
4
+ import { isClassObject } from "./isPlainObject";
5
+ import { isPrimitiveOrPrimitiveClass } from "./isPrimitive";
6
+ import { isPromise } from "./isPromise";
7
+ import { isSymbol } from "./isSymbol";
8
+ export function isClass(target) {
9
+ if (!target) {
10
+ return false;
11
+ }
12
+ if (isArrowFn(target)) {
13
+ return false;
14
+ }
15
+ return !(isSymbol(target) ||
16
+ isPrimitiveOrPrimitiveClass(target) ||
17
+ isClassObject(target) ||
18
+ isDate(target) ||
19
+ isPromise(target) ||
20
+ isArrayOrArrayClass(target));
21
+ }
22
+ //# sourceMappingURL=isClass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isClass.js","sourceRoot":"","sources":["../../../../src/utils/objects/isClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,2BAA2B,EAAC,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,UAAU,OAAO,CAAC,MAAW;IACjC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,KAAK,CAAC;KACd;IAED,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE;QACrB,OAAO,KAAK,CAAC;KACd;IAED,OAAO,CAAC,CACN,QAAQ,CAAC,MAAM,CAAC;QAChB,2BAA2B,CAAC,MAAM,CAAC;QACnC,aAAa,CAAC,MAAM,CAAC;QACrB,MAAM,CAAC,MAAM,CAAC;QACd,SAAS,CAAC,MAAM,CAAC;QACjB,mBAAmB,CAAC,MAAM,CAAC,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["import {isArrayOrArrayClass} from \"./isArray\";\nimport {isArrowFn} from \"./isArrowFn\";\nimport {isDate} from \"./isDate\";\nimport {isClassObject} from \"./isPlainObject\";\nimport {isPrimitiveOrPrimitiveClass} from \"./isPrimitive\";\nimport {isPromise} from \"./isPromise\";\nimport {isSymbol} from \"./isSymbol\";\n\nexport function isClass(target: any) {\n if (!target) {\n return false;\n }\n\n if (isArrowFn(target)) {\n return false;\n }\n\n return !(\n isSymbol(target) ||\n isPrimitiveOrPrimitiveClass(target) ||\n isClassObject(target) ||\n isDate(target) ||\n isPromise(target) ||\n isArrayOrArrayClass(target)\n );\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { isArrayOrArrayClass } from "./isArray";
2
+ /**
3
+ * Return true if the target.
4
+ * @param target
5
+ * @returns {boolean}
6
+ */
7
+ export function isCollection(target) {
8
+ return (isArrayOrArrayClass(target) ||
9
+ target === Map ||
10
+ target instanceof Map ||
11
+ target === Set ||
12
+ target instanceof Set ||
13
+ target === WeakMap ||
14
+ target instanceof WeakMap ||
15
+ target === WeakSet ||
16
+ target instanceof WeakSet);
17
+ }
18
+ //# sourceMappingURL=isCollection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isCollection.js","sourceRoot":"","sources":["../../../../src/utils/objects/isCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,WAAW,CAAC;AAE9C;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAW;IACtC,OAAO,CACL,mBAAmB,CAAC,MAAM,CAAC;QAC3B,MAAM,KAAK,GAAG;QACd,MAAM,YAAY,GAAG;QACrB,MAAM,KAAK,GAAG;QACd,MAAM,YAAY,GAAG;QACrB,MAAM,KAAK,OAAO;QAClB,MAAM,YAAY,OAAO;QACzB,MAAM,KAAK,OAAO;QAClB,MAAM,YAAY,OAAO,CAC1B,CAAC;AACJ,CAAC","sourcesContent":["import {isArrayOrArrayClass} from \"./isArray\";\n\n/**\n * Return true if the target.\n * @param target\n * @returns {boolean}\n */\nexport function isCollection(target: any): boolean {\n return (\n isArrayOrArrayClass(target) ||\n target === Map ||\n target instanceof Map ||\n target === Set ||\n target instanceof Set ||\n target === WeakMap ||\n target instanceof WeakMap ||\n target === WeakSet ||\n target instanceof WeakSet\n );\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ *
3
+ * @param target
4
+ * @returns {boolean}
5
+ */
6
+ export function isDate(target) {
7
+ return target === Date || (target instanceof Date && !isNaN(+target));
8
+ }
9
+ //# sourceMappingURL=isDate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDate.js","sourceRoot":"","sources":["../../../../src/utils/objects/isDate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,MAAW;IAChC,OAAO,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACxE,CAAC","sourcesContent":["/**\n *\n * @param target\n * @returns {boolean}\n */\nexport function isDate(target: any): target is Date {\n return target === Date || (target instanceof Date && !isNaN(+target));\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { isNil } from "./isNil";
2
+ /**
3
+ * Return true if the value is an empty string, null or undefined.
4
+ * @param value
5
+ * @returns {boolean}
6
+ */
7
+ export function isEmpty(value) {
8
+ return value === "" || isNil(value);
9
+ }
10
+ //# sourceMappingURL=isEmpty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isEmpty.js","sourceRoot":"","sources":["../../../../src/utils/objects/isEmpty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAE9B;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,KAAU;IAChC,OAAO,KAAK,KAAK,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import {isNil} from \"./isNil\";\n\n/**\n * Return true if the value is an empty string, null or undefined.\n * @param value\n * @returns {boolean}\n */\nexport function isEmpty(value: any): boolean {\n return value === \"\" || isNil(value);\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { inheritedDescriptorOf } from "../decorators/inheritedDescriptorOf";
2
+ import { classOf } from "./classOf";
3
+ /**
4
+ *
5
+ * @param obj
6
+ * @param key
7
+ */
8
+ export function isEnumerable(obj, key) {
9
+ const klass = classOf(obj);
10
+ if (klass) {
11
+ const descriptor = inheritedDescriptorOf(klass, key);
12
+ if (descriptor) {
13
+ return descriptor.enumerable;
14
+ }
15
+ }
16
+ return Object.prototype.propertyIsEnumerable.call(obj, key);
17
+ }
18
+ //# sourceMappingURL=isEnumerable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isEnumerable.js","sourceRoot":"","sources":["../../../../src/utils/objects/isEnumerable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,GAAQ,EAAE,GAAW;IAChD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAE3B,IAAI,KAAK,EAAE;QACT,MAAM,UAAU,GAAG,qBAAqB,CAAC,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","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,4 @@
1
+ export function isFunction(target) {
2
+ return typeof target === "function";
3
+ }
4
+ //# sourceMappingURL=isFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isFunction.js","sourceRoot":"","sources":["../../../../src/utils/objects/isFunction.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,MAAW;IACpC,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC;AACtC,CAAC","sourcesContent":["export function isFunction(target: any): target is Function {\n return typeof target === \"function\";\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import { classOf } from "./classOf";
2
+ import { ancestorOf } from "./ancestorOf";
3
+ import { nameOf } from "./nameOf";
4
+ export function isInheritedFrom(target, from, deep = 5) {
5
+ if (!target || !from) {
6
+ return false;
7
+ }
8
+ target = classOf(target);
9
+ from = classOf(from);
10
+ while (nameOf(target) !== "") {
11
+ if (!deep) {
12
+ return false;
13
+ }
14
+ if (target === from) {
15
+ return true;
16
+ }
17
+ target = ancestorOf(target);
18
+ deep--;
19
+ }
20
+ return false;
21
+ }
22
+ //# sourceMappingURL=isInheritedFrom.js.map