es-toolkit 1.23.0-dev.749 → 1.23.0-dev.751

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/index.js CHANGED
@@ -5,13 +5,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
  const zipWith = require('./_chunk/zipWith-CV0XAX.js');
6
6
  const array_index = require('./array/index.js');
7
7
  const promise_index = require('./_chunk/index-BGZDR9.js');
8
+ const unary = require('./_chunk/unary-BZ5Ixo.js');
8
9
  const function_index = require('./function/index.js');
9
- const flowRight = require('./_chunk/flowRight-Cf9ldK.js');
10
10
  const noop = require('./_chunk/noop-2IwLUk.js');
11
11
  const sumBy = require('./_chunk/sumBy-BkErWJ.js');
12
12
  const randomInt = require('./_chunk/randomInt-CF7bZK.js');
13
13
  const math_index = require('./math/index.js');
14
- const toMerged = require('./_chunk/toMerged-CkfNn9.js');
14
+ const toMerged = require('./_chunk/toMerged-DDLv0D.js');
15
15
  const object_index = require('./object/index.js');
16
16
  const isWeakSet = require('./_chunk/isWeakSet-Bd6nry.js');
17
17
  const predicate_index = require('./predicate/index.js');
@@ -82,23 +82,23 @@ exports.TimeoutError = promise_index.TimeoutError;
82
82
  exports.delay = promise_index.delay;
83
83
  exports.timeout = promise_index.timeout;
84
84
  exports.withTimeout = promise_index.withTimeout;
85
+ exports.after = unary.after;
86
+ exports.ary = unary.ary;
87
+ exports.debounce = unary.debounce;
88
+ exports.flow = unary.flow;
89
+ exports.flowRight = unary.flowRight;
90
+ exports.memoize = unary.memoize;
91
+ exports.negate = unary.negate;
92
+ exports.once = unary.once;
93
+ exports.partial = unary.partial;
94
+ exports.partialRight = unary.partialRight;
95
+ exports.rest = unary.rest;
96
+ exports.unary = unary.unary;
85
97
  exports.before = function_index.before;
86
98
  exports.curry = function_index.curry;
87
99
  exports.curryRight = function_index.curryRight;
88
100
  exports.spread = function_index.spread;
89
101
  exports.throttle = function_index.throttle;
90
- exports.after = flowRight.after;
91
- exports.ary = flowRight.ary;
92
- exports.debounce = flowRight.debounce;
93
- exports.flow = flowRight.flow;
94
- exports.flowRight = flowRight.flowRight;
95
- exports.memoize = flowRight.memoize;
96
- exports.negate = flowRight.negate;
97
- exports.once = flowRight.once;
98
- exports.partial = flowRight.partial;
99
- exports.partialRight = flowRight.partialRight;
100
- exports.rest = flowRight.rest;
101
- exports.unary = flowRight.unary;
102
102
  exports.noop = noop.noop;
103
103
  exports.clamp = sumBy.clamp;
104
104
  exports.inRange = sumBy.inRange;
package/dist/index.mjs CHANGED
@@ -56,24 +56,24 @@ export { zipObject } from './array/zipObject.mjs';
56
56
  export { zipWith } from './array/zipWith.mjs';
57
57
  export { AbortError } from './error/AbortError.mjs';
58
58
  export { TimeoutError } from './error/TimeoutError.mjs';
59
- export { before } from './function/before.mjs';
60
59
  export { after } from './function/after.mjs';
60
+ export { ary } from './function/ary.mjs';
61
+ export { before } from './function/before.mjs';
62
+ export { curry } from './function/curry.mjs';
63
+ export { curryRight } from './function/curryRight.mjs';
61
64
  export { debounce } from './function/debounce.mjs';
65
+ export { flow } from './function/flow.mjs';
66
+ export { flowRight } from './function/flowRight.mjs';
67
+ export { memoize } from './function/memoize.mjs';
68
+ export { negate } from './function/negate.mjs';
62
69
  export { noop } from './function/noop.mjs';
63
70
  export { once } from './function/once.mjs';
64
- export { throttle } from './function/throttle.mjs';
65
- export { negate } from './function/negate.mjs';
66
- export { memoize } from './function/memoize.mjs';
67
- export { ary } from './function/ary.mjs';
68
- export { unary } from './function/unary.mjs';
69
71
  export { partial } from './function/partial.mjs';
70
72
  export { partialRight } from './function/partialRight.mjs';
71
73
  export { rest } from './function/rest.mjs';
72
- export { curry } from './function/curry.mjs';
73
- export { curryRight } from './function/curryRight.mjs';
74
74
  export { spread } from './function/spread.mjs';
75
- export { flow } from './function/flow.mjs';
76
- export { flowRight } from './function/flowRight.mjs';
75
+ export { throttle } from './function/throttle.mjs';
76
+ export { unary } from './function/unary.mjs';
77
77
  export { clamp } from './math/clamp.mjs';
78
78
  export { inRange } from './math/inRange.mjs';
79
79
  export { mean } from './math/mean.mjs';
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const toMerged = require('../_chunk/toMerged-CkfNn9.js');
5
+ const toMerged = require('../_chunk/toMerged-DDLv0D.js');
6
6
 
7
7
  function mergeWith(target, source, merge) {
8
8
  const sourceKeys = Object.keys(source);
@@ -1,8 +1,9 @@
1
1
  function pickBy(obj, shouldPick) {
2
2
  const result = {};
3
- const objEntries = Object.entries(obj);
4
- for (let i = 0; i < objEntries.length; i++) {
5
- const [key, value] = objEntries[i];
3
+ const keys = Object.keys(obj);
4
+ for (let i = 0; i < keys.length; i++) {
5
+ const key = keys[i];
6
+ const value = obj[key];
6
7
  if (shouldPick(value, key)) {
7
8
  result[key] = value;
8
9
  }
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.23.0-dev.749+c367c374",
4
+ "version": "1.23.0-dev.751+aaec4abb",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {
@@ -237,7 +237,7 @@
237
237
  "globals": "^15.9.0",
238
238
  "jscodeshift": "^17.0.0",
239
239
  "prettier": "^3.2.5",
240
- "prettier-plugin-sort-re-exports": "^0.0.1",
240
+ "prettier-plugin-sort-re-exports": "^0.1.0",
241
241
  "rollup": "^4.19.0",
242
242
  "rollup-plugin-dts": "^6.1.1",
243
243
  "tar": "^6",
@@ -13,6 +13,12 @@ function after(n, func) {
13
13
  });
14
14
  }
15
15
 
16
+ function ary(func, n) {
17
+ return function (...args) {
18
+ return func.apply(this, args.slice(0, n));
19
+ };
20
+ }
21
+
16
22
  function debounce(func, debounceMs, { signal, edges } = {}) {
17
23
  let pendingThis = undefined;
18
24
  let pendingArgs = null;
@@ -75,20 +81,18 @@ function debounce(func, debounceMs, { signal, edges } = {}) {
75
81
  return debounced;
76
82
  }
77
83
 
78
- function once(func) {
79
- let called = false;
80
- let cache;
84
+ function flow(...funcs) {
81
85
  return function (...args) {
82
- if (!called) {
83
- called = true;
84
- cache = func(...args);
86
+ let result = funcs.length ? funcs[0].apply(this, args) : args[0];
87
+ for (let i = 1; i < funcs.length; i++) {
88
+ result = funcs[i].call(this, result);
85
89
  }
86
- return cache;
90
+ return result;
87
91
  };
88
92
  }
89
93
 
90
- function negate(func) {
91
- return ((...args) => !func(...args));
94
+ function flowRight(...funcs) {
95
+ return flow(...funcs.reverse());
92
96
  }
93
97
 
94
98
  function memoize(fn, options = {}) {
@@ -106,14 +110,20 @@ function memoize(fn, options = {}) {
106
110
  return memoizedFn;
107
111
  }
108
112
 
109
- function ary(func, n) {
110
- return function (...args) {
111
- return func.apply(this, args.slice(0, n));
112
- };
113
+ function negate(func) {
114
+ return ((...args) => !func(...args));
113
115
  }
114
116
 
115
- function unary(func) {
116
- return ary(func, 1);
117
+ function once(func) {
118
+ let called = false;
119
+ let cache;
120
+ return function (...args) {
121
+ if (!called) {
122
+ called = true;
123
+ cache = func(...args);
124
+ }
125
+ return cache;
126
+ };
117
127
  }
118
128
 
119
129
  function partial(func, ...partialArgs) {
@@ -173,18 +183,8 @@ function rest(func, startIndex = func.length - 1) {
173
183
  };
174
184
  }
175
185
 
176
- function flow(...funcs) {
177
- return function (...args) {
178
- let result = funcs.length ? funcs[0].apply(this, args) : args[0];
179
- for (let i = 1; i < funcs.length; i++) {
180
- result = funcs[i].call(this, result);
181
- }
182
- return result;
183
- };
184
- }
185
-
186
- function flowRight(...funcs) {
187
- return flow(...funcs.reverse());
186
+ function unary(func) {
187
+ return ary(func, 1);
188
188
  }
189
189
 
190
190
  exports.after = after;