@telperion/js-utils 3.5.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 (351) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +621 -0
  3. package/array/arrayize.cjs +22 -0
  4. package/array/arrayize.d.ts +17 -0
  5. package/array/arrayize.js +21 -0
  6. package/array/arrayize.js.map +1 -0
  7. package/array/async-map.cjs +40 -0
  8. package/array/async-map.d.ts +34 -0
  9. package/array/async-map.js +39 -0
  10. package/array/async-map.js.map +1 -0
  11. package/array/compact.cjs +34 -0
  12. package/array/compact.d.ts +28 -0
  13. package/array/compact.js +33 -0
  14. package/array/compact.js.map +1 -0
  15. package/array/difference.cjs +16 -0
  16. package/array/difference.d.ts +45 -0
  17. package/array/difference.js +15 -0
  18. package/array/difference.js.map +1 -0
  19. package/array/find-by-key.cjs +35 -0
  20. package/array/find-by-key.d.ts +30 -0
  21. package/array/find-by-key.js +34 -0
  22. package/array/find-by-key.js.map +1 -0
  23. package/array/index.cjs +14 -0
  24. package/array/index.d.ts +11 -0
  25. package/array/index.js +13 -0
  26. package/array/index.js.map +1 -0
  27. package/array/intersection.cjs +16 -0
  28. package/array/intersection.d.ts +45 -0
  29. package/array/intersection.js +15 -0
  30. package/array/intersection.js.map +1 -0
  31. package/array/limit.cjs +37 -0
  32. package/array/limit.d.ts +29 -0
  33. package/array/limit.js +36 -0
  34. package/array/limit.js.map +1 -0
  35. package/array/proto/async-map.cjs +6 -0
  36. package/array/proto/async-map.d.ts +25 -0
  37. package/array/proto/async-map.js +6 -0
  38. package/array/proto/async-map.js.map +1 -0
  39. package/array/proto/compact.cjs +6 -0
  40. package/array/proto/compact.d.ts +15 -0
  41. package/array/proto/compact.js +6 -0
  42. package/array/proto/compact.js.map +1 -0
  43. package/array/proto/difference.cjs +6 -0
  44. package/array/proto/difference.d.ts +27 -0
  45. package/array/proto/difference.js +6 -0
  46. package/array/proto/difference.js.map +1 -0
  47. package/array/proto/find-by-key.cjs +6 -0
  48. package/array/proto/find-by-key.d.ts +25 -0
  49. package/array/proto/find-by-key.js +6 -0
  50. package/array/proto/find-by-key.js.map +1 -0
  51. package/array/proto/intersection.cjs +6 -0
  52. package/array/proto/intersection.d.ts +27 -0
  53. package/array/proto/intersection.js +6 -0
  54. package/array/proto/intersection.js.map +1 -0
  55. package/array/proto/limit.cjs +6 -0
  56. package/array/proto/limit.d.ts +24 -0
  57. package/array/proto/limit.js +6 -0
  58. package/array/proto/limit.js.map +1 -0
  59. package/array/proto/remove.cjs +6 -0
  60. package/array/proto/remove.d.ts +32 -0
  61. package/array/proto/remove.js +6 -0
  62. package/array/proto/remove.js.map +1 -0
  63. package/array/proto/replace.cjs +6 -0
  64. package/array/proto/replace.d.ts +72 -0
  65. package/array/proto/replace.js +6 -0
  66. package/array/proto/replace.js.map +1 -0
  67. package/array/proto/uniquify-by-key.cjs +6 -0
  68. package/array/proto/uniquify-by-key.d.ts +24 -0
  69. package/array/proto/uniquify-by-key.js +6 -0
  70. package/array/proto/uniquify-by-key.js.map +1 -0
  71. package/array/proto/uniquify.cjs +6 -0
  72. package/array/proto/uniquify.d.ts +23 -0
  73. package/array/proto/uniquify.js +6 -0
  74. package/array/proto/uniquify.js.map +1 -0
  75. package/array/remove.cjs +46 -0
  76. package/array/remove.d.ts +33 -0
  77. package/array/remove.js +45 -0
  78. package/array/remove.js.map +1 -0
  79. package/array/replace.cjs +69 -0
  80. package/array/replace.d.ts +139 -0
  81. package/array/replace.js +68 -0
  82. package/array/replace.js.map +1 -0
  83. package/array/static/arrayize.cjs +4 -0
  84. package/array/static/arrayize.d.ts +6 -0
  85. package/array/static/arrayize.js +4 -0
  86. package/array/static/arrayize.js.map +1 -0
  87. package/array/uniquify-by-key.cjs +41 -0
  88. package/array/uniquify-by-key.d.ts +29 -0
  89. package/array/uniquify-by-key.js +40 -0
  90. package/array/uniquify-by-key.js.map +1 -0
  91. package/array/uniquify.cjs +32 -0
  92. package/array/uniquify.d.ts +27 -0
  93. package/array/uniquify.js +31 -0
  94. package/array/uniquify.js.map +1 -0
  95. package/boolean/static/is-falsy.cjs +4 -0
  96. package/boolean/static/is-falsy.d.ts +23 -0
  97. package/boolean/static/is-falsy.js +4 -0
  98. package/boolean/static/is-falsy.js.map +1 -0
  99. package/boolean/static/is-truthy.cjs +4 -0
  100. package/boolean/static/is-truthy.d.ts +23 -0
  101. package/boolean/static/is-truthy.js +4 -0
  102. package/boolean/static/is-truthy.js.map +1 -0
  103. package/class/index.cjs +4 -0
  104. package/class/index.d.ts +1 -0
  105. package/class/index.js +3 -0
  106. package/class/index.js.map +1 -0
  107. package/class/mixin.cjs +60 -0
  108. package/class/mixin.d.ts +50 -0
  109. package/class/mixin.js +59 -0
  110. package/class/mixin.js.map +1 -0
  111. package/compact.cjs +39 -0
  112. package/compact.d.ts +2 -0
  113. package/compact.js +38 -0
  114. package/compact.js.map +1 -0
  115. package/function/call.cjs +6 -0
  116. package/function/call.d.ts +1 -0
  117. package/function/call.js +5 -0
  118. package/function/call.js.map +1 -0
  119. package/function/debounce.cjs +85 -0
  120. package/function/debounce.d.ts +44 -0
  121. package/function/debounce.js +82 -0
  122. package/function/debounce.js.map +1 -0
  123. package/function/defer.cjs +42 -0
  124. package/function/defer.d.ts +26 -0
  125. package/function/defer.js +41 -0
  126. package/function/defer.js.map +1 -0
  127. package/function/index.cjs +8 -0
  128. package/function/index.d.ts +5 -0
  129. package/function/index.js +7 -0
  130. package/function/index.js.map +1 -0
  131. package/function/noop.cjs +23 -0
  132. package/function/noop.d.ts +20 -0
  133. package/function/noop.js +22 -0
  134. package/function/noop.js.map +1 -0
  135. package/function/of.cjs +44 -0
  136. package/function/of.d.ts +31 -0
  137. package/function/of.js +43 -0
  138. package/function/of.js.map +1 -0
  139. package/function/proto/debounce.cjs +6 -0
  140. package/function/proto/debounce.d.ts +30 -0
  141. package/function/proto/debounce.js +6 -0
  142. package/function/proto/debounce.js.map +1 -0
  143. package/function/static/call.cjs +4 -0
  144. package/function/static/call.d.ts +6 -0
  145. package/function/static/call.js +4 -0
  146. package/function/static/call.js.map +1 -0
  147. package/function/static/defer.cjs +4 -0
  148. package/function/static/defer.d.ts +23 -0
  149. package/function/static/defer.js +4 -0
  150. package/function/static/defer.js.map +1 -0
  151. package/function/static/noop.cjs +4 -0
  152. package/function/static/noop.d.ts +18 -0
  153. package/function/static/noop.js +4 -0
  154. package/function/static/noop.js.map +1 -0
  155. package/function/static/of.cjs +4 -0
  156. package/function/static/of.d.ts +26 -0
  157. package/function/static/of.js +4 -0
  158. package/function/static/of.js.map +1 -0
  159. package/index.cjs +31 -0
  160. package/index.d.ts +14 -0
  161. package/index.js +17 -0
  162. package/index.js.map +1 -0
  163. package/is-falsy.cjs +33 -0
  164. package/is-falsy.d.ts +28 -0
  165. package/is-falsy.js +32 -0
  166. package/is-falsy.js.map +1 -0
  167. package/is-truthy.cjs +33 -0
  168. package/is-truthy.d.ts +28 -0
  169. package/is-truthy.js +32 -0
  170. package/is-truthy.js.map +1 -0
  171. package/limit.cjs +34 -0
  172. package/limit.d.ts +2 -0
  173. package/limit.js +33 -0
  174. package/limit.js.map +1 -0
  175. package/map/index.cjs +4 -0
  176. package/map/index.d.ts +1 -0
  177. package/map/index.js +3 -0
  178. package/map/index.js.map +1 -0
  179. package/map/merge.cjs +33 -0
  180. package/map/merge.d.ts +24 -0
  181. package/map/merge.js +32 -0
  182. package/map/merge.js.map +1 -0
  183. package/math/index.cjs +4 -0
  184. package/math/index.d.ts +1 -0
  185. package/math/index.js +3 -0
  186. package/math/index.js.map +1 -0
  187. package/math/min-max.cjs +29 -0
  188. package/math/min-max.d.ts +24 -0
  189. package/math/min-max.js +28 -0
  190. package/math/min-max.js.map +1 -0
  191. package/math/static/min-max.cjs +4 -0
  192. package/math/static/min-max.d.ts +20 -0
  193. package/math/static/min-max.js +4 -0
  194. package/math/static/min-max.js.map +1 -0
  195. package/object/clone.cjs +157 -0
  196. package/object/clone.d.ts +161 -0
  197. package/object/clone.js +156 -0
  198. package/object/clone.js.map +1 -0
  199. package/object/compact.cjs +49 -0
  200. package/object/compact.d.ts +37 -0
  201. package/object/compact.js +48 -0
  202. package/object/compact.js.map +1 -0
  203. package/object/deep-freeze.cjs +16 -0
  204. package/object/deep-freeze.d.ts +1 -0
  205. package/object/deep-freeze.js +15 -0
  206. package/object/deep-freeze.js.map +1 -0
  207. package/object/deepest.cjs +55 -0
  208. package/object/deepest.d.ts +47 -0
  209. package/object/deepest.js +54 -0
  210. package/object/deepest.js.map +1 -0
  211. package/object/index.cjs +7 -0
  212. package/object/index.d.ts +4 -0
  213. package/object/index.js +6 -0
  214. package/object/index.js.map +1 -0
  215. package/object/static/clone.cjs +4 -0
  216. package/object/static/clone.d.ts +43 -0
  217. package/object/static/clone.js +4 -0
  218. package/object/static/clone.js.map +1 -0
  219. package/object/static/compact.cjs +4 -0
  220. package/object/static/compact.d.ts +26 -0
  221. package/object/static/compact.js +4 -0
  222. package/object/static/compact.js.map +1 -0
  223. package/object/static/deep-freeze.cjs +4 -0
  224. package/object/static/deep-freeze.d.ts +6 -0
  225. package/object/static/deep-freeze.js +4 -0
  226. package/object/static/deep-freeze.js.map +1 -0
  227. package/object/static/deepest.cjs +4 -0
  228. package/object/static/deepest.d.ts +32 -0
  229. package/object/static/deepest.js +4 -0
  230. package/object/static/deepest.js.map +1 -0
  231. package/open-promise.cjs +115 -0
  232. package/open-promise.d.ts +80 -0
  233. package/open-promise.js +113 -0
  234. package/open-promise.js.map +1 -0
  235. package/package.json +667 -0
  236. package/promise/chain.cjs +12 -0
  237. package/promise/chain.d.ts +7 -0
  238. package/promise/chain.js +11 -0
  239. package/promise/chain.js.map +1 -0
  240. package/promise/index.cjs +10 -0
  241. package/promise/index.d.ts +7 -0
  242. package/promise/index.js +9 -0
  243. package/promise/index.js.map +1 -0
  244. package/promise/never.cjs +41 -0
  245. package/promise/never.d.ts +34 -0
  246. package/promise/never.js +39 -0
  247. package/promise/never.js.map +1 -0
  248. package/promise/promisify.cjs +12 -0
  249. package/promise/promisify.d.ts +7 -0
  250. package/promise/promisify.js +11 -0
  251. package/promise/promisify.js.map +1 -0
  252. package/promise/proto/revert.cjs +6 -0
  253. package/promise/proto/revert.d.ts +29 -0
  254. package/promise/proto/revert.js +6 -0
  255. package/promise/proto/revert.js.map +1 -0
  256. package/promise/proto/try-catch.cjs +7 -0
  257. package/promise/proto/try-catch.d.ts +30 -0
  258. package/promise/proto/try-catch.js +7 -0
  259. package/promise/proto/try-catch.js.map +1 -0
  260. package/promise/revert.cjs +43 -0
  261. package/promise/revert.d.ts +38 -0
  262. package/promise/revert.js +42 -0
  263. package/promise/revert.js.map +1 -0
  264. package/promise/static/chain.cjs +4 -0
  265. package/promise/static/chain.d.ts +10 -0
  266. package/promise/static/chain.js +4 -0
  267. package/promise/static/chain.js.map +1 -0
  268. package/promise/static/never.cjs +5 -0
  269. package/promise/static/never.d.ts +39 -0
  270. package/promise/static/never.js +5 -0
  271. package/promise/static/never.js.map +1 -0
  272. package/promise/static/timeout.cjs +4 -0
  273. package/promise/static/timeout.d.ts +21 -0
  274. package/promise/static/timeout.js +4 -0
  275. package/promise/static/timeout.js.map +1 -0
  276. package/promise/static/try-one-by-one.cjs +4 -0
  277. package/promise/static/try-one-by-one.d.ts +27 -0
  278. package/promise/static/try-one-by-one.js +4 -0
  279. package/promise/static/try-one-by-one.js.map +1 -0
  280. package/promise/timeout.cjs +104 -0
  281. package/promise/timeout.d.ts +109 -0
  282. package/promise/timeout.js +103 -0
  283. package/promise/timeout.js.map +1 -0
  284. package/promise/try-catch.cjs +12 -0
  285. package/promise/try-catch.d.ts +45 -0
  286. package/promise/try-catch.js +11 -0
  287. package/promise/try-catch.js.map +1 -0
  288. package/promise/try-one-by-one.cjs +59 -0
  289. package/promise/try-one-by-one.d.ts +42 -0
  290. package/promise/try-one-by-one.js +58 -0
  291. package/promise/try-one-by-one.js.map +1 -0
  292. package/set/proto/difference.cjs +6 -0
  293. package/set/proto/difference.d.ts +26 -0
  294. package/set/proto/difference.js +6 -0
  295. package/set/proto/difference.js.map +1 -0
  296. package/set/proto/intersection.cjs +6 -0
  297. package/set/proto/intersection.d.ts +26 -0
  298. package/set/proto/intersection.js +6 -0
  299. package/set/proto/intersection.js.map +1 -0
  300. package/smart-map.cjs +108 -0
  301. package/smart-map.d.ts +81 -0
  302. package/smart-map.js +106 -0
  303. package/smart-map.js.map +1 -0
  304. package/string/index.cjs +4 -0
  305. package/string/index.d.ts +1 -0
  306. package/string/index.js +3 -0
  307. package/string/index.js.map +1 -0
  308. package/string/limit.cjs +35 -0
  309. package/string/limit.d.ts +29 -0
  310. package/string/limit.js +34 -0
  311. package/string/limit.js.map +1 -0
  312. package/string/proto/limit.cjs +6 -0
  313. package/string/proto/limit.d.ts +30 -0
  314. package/string/proto/limit.js +6 -0
  315. package/string/proto/limit.js.map +1 -0
  316. package/time/days.cjs +21 -0
  317. package/time/days.d.ts +15 -0
  318. package/time/days.js +20 -0
  319. package/time/days.js.map +1 -0
  320. package/time/hours.cjs +21 -0
  321. package/time/hours.d.ts +15 -0
  322. package/time/hours.js +20 -0
  323. package/time/hours.js.map +1 -0
  324. package/time/index.cjs +10 -0
  325. package/time/index.d.ts +7 -0
  326. package/time/index.js +9 -0
  327. package/time/index.js.map +1 -0
  328. package/time/minutes.cjs +21 -0
  329. package/time/minutes.d.ts +15 -0
  330. package/time/minutes.js +20 -0
  331. package/time/minutes.js.map +1 -0
  332. package/time/months.cjs +21 -0
  333. package/time/months.d.ts +15 -0
  334. package/time/months.js +20 -0
  335. package/time/months.js.map +1 -0
  336. package/time/seconds.cjs +20 -0
  337. package/time/seconds.d.ts +15 -0
  338. package/time/seconds.js +19 -0
  339. package/time/seconds.js.map +1 -0
  340. package/time/weeks.cjs +21 -0
  341. package/time/weeks.d.ts +15 -0
  342. package/time/weeks.js +20 -0
  343. package/time/weeks.js.map +1 -0
  344. package/time/years.cjs +21 -0
  345. package/time/years.d.ts +15 -0
  346. package/time/years.js +20 -0
  347. package/time/years.js.map +1 -0
  348. package/unique-id.cjs +24 -0
  349. package/unique-id.d.ts +21 -0
  350. package/unique-id.js +23 -0
  351. package/unique-id.js.map +1 -0
@@ -0,0 +1,41 @@
1
+ import { noop } from '@telperion/js-utils/function/noop';
2
+ /**
3
+ * #### Delays the execution of the passed function to increase the render performance
4
+ *
5
+ * * * *
6
+ * Example usage:
7
+ * ```typescript
8
+ * import { defer } from "@telperion/js-utils/function";
9
+ *
10
+ * defer(() => aFunctionToDefer())
11
+ * .then(res => ...)
12
+ * .catch(err => ...);
13
+ * ```
14
+ * Example as promise static method
15
+ * ```typescript
16
+ * import "@telperion/js-utils/function/static/defer";
17
+ *
18
+ * Function.defer(() => aFunctionToDefer())
19
+ * .then(res => ...)
20
+ * .catch(err => ...);
21
+ * ```
22
+ * * * *
23
+ * @param callback Callback function to be executed
24
+ * @typeparam T type of the return value of the callback
25
+ * @returns A promise which resolves with the value of the callback right after the execution
26
+ */
27
+ export function defer(callback = noop) {
28
+ return new Promise((resolve, reject) => {
29
+ setTimeout(() => {
30
+ try {
31
+ const returnValue = callback();
32
+ resolve(returnValue);
33
+ }
34
+ catch (error) {
35
+ reject(error);
36
+ }
37
+ }, 0);
38
+ });
39
+ }
40
+
41
+ //# sourceMappingURL=defer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../libs/js-utils/src/function/defer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,KAAK,CAAU,WAAoB,IAAe;IAChE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxC,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC;gBACH,MAAM,WAAW,GAAG,QAAQ,EAAE,CAAC;gBAC/B,OAAO,CAAC,WAAW,CAAC,CAAC;YACvB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC;QACH,CAAC,EAAE,CAAC,CAAC,CAAC;IACR,CAAC,CAAC,CAAC;AACL,CAAC","file":"defer.js","sourcesContent":["import { noop } from '@telperion/js-utils/function/noop';\n\n/**\n * #### Delays the execution of the passed function to increase the render performance\n *\n * * * *\n * Example usage:\n * ```typescript\n * import { defer } from \"@telperion/js-utils/function\";\n *\n * defer(() => aFunctionToDefer())\n * .then(res => ...)\n * .catch(err => ...);\n * ```\n * Example as promise static method\n * ```typescript\n * import \"@telperion/js-utils/function/static/defer\";\n *\n * Function.defer(() => aFunctionToDefer())\n * .then(res => ...)\n * .catch(err => ...);\n * ```\n * * * *\n * @param callback Callback function to be executed\n * @typeparam T type of the return value of the callback\n * @returns A promise which resolves with the value of the callback right after the execution\n */\nexport function defer<T = any>(callback: () => T = noop as () => T): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n setTimeout(() => {\n try {\n const returnValue = callback();\n resolve(returnValue);\n } catch (error) {\n reject(error);\n }\n }, 0);\n });\n}\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("@telperion/js-utils/function/call"), exports);
5
+ tslib_1.__exportStar(require("@telperion/js-utils/function/debounce"), exports);
6
+ tslib_1.__exportStar(require("@telperion/js-utils/function/defer"), exports);
7
+ tslib_1.__exportStar(require("@telperion/js-utils/function/of"), exports);
8
+ tslib_1.__exportStar(require("@telperion/js-utils/function/noop"), exports);
@@ -0,0 +1,5 @@
1
+ export * from '@telperion/js-utils/function/call';
2
+ export * from '@telperion/js-utils/function/debounce';
3
+ export * from '@telperion/js-utils/function/defer';
4
+ export * from '@telperion/js-utils/function/of';
5
+ export * from '@telperion/js-utils/function/noop';
@@ -0,0 +1,7 @@
1
+ export * from '@telperion/js-utils/function/call';
2
+ export * from '@telperion/js-utils/function/debounce';
3
+ export * from '@telperion/js-utils/function/defer';
4
+ export * from '@telperion/js-utils/function/of';
5
+ export * from '@telperion/js-utils/function/noop';
6
+
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../libs/js-utils/src/function/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC","file":"index.js","sourcesContent":["export * from '@telperion/js-utils/function/call';\nexport * from '@telperion/js-utils/function/debounce';\nexport * from '@telperion/js-utils/function/defer';\nexport * from '@telperion/js-utils/function/of';\nexport * from '@telperion/js-utils/function/noop';\n"]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.noop = noop;
4
+ /**
5
+ * #### Noop function
6
+ * * * *
7
+ * Example usage:
8
+ * ```typescript
9
+ * import { noop } from "@telperion/js-utils/function";
10
+ *
11
+ * noop();
12
+ * document.onload = noop;
13
+ * ```
14
+ * Static usage example:
15
+ * ```typescript
16
+ * import "@telperion/js-utils/function/static/noop";
17
+ *
18
+ * Function.noop();
19
+ * document.onload = Function.noop;
20
+ * ```
21
+ * * * *
22
+ */
23
+ function noop() { }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * #### Noop function
3
+ * * * *
4
+ * Example usage:
5
+ * ```typescript
6
+ * import { noop } from "@telperion/js-utils/function";
7
+ *
8
+ * noop();
9
+ * document.onload = noop;
10
+ * ```
11
+ * Static usage example:
12
+ * ```typescript
13
+ * import "@telperion/js-utils/function/static/noop";
14
+ *
15
+ * Function.noop();
16
+ * document.onload = Function.noop;
17
+ * ```
18
+ * * * *
19
+ */
20
+ export declare function noop(): void;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * #### Noop function
3
+ * * * *
4
+ * Example usage:
5
+ * ```typescript
6
+ * import { noop } from "@telperion/js-utils/function";
7
+ *
8
+ * noop();
9
+ * document.onload = noop;
10
+ * ```
11
+ * Static usage example:
12
+ * ```typescript
13
+ * import "@telperion/js-utils/function/static/noop";
14
+ *
15
+ * Function.noop();
16
+ * document.onload = Function.noop;
17
+ * ```
18
+ * * * *
19
+ */
20
+ export function noop() { }
21
+
22
+ //# sourceMappingURL=noop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../libs/js-utils/src/function/noop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,IAAI,KAAU,CAAC","file":"noop.js","sourcesContent":["/**\n * #### Noop function\n * * * *\n * Example usage:\n * ```typescript\n * import { noop } from \"@telperion/js-utils/function\";\n *\n * noop();\n * document.onload = noop;\n * ```\n * Static usage example:\n * ```typescript\n * import \"@telperion/js-utils/function/static/noop\";\n *\n * Function.noop();\n * document.onload = Function.noop;\n * ```\n * * * *\n */\nexport function noop(): void {}\n"]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.of = of;
4
+ const smart_map_1 = require("@telperion/js-utils/smart-map");
5
+ /**
6
+ * Cache object to store previously created functions
7
+ */
8
+ const CACHE = new smart_map_1.SmartMap();
9
+ /**
10
+ * ### Function Of
11
+ *
12
+ * Creates a function which returns the value given
13
+ *
14
+ * * * *
15
+ * Example:
16
+ * ```typescript
17
+ * import { of } from "@telperion/js-utils/function";
18
+ *
19
+ * const base = [1, 2, 5, {}, "x", "y"];
20
+ * const mapTo = of("thales rocks");
21
+ *
22
+ * const mapped = base.map(mapTo);
23
+ * // ["thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks"]
24
+ * ```
25
+ * Function Static Example:
26
+ * ```typescript
27
+ * import "@telperion/js-utils/function/static/of";
28
+ *
29
+ * const base = [1, 2, 5, {}, "x", "y"];
30
+ * const mapTo = Function.of("thales rocks");
31
+ *
32
+ * const mapped = base.map(mapTo);
33
+ * // ["thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks"]
34
+ * ```
35
+ * * * *
36
+ * @param returnValue The value which created function returns
37
+ * @returns A function which returns the `returnValue`
38
+ */
39
+ function of(returnValue) {
40
+ if (!CACHE.has(returnValue)) {
41
+ CACHE.set(returnValue, function () { return returnValue; });
42
+ }
43
+ return CACHE.get(returnValue);
44
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * ### Function Of
3
+ *
4
+ * Creates a function which returns the value given
5
+ *
6
+ * * * *
7
+ * Example:
8
+ * ```typescript
9
+ * import { of } from "@telperion/js-utils/function";
10
+ *
11
+ * const base = [1, 2, 5, {}, "x", "y"];
12
+ * const mapTo = of("thales rocks");
13
+ *
14
+ * const mapped = base.map(mapTo);
15
+ * // ["thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks"]
16
+ * ```
17
+ * Function Static Example:
18
+ * ```typescript
19
+ * import "@telperion/js-utils/function/static/of";
20
+ *
21
+ * const base = [1, 2, 5, {}, "x", "y"];
22
+ * const mapTo = Function.of("thales rocks");
23
+ *
24
+ * const mapped = base.map(mapTo);
25
+ * // ["thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks"]
26
+ * ```
27
+ * * * *
28
+ * @param returnValue The value which created function returns
29
+ * @returns A function which returns the `returnValue`
30
+ */
31
+ export declare function of<T>(returnValue: T): (...args: any[]) => T;
package/function/of.js ADDED
@@ -0,0 +1,43 @@
1
+ import { SmartMap } from '@telperion/js-utils/smart-map';
2
+ /**
3
+ * Cache object to store previously created functions
4
+ */
5
+ const CACHE = new SmartMap();
6
+ /**
7
+ * ### Function Of
8
+ *
9
+ * Creates a function which returns the value given
10
+ *
11
+ * * * *
12
+ * Example:
13
+ * ```typescript
14
+ * import { of } from "@telperion/js-utils/function";
15
+ *
16
+ * const base = [1, 2, 5, {}, "x", "y"];
17
+ * const mapTo = of("thales rocks");
18
+ *
19
+ * const mapped = base.map(mapTo);
20
+ * // ["thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks"]
21
+ * ```
22
+ * Function Static Example:
23
+ * ```typescript
24
+ * import "@telperion/js-utils/function/static/of";
25
+ *
26
+ * const base = [1, 2, 5, {}, "x", "y"];
27
+ * const mapTo = Function.of("thales rocks");
28
+ *
29
+ * const mapped = base.map(mapTo);
30
+ * // ["thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks"]
31
+ * ```
32
+ * * * *
33
+ * @param returnValue The value which created function returns
34
+ * @returns A function which returns the `returnValue`
35
+ */
36
+ export function of(returnValue) {
37
+ if (!CACHE.has(returnValue)) {
38
+ CACHE.set(returnValue, function () { return returnValue; });
39
+ }
40
+ return CACHE.get(returnValue);
41
+ }
42
+
43
+ //# sourceMappingURL=of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../libs/js-utils/src/function/of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD;;GAEG;AACH,MAAM,KAAK,GAAG,IAAI,QAAQ,EAAkB,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,EAAE,CAAI,WAAc;IAClC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5B,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,cAAa,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,CAAE,CAAC;AACjC,CAAC","file":"of.js","sourcesContent":["import { SmartMap } from '@telperion/js-utils/smart-map';\n\n/**\n * Cache object to store previously created functions\n */\nconst CACHE = new SmartMap<any, () => any>();\n\n/**\n * ### Function Of\n *\n * Creates a function which returns the value given\n *\n * * * *\n * Example:\n * ```typescript\n * import { of } from \"@telperion/js-utils/function\";\n *\n * const base = [1, 2, 5, {}, \"x\", \"y\"];\n * const mapTo = of(\"thales rocks\");\n *\n * const mapped = base.map(mapTo);\n * // [\"thales rocks\", \"thales rocks\", \"thales rocks\", \"thales rocks\", \"thales rocks\", \"thales rocks\"]\n * ```\n * Function Static Example:\n * ```typescript\n * import \"@telperion/js-utils/function/static/of\";\n *\n * const base = [1, 2, 5, {}, \"x\", \"y\"];\n * const mapTo = Function.of(\"thales rocks\");\n *\n * const mapped = base.map(mapTo);\n * // [\"thales rocks\", \"thales rocks\", \"thales rocks\", \"thales rocks\", \"thales rocks\", \"thales rocks\"]\n * ```\n * * * *\n * @param returnValue The value which created function returns\n * @returns A function which returns the `returnValue`\n */\nexport function of<T>(returnValue: T): (...args: any[]) => T {\n if (!CACHE.has(returnValue)) {\n CACHE.set(returnValue, function() { return returnValue; });\n }\n\n return CACHE.get(returnValue)!;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const debounce_1 = require("@telperion/js-utils/function/debounce");
4
+ Function.prototype.debounce = function (time = debounce_1.DEFAULT_DEBOUNCE_TIME, thisObject = null, ...args) {
5
+ return (0, debounce_1.debounce)(this, time, thisObject, ...args);
6
+ };
@@ -0,0 +1,30 @@
1
+ declare global {
2
+ export interface Function {
3
+ /**
4
+ * #### Debounces a function that delays invoking until after given time have elapsed since the last time the debounced function was invoked
5
+ *
6
+ * * * *
7
+ * Example usage:
8
+ * ```typescript
9
+ * import "@telperion/js-utils/function/proto/debounce";
10
+ *
11
+ * function foo() {
12
+ * console.log("hello");
13
+ * }
14
+ *
15
+ * for (let i = 0; i < 5; i++) {
16
+ * foo.debounce();
17
+ * }
18
+ *
19
+ * // logs "hello" only once
20
+ * ```
21
+ * * * *
22
+ * @param [time = 180] Time for debouncing
23
+ * @param [thisObject = null] This object to execute the callback function with
24
+ * @param args Function arguments
25
+ * @return A promise which resolves right after the debouncing sequence has been finished
26
+ */
27
+ debounce(time?: number, thisObject?: any, ...args: any[]): Promise<any>;
28
+ }
29
+ }
30
+ export {};
@@ -0,0 +1,6 @@
1
+ import { debounce, DEFAULT_DEBOUNCE_TIME } from '@telperion/js-utils/function/debounce';
2
+ Function.prototype.debounce = function (time = DEFAULT_DEBOUNCE_TIME, thisObject = null, ...args) {
3
+ return debounce(this, time, thisObject, ...args);
4
+ };
5
+
6
+ //# sourceMappingURL=debounce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../libs/js-utils/src/function/proto/debounce.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAgCxF,QAAQ,CAAC,SAAS,CAAC,QAAQ,GAAG,UAA4B,IAAI,GAAG,qBAAqB,EAAE,aAAkB,IAAI,EAAE,GAAG,IAAW;IAC5H,OAAO,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;AACnD,CAAC,CAAC","file":"debounce.js","sourcesContent":["import type { AnyFunction } from '@thalesrc/extra-ts-types';\n\nimport { debounce, DEFAULT_DEBOUNCE_TIME } from '@telperion/js-utils/function/debounce';\n\ndeclare global {\n export interface Function {\n /**\n * #### Debounces a function that delays invoking until after given time have elapsed since the last time the debounced function was invoked\n *\n * * * *\n * Example usage:\n * ```typescript\n * import \"@telperion/js-utils/function/proto/debounce\";\n *\n * function foo() {\n * console.log(\"hello\");\n * }\n *\n * for (let i = 0; i < 5; i++) {\n * foo.debounce();\n * }\n *\n * // logs \"hello\" only once\n * ```\n * * * *\n * @param [time = 180] Time for debouncing\n * @param [thisObject = null] This object to execute the callback function with\n * @param args Function arguments\n * @return A promise which resolves right after the debouncing sequence has been finished\n */\n debounce(time?: number, thisObject?: any, ...args: any[]): Promise<any>;\n }\n}\n\nFunction.prototype.debounce = function(this: AnyFunction, time = DEFAULT_DEBOUNCE_TIME, thisObject: any = null, ...args: any[]): Promise<any> {\n return debounce(this, time, thisObject, ...args);\n};\n"]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const call_1 = require("@telperion/js-utils/function/call");
4
+ Function.call = call_1.call;
@@ -0,0 +1,6 @@
1
+ import { call } from '@telperion/js-utils/function/call';
2
+ declare global {
3
+ export interface FunctionConstructor {
4
+ call: typeof call;
5
+ }
6
+ }
@@ -0,0 +1,4 @@
1
+ import { call } from '@telperion/js-utils/function/call';
2
+ Function.call = call;
3
+
4
+ //# sourceMappingURL=call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../libs/js-utils/src/function/static/call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AAQzD,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC","file":"call.js","sourcesContent":["import { call } from '@telperion/js-utils/function/call';\n\ndeclare global {\n export interface FunctionConstructor {\n call: typeof call;\n }\n}\n\nFunction.call = call;\n"]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const defer_1 = require("@telperion/js-utils/function/defer");
4
+ Function.defer = defer_1.defer;
@@ -0,0 +1,23 @@
1
+ import { defer } from '@telperion/js-utils/function/defer';
2
+ declare global {
3
+ export interface FunctionConstructor {
4
+ /**
5
+ * #### Delays the execution of the passed function to increase the render performance
6
+ *
7
+ * * * *
8
+ * Example as promise static method
9
+ * ```typescript
10
+ * import "@telperion/js-utils/function/static/defer";
11
+ *
12
+ * Function.defer(() => aFunctionToDefer())
13
+ * .then(res => ...)
14
+ * .catch(err => ...);
15
+ * ```
16
+ * * * *
17
+ * @param callback Callback function to be executed
18
+ * @typeparam T type of the return value of the callback
19
+ * @returns A promise which resolves with the value of the callback right after the execution
20
+ */
21
+ defer: typeof defer;
22
+ }
23
+ }
@@ -0,0 +1,4 @@
1
+ import { defer } from '@telperion/js-utils/function/defer';
2
+ Function.defer = defer;
3
+
4
+ //# sourceMappingURL=defer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../libs/js-utils/src/function/static/defer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAyB3D,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC","file":"defer.js","sourcesContent":["import { defer } from '@telperion/js-utils/function/defer';\n\ndeclare global {\n export interface FunctionConstructor {\n /**\n * #### Delays the execution of the passed function to increase the render performance\n *\n * * * *\n * Example as promise static method\n * ```typescript\n * import \"@telperion/js-utils/function/static/defer\";\n *\n * Function.defer(() => aFunctionToDefer())\n * .then(res => ...)\n * .catch(err => ...);\n * ```\n * * * *\n * @param callback Callback function to be executed\n * @typeparam T type of the return value of the callback\n * @returns A promise which resolves with the value of the callback right after the execution\n */\n defer: typeof defer;\n }\n}\n\nFunction.defer = defer;\n"]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const noop_1 = require("@telperion/js-utils/function/noop");
4
+ Function.noop = noop_1.noop;
@@ -0,0 +1,18 @@
1
+ import { noop } from '@telperion/js-utils/function/noop';
2
+ declare global {
3
+ export interface FunctionConstructor {
4
+ /**
5
+ * #### Noop function
6
+ * * * *
7
+ * Static usage example:
8
+ * ```typescript
9
+ * import "@telperion/js-utils/function/static/noop";
10
+ *
11
+ * Function.noop();
12
+ * document.onload = Function.noop;
13
+ * ```
14
+ * * * *
15
+ */
16
+ noop: typeof noop;
17
+ }
18
+ }
@@ -0,0 +1,4 @@
1
+ import { noop } from '@telperion/js-utils/function/noop';
2
+ Function.noop = noop;
3
+
4
+ //# sourceMappingURL=noop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../libs/js-utils/src/function/static/noop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AAoBzD,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC","file":"noop.js","sourcesContent":["import { noop } from '@telperion/js-utils/function/noop';\n\ndeclare global {\n export interface FunctionConstructor {\n /**\n * #### Noop function\n * * * *\n * Static usage example:\n * ```typescript\n * import \"@telperion/js-utils/function/static/noop\";\n *\n * Function.noop();\n * document.onload = Function.noop;\n * ```\n * * * *\n */\n noop: typeof noop;\n }\n}\n\nFunction.noop = noop;\n"]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const of_1 = require("@telperion/js-utils/function/of");
4
+ Function.of = of_1.of;
@@ -0,0 +1,26 @@
1
+ import { of } from '@telperion/js-utils/function/of';
2
+ declare global {
3
+ export interface FunctionConstructor {
4
+ /**
5
+ * ### Function Of
6
+ *
7
+ * Creates a function which returns the value given
8
+ *
9
+ * * * *
10
+ * Example:
11
+ * ```typescript
12
+ * import "@telperion/js-utils/function/static/of";
13
+ *
14
+ * const base = [1, 2, 5, {}, "x", "y"];
15
+ * const mapTo = Function.of("thales rocks");
16
+ *
17
+ * const mapped = base.map(mapTo);
18
+ * // ["thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks"]
19
+ * ```
20
+ * * * *
21
+ * @param returnValue The value which created function returns
22
+ * @returns A function which returns the `returnValue`
23
+ */
24
+ of: typeof of;
25
+ }
26
+ }
@@ -0,0 +1,4 @@
1
+ import { of } from '@telperion/js-utils/function/of';
2
+ Function.of = of;
3
+
4
+ //# sourceMappingURL=of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../libs/js-utils/src/function/static/of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AA4BrD,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC","file":"of.js","sourcesContent":["import { of } from '@telperion/js-utils/function/of';\n\ndeclare global {\n export interface FunctionConstructor {\n /**\n * ### Function Of\n *\n * Creates a function which returns the value given\n *\n * * * *\n * Example:\n * ```typescript\n * import \"@telperion/js-utils/function/static/of\";\n *\n * const base = [1, 2, 5, {}, \"x\", \"y\"];\n * const mapTo = Function.of(\"thales rocks\");\n *\n * const mapped = base.map(mapTo);\n * // [\"thales rocks\", \"thales rocks\", \"thales rocks\", \"thales rocks\", \"thales rocks\", \"thales rocks\"]\n * ```\n * * * *\n * @param returnValue The value which created function returns\n * @returns A function which returns the `returnValue`\n */\n of: typeof of;\n }\n}\n\nFunction.of = of;\n"]}
package/index.cjs ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deepFreeze = exports.deepest = exports.clone = exports.uniquifyByKey = exports.uniquify = exports.replace = exports.remove = exports.intersection = exports.findByKey = exports.difference = exports.asyncMap = exports.arrayize = void 0;
4
+ const tslib_1 = require("tslib");
5
+ var array_1 = require("@telperion/js-utils/array");
6
+ Object.defineProperty(exports, "arrayize", { enumerable: true, get: function () { return array_1.arrayize; } });
7
+ Object.defineProperty(exports, "asyncMap", { enumerable: true, get: function () { return array_1.asyncMap; } });
8
+ Object.defineProperty(exports, "difference", { enumerable: true, get: function () { return array_1.difference; } });
9
+ Object.defineProperty(exports, "findByKey", { enumerable: true, get: function () { return array_1.findByKey; } });
10
+ Object.defineProperty(exports, "intersection", { enumerable: true, get: function () { return array_1.intersection; } });
11
+ Object.defineProperty(exports, "remove", { enumerable: true, get: function () { return array_1.remove; } });
12
+ Object.defineProperty(exports, "replace", { enumerable: true, get: function () { return array_1.replace; } });
13
+ Object.defineProperty(exports, "uniquify", { enumerable: true, get: function () { return array_1.uniquify; } });
14
+ Object.defineProperty(exports, "uniquifyByKey", { enumerable: true, get: function () { return array_1.uniquifyByKey; } });
15
+ tslib_1.__exportStar(require("@telperion/js-utils/class"), exports);
16
+ tslib_1.__exportStar(require("@telperion/js-utils/function"), exports);
17
+ tslib_1.__exportStar(require("@telperion/js-utils/map"), exports);
18
+ tslib_1.__exportStar(require("@telperion/js-utils/math"), exports);
19
+ var object_1 = require("@telperion/js-utils/object");
20
+ Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return object_1.clone; } });
21
+ Object.defineProperty(exports, "deepest", { enumerable: true, get: function () { return object_1.deepest; } });
22
+ Object.defineProperty(exports, "deepFreeze", { enumerable: true, get: function () { return object_1.deepFreeze; } });
23
+ tslib_1.__exportStar(require("@telperion/js-utils/promise"), exports);
24
+ // export { } from '@telperion/js-utils/string';
25
+ tslib_1.__exportStar(require("@telperion/js-utils/compact"), exports);
26
+ tslib_1.__exportStar(require("@telperion/js-utils/is-falsy"), exports);
27
+ tslib_1.__exportStar(require("@telperion/js-utils/is-truthy"), exports);
28
+ tslib_1.__exportStar(require("@telperion/js-utils/open-promise"), exports);
29
+ tslib_1.__exportStar(require("@telperion/js-utils/smart-map"), exports);
30
+ tslib_1.__exportStar(require("@telperion/js-utils/unique-id"), exports);
31
+ tslib_1.__exportStar(require("@telperion/js-utils/limit"), exports);
package/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ export { ReplaceByMapOptions, ReplaceItemsOptions, Inclusion, Substraction, arrayize, asyncMap, difference, findByKey, intersection, remove, replace, uniquify, uniquifyByKey } from '@telperion/js-utils/array';
2
+ export * from '@telperion/js-utils/class';
3
+ export * from '@telperion/js-utils/function';
4
+ export * from '@telperion/js-utils/map';
5
+ export * from '@telperion/js-utils/math';
6
+ export { clone, deepest, deepFreeze } from '@telperion/js-utils/object';
7
+ export * from '@telperion/js-utils/promise';
8
+ export * from '@telperion/js-utils/compact';
9
+ export * from '@telperion/js-utils/is-falsy';
10
+ export * from '@telperion/js-utils/is-truthy';
11
+ export * from '@telperion/js-utils/open-promise';
12
+ export * from '@telperion/js-utils/smart-map';
13
+ export * from '@telperion/js-utils/unique-id';
14
+ export * from '@telperion/js-utils/limit';
package/index.js ADDED
@@ -0,0 +1,17 @@
1
+ export { arrayize, asyncMap, difference, findByKey, intersection, remove, replace, uniquify, uniquifyByKey } from '@telperion/js-utils/array';
2
+ export * from '@telperion/js-utils/class';
3
+ export * from '@telperion/js-utils/function';
4
+ export * from '@telperion/js-utils/map';
5
+ export * from '@telperion/js-utils/math';
6
+ export { clone, deepest, deepFreeze } from '@telperion/js-utils/object';
7
+ export * from '@telperion/js-utils/promise';
8
+ // export { } from '@telperion/js-utils/string';
9
+ export * from '@telperion/js-utils/compact';
10
+ export * from '@telperion/js-utils/is-falsy';
11
+ export * from '@telperion/js-utils/is-truthy';
12
+ export * from '@telperion/js-utils/open-promise';
13
+ export * from '@telperion/js-utils/smart-map';
14
+ export * from '@telperion/js-utils/unique-id';
15
+ export * from '@telperion/js-utils/limit';
16
+
17
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../libs/js-utils/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,SAAS,EACT,YAAY,EACZ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,aAAa,EACd,MAAM,2BAA2B,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxE,cAAc,6BAA6B,CAAC;AAC5C,iDAAiD;AAEjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC","file":"index.js","sourcesContent":["export {\n ReplaceByMapOptions,\n ReplaceItemsOptions,\n Inclusion,\n Substraction,\n arrayize,\n asyncMap,\n difference,\n findByKey,\n intersection,\n remove,\n replace,\n uniquify,\n uniquifyByKey\n} from '@telperion/js-utils/array';\nexport * from '@telperion/js-utils/class';\nexport * from '@telperion/js-utils/function';\nexport * from '@telperion/js-utils/map';\nexport * from '@telperion/js-utils/math';\nexport { clone, deepest, deepFreeze } from '@telperion/js-utils/object';\nexport * from '@telperion/js-utils/promise';\n// export { } from '@telperion/js-utils/string';\n\nexport * from '@telperion/js-utils/compact';\nexport * from '@telperion/js-utils/is-falsy';\nexport * from '@telperion/js-utils/is-truthy';\nexport * from '@telperion/js-utils/open-promise';\nexport * from '@telperion/js-utils/smart-map';\nexport * from '@telperion/js-utils/unique-id';\nexport * from '@telperion/js-utils/limit';\n"]}
package/is-falsy.cjs ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFalsy = isFalsy;
4
+ /**
5
+ * #### Returns whether the entered value is falsy
6
+ *
7
+ * * * *
8
+ * Example usage:
9
+ * ```typescript
10
+ * import { isFalsy } from "@telperion/js-utils";
11
+ *
12
+ * isFalsy(undefined); // true
13
+ * isFalsy(true); // false
14
+ * isFalsy([]) // false
15
+ *
16
+ * const falsyValues = ["a", undefined, "b", "", "c"].filter(isFalsy); // [undefined, ""]
17
+ * ```
18
+ * Static usage example:
19
+ * ```typescript
20
+ * import "@telperion/js-utils/dist/as-static/is-falsy";
21
+ *
22
+ * Boolean.isFalsy(undefined); // true
23
+ * Boolean.isFalsy(true); // false
24
+ * Boolean.isFalsy([]) // false
25
+ *
26
+ * const falsyValues = ["a", undefined, "b", "", "c"].filter(Boolean.isFalsy); // [undefined, ""]
27
+ * ```
28
+ * * * *
29
+ * @param value value to be checked
30
+ */
31
+ function isFalsy(value) {
32
+ return !value;
33
+ }
package/is-falsy.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * #### Returns whether the entered value is falsy
3
+ *
4
+ * * * *
5
+ * Example usage:
6
+ * ```typescript
7
+ * import { isFalsy } from "@telperion/js-utils";
8
+ *
9
+ * isFalsy(undefined); // true
10
+ * isFalsy(true); // false
11
+ * isFalsy([]) // false
12
+ *
13
+ * const falsyValues = ["a", undefined, "b", "", "c"].filter(isFalsy); // [undefined, ""]
14
+ * ```
15
+ * Static usage example:
16
+ * ```typescript
17
+ * import "@telperion/js-utils/dist/as-static/is-falsy";
18
+ *
19
+ * Boolean.isFalsy(undefined); // true
20
+ * Boolean.isFalsy(true); // false
21
+ * Boolean.isFalsy([]) // false
22
+ *
23
+ * const falsyValues = ["a", undefined, "b", "", "c"].filter(Boolean.isFalsy); // [undefined, ""]
24
+ * ```
25
+ * * * *
26
+ * @param value value to be checked
27
+ */
28
+ export declare function isFalsy(value: any): boolean;