es-toolkit 1.49.0-dev.1915 → 1.49.0-dev.1916

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/fp/pipe.js CHANGED
@@ -54,22 +54,18 @@ function pipe(value, ...functions) {
54
54
  return output;
55
55
  }
56
56
  function chunkFunctions(functions) {
57
- if (functions.length === 0) return [];
58
- let currentGroup = [functions[0]];
59
- const result = [currentGroup];
60
- let previousIsLazy = currentGroup[0].lazy != null;
61
- if (previousIsLazy) currentGroup.lazy = true;
62
- if (currentGroup[0].shortCircuit) currentGroup.shortCircuit = true;
63
- for (let index = 1; index < functions.length; index++) {
57
+ const result = [];
58
+ let currentGroup;
59
+ for (let index = 0; index < functions.length; index++) {
64
60
  const func = functions[index];
65
61
  const isLazy = func.lazy != null;
66
- if (isLazy !== previousIsLazy) {
67
- currentGroup = [func];
62
+ if (currentGroup === void 0 || currentGroup.lazy !== isLazy) {
63
+ currentGroup = [];
64
+ currentGroup.lazy = isLazy;
68
65
  result.push(currentGroup);
69
- } else currentGroup.push(func);
70
- if (isLazy) currentGroup.lazy = true;
66
+ }
67
+ currentGroup.push(func);
71
68
  if (func.shortCircuit) currentGroup.shortCircuit = true;
72
- previousIsLazy = isLazy;
73
69
  }
74
70
  return result;
75
71
  }
package/dist/fp/pipe.mjs CHANGED
@@ -54,22 +54,18 @@ function pipe(value, ...functions) {
54
54
  return output;
55
55
  }
56
56
  function chunkFunctions(functions) {
57
- if (functions.length === 0) return [];
58
- let currentGroup = [functions[0]];
59
- const result = [currentGroup];
60
- let previousIsLazy = currentGroup[0].lazy != null;
61
- if (previousIsLazy) currentGroup.lazy = true;
62
- if (currentGroup[0].shortCircuit) currentGroup.shortCircuit = true;
63
- for (let index = 1; index < functions.length; index++) {
57
+ const result = [];
58
+ let currentGroup;
59
+ for (let index = 0; index < functions.length; index++) {
64
60
  const func = functions[index];
65
61
  const isLazy = func.lazy != null;
66
- if (isLazy !== previousIsLazy) {
67
- currentGroup = [func];
62
+ if (currentGroup === void 0 || currentGroup.lazy !== isLazy) {
63
+ currentGroup = [];
64
+ currentGroup.lazy = isLazy;
68
65
  result.push(currentGroup);
69
- } else currentGroup.push(func);
70
- if (isLazy) currentGroup.lazy = true;
66
+ }
67
+ currentGroup.push(func);
71
68
  if (func.shortCircuit) currentGroup.shortCircuit = true;
72
- previousIsLazy = isLazy;
73
69
  }
74
70
  return result;
75
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
- "version": "1.49.0-dev.1915+62c4d1ad",
3
+ "version": "1.49.0-dev.1916+d40cc87f",
4
4
  "description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
5
5
  "homepage": "https://es-toolkit.dev",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",