@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.
- package/LICENSE +21 -0
- package/README.md +621 -0
- package/array/arrayize.cjs +22 -0
- package/array/arrayize.d.ts +17 -0
- package/array/arrayize.js +21 -0
- package/array/arrayize.js.map +1 -0
- package/array/async-map.cjs +40 -0
- package/array/async-map.d.ts +34 -0
- package/array/async-map.js +39 -0
- package/array/async-map.js.map +1 -0
- package/array/compact.cjs +34 -0
- package/array/compact.d.ts +28 -0
- package/array/compact.js +33 -0
- package/array/compact.js.map +1 -0
- package/array/difference.cjs +16 -0
- package/array/difference.d.ts +45 -0
- package/array/difference.js +15 -0
- package/array/difference.js.map +1 -0
- package/array/find-by-key.cjs +35 -0
- package/array/find-by-key.d.ts +30 -0
- package/array/find-by-key.js +34 -0
- package/array/find-by-key.js.map +1 -0
- package/array/index.cjs +14 -0
- package/array/index.d.ts +11 -0
- package/array/index.js +13 -0
- package/array/index.js.map +1 -0
- package/array/intersection.cjs +16 -0
- package/array/intersection.d.ts +45 -0
- package/array/intersection.js +15 -0
- package/array/intersection.js.map +1 -0
- package/array/limit.cjs +37 -0
- package/array/limit.d.ts +29 -0
- package/array/limit.js +36 -0
- package/array/limit.js.map +1 -0
- package/array/proto/async-map.cjs +6 -0
- package/array/proto/async-map.d.ts +25 -0
- package/array/proto/async-map.js +6 -0
- package/array/proto/async-map.js.map +1 -0
- package/array/proto/compact.cjs +6 -0
- package/array/proto/compact.d.ts +15 -0
- package/array/proto/compact.js +6 -0
- package/array/proto/compact.js.map +1 -0
- package/array/proto/difference.cjs +6 -0
- package/array/proto/difference.d.ts +27 -0
- package/array/proto/difference.js +6 -0
- package/array/proto/difference.js.map +1 -0
- package/array/proto/find-by-key.cjs +6 -0
- package/array/proto/find-by-key.d.ts +25 -0
- package/array/proto/find-by-key.js +6 -0
- package/array/proto/find-by-key.js.map +1 -0
- package/array/proto/intersection.cjs +6 -0
- package/array/proto/intersection.d.ts +27 -0
- package/array/proto/intersection.js +6 -0
- package/array/proto/intersection.js.map +1 -0
- package/array/proto/limit.cjs +6 -0
- package/array/proto/limit.d.ts +24 -0
- package/array/proto/limit.js +6 -0
- package/array/proto/limit.js.map +1 -0
- package/array/proto/remove.cjs +6 -0
- package/array/proto/remove.d.ts +32 -0
- package/array/proto/remove.js +6 -0
- package/array/proto/remove.js.map +1 -0
- package/array/proto/replace.cjs +6 -0
- package/array/proto/replace.d.ts +72 -0
- package/array/proto/replace.js +6 -0
- package/array/proto/replace.js.map +1 -0
- package/array/proto/uniquify-by-key.cjs +6 -0
- package/array/proto/uniquify-by-key.d.ts +24 -0
- package/array/proto/uniquify-by-key.js +6 -0
- package/array/proto/uniquify-by-key.js.map +1 -0
- package/array/proto/uniquify.cjs +6 -0
- package/array/proto/uniquify.d.ts +23 -0
- package/array/proto/uniquify.js +6 -0
- package/array/proto/uniquify.js.map +1 -0
- package/array/remove.cjs +46 -0
- package/array/remove.d.ts +33 -0
- package/array/remove.js +45 -0
- package/array/remove.js.map +1 -0
- package/array/replace.cjs +69 -0
- package/array/replace.d.ts +139 -0
- package/array/replace.js +68 -0
- package/array/replace.js.map +1 -0
- package/array/static/arrayize.cjs +4 -0
- package/array/static/arrayize.d.ts +6 -0
- package/array/static/arrayize.js +4 -0
- package/array/static/arrayize.js.map +1 -0
- package/array/uniquify-by-key.cjs +41 -0
- package/array/uniquify-by-key.d.ts +29 -0
- package/array/uniquify-by-key.js +40 -0
- package/array/uniquify-by-key.js.map +1 -0
- package/array/uniquify.cjs +32 -0
- package/array/uniquify.d.ts +27 -0
- package/array/uniquify.js +31 -0
- package/array/uniquify.js.map +1 -0
- package/boolean/static/is-falsy.cjs +4 -0
- package/boolean/static/is-falsy.d.ts +23 -0
- package/boolean/static/is-falsy.js +4 -0
- package/boolean/static/is-falsy.js.map +1 -0
- package/boolean/static/is-truthy.cjs +4 -0
- package/boolean/static/is-truthy.d.ts +23 -0
- package/boolean/static/is-truthy.js +4 -0
- package/boolean/static/is-truthy.js.map +1 -0
- package/class/index.cjs +4 -0
- package/class/index.d.ts +1 -0
- package/class/index.js +3 -0
- package/class/index.js.map +1 -0
- package/class/mixin.cjs +60 -0
- package/class/mixin.d.ts +50 -0
- package/class/mixin.js +59 -0
- package/class/mixin.js.map +1 -0
- package/compact.cjs +39 -0
- package/compact.d.ts +2 -0
- package/compact.js +38 -0
- package/compact.js.map +1 -0
- package/function/call.cjs +6 -0
- package/function/call.d.ts +1 -0
- package/function/call.js +5 -0
- package/function/call.js.map +1 -0
- package/function/debounce.cjs +85 -0
- package/function/debounce.d.ts +44 -0
- package/function/debounce.js +82 -0
- package/function/debounce.js.map +1 -0
- package/function/defer.cjs +42 -0
- package/function/defer.d.ts +26 -0
- package/function/defer.js +41 -0
- package/function/defer.js.map +1 -0
- package/function/index.cjs +8 -0
- package/function/index.d.ts +5 -0
- package/function/index.js +7 -0
- package/function/index.js.map +1 -0
- package/function/noop.cjs +23 -0
- package/function/noop.d.ts +20 -0
- package/function/noop.js +22 -0
- package/function/noop.js.map +1 -0
- package/function/of.cjs +44 -0
- package/function/of.d.ts +31 -0
- package/function/of.js +43 -0
- package/function/of.js.map +1 -0
- package/function/proto/debounce.cjs +6 -0
- package/function/proto/debounce.d.ts +30 -0
- package/function/proto/debounce.js +6 -0
- package/function/proto/debounce.js.map +1 -0
- package/function/static/call.cjs +4 -0
- package/function/static/call.d.ts +6 -0
- package/function/static/call.js +4 -0
- package/function/static/call.js.map +1 -0
- package/function/static/defer.cjs +4 -0
- package/function/static/defer.d.ts +23 -0
- package/function/static/defer.js +4 -0
- package/function/static/defer.js.map +1 -0
- package/function/static/noop.cjs +4 -0
- package/function/static/noop.d.ts +18 -0
- package/function/static/noop.js +4 -0
- package/function/static/noop.js.map +1 -0
- package/function/static/of.cjs +4 -0
- package/function/static/of.d.ts +26 -0
- package/function/static/of.js +4 -0
- package/function/static/of.js.map +1 -0
- package/index.cjs +31 -0
- package/index.d.ts +14 -0
- package/index.js +17 -0
- package/index.js.map +1 -0
- package/is-falsy.cjs +33 -0
- package/is-falsy.d.ts +28 -0
- package/is-falsy.js +32 -0
- package/is-falsy.js.map +1 -0
- package/is-truthy.cjs +33 -0
- package/is-truthy.d.ts +28 -0
- package/is-truthy.js +32 -0
- package/is-truthy.js.map +1 -0
- package/limit.cjs +34 -0
- package/limit.d.ts +2 -0
- package/limit.js +33 -0
- package/limit.js.map +1 -0
- package/map/index.cjs +4 -0
- package/map/index.d.ts +1 -0
- package/map/index.js +3 -0
- package/map/index.js.map +1 -0
- package/map/merge.cjs +33 -0
- package/map/merge.d.ts +24 -0
- package/map/merge.js +32 -0
- package/map/merge.js.map +1 -0
- package/math/index.cjs +4 -0
- package/math/index.d.ts +1 -0
- package/math/index.js +3 -0
- package/math/index.js.map +1 -0
- package/math/min-max.cjs +29 -0
- package/math/min-max.d.ts +24 -0
- package/math/min-max.js +28 -0
- package/math/min-max.js.map +1 -0
- package/math/static/min-max.cjs +4 -0
- package/math/static/min-max.d.ts +20 -0
- package/math/static/min-max.js +4 -0
- package/math/static/min-max.js.map +1 -0
- package/object/clone.cjs +157 -0
- package/object/clone.d.ts +161 -0
- package/object/clone.js +156 -0
- package/object/clone.js.map +1 -0
- package/object/compact.cjs +49 -0
- package/object/compact.d.ts +37 -0
- package/object/compact.js +48 -0
- package/object/compact.js.map +1 -0
- package/object/deep-freeze.cjs +16 -0
- package/object/deep-freeze.d.ts +1 -0
- package/object/deep-freeze.js +15 -0
- package/object/deep-freeze.js.map +1 -0
- package/object/deepest.cjs +55 -0
- package/object/deepest.d.ts +47 -0
- package/object/deepest.js +54 -0
- package/object/deepest.js.map +1 -0
- package/object/index.cjs +7 -0
- package/object/index.d.ts +4 -0
- package/object/index.js +6 -0
- package/object/index.js.map +1 -0
- package/object/static/clone.cjs +4 -0
- package/object/static/clone.d.ts +43 -0
- package/object/static/clone.js +4 -0
- package/object/static/clone.js.map +1 -0
- package/object/static/compact.cjs +4 -0
- package/object/static/compact.d.ts +26 -0
- package/object/static/compact.js +4 -0
- package/object/static/compact.js.map +1 -0
- package/object/static/deep-freeze.cjs +4 -0
- package/object/static/deep-freeze.d.ts +6 -0
- package/object/static/deep-freeze.js +4 -0
- package/object/static/deep-freeze.js.map +1 -0
- package/object/static/deepest.cjs +4 -0
- package/object/static/deepest.d.ts +32 -0
- package/object/static/deepest.js +4 -0
- package/object/static/deepest.js.map +1 -0
- package/open-promise.cjs +115 -0
- package/open-promise.d.ts +80 -0
- package/open-promise.js +113 -0
- package/open-promise.js.map +1 -0
- package/package.json +667 -0
- package/promise/chain.cjs +12 -0
- package/promise/chain.d.ts +7 -0
- package/promise/chain.js +11 -0
- package/promise/chain.js.map +1 -0
- package/promise/index.cjs +10 -0
- package/promise/index.d.ts +7 -0
- package/promise/index.js +9 -0
- package/promise/index.js.map +1 -0
- package/promise/never.cjs +41 -0
- package/promise/never.d.ts +34 -0
- package/promise/never.js +39 -0
- package/promise/never.js.map +1 -0
- package/promise/promisify.cjs +12 -0
- package/promise/promisify.d.ts +7 -0
- package/promise/promisify.js +11 -0
- package/promise/promisify.js.map +1 -0
- package/promise/proto/revert.cjs +6 -0
- package/promise/proto/revert.d.ts +29 -0
- package/promise/proto/revert.js +6 -0
- package/promise/proto/revert.js.map +1 -0
- package/promise/proto/try-catch.cjs +7 -0
- package/promise/proto/try-catch.d.ts +30 -0
- package/promise/proto/try-catch.js +7 -0
- package/promise/proto/try-catch.js.map +1 -0
- package/promise/revert.cjs +43 -0
- package/promise/revert.d.ts +38 -0
- package/promise/revert.js +42 -0
- package/promise/revert.js.map +1 -0
- package/promise/static/chain.cjs +4 -0
- package/promise/static/chain.d.ts +10 -0
- package/promise/static/chain.js +4 -0
- package/promise/static/chain.js.map +1 -0
- package/promise/static/never.cjs +5 -0
- package/promise/static/never.d.ts +39 -0
- package/promise/static/never.js +5 -0
- package/promise/static/never.js.map +1 -0
- package/promise/static/timeout.cjs +4 -0
- package/promise/static/timeout.d.ts +21 -0
- package/promise/static/timeout.js +4 -0
- package/promise/static/timeout.js.map +1 -0
- package/promise/static/try-one-by-one.cjs +4 -0
- package/promise/static/try-one-by-one.d.ts +27 -0
- package/promise/static/try-one-by-one.js +4 -0
- package/promise/static/try-one-by-one.js.map +1 -0
- package/promise/timeout.cjs +104 -0
- package/promise/timeout.d.ts +109 -0
- package/promise/timeout.js +103 -0
- package/promise/timeout.js.map +1 -0
- package/promise/try-catch.cjs +12 -0
- package/promise/try-catch.d.ts +45 -0
- package/promise/try-catch.js +11 -0
- package/promise/try-catch.js.map +1 -0
- package/promise/try-one-by-one.cjs +59 -0
- package/promise/try-one-by-one.d.ts +42 -0
- package/promise/try-one-by-one.js +58 -0
- package/promise/try-one-by-one.js.map +1 -0
- package/set/proto/difference.cjs +6 -0
- package/set/proto/difference.d.ts +26 -0
- package/set/proto/difference.js +6 -0
- package/set/proto/difference.js.map +1 -0
- package/set/proto/intersection.cjs +6 -0
- package/set/proto/intersection.d.ts +26 -0
- package/set/proto/intersection.js +6 -0
- package/set/proto/intersection.js.map +1 -0
- package/smart-map.cjs +108 -0
- package/smart-map.d.ts +81 -0
- package/smart-map.js +106 -0
- package/smart-map.js.map +1 -0
- package/string/index.cjs +4 -0
- package/string/index.d.ts +1 -0
- package/string/index.js +3 -0
- package/string/index.js.map +1 -0
- package/string/limit.cjs +35 -0
- package/string/limit.d.ts +29 -0
- package/string/limit.js +34 -0
- package/string/limit.js.map +1 -0
- package/string/proto/limit.cjs +6 -0
- package/string/proto/limit.d.ts +30 -0
- package/string/proto/limit.js +6 -0
- package/string/proto/limit.js.map +1 -0
- package/time/days.cjs +21 -0
- package/time/days.d.ts +15 -0
- package/time/days.js +20 -0
- package/time/days.js.map +1 -0
- package/time/hours.cjs +21 -0
- package/time/hours.d.ts +15 -0
- package/time/hours.js +20 -0
- package/time/hours.js.map +1 -0
- package/time/index.cjs +10 -0
- package/time/index.d.ts +7 -0
- package/time/index.js +9 -0
- package/time/index.js.map +1 -0
- package/time/minutes.cjs +21 -0
- package/time/minutes.d.ts +15 -0
- package/time/minutes.js +20 -0
- package/time/minutes.js.map +1 -0
- package/time/months.cjs +21 -0
- package/time/months.d.ts +15 -0
- package/time/months.js +20 -0
- package/time/months.js.map +1 -0
- package/time/seconds.cjs +20 -0
- package/time/seconds.d.ts +15 -0
- package/time/seconds.js +19 -0
- package/time/seconds.js.map +1 -0
- package/time/weeks.cjs +21 -0
- package/time/weeks.d.ts +15 -0
- package/time/weeks.js +20 -0
- package/time/weeks.js.map +1 -0
- package/time/years.cjs +21 -0
- package/time/years.d.ts +15 -0
- package/time/years.js +20 -0
- package/time/years.js.map +1 -0
- package/unique-id.cjs +24 -0
- package/unique-id.d.ts +21 -0
- package/unique-id.js +23 -0
- 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,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;
|
package/function/noop.js
ADDED
|
@@ -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"]}
|
package/function/of.cjs
ADDED
|
@@ -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
|
+
}
|
package/function/of.d.ts
ADDED
|
@@ -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 @@
|
|
|
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,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 @@
|
|
|
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,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 @@
|
|
|
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,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 @@
|
|
|
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;
|