es-toolkit 1.22.0-dev.700 → 1.22.0-dev.702
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/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/function/flow.d.mts +133 -0
- package/dist/compat/function/flow.d.ts +133 -0
- package/dist/compat/function/flow.mjs +12 -0
- package/dist/compat/function/flowRight.d.mts +145 -0
- package/dist/compat/function/flowRight.d.ts +145 -0
- package/dist/compat/function/flowRight.mjs +12 -0
- package/dist/compat/index.d.mts +2 -2
- package/dist/compat/index.d.ts +2 -2
- package/dist/compat/index.js +33 -17
- package/dist/compat/index.mjs +2 -2
- package/package.json +1 -1
package/dist/compat/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const zipWith = require('../_chunk/zipWith-EOU_KZ.js');
|
|
6
6
|
const promise_index = require('../_chunk/index-BGZDR9.js');
|
|
7
|
-
const flowRight = require('../_chunk/flowRight-DD5Qyk.js');
|
|
7
|
+
const flowRight$1 = require('../_chunk/flowRight-DD5Qyk.js');
|
|
8
8
|
const range = require('../_chunk/range-BXlMmn.js');
|
|
9
9
|
const randomInt = require('../_chunk/randomInt-CF7bZK.js');
|
|
10
10
|
const toMerged = require('../_chunk/toMerged-QkD_NC.js');
|
|
@@ -905,7 +905,7 @@ function ary(func, n = func.length, guard) {
|
|
|
905
905
|
if (Number.isNaN(n) || n < 0) {
|
|
906
906
|
n = 0;
|
|
907
907
|
}
|
|
908
|
-
return flowRight.ary(func, n);
|
|
908
|
+
return flowRight$1.ary(func, n);
|
|
909
909
|
}
|
|
910
910
|
|
|
911
911
|
function bind(func, thisObj, ...partialArgs) {
|
|
@@ -972,7 +972,7 @@ function rest(func, start = func.length - 1) {
|
|
|
972
972
|
if (Number.isNaN(start) || start < 0) {
|
|
973
973
|
start = func.length - 1;
|
|
974
974
|
}
|
|
975
|
-
return flowRight.rest(func, start);
|
|
975
|
+
return flowRight$1.rest(func, start);
|
|
976
976
|
}
|
|
977
977
|
|
|
978
978
|
function spread(func, argsIndex = 0) {
|
|
@@ -1080,7 +1080,7 @@ function debounce(func, debounceMs = 0, options = {}) {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
let result = undefined;
|
|
1082
1082
|
let pendingAt = null;
|
|
1083
|
-
const _debounced = flowRight.debounce(function (...args) {
|
|
1083
|
+
const _debounced = flowRight$1.debounce(function (...args) {
|
|
1084
1084
|
result = func.apply(this, args);
|
|
1085
1085
|
pendingAt = null;
|
|
1086
1086
|
}, debounceMs, { signal, edges });
|
|
@@ -1125,6 +1125,22 @@ function flip(func) {
|
|
|
1125
1125
|
};
|
|
1126
1126
|
}
|
|
1127
1127
|
|
|
1128
|
+
function flow(...funcs) {
|
|
1129
|
+
const flattenFuncs = zipWith.flatten(funcs, 1);
|
|
1130
|
+
if (flattenFuncs.some(func => typeof func !== 'function')) {
|
|
1131
|
+
throw new TypeError('Expected a function');
|
|
1132
|
+
}
|
|
1133
|
+
return flowRight$1.flow(...flattenFuncs);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
function flowRight(...funcs) {
|
|
1137
|
+
const flattenFuncs = zipWith.flatten(funcs, 1);
|
|
1138
|
+
if (flattenFuncs.some(func => typeof func !== 'function')) {
|
|
1139
|
+
throw new TypeError('Expected a function');
|
|
1140
|
+
}
|
|
1141
|
+
return flowRight$1.flowRight(...flattenFuncs);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1128
1144
|
function isNil(x) {
|
|
1129
1145
|
return x == null;
|
|
1130
1146
|
}
|
|
@@ -1392,7 +1408,7 @@ function mergeWithDeep(target, source, merge, stack) {
|
|
|
1392
1408
|
}
|
|
1393
1409
|
|
|
1394
1410
|
function merge(object, ...sources) {
|
|
1395
|
-
return mergeWith(object, ...sources, flowRight.noop);
|
|
1411
|
+
return mergeWith(object, ...sources, flowRight$1.noop);
|
|
1396
1412
|
}
|
|
1397
1413
|
|
|
1398
1414
|
function isArrayLike(value) {
|
|
@@ -1845,18 +1861,16 @@ exports.TimeoutError = promise_index.TimeoutError;
|
|
|
1845
1861
|
exports.delay = promise_index.delay;
|
|
1846
1862
|
exports.timeout = promise_index.timeout;
|
|
1847
1863
|
exports.withTimeout = promise_index.withTimeout;
|
|
1848
|
-
exports.after = flowRight.after;
|
|
1849
|
-
exports.before = flowRight.before;
|
|
1850
|
-
exports.curryRight = flowRight.curryRight;
|
|
1851
|
-
exports.
|
|
1852
|
-
exports.
|
|
1853
|
-
exports.
|
|
1854
|
-
exports.
|
|
1855
|
-
exports.
|
|
1856
|
-
exports.
|
|
1857
|
-
exports.
|
|
1858
|
-
exports.partialRight = flowRight.partialRight;
|
|
1859
|
-
exports.unary = flowRight.unary;
|
|
1864
|
+
exports.after = flowRight$1.after;
|
|
1865
|
+
exports.before = flowRight$1.before;
|
|
1866
|
+
exports.curryRight = flowRight$1.curryRight;
|
|
1867
|
+
exports.memoize = flowRight$1.memoize;
|
|
1868
|
+
exports.negate = flowRight$1.negate;
|
|
1869
|
+
exports.noop = flowRight$1.noop;
|
|
1870
|
+
exports.once = flowRight$1.once;
|
|
1871
|
+
exports.partial = flowRight$1.partial;
|
|
1872
|
+
exports.partialRight = flowRight$1.partialRight;
|
|
1873
|
+
exports.unary = flowRight$1.unary;
|
|
1860
1874
|
exports.mean = range.mean;
|
|
1861
1875
|
exports.meanBy = range.meanBy;
|
|
1862
1876
|
exports.range = range.range;
|
|
@@ -1924,6 +1938,8 @@ exports.flattenDeep = flattenDeep;
|
|
|
1924
1938
|
exports.flattenDepth = flattenDepth;
|
|
1925
1939
|
exports.flip = flip;
|
|
1926
1940
|
exports.floor = floor;
|
|
1941
|
+
exports.flow = flow;
|
|
1942
|
+
exports.flowRight = flowRight;
|
|
1927
1943
|
exports.fromPairs = fromPairs;
|
|
1928
1944
|
exports.get = get;
|
|
1929
1945
|
exports.has = has;
|
package/dist/compat/index.mjs
CHANGED
|
@@ -57,8 +57,6 @@ export { unary } from '../function/unary.mjs';
|
|
|
57
57
|
export { partial } from '../function/partial.mjs';
|
|
58
58
|
export { partialRight } from '../function/partialRight.mjs';
|
|
59
59
|
export { curryRight } from '../function/curryRight.mjs';
|
|
60
|
-
export { flow } from '../function/flow.mjs';
|
|
61
|
-
export { flowRight } from '../function/flowRight.mjs';
|
|
62
60
|
export { mean } from '../math/mean.mjs';
|
|
63
61
|
export { meanBy } from '../math/meanBy.mjs';
|
|
64
62
|
export { randomInt } from '../math/randomInt.mjs';
|
|
@@ -133,6 +131,8 @@ export { curry } from './function/curry.mjs';
|
|
|
133
131
|
export { debounce } from './function/debounce.mjs';
|
|
134
132
|
export { throttle } from './function/throttle.mjs';
|
|
135
133
|
export { flip } from './function/flip.mjs';
|
|
134
|
+
export { flow } from './function/flow.mjs';
|
|
135
|
+
export { flowRight } from './function/flowRight.mjs';
|
|
136
136
|
export { get } from './object/get.mjs';
|
|
137
137
|
export { set } from './object/set.mjs';
|
|
138
138
|
export { pick } from './object/pick.mjs';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
3
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
4
|
-
"version": "1.22.0-dev.
|
|
4
|
+
"version": "1.22.0-dev.702+674d0868",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|