es-toolkit 1.9.0 → 1.10.0-dev.204

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 (253) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/README.md +1 -1
  3. package/dist/array/chunk.mjs +1 -1
  4. package/dist/array/compact.mjs +1 -1
  5. package/dist/array/countBy.mjs +1 -1
  6. package/dist/array/difference.mjs +1 -1
  7. package/dist/array/differenceBy.mjs +1 -1
  8. package/dist/array/differenceWith.mjs +1 -1
  9. package/dist/array/drop.mjs +1 -1
  10. package/dist/array/dropRight.mjs +1 -1
  11. package/dist/array/dropRightWhile.mjs +1 -1
  12. package/dist/array/dropWhile.mjs +1 -1
  13. package/dist/array/fill.mjs +1 -1
  14. package/dist/array/flatten.mjs +1 -1
  15. package/dist/array/flattenDeep.d.mts +25 -0
  16. package/dist/array/flattenDeep.d.ts +25 -0
  17. package/dist/array/flattenDeep.js +52 -0
  18. package/dist/array/flattenDeep.js.map +1 -0
  19. package/dist/array/flattenDeep.mjs +9 -0
  20. package/dist/array/forEachRight.mjs +1 -1
  21. package/dist/array/groupBy.mjs +1 -1
  22. package/dist/array/head.mjs +1 -1
  23. package/dist/array/index.d.mts +4 -0
  24. package/dist/array/index.d.ts +4 -0
  25. package/dist/array/index.js +38 -0
  26. package/dist/array/index.js.map +1 -1
  27. package/dist/array/index.mjs +45 -29
  28. package/dist/array/initial.d.mts +26 -0
  29. package/dist/array/initial.d.ts +26 -0
  30. package/dist/array/initial.js +36 -0
  31. package/dist/array/initial.js.map +1 -0
  32. package/dist/array/initial.mjs +8 -0
  33. package/dist/array/intersection.mjs +1 -1
  34. package/dist/array/intersectionBy.mjs +1 -1
  35. package/dist/array/intersectionWith.mjs +1 -1
  36. package/dist/array/keyBy.mjs +1 -1
  37. package/dist/array/last.d.mts +25 -0
  38. package/dist/array/last.d.ts +25 -0
  39. package/dist/array/last.js +33 -0
  40. package/dist/array/last.js.map +1 -0
  41. package/dist/array/last.mjs +8 -0
  42. package/dist/array/maxBy.mjs +1 -1
  43. package/dist/array/minBy.mjs +1 -1
  44. package/dist/array/orderBy.mjs +1 -1
  45. package/dist/array/partition.mjs +1 -1
  46. package/dist/array/sample.mjs +1 -1
  47. package/dist/array/sampleSize.mjs +1 -1
  48. package/dist/array/shuffle.mjs +1 -1
  49. package/dist/array/tail.mjs +1 -1
  50. package/dist/array/take.mjs +1 -1
  51. package/dist/array/takeRight.mjs +1 -1
  52. package/dist/array/takeRightWhile.mjs +1 -1
  53. package/dist/array/takeWhile.mjs +1 -1
  54. package/dist/array/toFilled.d.mts +33 -0
  55. package/dist/array/toFilled.d.ts +33 -0
  56. package/dist/array/toFilled.js +40 -0
  57. package/dist/array/toFilled.js.map +1 -0
  58. package/dist/array/toFilled.mjs +8 -0
  59. package/dist/array/union.mjs +1 -1
  60. package/dist/array/unionBy.mjs +1 -1
  61. package/dist/array/unionWith.mjs +1 -1
  62. package/dist/array/uniq.mjs +1 -1
  63. package/dist/array/uniqBy.mjs +1 -1
  64. package/dist/array/uniqWith.mjs +1 -1
  65. package/dist/array/unzip.mjs +1 -1
  66. package/dist/array/unzipWith.mjs +1 -1
  67. package/dist/array/without.mjs +1 -1
  68. package/dist/array/xor.mjs +1 -1
  69. package/dist/array/xorBy.mjs +1 -1
  70. package/dist/array/xorWith.mjs +1 -1
  71. package/dist/array/zip.mjs +1 -1
  72. package/dist/array/zipObject.mjs +1 -1
  73. package/dist/array/zipWith.mjs +1 -1
  74. package/dist/chunk-236H5JZJ.mjs +1 -0
  75. package/dist/chunk-2HIMLZE3.mjs +46 -0
  76. package/dist/chunk-2HIMLZE3.mjs.map +1 -0
  77. package/dist/chunk-2MRZANXZ.mjs +1 -0
  78. package/dist/chunk-2MRZANXZ.mjs.map +1 -0
  79. package/dist/chunk-2SLTL4KL.mjs +13 -0
  80. package/dist/{chunk-NOFHNJ5C.mjs.map → chunk-2SLTL4KL.mjs.map} +1 -1
  81. package/dist/{chunk-QZITBKWX.mjs → chunk-4E4D3BMI.mjs} +2 -2
  82. package/dist/chunk-5IKVJGHO.mjs +14 -0
  83. package/dist/chunk-5IKVJGHO.mjs.map +1 -0
  84. package/dist/chunk-ASJF5D6C.mjs +1 -0
  85. package/dist/chunk-ASJF5D6C.mjs.map +1 -0
  86. package/dist/chunk-BOOQBJN2.mjs +9 -0
  87. package/dist/chunk-BOOQBJN2.mjs.map +1 -0
  88. package/dist/chunk-EYYZQFOP.mjs +14 -0
  89. package/dist/chunk-EYYZQFOP.mjs.map +1 -0
  90. package/dist/chunk-F3WCQQET.mjs +14 -0
  91. package/dist/chunk-F3WCQQET.mjs.map +1 -0
  92. package/dist/{chunk-LT6E4Y4Z.mjs → chunk-GDC64SYJ.mjs} +2 -2
  93. package/dist/{chunk-SDIMTYZW.mjs → chunk-IZAD2S7R.mjs} +2 -2
  94. package/dist/chunk-JYSV56US.mjs +41 -0
  95. package/dist/chunk-JYSV56US.mjs.map +1 -0
  96. package/dist/chunk-KPBQ7OUY.mjs +9 -0
  97. package/dist/chunk-KPBQ7OUY.mjs.map +1 -0
  98. package/dist/chunk-ML727RRJ.mjs +13 -0
  99. package/dist/chunk-ML727RRJ.mjs.map +1 -0
  100. package/dist/chunk-NKLIE2OI.mjs +1 -0
  101. package/dist/chunk-NKLIE2OI.mjs.map +1 -0
  102. package/dist/chunk-OP4OAKQJ.mjs +16 -0
  103. package/dist/chunk-OP4OAKQJ.mjs.map +1 -0
  104. package/dist/chunk-OSOLEQLZ.mjs +1 -0
  105. package/dist/chunk-OSOLEQLZ.mjs.map +1 -0
  106. package/dist/chunk-QKYYOLJ6.mjs +1 -0
  107. package/dist/chunk-QKYYOLJ6.mjs.map +1 -0
  108. package/dist/chunk-U4JGKZ56.mjs +41 -0
  109. package/dist/chunk-U4JGKZ56.mjs.map +1 -0
  110. package/dist/chunk-U56ZOM7L.mjs +9 -0
  111. package/dist/chunk-U56ZOM7L.mjs.map +1 -0
  112. package/dist/chunk-WMM7TZLG.mjs +9 -0
  113. package/dist/{chunk-OHQAR5AU.mjs.map → chunk-WMM7TZLG.mjs.map} +1 -1
  114. package/dist/chunk-WVQ7YVRK.mjs +11 -0
  115. package/dist/chunk-WVQ7YVRK.mjs.map +1 -0
  116. package/dist/chunk-XGCYC4YA.mjs +5516 -0
  117. package/dist/chunk-XGCYC4YA.mjs.map +1 -0
  118. package/dist/chunk-XPSOKBRZ.mjs +12 -0
  119. package/dist/chunk-XPSOKBRZ.mjs.map +1 -0
  120. package/dist/compat/index.d.mts +108 -0
  121. package/dist/compat/index.d.ts +108 -0
  122. package/dist/compat/index.js +6578 -0
  123. package/dist/compat/index.js.map +1 -0
  124. package/dist/compat/index.mjs +351 -0
  125. package/dist/compat/index.mjs.map +1 -0
  126. package/dist/error/AbortError.mjs +1 -1
  127. package/dist/error/index.mjs +1 -1
  128. package/dist/function/debounce.mjs +1 -1
  129. package/dist/function/index.d.mts +1 -0
  130. package/dist/function/index.d.ts +1 -0
  131. package/dist/function/index.js +7 -0
  132. package/dist/function/index.js.map +1 -1
  133. package/dist/function/index.mjs +8 -4
  134. package/dist/function/negate.d.mts +10 -0
  135. package/dist/function/negate.d.ts +10 -0
  136. package/dist/function/negate.js +33 -0
  137. package/dist/function/negate.js.map +1 -0
  138. package/dist/function/negate.mjs +8 -0
  139. package/dist/function/negate.mjs.map +1 -0
  140. package/dist/function/noop.mjs +1 -1
  141. package/dist/function/once.mjs +1 -1
  142. package/dist/function/throttle.mjs +1 -1
  143. package/dist/index.d.mts +12 -0
  144. package/dist/index.d.ts +12 -0
  145. package/dist/index.js +5681 -3
  146. package/dist/index.js.map +1 -1
  147. package/dist/index.mjs +101 -50
  148. package/dist/math/clamp.mjs +1 -1
  149. package/dist/math/inRange.mjs +1 -1
  150. package/dist/math/index.js +2 -2
  151. package/dist/math/index.js.map +1 -1
  152. package/dist/math/index.mjs +9 -9
  153. package/dist/math/mean.js +2 -2
  154. package/dist/math/mean.js.map +1 -1
  155. package/dist/math/mean.mjs +3 -3
  156. package/dist/math/meanBy.js +2 -2
  157. package/dist/math/meanBy.js.map +1 -1
  158. package/dist/math/meanBy.mjs +4 -4
  159. package/dist/math/random.mjs +1 -1
  160. package/dist/math/randomInt.mjs +1 -1
  161. package/dist/math/range.mjs +1 -1
  162. package/dist/math/round.mjs +1 -1
  163. package/dist/math/sum.js +2 -2
  164. package/dist/math/sum.js.map +1 -1
  165. package/dist/math/sum.mjs +2 -2
  166. package/dist/object/clone.d.mts +31 -0
  167. package/dist/object/clone.d.ts +31 -0
  168. package/dist/object/clone.js +65 -0
  169. package/dist/object/clone.js.map +1 -0
  170. package/dist/object/clone.mjs +8 -0
  171. package/dist/object/clone.mjs.map +1 -0
  172. package/dist/object/index.d.mts +1 -0
  173. package/dist/object/index.d.ts +1 -0
  174. package/dist/object/index.js +39 -0
  175. package/dist/object/index.js.map +1 -1
  176. package/dist/object/index.mjs +7 -3
  177. package/dist/object/invert.mjs +1 -1
  178. package/dist/object/omit.mjs +2 -2
  179. package/dist/object/omitBy.mjs +1 -1
  180. package/dist/object/pick.mjs +1 -1
  181. package/dist/object/pickBy.mjs +1 -1
  182. package/dist/predicate/index.d.mts +1 -0
  183. package/dist/predicate/index.d.ts +1 -0
  184. package/dist/predicate/index.js +46 -1
  185. package/dist/predicate/index.js.map +1 -1
  186. package/dist/predicate/index.mjs +9 -3
  187. package/dist/predicate/isEqual.d.mts +17 -0
  188. package/dist/predicate/isEqual.d.ts +17 -0
  189. package/dist/predicate/isEqual.js +73 -0
  190. package/dist/predicate/isEqual.js.map +1 -0
  191. package/dist/predicate/isEqual.mjs +10 -0
  192. package/dist/predicate/isEqual.mjs.map +1 -0
  193. package/dist/predicate/isNil.js +1 -1
  194. package/dist/predicate/isNil.js.map +1 -1
  195. package/dist/predicate/isNil.mjs +2 -2
  196. package/dist/predicate/isNotNil.mjs +1 -1
  197. package/dist/predicate/isNull.mjs +1 -1
  198. package/dist/predicate/isUndefined.mjs +1 -1
  199. package/dist/promise/delay.mjs +1 -1
  200. package/dist/promise/index.mjs +1 -1
  201. package/dist/string/camelCase.d.mts +17 -0
  202. package/dist/string/camelCase.d.ts +17 -0
  203. package/dist/string/camelCase.js +5554 -0
  204. package/dist/string/camelCase.js.map +1 -0
  205. package/dist/string/camelCase.mjs +9 -0
  206. package/dist/string/camelCase.mjs.map +1 -0
  207. package/dist/string/capitalize.d.mts +14 -0
  208. package/dist/string/capitalize.d.ts +14 -0
  209. package/dist/string/capitalize.js +33 -0
  210. package/dist/string/capitalize.js.map +1 -0
  211. package/dist/string/capitalize.mjs +8 -0
  212. package/dist/string/capitalize.mjs.map +1 -0
  213. package/dist/string/index.d.mts +5 -0
  214. package/dist/string/index.d.ts +5 -0
  215. package/dist/string/index.js +5587 -0
  216. package/dist/string/index.js.map +1 -0
  217. package/dist/string/index.mjs +26 -0
  218. package/dist/string/index.mjs.map +1 -0
  219. package/dist/string/kebabCase.d.mts +17 -0
  220. package/dist/string/kebabCase.d.ts +17 -0
  221. package/dist/string/kebabCase.js +43 -0
  222. package/dist/string/kebabCase.js.map +1 -0
  223. package/dist/string/kebabCase.mjs +9 -0
  224. package/dist/string/kebabCase.mjs.map +1 -0
  225. package/dist/string/lowerCase.d.mts +17 -0
  226. package/dist/string/lowerCase.d.ts +17 -0
  227. package/dist/string/lowerCase.js +43 -0
  228. package/dist/string/lowerCase.js.map +1 -0
  229. package/dist/string/lowerCase.mjs +9 -0
  230. package/dist/string/lowerCase.mjs.map +1 -0
  231. package/dist/string/snakeCase.d.mts +17 -0
  232. package/dist/string/snakeCase.d.ts +17 -0
  233. package/dist/string/snakeCase.js +43 -0
  234. package/dist/string/snakeCase.js.map +1 -0
  235. package/dist/string/snakeCase.mjs +9 -0
  236. package/dist/string/snakeCase.mjs.map +1 -0
  237. package/package.json +21 -1
  238. package/string.d.ts +1 -0
  239. package/dist/chunk-2MM5EJJX.mjs +0 -21
  240. package/dist/chunk-LOY6PATI.mjs +0 -1
  241. package/dist/chunk-MAJSPFA6.mjs +0 -1
  242. package/dist/chunk-N6EM6ETS.mjs +0 -1
  243. package/dist/chunk-NOFHNJ5C.mjs +0 -13
  244. package/dist/chunk-OHQAR5AU.mjs +0 -9
  245. package/dist/chunk-PMHULJNL.mjs +0 -1
  246. /package/dist/{chunk-2MM5EJJX.mjs.map → array/flattenDeep.mjs.map} +0 -0
  247. /package/dist/{chunk-LOY6PATI.mjs.map → array/initial.mjs.map} +0 -0
  248. /package/dist/{chunk-MAJSPFA6.mjs.map → array/last.mjs.map} +0 -0
  249. /package/dist/{chunk-N6EM6ETS.mjs.map → array/toFilled.mjs.map} +0 -0
  250. /package/dist/{chunk-PMHULJNL.mjs.map → chunk-236H5JZJ.mjs.map} +0 -0
  251. /package/dist/{chunk-QZITBKWX.mjs.map → chunk-4E4D3BMI.mjs.map} +0 -0
  252. /package/dist/{chunk-LT6E4Y4Z.mjs.map → chunk-GDC64SYJ.mjs.map} +0 -0
  253. /package/dist/{chunk-SDIMTYZW.mjs.map → chunk-IZAD2S7R.mjs.map} +0 -0
@@ -0,0 +1,12 @@
1
+ // src/array/initial.ts
2
+ function initial(arr) {
3
+ if (arr.length <= 1) {
4
+ return [];
5
+ }
6
+ return arr.slice(0, -1);
7
+ }
8
+
9
+ export {
10
+ initial
11
+ };
12
+ //# sourceMappingURL=chunk-XPSOKBRZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/initial.ts"],"sourcesContent":["/**\n * Returns a new array containing all elements except the last one from the input array.\n * If the input array is empty or has only one element, the function returns an empty array.\n *\n * @template T The type of elements in the array.\n * @param {T[]} arr - The input array to query.\n * @returns {T[]} A new array containing all but the last element of the input array.\n *\n * @example\n * const arr = [1, 2, 3, 4];\n * const newArr = initial(arr);\n * // newArr will be [1, 2, 3]\n *\n * @example\n * const emptyArr: number[] = [];\n * const newEmptyArr = initial(emptyArr);\n * // newEmptyArr will be []\n *\n * @example\n * const singleElementArr = ['only one'];\n * const newSingleElementArr = initial(singleElementArr);\n * // newSingleElementArr will be []\n */\nexport function initial<T>(arr: T[]): T[] {\n if (arr.length <= 1) {\n return [];\n }\n return arr.slice(0, -1);\n}\n"],"mappings":";AAuBO,SAAS,QAAW,KAAe;AACxC,MAAI,IAAI,UAAU,GAAG;AACnB,WAAO,CAAC;AAAA,EACV;AACA,SAAO,IAAI,MAAM,GAAG,EAAE;AACxB;","names":[]}
@@ -0,0 +1,108 @@
1
+ export { compact } from '../array/compact.mjs';
2
+ export { countBy } from '../array/countBy.mjs';
3
+ export { difference } from '../array/difference.mjs';
4
+ export { differenceBy } from '../array/differenceBy.mjs';
5
+ export { differenceWith } from '../array/differenceWith.mjs';
6
+ export { drop } from '../array/drop.mjs';
7
+ export { dropRight } from '../array/dropRight.mjs';
8
+ export { dropRightWhile } from '../array/dropRightWhile.mjs';
9
+ export { dropWhile } from '../array/dropWhile.mjs';
10
+ export { fill } from '../array/fill.mjs';
11
+ export { flatten } from '../array/flatten.mjs';
12
+ export { flattenDeep } from '../array/flattenDeep.mjs';
13
+ export { forEachRight } from '../array/forEachRight.mjs';
14
+ export { groupBy } from '../array/groupBy.mjs';
15
+ export { intersection } from '../array/intersection.mjs';
16
+ export { intersectionBy } from '../array/intersectionBy.mjs';
17
+ export { intersectionWith } from '../array/intersectionWith.mjs';
18
+ export { keyBy } from '../array/keyBy.mjs';
19
+ export { maxBy } from '../array/maxBy.mjs';
20
+ export { minBy } from '../array/minBy.mjs';
21
+ export { orderBy } from '../array/orderBy.mjs';
22
+ export { partition } from '../array/partition.mjs';
23
+ export { sample } from '../array/sample.mjs';
24
+ export { sampleSize } from '../array/sampleSize.mjs';
25
+ export { shuffle } from '../array/shuffle.mjs';
26
+ export { take } from '../array/take.mjs';
27
+ export { takeRight } from '../array/takeRight.mjs';
28
+ export { takeRightWhile } from '../array/takeRightWhile.mjs';
29
+ export { takeWhile } from '../array/takeWhile.mjs';
30
+ export { union } from '../array/union.mjs';
31
+ export { unionBy } from '../array/unionBy.mjs';
32
+ export { unionWith } from '../array/unionWith.mjs';
33
+ export { uniq } from '../array/uniq.mjs';
34
+ export { uniqBy } from '../array/uniqBy.mjs';
35
+ export { uniqWith } from '../array/uniqWith.mjs';
36
+ export { unzip } from '../array/unzip.mjs';
37
+ export { unzipWith } from '../array/unzipWith.mjs';
38
+ export { xor } from '../array/xor.mjs';
39
+ export { xorBy } from '../array/xorBy.mjs';
40
+ export { xorWith } from '../array/xorWith.mjs';
41
+ export { zip } from '../array/zip.mjs';
42
+ export { zipObject } from '../array/zipObject.mjs';
43
+ export { zipWith } from '../array/zipWith.mjs';
44
+ export { without } from '../array/without.mjs';
45
+ export { head } from '../array/head.mjs';
46
+ export { tail } from '../array/tail.mjs';
47
+ export { toFilled } from '../array/toFilled.mjs';
48
+ export { last } from '../array/last.mjs';
49
+ export { initial } from '../array/initial.mjs';
50
+ export { AbortError } from '../error/AbortError.mjs';
51
+ export { debounce } from '../function/debounce.mjs';
52
+ export { noop } from '../function/noop.mjs';
53
+ export { once } from '../function/once.mjs';
54
+ export { throttle } from '../function/throttle.mjs';
55
+ export { negate } from '../function/negate.mjs';
56
+ export { clamp } from '../math/clamp.mjs';
57
+ export { inRange } from '../math/inRange.mjs';
58
+ export { mean } from '../math/mean.mjs';
59
+ export { meanBy } from '../math/meanBy.mjs';
60
+ export { random } from '../math/random.mjs';
61
+ export { randomInt } from '../math/randomInt.mjs';
62
+ export { round } from '../math/round.mjs';
63
+ export { sum } from '../math/sum.mjs';
64
+ export { range } from '../math/range.mjs';
65
+ export { omit } from '../object/omit.mjs';
66
+ export { omitBy } from '../object/omitBy.mjs';
67
+ export { pick } from '../object/pick.mjs';
68
+ export { pickBy } from '../object/pickBy.mjs';
69
+ export { invert } from '../object/invert.mjs';
70
+ export { clone } from '../object/clone.mjs';
71
+ export { isEqual } from '../predicate/isEqual.mjs';
72
+ export { isNil } from '../predicate/isNil.mjs';
73
+ export { isNotNil } from '../predicate/isNotNil.mjs';
74
+ export { isNull } from '../predicate/isNull.mjs';
75
+ export { isUndefined } from '../predicate/isUndefined.mjs';
76
+ export { delay } from '../promise/delay.mjs';
77
+ export { camelCase } from '../string/camelCase.mjs';
78
+ export { snakeCase } from '../string/snakeCase.mjs';
79
+ export { kebabCase } from '../string/kebabCase.mjs';
80
+ export { lowerCase } from '../string/lowerCase.mjs';
81
+ export { capitalize } from '../string/capitalize.mjs';
82
+
83
+ /**
84
+ * Splits an array into smaller arrays of a specified length.
85
+ *
86
+ * This function takes an input array and divides it into multiple smaller arrays,
87
+ * each of a specified length. If the input array cannot be evenly divided,
88
+ * the final sub-array will contain the remaining elements.
89
+ *
90
+ * @template T The type of elements in the array.
91
+ * @param {T[]} arr - The array to be chunked into smaller arrays.
92
+ * @param {number} size - The size of each smaller array. Must be a positive integer.
93
+ * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.
94
+ * @throws {Error} Throws an error if `size` is not a positive integer.
95
+ *
96
+ * @example
97
+ * // Splits an array of numbers into sub-arrays of length 2
98
+ * chunk([1, 2, 3, 4, 5], 2);
99
+ * // Returns: [[1, 2], [3, 4], [5]]
100
+ *
101
+ * @example
102
+ * // Splits an array of strings into sub-arrays of length 3
103
+ * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
104
+ * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
105
+ */
106
+ declare function chunk<T>(arr: readonly T[], size?: number): T[][];
107
+
108
+ export { chunk };
@@ -0,0 +1,108 @@
1
+ export { compact } from '../array/compact.js';
2
+ export { countBy } from '../array/countBy.js';
3
+ export { difference } from '../array/difference.js';
4
+ export { differenceBy } from '../array/differenceBy.js';
5
+ export { differenceWith } from '../array/differenceWith.js';
6
+ export { drop } from '../array/drop.js';
7
+ export { dropRight } from '../array/dropRight.js';
8
+ export { dropRightWhile } from '../array/dropRightWhile.js';
9
+ export { dropWhile } from '../array/dropWhile.js';
10
+ export { fill } from '../array/fill.js';
11
+ export { flatten } from '../array/flatten.js';
12
+ export { flattenDeep } from '../array/flattenDeep.js';
13
+ export { forEachRight } from '../array/forEachRight.js';
14
+ export { groupBy } from '../array/groupBy.js';
15
+ export { intersection } from '../array/intersection.js';
16
+ export { intersectionBy } from '../array/intersectionBy.js';
17
+ export { intersectionWith } from '../array/intersectionWith.js';
18
+ export { keyBy } from '../array/keyBy.js';
19
+ export { maxBy } from '../array/maxBy.js';
20
+ export { minBy } from '../array/minBy.js';
21
+ export { orderBy } from '../array/orderBy.js';
22
+ export { partition } from '../array/partition.js';
23
+ export { sample } from '../array/sample.js';
24
+ export { sampleSize } from '../array/sampleSize.js';
25
+ export { shuffle } from '../array/shuffle.js';
26
+ export { take } from '../array/take.js';
27
+ export { takeRight } from '../array/takeRight.js';
28
+ export { takeRightWhile } from '../array/takeRightWhile.js';
29
+ export { takeWhile } from '../array/takeWhile.js';
30
+ export { union } from '../array/union.js';
31
+ export { unionBy } from '../array/unionBy.js';
32
+ export { unionWith } from '../array/unionWith.js';
33
+ export { uniq } from '../array/uniq.js';
34
+ export { uniqBy } from '../array/uniqBy.js';
35
+ export { uniqWith } from '../array/uniqWith.js';
36
+ export { unzip } from '../array/unzip.js';
37
+ export { unzipWith } from '../array/unzipWith.js';
38
+ export { xor } from '../array/xor.js';
39
+ export { xorBy } from '../array/xorBy.js';
40
+ export { xorWith } from '../array/xorWith.js';
41
+ export { zip } from '../array/zip.js';
42
+ export { zipObject } from '../array/zipObject.js';
43
+ export { zipWith } from '../array/zipWith.js';
44
+ export { without } from '../array/without.js';
45
+ export { head } from '../array/head.js';
46
+ export { tail } from '../array/tail.js';
47
+ export { toFilled } from '../array/toFilled.js';
48
+ export { last } from '../array/last.js';
49
+ export { initial } from '../array/initial.js';
50
+ export { AbortError } from '../error/AbortError.js';
51
+ export { debounce } from '../function/debounce.js';
52
+ export { noop } from '../function/noop.js';
53
+ export { once } from '../function/once.js';
54
+ export { throttle } from '../function/throttle.js';
55
+ export { negate } from '../function/negate.js';
56
+ export { clamp } from '../math/clamp.js';
57
+ export { inRange } from '../math/inRange.js';
58
+ export { mean } from '../math/mean.js';
59
+ export { meanBy } from '../math/meanBy.js';
60
+ export { random } from '../math/random.js';
61
+ export { randomInt } from '../math/randomInt.js';
62
+ export { round } from '../math/round.js';
63
+ export { sum } from '../math/sum.js';
64
+ export { range } from '../math/range.js';
65
+ export { omit } from '../object/omit.js';
66
+ export { omitBy } from '../object/omitBy.js';
67
+ export { pick } from '../object/pick.js';
68
+ export { pickBy } from '../object/pickBy.js';
69
+ export { invert } from '../object/invert.js';
70
+ export { clone } from '../object/clone.js';
71
+ export { isEqual } from '../predicate/isEqual.js';
72
+ export { isNil } from '../predicate/isNil.js';
73
+ export { isNotNil } from '../predicate/isNotNil.js';
74
+ export { isNull } from '../predicate/isNull.js';
75
+ export { isUndefined } from '../predicate/isUndefined.js';
76
+ export { delay } from '../promise/delay.js';
77
+ export { camelCase } from '../string/camelCase.js';
78
+ export { snakeCase } from '../string/snakeCase.js';
79
+ export { kebabCase } from '../string/kebabCase.js';
80
+ export { lowerCase } from '../string/lowerCase.js';
81
+ export { capitalize } from '../string/capitalize.js';
82
+
83
+ /**
84
+ * Splits an array into smaller arrays of a specified length.
85
+ *
86
+ * This function takes an input array and divides it into multiple smaller arrays,
87
+ * each of a specified length. If the input array cannot be evenly divided,
88
+ * the final sub-array will contain the remaining elements.
89
+ *
90
+ * @template T The type of elements in the array.
91
+ * @param {T[]} arr - The array to be chunked into smaller arrays.
92
+ * @param {number} size - The size of each smaller array. Must be a positive integer.
93
+ * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.
94
+ * @throws {Error} Throws an error if `size` is not a positive integer.
95
+ *
96
+ * @example
97
+ * // Splits an array of numbers into sub-arrays of length 2
98
+ * chunk([1, 2, 3, 4, 5], 2);
99
+ * // Returns: [[1, 2], [3, 4], [5]]
100
+ *
101
+ * @example
102
+ * // Splits an array of strings into sub-arrays of length 3
103
+ * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
104
+ * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
105
+ */
106
+ declare function chunk<T>(arr: readonly T[], size?: number): T[][];
107
+
108
+ export { chunk };