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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  intersectionBy
3
3
  } from "../chunk-O6UXZR3U.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  intersectionBy
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  intersectionWith
3
3
  } from "../chunk-XI7KRD2C.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  intersectionWith
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  keyBy
3
3
  } from "../chunk-AJKZMN2V.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  keyBy
7
7
  };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Returns the last element of an array.
3
+ *
4
+ * This function takes an array and returns the last element of the array.
5
+ * If the array is empty, the function returns `undefined`.
6
+ *
7
+ * Unlike some implementations, this function is optimized for performance
8
+ * by directly accessing the last index of the array.
9
+ *
10
+ * @param {T[]} arr - The array from which to get the last element.
11
+ * @returns {T | undefined} The last element of the array, or `undefined` if the array is empty.
12
+ *
13
+ * @example
14
+ * const arr = [1, 2, 3];
15
+ * const lastElement = last(arr);
16
+ * // lastElement will be 3
17
+ *
18
+ * const emptyArr: number[] = [];
19
+ * const noElement = last(emptyArr);
20
+ * // noElement will be undefined
21
+ */
22
+ declare function last<T>(arr: readonly [...T[], T]): T;
23
+ declare function last<T>(arr: readonly T[]): T | undefined;
24
+
25
+ export { last };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Returns the last element of an array.
3
+ *
4
+ * This function takes an array and returns the last element of the array.
5
+ * If the array is empty, the function returns `undefined`.
6
+ *
7
+ * Unlike some implementations, this function is optimized for performance
8
+ * by directly accessing the last index of the array.
9
+ *
10
+ * @param {T[]} arr - The array from which to get the last element.
11
+ * @returns {T | undefined} The last element of the array, or `undefined` if the array is empty.
12
+ *
13
+ * @example
14
+ * const arr = [1, 2, 3];
15
+ * const lastElement = last(arr);
16
+ * // lastElement will be 3
17
+ *
18
+ * const emptyArr: number[] = [];
19
+ * const noElement = last(emptyArr);
20
+ * // noElement will be undefined
21
+ */
22
+ declare function last<T>(arr: readonly [...T[], T]): T;
23
+ declare function last<T>(arr: readonly T[]): T | undefined;
24
+
25
+ export { last };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/array/last.ts
21
+ var last_exports = {};
22
+ __export(last_exports, {
23
+ last: () => last
24
+ });
25
+ module.exports = __toCommonJS(last_exports);
26
+ function last(arr) {
27
+ return arr[arr.length - 1];
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ last
32
+ });
33
+ //# sourceMappingURL=last.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/last.ts"],"sourcesContent":["/**\n * Returns the last element of an array.\n *\n * This function takes an array and returns the last element of the array.\n * If the array is empty, the function returns `undefined`.\n *\n * Unlike some implementations, this function is optimized for performance\n * by directly accessing the last index of the array.\n *\n * @param {T[]} arr - The array from which to get the last element.\n * @returns {T | undefined} The last element of the array, or `undefined` if the array is empty.\n *\n * @example\n * const arr = [1, 2, 3];\n * const lastElement = last(arr);\n * // lastElement will be 3\n *\n * const emptyArr: number[] = [];\n * const noElement = last(emptyArr);\n * // noElement will be undefined\n */\n\nexport function last<T>(arr: readonly [...T[], T]): T;\nexport function last<T>(arr: readonly T[]): T | undefined;\nexport function last<T>(arr: readonly T[]): T | undefined {\n return arr[arr.length - 1];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBO,SAAS,KAAQ,KAAkC;AACxD,SAAO,IAAI,IAAI,SAAS,CAAC;AAC3B;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ last
3
+ } from "../chunk-KPBQ7OUY.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
+ export {
6
+ last
7
+ };
8
+ //# sourceMappingURL=last.mjs.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  maxBy
3
3
  } from "../chunk-OOKNBU4V.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  maxBy
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  minBy
3
3
  } from "../chunk-IJD7FE2Z.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  minBy
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  orderBy
3
3
  } from "../chunk-7B7W36UP.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  orderBy
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  partition
3
3
  } from "../chunk-DN3NOZ3H.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  partition
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  sample
3
3
  } from "../chunk-2KNLZB7V.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  sample
7
7
  };
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-EHSKB6DF.mjs";
4
4
  import "../chunk-GIWAOOFY.mjs";
5
5
  import "../chunk-SYWMYQYJ.mjs";
6
- import "../chunk-2MM5EJJX.mjs";
6
+ import "../chunk-2HIMLZE3.mjs";
7
7
  export {
8
8
  sampleSize
9
9
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  shuffle
3
3
  } from "../chunk-G7UQ5PUR.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  shuffle
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  tail
3
3
  } from "../chunk-OF6NM4G7.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  tail
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  take
3
3
  } from "../chunk-ME352XO7.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  take
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  takeRight
3
3
  } from "../chunk-IQLKIDXF.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  takeRight
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  takeRightWhile
3
3
  } from "../chunk-NTLX2MPV.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  takeRightWhile
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  takeWhile
3
3
  } from "../chunk-2IXFGSUA.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  takeWhile
7
7
  };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Creates a new array filled with the specified value from the start position up to, but not including, the end position.
3
+ * This function does not mutate the original array.
4
+ *
5
+ * @param {Array<T>} arr - The array to base the new array on.
6
+ * @param {U} value - The value to fill the new array with.
7
+ * @param {number} [start=0] - The start position. Defaults to 0.
8
+ * @param {number} [end=arr.length] - The end position. Defaults to the array's length.
9
+ * @returns {Array<T | U>} The new array with the filled values.
10
+ *
11
+ * @example
12
+ * const array = [1, 2, 3, 4, 5];
13
+ * let result = toFilled(array, '*', 2);
14
+ * console.log(result); // [1, 2, '*', '*', '*']
15
+ * console.log(array); // [1, 2, 3, 4, 5]
16
+ *
17
+ * result = toFilled(array, '*', 1, 4);
18
+ * console.log(result); // [1, '*', '*', '*', 5]
19
+ * console.log(array); // [1, 2, 3, 4, 5]
20
+ *
21
+ * result = toFilled(array, '*');
22
+ * console.log(result); // ['*', '*', '*', '*', '*']
23
+ * console.log(array); // [1, 2, 3, 4, 5]
24
+ *
25
+ * result = toFilled(array, '*', -4, -1);
26
+ * console.log(result); // [1, '*', '*', '*', 5]
27
+ * console.log(array); // [1, 2, 3, 4, 5]
28
+ */
29
+ declare function toFilled<T, U>(arr: T[], value: U): Array<T | U>;
30
+ declare function toFilled<T, U>(arr: T[], value: U, start: number): Array<T | U>;
31
+ declare function toFilled<T, U>(arr: T[], value: U, start: number, end: number): Array<T | U>;
32
+
33
+ export { toFilled };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Creates a new array filled with the specified value from the start position up to, but not including, the end position.
3
+ * This function does not mutate the original array.
4
+ *
5
+ * @param {Array<T>} arr - The array to base the new array on.
6
+ * @param {U} value - The value to fill the new array with.
7
+ * @param {number} [start=0] - The start position. Defaults to 0.
8
+ * @param {number} [end=arr.length] - The end position. Defaults to the array's length.
9
+ * @returns {Array<T | U>} The new array with the filled values.
10
+ *
11
+ * @example
12
+ * const array = [1, 2, 3, 4, 5];
13
+ * let result = toFilled(array, '*', 2);
14
+ * console.log(result); // [1, 2, '*', '*', '*']
15
+ * console.log(array); // [1, 2, 3, 4, 5]
16
+ *
17
+ * result = toFilled(array, '*', 1, 4);
18
+ * console.log(result); // [1, '*', '*', '*', 5]
19
+ * console.log(array); // [1, 2, 3, 4, 5]
20
+ *
21
+ * result = toFilled(array, '*');
22
+ * console.log(result); // ['*', '*', '*', '*', '*']
23
+ * console.log(array); // [1, 2, 3, 4, 5]
24
+ *
25
+ * result = toFilled(array, '*', -4, -1);
26
+ * console.log(result); // [1, '*', '*', '*', 5]
27
+ * console.log(array); // [1, 2, 3, 4, 5]
28
+ */
29
+ declare function toFilled<T, U>(arr: T[], value: U): Array<T | U>;
30
+ declare function toFilled<T, U>(arr: T[], value: U, start: number): Array<T | U>;
31
+ declare function toFilled<T, U>(arr: T[], value: U, start: number, end: number): Array<T | U>;
32
+
33
+ export { toFilled };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/array/toFilled.ts
21
+ var toFilled_exports = {};
22
+ __export(toFilled_exports, {
23
+ toFilled: () => toFilled
24
+ });
25
+ module.exports = __toCommonJS(toFilled_exports);
26
+ function toFilled(arr, value, start = 0, end = arr.length) {
27
+ const length = arr.length;
28
+ const finalStart = Math.max(start >= 0 ? start : length + start, 0);
29
+ const finalEnd = Math.min(end >= 0 ? end : length + end, length);
30
+ const newArr = arr.slice();
31
+ for (let i = finalStart; i < finalEnd; i++) {
32
+ newArr[i] = value;
33
+ }
34
+ return newArr;
35
+ }
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ toFilled
39
+ });
40
+ //# sourceMappingURL=toFilled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/toFilled.ts"],"sourcesContent":["/**\n * Creates a new array filled with the specified value from the start position up to, but not including, the end position.\n * This function does not mutate the original array.\n *\n * @param {Array<T>} arr - The array to base the new array on.\n * @param {U} value - The value to fill the new array with.\n * @param {number} [start=0] - The start position. Defaults to 0.\n * @param {number} [end=arr.length] - The end position. Defaults to the array's length.\n * @returns {Array<T | U>} The new array with the filled values.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * let result = toFilled(array, '*', 2);\n * console.log(result); // [1, 2, '*', '*', '*']\n * console.log(array); // [1, 2, 3, 4, 5]\n *\n * result = toFilled(array, '*', 1, 4);\n * console.log(result); // [1, '*', '*', '*', 5]\n * console.log(array); // [1, 2, 3, 4, 5]\n *\n * result = toFilled(array, '*');\n * console.log(result); // ['*', '*', '*', '*', '*']\n * console.log(array); // [1, 2, 3, 4, 5]\n *\n * result = toFilled(array, '*', -4, -1);\n * console.log(result); // [1, '*', '*', '*', 5]\n * console.log(array); // [1, 2, 3, 4, 5]\n */\n\nexport function toFilled<T, U>(arr: T[], value: U): Array<T | U>;\nexport function toFilled<T, U>(arr: T[], value: U, start: number): Array<T | U>;\nexport function toFilled<T, U>(arr: T[], value: U, start: number, end: number): Array<T | U>;\nexport function toFilled<T, U>(arr: T[], value: U, start = 0, end = arr.length): Array<T | U> {\n const length = arr.length;\n const finalStart = Math.max(start >= 0 ? start : length + start, 0);\n const finalEnd = Math.min(end >= 0 ? end : length + end, length);\n\n const newArr: Array<T | U> = arr.slice();\n\n for (let i = finalStart; i < finalEnd; i++) {\n newArr[i] = value;\n }\n\n return newArr;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCO,SAAS,SAAe,KAAU,OAAU,QAAQ,GAAG,MAAM,IAAI,QAAsB;AAC5F,QAAM,SAAS,IAAI;AACnB,QAAM,aAAa,KAAK,IAAI,SAAS,IAAI,QAAQ,SAAS,OAAO,CAAC;AAClE,QAAM,WAAW,KAAK,IAAI,OAAO,IAAI,MAAM,SAAS,KAAK,MAAM;AAE/D,QAAM,SAAuB,IAAI,MAAM;AAEvC,WAAS,IAAI,YAAY,IAAI,UAAU,KAAK;AAC1C,WAAO,CAAC,IAAI;AAAA,EACd;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ toFilled
3
+ } from "../chunk-OP4OAKQJ.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
+ export {
6
+ toFilled
7
+ };
8
+ //# sourceMappingURL=toFilled.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  union
3
3
  } from "../chunk-R6QA7PLZ.mjs";
4
4
  import "../chunk-DVK2N4KC.mjs";
5
- import "../chunk-2MM5EJJX.mjs";
5
+ import "../chunk-2HIMLZE3.mjs";
6
6
  export {
7
7
  union
8
8
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unionBy
3
3
  } from "../chunk-NFS7RWWE.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  unionBy
7
7
  };
@@ -2,7 +2,7 @@ import {
2
2
  unionWith
3
3
  } from "../chunk-2ZCITDMK.mjs";
4
4
  import "../chunk-237HGSZS.mjs";
5
- import "../chunk-2MM5EJJX.mjs";
5
+ import "../chunk-2HIMLZE3.mjs";
6
6
  export {
7
7
  unionWith
8
8
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  uniq
3
3
  } from "../chunk-DVK2N4KC.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  uniq
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  uniqBy
3
3
  } from "../chunk-OXAZEEGP.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  uniqBy
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  uniqWith
3
3
  } from "../chunk-237HGSZS.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  uniqWith
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unzip
3
3
  } from "../chunk-UYZKMBDO.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  unzip
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unzipWith
3
3
  } from "../chunk-IFNXROZR.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  unzipWith
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  without
3
3
  } from "../chunk-PYEYV7BY.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  without
7
7
  };
@@ -5,7 +5,7 @@ import "../chunk-R6QA7PLZ.mjs";
5
5
  import "../chunk-DVK2N4KC.mjs";
6
6
  import "../chunk-FVVSE2F2.mjs";
7
7
  import "../chunk-JPUKH67K.mjs";
8
- import "../chunk-2MM5EJJX.mjs";
8
+ import "../chunk-2HIMLZE3.mjs";
9
9
  export {
10
10
  xor
11
11
  };
@@ -4,7 +4,7 @@ import {
4
4
  import "../chunk-NFS7RWWE.mjs";
5
5
  import "../chunk-O6UXZR3U.mjs";
6
6
  import "../chunk-LVWX5B43.mjs";
7
- import "../chunk-2MM5EJJX.mjs";
7
+ import "../chunk-2HIMLZE3.mjs";
8
8
  export {
9
9
  xorBy
10
10
  };
@@ -5,7 +5,7 @@ import "../chunk-2ZCITDMK.mjs";
5
5
  import "../chunk-237HGSZS.mjs";
6
6
  import "../chunk-XI7KRD2C.mjs";
7
7
  import "../chunk-6NVQAHXP.mjs";
8
- import "../chunk-2MM5EJJX.mjs";
8
+ import "../chunk-2HIMLZE3.mjs";
9
9
  export {
10
10
  xorWith
11
11
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  zip
3
3
  } from "../chunk-IDCUZVJL.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  zip
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  zipObject
3
3
  } from "../chunk-6GWEY5EL.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  zipObject
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  zipWith
3
3
  } from "../chunk-4KYXHZ4R.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
4
+ import "../chunk-2HIMLZE3.mjs";
5
5
  export {
6
6
  zipWith
7
7
  };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-236H5JZJ.mjs.map
@@ -0,0 +1,46 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
21
+ var __commonJS = (cb, mod) => function __require() {
22
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (let key of __getOwnPropNames(from))
27
+ if (!__hasOwnProp.call(to, key) && key !== except)
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
29
+ }
30
+ return to;
31
+ };
32
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
33
+ // If the importer is in node compatibility mode or this is not an ESM
34
+ // file that has been converted to a CommonJS file using a Babel-
35
+ // compatible transform (i.e. "__esModule" has not been set), then set
36
+ // "default" to the CommonJS "module.exports" for node compatibility.
37
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
38
+ mod
39
+ ));
40
+
41
+ export {
42
+ __spreadValues,
43
+ __commonJS,
44
+ __toESM
45
+ };
46
+ //# sourceMappingURL=chunk-2HIMLZE3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-2MRZANXZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,13 @@
1
+ // src/math/sum.ts
2
+ function sum(nums) {
3
+ let result = 0;
4
+ for (let i = 0; i < nums.length; i++) {
5
+ result += nums[i];
6
+ }
7
+ return result;
8
+ }
9
+
10
+ export {
11
+ sum
12
+ };
13
+ //# sourceMappingURL=chunk-2SLTL4KL.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/math/sum.ts"],"sourcesContent":["/**\n * Calculates the sum of an array of numbers.\n *\n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: readonly number[]): number {\n let result = 0;\n\n for (const num of nums) {\n result += num;\n }\n\n return result;\n}\n"],"mappings":";AAaO,SAAS,IAAI,MAAiC;AACnD,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/math/sum.ts"],"sourcesContent":["/**\n * Calculates the sum of an array of numbers.\n *\n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: readonly number[]): number {\n let result = 0;\n\n for (let i = 0; i < nums.length; i++) {\n result += nums[i];\n }\n\n return result;\n}\n"],"mappings":";AAaO,SAAS,IAAI,MAAiC;AACnD,MAAI,SAAS;AAEb,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,cAAU,KAAK,CAAC;AAAA,EAClB;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __spreadValues
3
- } from "./chunk-2MM5EJJX.mjs";
3
+ } from "./chunk-2HIMLZE3.mjs";
4
4
 
5
5
  // src/object/omit.ts
6
6
  function omit(obj, keys) {
@@ -14,4 +14,4 @@ function omit(obj, keys) {
14
14
  export {
15
15
  omit
16
16
  };
17
- //# sourceMappingURL=chunk-QZITBKWX.mjs.map
17
+ //# sourceMappingURL=chunk-4E4D3BMI.mjs.map
@@ -0,0 +1,14 @@
1
+ import {
2
+ getWords
3
+ } from "./chunk-WVQ7YVRK.mjs";
4
+
5
+ // src/string/lowerCase.ts
6
+ var lowerCase = (str) => {
7
+ const words = getWords(str);
8
+ return words.map((word) => word.toLowerCase()).join(" ");
9
+ };
10
+
11
+ export {
12
+ lowerCase
13
+ };
14
+ //# sourceMappingURL=chunk-5IKVJGHO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/string/lowerCase.ts"],"sourcesContent":["import { getWords } from './_internal/getWords.ts';\n\n/**\n * Converts a string to lower case.\n *\n * Lower case is the naming convention in which each word is written in lowercase and separated by an space ( ) character.\n *\n * @param {string} str - The string that is to be changed to lower case.\n * @returns {string} - The converted string to lower case.\n *\n * @example\n * const convertedStr1 = lowerCase('camelCase') // returns 'camel case'\n * const convertedStr2 = lowerCase('some whitespace') // returns 'some whitespace'\n * const convertedStr3 = lowerCase('hyphen-text') // returns 'hyphen text'\n * const convertedStr4 = lowerCase('HTTPRequest') // returns 'http request'\n */\nexport const lowerCase = (str: string): string => {\n const words = getWords(str);\n return words.map(word => word.toLowerCase()).join(' ');\n};\n"],"mappings":";;;;;AAgBO,IAAM,YAAY,CAAC,QAAwB;AAChD,QAAM,QAAQ,SAAS,GAAG;AAC1B,SAAO,MAAM,IAAI,UAAQ,KAAK,YAAY,CAAC,EAAE,KAAK,GAAG;AACvD;","names":[]}