es-toolkit 1.51.0-dev.2069 → 1.51.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 (142) hide show
  1. package/dist/browser.global.js +1 -1
  2. package/dist/compat/function/debounce.js +1 -1
  3. package/dist/compat/function/debounce.mjs +1 -1
  4. package/package.json +1 -44
  5. package/dist/fp/iterator/chunk.d.mts +0 -19
  6. package/dist/fp/iterator/chunk.d.ts +0 -19
  7. package/dist/fp/iterator/chunk.js +0 -24
  8. package/dist/fp/iterator/chunk.mjs +0 -24
  9. package/dist/fp/iterator/count.d.mts +0 -20
  10. package/dist/fp/iterator/count.d.ts +0 -20
  11. package/dist/fp/iterator/count.js +0 -25
  12. package/dist/fp/iterator/count.mjs +0 -25
  13. package/dist/fp/iterator/drop.d.mts +0 -20
  14. package/dist/fp/iterator/drop.d.ts +0 -20
  15. package/dist/fp/iterator/drop.js +0 -24
  16. package/dist/fp/iterator/drop.mjs +0 -24
  17. package/dist/fp/iterator/dropWhile.d.mts +0 -18
  18. package/dist/fp/iterator/dropWhile.d.ts +0 -18
  19. package/dist/fp/iterator/dropWhile.js +0 -23
  20. package/dist/fp/iterator/dropWhile.mjs +0 -23
  21. package/dist/fp/iterator/every.d.mts +0 -20
  22. package/dist/fp/iterator/every.d.ts +0 -20
  23. package/dist/fp/iterator/every.js +0 -24
  24. package/dist/fp/iterator/every.mjs +0 -24
  25. package/dist/fp/iterator/filter.d.mts +0 -37
  26. package/dist/fp/iterator/filter.d.ts +0 -37
  27. package/dist/fp/iterator/filter.js +0 -8
  28. package/dist/fp/iterator/filter.mjs +0 -8
  29. package/dist/fp/iterator/find.d.mts +0 -20
  30. package/dist/fp/iterator/find.d.ts +0 -20
  31. package/dist/fp/iterator/find.js +0 -24
  32. package/dist/fp/iterator/find.mjs +0 -24
  33. package/dist/fp/iterator/flatMap.d.mts +0 -20
  34. package/dist/fp/iterator/flatMap.d.ts +0 -20
  35. package/dist/fp/iterator/flatMap.js +0 -24
  36. package/dist/fp/iterator/flatMap.mjs +0 -24
  37. package/dist/fp/iterator/forEach.d.mts +0 -22
  38. package/dist/fp/iterator/forEach.d.ts +0 -22
  39. package/dist/fp/iterator/forEach.js +0 -26
  40. package/dist/fp/iterator/forEach.mjs +0 -26
  41. package/dist/fp/iterator/head.d.mts +0 -19
  42. package/dist/fp/iterator/head.d.ts +0 -19
  43. package/dist/fp/iterator/head.js +0 -24
  44. package/dist/fp/iterator/head.mjs +0 -24
  45. package/dist/fp/iterator/index.d.mts +0 -21
  46. package/dist/fp/iterator/index.d.ts +0 -21
  47. package/dist/fp/iterator/index.js +0 -41
  48. package/dist/fp/iterator/index.mjs +0 -21
  49. package/dist/fp/iterator/map.d.mts +0 -20
  50. package/dist/fp/iterator/map.d.ts +0 -20
  51. package/dist/fp/iterator/map.js +0 -24
  52. package/dist/fp/iterator/map.mjs +0 -24
  53. package/dist/fp/iterator/partition.d.mts +0 -22
  54. package/dist/fp/iterator/partition.d.ts +0 -22
  55. package/dist/fp/iterator/partition.js +0 -27
  56. package/dist/fp/iterator/partition.mjs +0 -27
  57. package/dist/fp/iterator/reduce.d.mts +0 -24
  58. package/dist/fp/iterator/reduce.d.ts +0 -24
  59. package/dist/fp/iterator/reduce.js +0 -28
  60. package/dist/fp/iterator/reduce.mjs +0 -28
  61. package/dist/fp/iterator/scan.d.mts +0 -21
  62. package/dist/fp/iterator/scan.d.ts +0 -21
  63. package/dist/fp/iterator/scan.js +0 -26
  64. package/dist/fp/iterator/scan.mjs +0 -26
  65. package/dist/fp/iterator/some.d.mts +0 -20
  66. package/dist/fp/iterator/some.d.ts +0 -20
  67. package/dist/fp/iterator/some.js +0 -24
  68. package/dist/fp/iterator/some.mjs +0 -24
  69. package/dist/fp/iterator/take.d.mts +0 -21
  70. package/dist/fp/iterator/take.d.ts +0 -21
  71. package/dist/fp/iterator/take.js +0 -25
  72. package/dist/fp/iterator/take.mjs +0 -25
  73. package/dist/fp/iterator/takeWhile.d.mts +0 -19
  74. package/dist/fp/iterator/takeWhile.d.ts +0 -19
  75. package/dist/fp/iterator/takeWhile.js +0 -24
  76. package/dist/fp/iterator/takeWhile.mjs +0 -24
  77. package/dist/fp/iterator/toArray.d.mts +0 -21
  78. package/dist/fp/iterator/toArray.d.ts +0 -21
  79. package/dist/fp/iterator/toArray.js +0 -25
  80. package/dist/fp/iterator/toArray.mjs +0 -25
  81. package/dist/fp/iterator/uniqBy.d.mts +0 -20
  82. package/dist/fp/iterator/uniqBy.d.ts +0 -20
  83. package/dist/fp/iterator/uniqBy.js +0 -25
  84. package/dist/fp/iterator/uniqBy.mjs +0 -25
  85. package/dist/fp/iterator/zip.d.mts +0 -20
  86. package/dist/fp/iterator/zip.d.ts +0 -20
  87. package/dist/fp/iterator/zip.js +0 -25
  88. package/dist/fp/iterator/zip.mjs +0 -25
  89. package/dist/iterator/_internal/iterator.js +0 -74
  90. package/dist/iterator/_internal/iterator.mjs +0 -74
  91. package/dist/iterator/chunk.d.mts +0 -21
  92. package/dist/iterator/chunk.d.ts +0 -21
  93. package/dist/iterator/chunk.js +0 -40
  94. package/dist/iterator/chunk.mjs +0 -40
  95. package/dist/iterator/count.d.mts +0 -18
  96. package/dist/iterator/count.d.ts +0 -18
  97. package/dist/iterator/count.js +0 -26
  98. package/dist/iterator/count.mjs +0 -26
  99. package/dist/iterator/dropWhile.d.mts +0 -20
  100. package/dist/iterator/dropWhile.d.ts +0 -20
  101. package/dist/iterator/dropWhile.js +0 -52
  102. package/dist/iterator/dropWhile.mjs +0 -52
  103. package/dist/iterator/head.d.mts +0 -21
  104. package/dist/iterator/head.d.ts +0 -21
  105. package/dist/iterator/head.js +0 -26
  106. package/dist/iterator/head.mjs +0 -26
  107. package/dist/iterator/index.d.mts +0 -12
  108. package/dist/iterator/index.d.ts +0 -12
  109. package/dist/iterator/index.js +0 -23
  110. package/dist/iterator/index.mjs +0 -12
  111. package/dist/iterator/iterate.d.mts +0 -20
  112. package/dist/iterator/iterate.d.ts +0 -20
  113. package/dist/iterator/iterate.js +0 -32
  114. package/dist/iterator/iterate.mjs +0 -32
  115. package/dist/iterator/partition.d.mts +0 -18
  116. package/dist/iterator/partition.d.ts +0 -18
  117. package/dist/iterator/partition.js +0 -36
  118. package/dist/iterator/partition.mjs +0 -36
  119. package/dist/iterator/range.d.mts +0 -42
  120. package/dist/iterator/range.d.ts +0 -42
  121. package/dist/iterator/range.js +0 -25
  122. package/dist/iterator/range.mjs +0 -25
  123. package/dist/iterator/scan.d.mts +0 -23
  124. package/dist/iterator/scan.d.ts +0 -23
  125. package/dist/iterator/scan.js +0 -47
  126. package/dist/iterator/scan.mjs +0 -47
  127. package/dist/iterator/takeWhile.d.mts +0 -20
  128. package/dist/iterator/takeWhile.d.ts +0 -20
  129. package/dist/iterator/takeWhile.js +0 -34
  130. package/dist/iterator/takeWhile.mjs +0 -34
  131. package/dist/iterator/uniqBy.d.mts +0 -22
  132. package/dist/iterator/uniqBy.d.ts +0 -22
  133. package/dist/iterator/uniqBy.js +0 -43
  134. package/dist/iterator/uniqBy.mjs +0 -43
  135. package/dist/iterator/zip.d.mts +0 -23
  136. package/dist/iterator/zip.d.ts +0 -23
  137. package/dist/iterator/zip.js +0 -45
  138. package/dist/iterator/zip.mjs +0 -45
  139. package/fp/iterator.d.ts +0 -1
  140. package/fp/iterator.js +0 -1
  141. package/iterator.d.ts +0 -1
  142. package/iterator.js +0 -1
@@ -1,45 +0,0 @@
1
- const require_iterator = require("./_internal/iterator.js");
2
- //#region src/iterator/zip.ts
3
- /**
4
- * Lazily combines several iterators into a single iterator of tuples, pairing
5
- * the elements at matching positions. Iteration stops as soon as the **shortest**
6
- * source is exhausted.
7
- *
8
- * Stopping at the shortest source (rather than padding to the longest, as the
9
- * array `zip` does) is what makes this safe to use with infinite iterators:
10
- * `zip(range(0, Infinity), names.values())` ends with `names`. When iteration
11
- * ends — because a source ran out or the consumer terminated early — every
12
- * source is closed via its `return` method.
13
- *
14
- * @template T - A tuple of the source iterator types.
15
- * @param sources - The iterators to zip together.
16
- * @returns A lazy iterator over tuples of the paired elements.
17
- *
18
- * @example
19
- * zip([1, 2, 3].values(), ['a', 'b'].values()).toArray(); // => [[1, 'a'], [2, 'b']]
20
- */
21
- function zip(...sources) {
22
- return require_iterator.iterator(function() {
23
- if (sources.length === 0) return {
24
- value: void 0,
25
- done: true
26
- };
27
- const tuple = new Array(sources.length);
28
- for (let index = 0; index < sources.length; index++) {
29
- const result = sources[index].next();
30
- if (result.done) return {
31
- value: void 0,
32
- done: true
33
- };
34
- tuple[index] = result.value;
35
- }
36
- return {
37
- value: tuple,
38
- done: false
39
- };
40
- }, () => {
41
- for (const source of sources) source.return?.();
42
- });
43
- }
44
- //#endregion
45
- exports.zip = zip;
@@ -1,45 +0,0 @@
1
- import { iterator } from "./_internal/iterator.mjs";
2
- //#region src/iterator/zip.ts
3
- /**
4
- * Lazily combines several iterators into a single iterator of tuples, pairing
5
- * the elements at matching positions. Iteration stops as soon as the **shortest**
6
- * source is exhausted.
7
- *
8
- * Stopping at the shortest source (rather than padding to the longest, as the
9
- * array `zip` does) is what makes this safe to use with infinite iterators:
10
- * `zip(range(0, Infinity), names.values())` ends with `names`. When iteration
11
- * ends — because a source ran out or the consumer terminated early — every
12
- * source is closed via its `return` method.
13
- *
14
- * @template T - A tuple of the source iterator types.
15
- * @param sources - The iterators to zip together.
16
- * @returns A lazy iterator over tuples of the paired elements.
17
- *
18
- * @example
19
- * zip([1, 2, 3].values(), ['a', 'b'].values()).toArray(); // => [[1, 'a'], [2, 'b']]
20
- */
21
- function zip(...sources) {
22
- return iterator(function() {
23
- if (sources.length === 0) return {
24
- value: void 0,
25
- done: true
26
- };
27
- const tuple = new Array(sources.length);
28
- for (let index = 0; index < sources.length; index++) {
29
- const result = sources[index].next();
30
- if (result.done) return {
31
- value: void 0,
32
- done: true
33
- };
34
- tuple[index] = result.value;
35
- }
36
- return {
37
- value: tuple,
38
- done: false
39
- };
40
- }, () => {
41
- for (const source of sources) source.return?.();
42
- });
43
- }
44
- //#endregion
45
- export { zip };
package/fp/iterator.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from '../dist/fp/iterator';
package/fp/iterator.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('../dist/fp/iterator');
package/iterator.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './dist/iterator';
package/iterator.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./dist/iterator');