es-toolkit 1.13.1-dev.318 → 1.13.1-dev.321

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 (210) hide show
  1. package/dist/array/chunk.mjs +1 -1
  2. package/dist/array/compact.mjs +1 -1
  3. package/dist/array/countBy.js +1 -2
  4. package/dist/array/countBy.js.map +1 -1
  5. package/dist/array/countBy.mjs +2 -2
  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/flatMap.mjs +1 -1
  15. package/dist/array/flatten.mjs +1 -1
  16. package/dist/array/flattenDeep.mjs +1 -1
  17. package/dist/array/forEachRight.mjs +1 -1
  18. package/dist/array/groupBy.mjs +1 -1
  19. package/dist/array/head.mjs +1 -1
  20. package/dist/array/index.js +1 -2
  21. package/dist/array/index.js.map +1 -1
  22. package/dist/array/index.mjs +2 -2
  23. package/dist/array/initial.mjs +1 -1
  24. package/dist/array/intersection.mjs +1 -1
  25. package/dist/array/intersectionBy.mjs +1 -1
  26. package/dist/array/intersectionWith.mjs +1 -1
  27. package/dist/array/keyBy.mjs +1 -1
  28. package/dist/array/last.mjs +1 -1
  29. package/dist/array/maxBy.mjs +1 -1
  30. package/dist/array/minBy.mjs +1 -1
  31. package/dist/array/orderBy.mjs +1 -1
  32. package/dist/array/partition.mjs +1 -1
  33. package/dist/array/sample.mjs +1 -1
  34. package/dist/array/sampleSize.mjs +1 -1
  35. package/dist/array/shuffle.mjs +1 -1
  36. package/dist/array/tail.mjs +1 -1
  37. package/dist/array/take.mjs +1 -1
  38. package/dist/array/takeRight.mjs +1 -1
  39. package/dist/array/takeRightWhile.mjs +1 -1
  40. package/dist/array/takeWhile.mjs +1 -1
  41. package/dist/array/toFilled.mjs +1 -1
  42. package/dist/array/union.mjs +1 -1
  43. package/dist/array/unionBy.mjs +1 -1
  44. package/dist/array/unionWith.mjs +1 -1
  45. package/dist/array/uniq.mjs +1 -1
  46. package/dist/array/uniqBy.mjs +1 -1
  47. package/dist/array/uniqWith.mjs +1 -1
  48. package/dist/array/unzip.mjs +1 -1
  49. package/dist/array/unzipWith.mjs +1 -1
  50. package/dist/array/without.mjs +1 -1
  51. package/dist/array/xor.mjs +1 -1
  52. package/dist/array/xorBy.mjs +1 -1
  53. package/dist/array/xorWith.mjs +1 -1
  54. package/dist/array/zip.mjs +1 -1
  55. package/dist/array/zipObject.mjs +1 -1
  56. package/dist/array/zipWith.mjs +1 -1
  57. package/dist/browser.js +33 -58
  58. package/dist/browser.js.map +1 -1
  59. package/dist/browser.mjs +19 -17
  60. package/dist/browser.mjs.map +1 -1
  61. package/dist/{chunk-QXTNZR7B.mjs → chunk-3SBT6WDU.mjs} +2 -2
  62. package/dist/{chunk-O64NE2P4.mjs → chunk-4DFAGGIM.mjs} +3 -3
  63. package/dist/{chunk-O64NE2P4.mjs.map → chunk-4DFAGGIM.mjs.map} +1 -1
  64. package/dist/{chunk-Y5V7UAZZ.mjs → chunk-4ZES5T6V.mjs} +4 -4
  65. package/dist/{chunk-EYYZQFOP.mjs → chunk-ET33L3MQ.mjs} +2 -2
  66. package/dist/chunk-EZYYB34V.mjs +17 -0
  67. package/dist/{chunk-CVVZHOJX.mjs.map → chunk-EZYYB34V.mjs.map} +1 -1
  68. package/dist/{chunk-36ZJSTNA.mjs → chunk-IGM5IABU.mjs} +37 -24
  69. package/dist/chunk-IGM5IABU.mjs.map +1 -0
  70. package/dist/{chunk-F3WCQQET.mjs → chunk-IWXZI3QT.mjs} +2 -2
  71. package/dist/chunk-J5LGTIGS.mjs +10 -0
  72. package/dist/{chunk-5CPXZFCB.mjs → chunk-K5WL54BY.mjs} +2 -2
  73. package/dist/{chunk-5CPXZFCB.mjs.map → chunk-K5WL54BY.mjs.map} +1 -1
  74. package/dist/{chunk-3IP4JVLL.mjs → chunk-MSHSKENG.mjs} +3 -3
  75. package/dist/{chunk-3IP4JVLL.mjs.map → chunk-MSHSKENG.mjs.map} +1 -1
  76. package/dist/{chunk-WVQ7YVRK.mjs → chunk-OG2RLT5U.mjs} +2 -3
  77. package/dist/{chunk-WVQ7YVRK.mjs.map → chunk-OG2RLT5U.mjs.map} +1 -1
  78. package/dist/chunk-R6GLTTAB.mjs +9 -0
  79. package/dist/chunk-R6GLTTAB.mjs.map +1 -0
  80. package/dist/{chunk-5IKVJGHO.mjs → chunk-RTFTLCF3.mjs} +2 -2
  81. package/dist/chunk-SXFMQQ6F.mjs +9 -0
  82. package/dist/chunk-SXFMQQ6F.mjs.map +1 -0
  83. package/dist/{chunk-WFZXCGEG.mjs → chunk-YOPFSFTD.mjs} +2 -6
  84. package/dist/{chunk-WFZXCGEG.mjs.map → chunk-YOPFSFTD.mjs.map} +1 -1
  85. package/dist/chunk-YXD3AQAK.mjs +1 -0
  86. package/dist/{chunk-CRSKT4WW.mjs → chunk-Z7HWEOQX.mjs} +2 -3
  87. package/dist/{chunk-CRSKT4WW.mjs.map → chunk-Z7HWEOQX.mjs.map} +1 -1
  88. package/dist/chunk-ZPNX2QDE.mjs +13 -0
  89. package/dist/{chunk-IIDZ3KAJ.mjs.map → chunk-ZPNX2QDE.mjs.map} +1 -1
  90. package/dist/compat/index.d.mts +20 -1
  91. package/dist/compat/index.d.ts +20 -1
  92. package/dist/compat/index.js +35 -57
  93. package/dist/compat/index.js.map +1 -1
  94. package/dist/compat/index.mjs +30 -23
  95. package/dist/error/AbortError.mjs +1 -1
  96. package/dist/error/TimeoutError.mjs +1 -1
  97. package/dist/error/index.mjs +1 -1
  98. package/dist/function/after.mjs +1 -1
  99. package/dist/function/debounce.js +2 -2
  100. package/dist/function/debounce.js.map +1 -1
  101. package/dist/function/debounce.mjs +2 -2
  102. package/dist/function/index.js +2 -2
  103. package/dist/function/index.js.map +1 -1
  104. package/dist/function/index.mjs +2 -2
  105. package/dist/function/negate.mjs +1 -1
  106. package/dist/function/noop.mjs +1 -1
  107. package/dist/function/once.mjs +1 -1
  108. package/dist/function/throttle.mjs +1 -1
  109. package/dist/index.d.mts +2 -0
  110. package/dist/index.d.ts +2 -0
  111. package/dist/index.js +27 -53
  112. package/dist/index.js.map +1 -1
  113. package/dist/index.mjs +30 -22
  114. package/dist/math/clamp.mjs +1 -1
  115. package/dist/math/inRange.mjs +1 -1
  116. package/dist/math/index.mjs +1 -1
  117. package/dist/math/mean.mjs +1 -1
  118. package/dist/math/meanBy.mjs +1 -1
  119. package/dist/math/random.mjs +1 -1
  120. package/dist/math/randomInt.mjs +1 -1
  121. package/dist/math/range.mjs +1 -1
  122. package/dist/math/round.mjs +1 -1
  123. package/dist/math/sum.mjs +1 -1
  124. package/dist/math/sumBy.mjs +1 -1
  125. package/dist/object/clone.mjs +1 -1
  126. package/dist/object/cloneDeep.js +1 -1
  127. package/dist/object/cloneDeep.js.map +1 -1
  128. package/dist/object/cloneDeep.mjs +2 -2
  129. package/dist/object/flattenObject.mjs +1 -1
  130. package/dist/object/index.js +2 -16
  131. package/dist/object/index.js.map +1 -1
  132. package/dist/object/index.mjs +3 -3
  133. package/dist/object/invert.mjs +1 -1
  134. package/dist/object/omit.js +1 -15
  135. package/dist/object/omit.js.map +1 -1
  136. package/dist/object/omit.mjs +2 -2
  137. package/dist/object/omitBy.mjs +1 -1
  138. package/dist/object/pick.mjs +1 -1
  139. package/dist/object/pickBy.mjs +1 -1
  140. package/dist/predicate/index.d.mts +2 -0
  141. package/dist/predicate/index.d.ts +2 -0
  142. package/dist/predicate/index.js +14 -0
  143. package/dist/predicate/index.js.map +1 -1
  144. package/dist/predicate/index.mjs +12 -4
  145. package/dist/predicate/isArrayLike.mjs +1 -1
  146. package/dist/predicate/isEqual.mjs +1 -1
  147. package/dist/predicate/isFunction.mjs +1 -1
  148. package/dist/predicate/isLength.mjs +1 -1
  149. package/dist/predicate/isNil.mjs +1 -1
  150. package/dist/predicate/isNotNil.mjs +1 -1
  151. package/dist/predicate/isNull.mjs +1 -1
  152. package/dist/predicate/isPlainObject.mjs +1 -1
  153. package/dist/predicate/isPrimitive.d.mts +17 -0
  154. package/dist/predicate/isPrimitive.d.ts +17 -0
  155. package/dist/predicate/isPrimitive.js +33 -0
  156. package/dist/predicate/isPrimitive.js.map +1 -0
  157. package/dist/predicate/isPrimitive.mjs +8 -0
  158. package/dist/predicate/isPrimitive.mjs.map +1 -0
  159. package/dist/predicate/isTypedArray.d.mts +19 -0
  160. package/dist/predicate/isTypedArray.d.ts +19 -0
  161. package/dist/predicate/isTypedArray.js +33 -0
  162. package/dist/predicate/isTypedArray.js.map +1 -0
  163. package/dist/predicate/isTypedArray.mjs +8 -0
  164. package/dist/predicate/isTypedArray.mjs.map +1 -0
  165. package/dist/predicate/isUndefined.mjs +1 -1
  166. package/dist/promise/delay.js +2 -2
  167. package/dist/promise/delay.js.map +1 -1
  168. package/dist/promise/delay.mjs +2 -2
  169. package/dist/promise/index.js +7 -31
  170. package/dist/promise/index.js.map +1 -1
  171. package/dist/promise/index.mjs +4 -4
  172. package/dist/promise/timeout.js +5 -27
  173. package/dist/promise/timeout.js.map +1 -1
  174. package/dist/promise/timeout.mjs +3 -3
  175. package/dist/promise/withTimeout.js +7 -31
  176. package/dist/promise/withTimeout.js.map +1 -1
  177. package/dist/promise/withTimeout.mjs +4 -4
  178. package/dist/string/camelCase.js +1 -2
  179. package/dist/string/camelCase.js.map +1 -1
  180. package/dist/string/camelCase.mjs +3 -3
  181. package/dist/string/capitalize.mjs +1 -1
  182. package/dist/string/index.js +1 -2
  183. package/dist/string/index.js.map +1 -1
  184. package/dist/string/index.mjs +11 -11
  185. package/dist/string/kebabCase.js +1 -2
  186. package/dist/string/kebabCase.js.map +1 -1
  187. package/dist/string/kebabCase.mjs +3 -3
  188. package/dist/string/lowerCase.js +1 -2
  189. package/dist/string/lowerCase.js.map +1 -1
  190. package/dist/string/lowerCase.mjs +3 -3
  191. package/dist/string/snakeCase.js +1 -2
  192. package/dist/string/snakeCase.js.map +1 -1
  193. package/dist/string/snakeCase.mjs +3 -3
  194. package/dist/string/startCase.js +1 -2
  195. package/dist/string/startCase.js.map +1 -1
  196. package/dist/string/startCase.mjs +3 -3
  197. package/package.json +1 -1
  198. package/umd/browser.global.js +1 -1
  199. package/dist/chunk-24FKGR6U.mjs +0 -47
  200. package/dist/chunk-36ZJSTNA.mjs.map +0 -1
  201. package/dist/chunk-CVVZHOJX.mjs +0 -22
  202. package/dist/chunk-IIDZ3KAJ.mjs +0 -18
  203. package/dist/chunk-U4JWMVQK.mjs +0 -1
  204. /package/dist/{chunk-QXTNZR7B.mjs.map → chunk-3SBT6WDU.mjs.map} +0 -0
  205. /package/dist/{chunk-Y5V7UAZZ.mjs.map → chunk-4ZES5T6V.mjs.map} +0 -0
  206. /package/dist/{chunk-EYYZQFOP.mjs.map → chunk-ET33L3MQ.mjs.map} +0 -0
  207. /package/dist/{chunk-F3WCQQET.mjs.map → chunk-IWXZI3QT.mjs.map} +0 -0
  208. /package/dist/{chunk-24FKGR6U.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  209. /package/dist/{chunk-5IKVJGHO.mjs.map → chunk-RTFTLCF3.mjs.map} +0 -0
  210. /package/dist/{chunk-U4JWMVQK.mjs.map → chunk-YXD3AQAK.mjs.map} +0 -0
package/dist/browser.mjs CHANGED
@@ -1,36 +1,38 @@
1
1
  import {
2
2
  compat_exports
3
- } from "./chunk-36ZJSTNA.mjs";
3
+ } from "./chunk-IGM5IABU.mjs";
4
4
  import "./chunk-NKLIE2OI.mjs";
5
5
  import "./chunk-4OIZM4HS.mjs";
6
- import "./chunk-IIDZ3KAJ.mjs";
7
- import "./chunk-CVVZHOJX.mjs";
6
+ import "./chunk-ZPNX2QDE.mjs";
7
+ import "./chunk-EZYYB34V.mjs";
8
+ import "./chunk-4DFAGGIM.mjs";
8
9
  import "./chunk-XT74R35S.mjs";
9
- import "./chunk-F3WCQQET.mjs";
10
- import "./chunk-QXTNZR7B.mjs";
11
- import "./chunk-Y5V7UAZZ.mjs";
10
+ import "./chunk-ET33L3MQ.mjs";
11
+ import "./chunk-RTFTLCF3.mjs";
12
+ import "./chunk-IWXZI3QT.mjs";
13
+ import "./chunk-3SBT6WDU.mjs";
14
+ import "./chunk-4ZES5T6V.mjs";
15
+ import "./chunk-OG2RLT5U.mjs";
12
16
  import "./chunk-U56ZOM7L.mjs";
13
- import "./chunk-EYYZQFOP.mjs";
14
- import "./chunk-5IKVJGHO.mjs";
15
- import "./chunk-WVQ7YVRK.mjs";
16
- import "./chunk-O64NE2P4.mjs";
17
- import "./chunk-U4JWMVQK.mjs";
17
+ import "./chunk-YXD3AQAK.mjs";
18
+ import "./chunk-VH2PV426.mjs";
18
19
  import "./chunk-74CREQXW.mjs";
19
20
  import "./chunk-WMM7TZLG.mjs";
20
21
  import "./chunk-BMRTZMRE.mjs";
21
22
  import "./chunk-AIRSKN47.mjs";
22
- import "./chunk-VH2PV426.mjs";
23
+ import "./chunk-R6GLTTAB.mjs";
24
+ import "./chunk-SXFMQQ6F.mjs";
23
25
  import "./chunk-LPZZIY5Z.mjs";
24
26
  import "./chunk-27QMXBLJ.mjs";
25
27
  import "./chunk-JYSV56US.mjs";
26
28
  import "./chunk-YXAOYIRV.mjs";
27
29
  import "./chunk-OLX53VEF.mjs";
28
- import "./chunk-WFZXCGEG.mjs";
30
+ import "./chunk-YOPFSFTD.mjs";
29
31
  import "./chunk-BCTYOXT7.mjs";
30
32
  import "./chunk-HPFDYUGP.mjs";
31
33
  import "./chunk-6CLH5YZ2.mjs";
32
34
  import "./chunk-VRUTBJYS.mjs";
33
- import "./chunk-5CPXZFCB.mjs";
35
+ import "./chunk-K5WL54BY.mjs";
34
36
  import "./chunk-XGQWTHW6.mjs";
35
37
  import "./chunk-MIGAC7F4.mjs";
36
38
  import "./chunk-FUS75PJ7.mjs";
@@ -45,7 +47,7 @@ import "./chunk-2SLTL4KL.mjs";
45
47
  import "./chunk-ZA2XI3OV.mjs";
46
48
  import "./chunk-QOJGMVVR.mjs";
47
49
  import "./chunk-OGZMEWPR.mjs";
48
- import "./chunk-3IP4JVLL.mjs";
50
+ import "./chunk-MSHSKENG.mjs";
49
51
  import "./chunk-BOOQBJN2.mjs";
50
52
  import "./chunk-LKXCOLNY.mjs";
51
53
  import "./chunk-CMBC4MXG.mjs";
@@ -93,7 +95,7 @@ import "./chunk-33MSBDC6.mjs";
93
95
  import "./chunk-IEA53J7P.mjs";
94
96
  import "./chunk-E6E4RZLN.mjs";
95
97
  import "./chunk-HM2JT2RX.mjs";
96
- import "./chunk-CRSKT4WW.mjs";
98
+ import "./chunk-Z7HWEOQX.mjs";
97
99
  import "./chunk-JPUKH67K.mjs";
98
100
  import "./chunk-LVWX5B43.mjs";
99
101
  import "./chunk-6NVQAHXP.mjs";
@@ -106,7 +108,7 @@ import "./chunk-DXB7EZUQ.mjs";
106
108
  import "./chunk-KIOYQRMQ.mjs";
107
109
  import "./chunk-E6C5EZQA.mjs";
108
110
  import "./chunk-DTJJIMKJ.mjs";
109
- import "./chunk-24FKGR6U.mjs";
111
+ import "./chunk-J5LGTIGS.mjs";
110
112
 
111
113
  // src/browser.ts
112
114
  window._ = compat_exports;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/browser.ts"],"sourcesContent":["import * as toolkit from './compat/index.ts';\n\ninterface Window {\n _: typeof toolkit;\n}\n\ndeclare let window: Window;\nwindow._ = toolkit;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,OAAO,IAAI;","names":[]}
1
+ {"version":3,"sources":["../src/browser.ts"],"sourcesContent":["import * as toolkit from './compat/index.ts';\n\ninterface Window {\n _: typeof toolkit;\n}\n\ndeclare let window: Window;\nwindow._ = toolkit;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,OAAO,IAAI;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getWords
3
- } from "./chunk-WVQ7YVRK.mjs";
3
+ } from "./chunk-OG2RLT5U.mjs";
4
4
 
5
5
  // src/string/startCase.ts
6
6
  function startCase(str) {
@@ -22,4 +22,4 @@ function startCase(str) {
22
22
  export {
23
23
  startCase
24
24
  };
25
- //# sourceMappingURL=chunk-QXTNZR7B.mjs.map
25
+ //# sourceMappingURL=chunk-3SBT6WDU.mjs.map
@@ -12,15 +12,15 @@ function delay(ms, { signal } = {}) {
12
12
  clearTimeout(timeoutId);
13
13
  abortError();
14
14
  };
15
- if (signal == null ? void 0 : signal.aborted) {
15
+ if (signal?.aborted) {
16
16
  return abortError();
17
17
  }
18
18
  const timeoutId = setTimeout(resolve, ms);
19
- signal == null ? void 0 : signal.addEventListener("abort", abortHandler, { once: true });
19
+ signal?.addEventListener("abort", abortHandler, { once: true });
20
20
  });
21
21
  }
22
22
 
23
23
  export {
24
24
  delay
25
25
  };
26
- //# sourceMappingURL=chunk-O64NE2P4.mjs.map
26
+ //# sourceMappingURL=chunk-4DFAGGIM.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/promise/delay.ts"],"sourcesContent":["import { AbortError } from '../error/AbortError.ts';\n\ninterface DelayOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Delays the execution of code for a specified number of milliseconds.\n *\n * This function returns a Promise that resolves after the specified delay, allowing you to use it\n * with async/await to pause execution.\n *\n * @param {number} ms - The number of milliseconds to delay.\n * @param {DelayOptions} options - The options object.\n * @param {AbortSignal} options.signal - An optional AbortSignal to cancel the delay.\n * @returns {Promise<void>} A Promise that resolves after the specified delay.\n *\n * @example\n * async function foo() {\n * console.log('Start');\n * await delay(1000); // Delays execution for 1 second\n * console.log('End');\n * }\n *\n * foo();\n *\n * // With AbortSignal\n * const controller = new AbortController();\n * const { signal } = controller;\n *\n * setTimeout(() => controller.abort(), 50); // Will cancel the delay after 50ms\n * try {\n * await delay(100, { signal });\n * } catch (error) {\n * console.error(error); // Will log 'AbortError'\n * }\n * }\n */\nexport function delay(ms: number, { signal }: DelayOptions = {}): Promise<void> {\n return new Promise((resolve, reject) => {\n const abortError = () => {\n reject(new AbortError());\n };\n\n const abortHandler = () => {\n clearTimeout(timeoutId);\n abortError();\n };\n\n if (signal?.aborted) {\n return abortError();\n }\n\n const timeoutId = setTimeout(resolve, ms);\n\n signal?.addEventListener('abort', abortHandler, { once: true });\n });\n}\n"],"mappings":";;;;;AAsCO,SAAS,MAAM,IAAY,EAAE,OAAO,IAAkB,CAAC,GAAkB;AAC9E,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,aAAa,MAAM;AACvB,aAAO,IAAI,WAAW,CAAC;AAAA,IACzB;AAEA,UAAM,eAAe,MAAM;AACzB,mBAAa,SAAS;AACtB,iBAAW;AAAA,IACb;AAEA,QAAI,iCAAQ,SAAS;AACnB,aAAO,WAAW;AAAA,IACpB;AAEA,UAAM,YAAY,WAAW,SAAS,EAAE;AAExC,qCAAQ,iBAAiB,SAAS,cAAc,EAAE,MAAM,KAAK;AAAA,EAC/D,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../src/promise/delay.ts"],"sourcesContent":["import { AbortError } from '../error/AbortError.ts';\n\ninterface DelayOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Delays the execution of code for a specified number of milliseconds.\n *\n * This function returns a Promise that resolves after the specified delay, allowing you to use it\n * with async/await to pause execution.\n *\n * @param {number} ms - The number of milliseconds to delay.\n * @param {DelayOptions} options - The options object.\n * @param {AbortSignal} options.signal - An optional AbortSignal to cancel the delay.\n * @returns {Promise<void>} A Promise that resolves after the specified delay.\n *\n * @example\n * async function foo() {\n * console.log('Start');\n * await delay(1000); // Delays execution for 1 second\n * console.log('End');\n * }\n *\n * foo();\n *\n * // With AbortSignal\n * const controller = new AbortController();\n * const { signal } = controller;\n *\n * setTimeout(() => controller.abort(), 50); // Will cancel the delay after 50ms\n * try {\n * await delay(100, { signal });\n * } catch (error) {\n * console.error(error); // Will log 'AbortError'\n * }\n * }\n */\nexport function delay(ms: number, { signal }: DelayOptions = {}): Promise<void> {\n return new Promise((resolve, reject) => {\n const abortError = () => {\n reject(new AbortError());\n };\n\n const abortHandler = () => {\n clearTimeout(timeoutId);\n abortError();\n };\n\n if (signal?.aborted) {\n return abortError();\n }\n\n const timeoutId = setTimeout(resolve, ms);\n\n signal?.addEventListener('abort', abortHandler, { once: true });\n });\n}\n"],"mappings":";;;;;AAsCO,SAAS,MAAM,IAAY,EAAE,OAAO,IAAkB,CAAC,GAAkB;AAC9E,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,aAAa,MAAM;AACvB,aAAO,IAAI,WAAW,CAAC;AAAA,IACzB;AAEA,UAAM,eAAe,MAAM;AACzB,mBAAa,SAAS;AACtB,iBAAW;AAAA,IACb;AAEA,QAAI,QAAQ,SAAS;AACnB,aAAO,WAAW;AAAA,IACpB;AAEA,UAAM,YAAY,WAAW,SAAS,EAAE;AAExC,YAAQ,iBAAiB,SAAS,cAAc,EAAE,MAAM,KAAK,CAAC;AAAA,EAChE,CAAC;AACH;","names":[]}
@@ -1,9 +1,9 @@
1
+ import {
2
+ getWords
3
+ } from "./chunk-OG2RLT5U.mjs";
1
4
  import {
2
5
  capitalize
3
6
  } from "./chunk-U56ZOM7L.mjs";
4
- import {
5
- getWords
6
- } from "./chunk-WVQ7YVRK.mjs";
7
7
 
8
8
  // src/string/camelCase.ts
9
9
  function camelCase(str) {
@@ -18,4 +18,4 @@ function camelCase(str) {
18
18
  export {
19
19
  camelCase
20
20
  };
21
- //# sourceMappingURL=chunk-Y5V7UAZZ.mjs.map
21
+ //# sourceMappingURL=chunk-4ZES5T6V.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getWords
3
- } from "./chunk-WVQ7YVRK.mjs";
3
+ } from "./chunk-OG2RLT5U.mjs";
4
4
 
5
5
  // src/string/kebabCase.ts
6
6
  var kebabCase = (str) => {
@@ -11,4 +11,4 @@ var kebabCase = (str) => {
11
11
  export {
12
12
  kebabCase
13
13
  };
14
- //# sourceMappingURL=chunk-EYYZQFOP.mjs.map
14
+ //# sourceMappingURL=chunk-ET33L3MQ.mjs.map
@@ -0,0 +1,17 @@
1
+ import {
2
+ delay
3
+ } from "./chunk-4DFAGGIM.mjs";
4
+ import {
5
+ TimeoutError
6
+ } from "./chunk-KIOYQRMQ.mjs";
7
+
8
+ // src/promise/timeout.ts
9
+ async function timeout(ms) {
10
+ await delay(ms);
11
+ throw new TimeoutError();
12
+ }
13
+
14
+ export {
15
+ timeout
16
+ };
17
+ //# sourceMappingURL=chunk-EZYYB34V.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/promise/timeout.ts"],"sourcesContent":["import { delay } from './delay.ts';\nimport { TimeoutError } from '../error/TimeoutError.ts';\n\n/**\n * Returns a promise that rejects with a `TimeoutError` after a specified delay.\n *\n * @param {number} ms - The delay duration in milliseconds.\n * @returns {Promise<void>} A promise that rejects with a `TimeoutError` after the specified delay.\n * @throws {TimeoutError} Throws a `TimeoutError` after the specified delay.\n */\nexport async function timeout(ms: number): Promise<never> {\n await delay(ms);\n throw new TimeoutError();\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAsB,QAAQ,IAA4B;AAAA;AACxD,UAAM,MAAM,EAAE;AACd,UAAM,IAAI,aAAa;AAAA,EACzB;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/promise/timeout.ts"],"sourcesContent":["import { delay } from './delay.ts';\nimport { TimeoutError } from '../error/TimeoutError.ts';\n\n/**\n * Returns a promise that rejects with a `TimeoutError` after a specified delay.\n *\n * @param {number} ms - The delay duration in milliseconds.\n * @returns {Promise<void>} A promise that rejects with a `TimeoutError` after the specified delay.\n * @throws {TimeoutError} Throws a `TimeoutError` after the specified delay.\n */\nexport async function timeout(ms: number): Promise<never> {\n await delay(ms);\n throw new TimeoutError();\n}\n"],"mappings":";;;;;;;;AAUA,eAAsB,QAAQ,IAA4B;AACxD,QAAM,MAAM,EAAE;AACd,QAAM,IAAI,aAAa;AACzB;","names":[]}
@@ -1,27 +1,30 @@
1
1
  import {
2
2
  withTimeout
3
- } from "./chunk-IIDZ3KAJ.mjs";
3
+ } from "./chunk-ZPNX2QDE.mjs";
4
+ import {
5
+ delay
6
+ } from "./chunk-4DFAGGIM.mjs";
7
+ import {
8
+ kebabCase
9
+ } from "./chunk-ET33L3MQ.mjs";
10
+ import {
11
+ lowerCase
12
+ } from "./chunk-RTFTLCF3.mjs";
4
13
  import {
5
14
  snakeCase
6
- } from "./chunk-F3WCQQET.mjs";
15
+ } from "./chunk-IWXZI3QT.mjs";
7
16
  import {
8
17
  startCase
9
- } from "./chunk-QXTNZR7B.mjs";
18
+ } from "./chunk-3SBT6WDU.mjs";
10
19
  import {
11
20
  camelCase
12
- } from "./chunk-Y5V7UAZZ.mjs";
21
+ } from "./chunk-4ZES5T6V.mjs";
13
22
  import {
14
23
  capitalize
15
24
  } from "./chunk-U56ZOM7L.mjs";
16
25
  import {
17
- kebabCase
18
- } from "./chunk-EYYZQFOP.mjs";
19
- import {
20
- lowerCase
21
- } from "./chunk-5IKVJGHO.mjs";
22
- import {
23
- delay
24
- } from "./chunk-O64NE2P4.mjs";
26
+ isUndefined
27
+ } from "./chunk-VH2PV426.mjs";
25
28
  import {
26
29
  isFunction
27
30
  } from "./chunk-74CREQXW.mjs";
@@ -35,8 +38,11 @@ import {
35
38
  isNull
36
39
  } from "./chunk-AIRSKN47.mjs";
37
40
  import {
38
- isUndefined
39
- } from "./chunk-VH2PV426.mjs";
41
+ isPrimitive
42
+ } from "./chunk-R6GLTTAB.mjs";
43
+ import {
44
+ isTypedArray
45
+ } from "./chunk-SXFMQQ6F.mjs";
40
46
  import {
41
47
  isArrayLike
42
48
  } from "./chunk-LPZZIY5Z.mjs";
@@ -51,7 +57,7 @@ import {
51
57
  } from "./chunk-OLX53VEF.mjs";
52
58
  import {
53
59
  omit
54
- } from "./chunk-WFZXCGEG.mjs";
60
+ } from "./chunk-YOPFSFTD.mjs";
55
61
  import {
56
62
  omitBy
57
63
  } from "./chunk-BCTYOXT7.mjs";
@@ -66,7 +72,7 @@ import {
66
72
  } from "./chunk-VRUTBJYS.mjs";
67
73
  import {
68
74
  cloneDeep
69
- } from "./chunk-5CPXZFCB.mjs";
75
+ } from "./chunk-K5WL54BY.mjs";
70
76
  import {
71
77
  flattenObject
72
78
  } from "./chunk-XGQWTHW6.mjs";
@@ -102,7 +108,7 @@ import {
102
108
  } from "./chunk-OGZMEWPR.mjs";
103
109
  import {
104
110
  debounce
105
- } from "./chunk-3IP4JVLL.mjs";
111
+ } from "./chunk-MSHSKENG.mjs";
106
112
  import {
107
113
  negate
108
114
  } from "./chunk-BOOQBJN2.mjs";
@@ -243,7 +249,7 @@ import {
243
249
  } from "./chunk-HM2JT2RX.mjs";
244
250
  import {
245
251
  countBy
246
- } from "./chunk-CRSKT4WW.mjs";
252
+ } from "./chunk-Z7HWEOQX.mjs";
247
253
  import {
248
254
  difference
249
255
  } from "./chunk-JPUKH67K.mjs";
@@ -279,7 +285,7 @@ import {
279
285
  } from "./chunk-DTJJIMKJ.mjs";
280
286
  import {
281
287
  __export
282
- } from "./chunk-24FKGR6U.mjs";
288
+ } from "./chunk-J5LGTIGS.mjs";
283
289
 
284
290
  // src/compat/index.ts
285
291
  var compat_exports = {};
@@ -331,6 +337,8 @@ __export(compat_exports, {
331
337
  isNotNil: () => isNotNil,
332
338
  isNull: () => isNull,
333
339
  isPlainObject: () => isPlainObject,
340
+ isPrimitive: () => isPrimitive,
341
+ isTypedArray: () => isTypedArray2,
334
342
  isUndefined: () => isUndefined,
335
343
  kebabCase: () => kebabCase,
336
344
  keyBy: () => keyBy,
@@ -524,7 +532,7 @@ function get(object, path, defaultValue) {
524
532
  let resolvedPath;
525
533
  if (Array.isArray(path)) {
526
534
  resolvedPath = path;
527
- } else if (typeof path === "string" && isDeepKey(path) && (object == null ? void 0 : object[path]) == null) {
535
+ } else if (typeof path === "string" && isDeepKey(path) && object?.[path] == null) {
528
536
  resolvedPath = toPath(path);
529
537
  } else {
530
538
  resolvedPath = [path];
@@ -544,12 +552,11 @@ function get(object, path, defaultValue) {
544
552
  if (current === null && index === resolvedPath.length) {
545
553
  return current;
546
554
  }
547
- return current != null ? current : defaultValue;
555
+ return current ?? defaultValue;
548
556
  }
549
557
 
550
558
  // src/compat/predicate/isPlainObject.ts
551
559
  function isPlainObject(object) {
552
- var _a;
553
560
  if (typeof object !== "object") {
554
561
  return false;
555
562
  }
@@ -564,7 +571,7 @@ function isPlainObject(object) {
564
571
  if (tag == null) {
565
572
  return false;
566
573
  }
567
- const isTagReadonly = !((_a = Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)) == null ? void 0 : _a.writable);
574
+ const isTagReadonly = !Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)?.writable;
568
575
  if (isTagReadonly) {
569
576
  return false;
570
577
  }
@@ -582,6 +589,11 @@ function isArray(value) {
582
589
  return Array.isArray(value);
583
590
  }
584
591
 
592
+ // src/compat/predicate/isTypedArray.ts
593
+ function isTypedArray2(x) {
594
+ return isTypedArray(x);
595
+ }
596
+
585
597
  // src/compat/string/startsWith.ts
586
598
  var startsWith = (str, target, position = 0) => {
587
599
  return str.startsWith(target, position);
@@ -628,10 +640,11 @@ export {
628
640
  get,
629
641
  isPlainObject,
630
642
  isArray,
643
+ isTypedArray2 as isTypedArray,
631
644
  startsWith,
632
645
  endsWith,
633
646
  max,
634
647
  min,
635
648
  compat_exports
636
649
  };
637
- //# sourceMappingURL=chunk-36ZJSTNA.mjs.map
650
+ //# sourceMappingURL=chunk-IGM5IABU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/compat/index.ts","../src/compat/array/chunk.ts","../src/compat/array/concat.ts","../src/compat/array/difference.ts","../src/compat/array/fill.ts","../src/compat/_internal/isIndex.ts","../src/compat/_internal/toPath.ts","../src/compat/object/set.ts","../src/compat/array/zipObjectDeep.ts","../src/compat/_internal/isDeepKey.ts","../src/compat/object/get.ts","../src/compat/predicate/isPlainObject.ts","../src/compat/predicate/isArray.ts","../src/compat/predicate/isTypedArray.ts","../src/compat/string/startsWith.ts","../src/compat/string/endsWith.ts","../src/compat/math/max.ts","../src/compat/math/min.ts"],"sourcesContent":["/**\n * es-toolkit compatibility layer with lodash (WIP)\n * ====================================\n * ```tsx\n * // es-toolkit/compat aims to provide 100% feature parity with lodash\n * import { chunk } from 'es-toolkit/compat';\n *\n * chunk([1, 2, 3, 4], 0);\n * // Returns [], which is identical to lodash\n * ```\n *\n * `es-toolkit/compat` will offer complete compatibility with lodash, ensuring a seamless transition.\n *\n * To guarantee identical behavior, `es-toolkit/compat` will be thoroughly tested using actual lodash test cases.\n *\n * The primary goal of `es-toolkit/compat` is to serve as a drop-in replacement for lodash.\n *\n * It's important to note that while `es-toolkit/compat` will mirror the behavior of lodash functions with 100% accuracy,\n * it will deliberately omit unsafe features, such as:\n *\n * - Implicit type casting from an empty string `''` to 0 or false, and similar cases.\n *\n * @module\n */\nexport * from '../index.ts';\n\nexport { chunk } from './array/chunk.ts';\nexport { concat } from './array/concat.ts';\nexport { difference } from './array/difference.ts';\nexport { fill } from './array/fill.ts';\nexport { zipObjectDeep } from './array/zipObjectDeep.ts';\nexport { head as first } from '../index.ts';\n\nexport { get } from './object/get.ts';\nexport { set } from './object/set.ts';\n\nexport { isPlainObject } from './predicate/isPlainObject.ts';\nexport { isArray } from './predicate/isArray.ts';\nexport { isTypedArray } from './predicate/isTypedArray.ts';\n\nexport { startsWith } from './string/startsWith.ts';\nexport { endsWith } from './string/endsWith.ts';\n\nexport { max } from './math/max.ts';\nexport { min } from './math/min.ts';\n","import { chunk as chunkToolkit } from '../../array/chunk.ts';\n\n/**\n * Splits an array into smaller arrays of a specified length.\n *\n * This function takes an input array and divides it into multiple smaller arrays,\n * each of a specified length. If the input array cannot be evenly divided,\n * the final sub-array will contain the remaining elements.\n *\n * @template T The type of elements in the array.\n * @param {T[]} arr - The array to be chunked into smaller arrays.\n * @param {number} size - The size of each smaller array. Must be a positive integer.\n * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.\n * @throws {Error} Throws an error if `size` is not a positive integer.\n *\n * @example\n * // Splits an array of numbers into sub-arrays of length 2\n * chunk([1, 2, 3, 4, 5], 2);\n * // Returns: [[1, 2], [3, 4], [5]]\n *\n * @example\n * // Splits an array of strings into sub-arrays of length 3\n * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);\n * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]\n */\nexport function chunk<T>(arr: readonly T[], size = 1): T[][] {\n size = Math.max(Math.floor(size), 0);\n\n if (size === 0) {\n return [];\n }\n\n return chunkToolkit(arr, size);\n}\n","import { flatten } from \"../../array/flatten.ts\";\n\n/**\n * Concatenates multiple arrays and values into a single array.\n *\n * @template T The type of elements in the array.\n * @param {...(T | readonly T[])} values - The values and/or arrays to concatenate.\n * @returns {T[]} A new array containing all the input values.\n * \n * @example\n * // Concatenate individual values\n * concat(1, 2, 3); \n * // returns [1, 2, 3]\n *\n * @example\n * // Concatenate arrays of values\n * concat([1, 2], [3, 4]);\n * // returns [1, 2, 3, 4]\n *\n * @example\n * // Concatenate a mix of individual values and arrays\n * concat(1, [2, 3], 4);\n * // returns [1, 2, 3, 4]\n *\n * @example\n * // Concatenate nested arrays\n * concat([1, [2, 3]], 4);\n * // returns [1, [2, 3], 4]\n */\nexport function concat<T>(...values: Array<T | readonly T[]>): T[] {\n return flatten(values) as T[];\n}\n","import { difference as differenceToolkit } from '../../array/difference.ts';\nimport { flatten } from '../../array/flatten.ts';\n\nexport function difference<T>(arr: readonly T[], ...values: Array<readonly T[]>): T[] {\n const arr1 = arr;\n const arr2 = flatten(values);\n\n return differenceToolkit(arr1, arr2);\n}","import { fill as fillToolkit } from '../../array/fill.ts';\n\n/**\n * Fills elements of an array with a specified value from the start position up to, but not including, the end position.\n *\n * This function mutates the original array and replaces its elements with the provided value, starting from the specified\n * start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the\n * entire array.\n *\n * @param {Array<T | U>} array - The array to fill.\n * @param {U} value - The value to fill the array with.\n * @param {S} [start=0] - The start position. Defaults to 0.\n * @param {V} [end=arr.length] - The end position. Defaults to the array's length.\n * @returns {Array<T | U>} The array with the filled values.\n *\n * @example\n * const array = [1, 2, 3];\n * const result = fill(array, 'a');\n * // => ['a', 'a', 'a']\n *\n * const result = fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * const result = fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n *\n * const result = fill(array, '*', -2, -1);\n * // => [1, '*', 3]\n */\nexport function fill<T>(array: unknown[], value?: T): T[];\nexport function fill<T, U, S>(array: Array<T | U>, value: U, start: S): Array<T | U>;\nexport function fill<T, U, S, V>(array: Array<T | U>, value: U, start: S, end: V): Array<T | U>;\nexport function fill<T, U>(array: Array<T | U>, value: U, start = 0, end = array.length): Array<T | U> {\n start = Math.floor(start);\n end = Math.floor(end);\n\n if (!start) {\n start = 0;\n }\n if (!end) {\n end = 0;\n }\n\n return fillToolkit(array, value, start, end);\n}\n","const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/\n\nexport function isIndex(value: PropertyKey) {\n switch (typeof value) {\n case 'number': {\n return Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;\n }\n case 'symbol': {\n return false;\n }\n case 'string': {\n return IS_UNSIGNED_INTEGER.test(value);\n }\n }\n}","/**\n * Converts a deep key string into an array of path segments.\n *\n * This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.\n *\n * @param deepKey - The deep key string to convert.\n * @returns An array of strings, each representing a segment of the path.\n *\n * Examples:\n *\n * toPath('a.b.c') // Returns ['a', 'b', 'c']\n * toPath('a[b][c]') // Returns ['a', 'b', 'c']\n * toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']\n * toPath('a[\"b.c\"].d') // Returns ['a', 'b.c', 'd']\n * toPath('') // Returns []\n * toPath('.a[b].c.d[e][\"f.g\"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']\n */\nexport function toPath(deepKey: string): string[] {\n const ESCAPE_REGEXP = /\\\\(\\\\)?/g;\n const PROPERTY_REGEXP = RegExp(\n // Match anything that isn't a dot or bracket.\n '[^.[\\\\]]+' +\n '|' +\n // Or match property names within brackets.\n '\\\\[(?:' +\n // Match a non-string expression.\n '([^\"\\'][^[]*)' +\n '|' +\n // Or match strings (supports escaping characters).\n '([\"\\'])((?:(?!\\\\2)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\2' +\n ')\\\\]' +\n '|' +\n // Or match \"\" as the space between consecutive dots or empty brackets.\n '(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))',\n 'g'\n );\n\n const result: string[] = [];\n\n if (deepKey[0] === '.') {\n result.push('');\n }\n\n let match: RegExpExecArray | null;\n let lastIndex = 0;\n\n while ((match = PROPERTY_REGEXP.exec(deepKey)) !== null) {\n let key = match[0];\n const expr = match[1];\n const quote = match[2];\n const substr = match[3];\n\n if (quote) {\n key = substr.replace(ESCAPE_REGEXP, '$1');\n } else if (expr) {\n key = expr;\n }\n\n result.push(key);\n\n if (PROPERTY_REGEXP.lastIndex === lastIndex) {\n PROPERTY_REGEXP.lastIndex++;\n } else {\n lastIndex = PROPERTY_REGEXP.lastIndex;\n }\n }\n\n return result;\n}\n","import { isIndex } from \"../_internal/isIndex.ts\";\nimport { toPath } from \"../_internal/toPath.ts\";\n\n/**\n * Sets the value at the specified path of the given object. If any part of the path does not exist, it will be created.\n *\n * @template T - The type of the object.\n * @param {Settable} obj - The object to modify.\n * @param {Path} path - The path of the property to set.\n * @param {any} value - The value to set.\n * @returns {T} - The modified object.\n *\n * @example\n * // Set a value in a nested object\n * const obj = { a: { b: { c: 3 } } };\n * set(obj, 'a.b.c', 4);\n * console.log(obj.a.b.c); // 4\n *\n * @example\n * // Set a value in an array\n * const arr = [1, 2, 3];\n * set(arr, 1, 4);\n * console.log(arr[1]); // 4\n *\n * @example\n * // Create non-existent path and set value\n * const obj = {};\n * set(obj, 'a.b.c', 4);\n * console.log(obj); // { a: { b: { c: 4 } } }\n */\nexport function set<T>(obj: object, path: PropertyKey | readonly PropertyKey[], value: unknown): T;\nexport function set<T extends object>(obj: T, path: PropertyKey | readonly PropertyKey[], value: unknown): T {\n const resolvedPath = Array.isArray(path)\n ? path\n : typeof path === 'string'\n ? toPath(path)\n : [path];\n\n let current: any = obj;\n\n for (let i = 0; i < resolvedPath.length - 1; i++) {\n const key = resolvedPath[i];\n const nextKey = resolvedPath[i + 1];\n\n if (current[key] == null) {\n current[key] = isIndex(nextKey) ? [] : {};\n }\n\n current = current[key];\n }\n\n const lastKey = resolvedPath[resolvedPath.length - 1];\n current[lastKey] = value;\n\n return obj;\n}\n","import { zip } from \"../../array/zip.ts\";\nimport { set } from \"../object/set.ts\";\n\n/**\n * Creates a deeply nested object given arrays of paths and values.\n *\n * This function takes two arrays: one containing arrays of property paths, and the other containing corresponding values.\n * It returns a new object where paths from the first array are used as key paths to set values, with corresponding elements from the second array as values.\n * Paths can be dot-separated strings or arrays of property names.\n * \n * If the `keys` array is longer than the `values` array, the remaining keys will have `undefined` as their values.\n *\n * @template V - The type of elements in the array.\n * @param {string[] | string[][]} keys - An array of property paths, each path can be a dot-separated string or an array of property names.\n * @param {V[]} values - An array of values corresponding to the property paths.\n * @returns {object} A new object composed of the given property paths and values.\n *\n * @example\n * const paths = ['a.b.c', 'd.e.f'];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }\n *\n * @example\n * const paths = [['a', 'b', 'c'], ['d', 'e', 'f']];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }\n * \n * @example\n * const paths = ['a.b[0].c', 'a.b[1].d'];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\nexport function zipObjectDeep<P extends string | number | symbol, V>(keys: P[], values: V[]): { [K in P]: V } {\n const result = {} as { [K in P]: V };\n const zipped = zip(keys, values);\n\n for (let i = 0; i < zipped.length; i++) {\n const [key, value] = zipped[i];\n\n if (key != null) {\n set(result, key, value);\n }\n }\n\n return result;\n}\n","const IS_PLAIN = /^\\w*$/;\nconst IS_DEEP = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\n\n/**\n * Checks if a given key is a deep key.\n *\n * A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n *\n * @param key - The key to check.\n * @returns {boolean} - Returns true if the key is a deep key, otherwise false.\n *\n * Examples:\n *\n * isDeepKey('a.b') // true\n * isDeepKey('a[b]') // true\n * isDeepKey('a') // false\n * isDeepKey(123) // false\n * isDeepKey('a.b.c') // true\n * isDeepKey('a[b][c]') // true\n */\nexport function isDeepKey(key: PropertyKey): boolean {\n switch (typeof key) {\n case \"number\":\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return !IS_PLAIN.test(key) && IS_DEEP.test(key);\n }\n }\n}\n","import { isDeepKey } from \"../_internal/isDeepKey.ts\";\nimport { toPath } from \"../_internal/toPath.ts\";\nimport type { Get } from \"./get.types.ts\";\n\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K - The type of the key in the object.\n * @template D - The type of the default value.\n * \n * @param {T} object - The object to query.\n * @param {K | [K]} path - The path of the property to get.\n * @returns {T[K]} - Returns the resolved value.\n */\nexport function get<T extends object, K extends keyof T>(object: T, path: K | [K]): T[K];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K - The type of the key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {K | [K]} path - The path of the property to get.\n * @returns {T[K] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K extends keyof T>(object: T | null | undefined, path: K | [K]): T[K] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K - The type of the key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {K | [K]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K extends keyof T, D>(object: T | null | undefined, path: K | [K], defaultValue: D): Exclude<T[K], undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * \n * @param {T} object - The object to query.\n * @param {[K1, K2]} path - The path of the property to get.\n * @returns {T[K1][K2]} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1]>(object: T, path: [K1, K2]): T[K1][K2];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2]} path - The path of the property to get.\n * @returns {T[K1][K2] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1]>(object: T | null | undefined, path: [K1, K2]): T[K1][K2] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K1][K2], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], D>(object: T | null | undefined, path: [K1, K2], defaultValue: D): Exclude<T[K1][K2], undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * \n * @param {T} object - The object to query.\n * @param {[K1, K2, K3]} path - The path of the property to get.\n * @returns {T[K1][K2][K3]} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2]>(object: T, path: [K1, K2, K3]): T[K1][K2][K3];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3]} path - The path of the property to get.\n * @returns {T[K1][K2][K3] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2]>(object: T | null | undefined, path: [K1, K2, K3]): T[K1][K2][K3] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K1][K2][K3], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], D>(object: T | null | undefined, path: [K1, K2, K3], defaultValue: D): Exclude<T[K1][K2][K3], undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template K4 - The type of the fourth key in the object.\n * \n * @param {T} object - The object to query.\n * @param {[K1, K2, K3, K4]} path - The path of the property to get.\n * @returns {T[K1][K2][K3][K4]} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3]>(object: T, path: [K1, K2, K3, K4]): T[K1][K2][K3][K4];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template K4 - The type of the fourth key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3, K4]} path - The path of the property to get.\n * @returns {T[K1][K2][K3][K4] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3]>(object: T | null | undefined, path: [K1, K2, K3, K4]): T[K1][K2][K3][K4] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template K4 - The type of the fourth key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3, K4]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K1][K2][K3][K4], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3], D>(object: T | null | undefined, path: [K1, K2, K3, K4], defaultValue: D): Exclude<T[K1][K2][K3][K4], undefined> | D;\n/**\n * Retrieves the value at a given path from an object with numeric keys. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the value.\n * \n * @param {Record<number, T>} object - The object to query.\n * @param {number} path - The path of the property to get.\n * @returns {T} - Returns the resolved value.\n */\nexport function get<T>(object: Record<number, T>, path: number): T;\n/**\n * Retrieves the value at a given path from an object with numeric keys. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the value.\n * \n * @param {Record<number, T> | null | undefined} object - The object to query.\n * @param {number} path - The path of the property to get.\n * @returns {T | undefined} - Returns the resolved value.\n */\nexport function get<T>(object: Record<number, T> | null | undefined, path: number): T | undefined;\n/**\n * Retrieves the value at a given path from an object with numeric keys. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the value.\n * @template D - The type of the default value.\n * \n * @param {Record<number, T> | null | undefined} object - The object to query.\n * @param {number} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {T | D} - Returns the resolved value.\n */\nexport function get<T, D>(object: Record<number, T> | null | undefined, path: number, defaultValue: D): T | D;\n/**\n * Retrieves the value at a given path from a null or undefined object, returning the default value.\n * \n * @template D - The type of the default value.\n * \n * @param {null | undefined} object - The object to query.\n * @param {PropertyKey} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {D} - Returns the default value.\n */\nexport function get<D>(object: null | undefined, path: PropertyKey, defaultValue: D): D;\n/**\n * Retrieves the value at a given path from a null or undefined object, returning undefined.\n * \n * @param {null | undefined} object - The object to query.\n * @param {PropertyKey} path - The path of the property to get.\n * @returns {undefined} - Returns undefined.\n */\nexport function get(object: null | undefined, path: PropertyKey): undefined;\n/**\n * Retrieves the value at a given path from a string-keyed object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template P - The type of the path.\n * \n * @param {T} data - The object to query.\n * @param {P} path - The path of the property to get.\n * @returns {string extends P ? any : Get<T, P>} - Returns the resolved value.\n */\nexport function get<T, P extends string>(data: T, path: P): string extends P ? any : Get<T, P>;\n/**\n * Retrieves the value at a given path from a string-keyed object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template P - The type of the path.\n * @template D - The type of the default value.\n * \n * @param {T} data - The object to query.\n * @param {P} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<Get<T, P>, null | undefined> | D} - Returns the resolved value.\n */\nexport function get<T, P extends string, D = Get<T, P>>(data: T, path: P, defaultValue: D): Exclude<Get<T, P>, null | undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @param {unknown} object - The object to query.\n * @param {PropertyKey | readonly PropertyKey[]} path - The path of the property to get.\n * @param {unknown} [defaultValue] - The value returned if the resolved value is undefined.\n * @returns {any} - Returns the resolved value.\n */\nexport function get(object: unknown, path: PropertyKey | readonly PropertyKey[], defaultValue?: unknown): any;\nexport function get(object: any, path: PropertyKey | readonly PropertyKey[], defaultValue?: any): any {\n let resolvedPath;\n\n if (Array.isArray(path)) {\n resolvedPath = path;\n } else if (typeof path === 'string' && isDeepKey(path) && object?.[path] == null) {\n resolvedPath = toPath(path);\n } else {\n resolvedPath = [path];\n }\n\n if (resolvedPath.length === 0) {\n return defaultValue;\n }\n\n let current = object;\n let index;\n\n for (index = 0; index < resolvedPath.length && current != null; index++) {\n let key = resolvedPath[index];\n\n if (Object.is(key.valueOf(), -0)) {\n key = '-0';\n }\n\n current = current[key];\n }\n\n if (current === null && index === resolvedPath.length) {\n return current;\n }\n\n return current ?? defaultValue;\n}","/**\n * Checks if a given value is a plain object.\n *\n * A plain object is an object created by the `{}` literal, `new Object()`, or\n * `Object.create(null)`.\n *\n * This function also handles objects with custom\n * `Symbol.toStringTag` properties.\n *\n * `Symbol.toStringTag` is a built-in symbol that a constructor can use to customize the\n * default string description of objects.\n *\n * @param {unknown} [object] - The value to check.\n * @returns {boolean} - True if the value is a plain object, otherwise false.\n *\n * @example\n * console.log(isPlainObject({})); // true\n * console.log(isPlainObject([])); // false\n * console.log(isPlainObject(null)); // false\n * console.log(isPlainObject(Object.create(null))); // true\n * console.log(isPlainObject(new Map())); // false\n */\nexport function isPlainObject(object?: unknown): boolean {\n if (typeof object !== 'object') {\n return false;\n }\n\n if (object == null) {\n return false;\n }\n\n if (Object.getPrototypeOf(object) === null) {\n return true;\n }\n\n if (object.toString() !== '[object Object]') {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const tag = object[Symbol.toStringTag];\n\n if (tag == null) {\n return false;\n }\n\n const isTagReadonly = !Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)?.writable;\n\n if (isTagReadonly) {\n return false;\n }\n\n return object.toString() === `[object ${tag}]`;\n }\n\n let proto = object;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(object) === proto;\n}\n","/**\n * Checks if the given value is an array.\n *\n * This function tests whether the provided value is an array or not.\n * It returns `true` if the value is an array, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an array.\n *\n * @template T - The type of value.\n * @param {T} value - The value to test if it is an array.\n * @returns {value is Extract<T, unknown[]>} `true` if the value is an array, `false` otherwise.\n *\n * @example\n * const value1 = [1, 2, 3];\n * const value2 = 'abc';\n * const value3 = () => {};\n *\n * console.log(isArray(value1)); // true\n * console.log(isArray(value2)); // false\n * console.log(isArray(value3)); // false\n */\nexport function isArray<T>(value?: T): value is Extract<T, readonly unknown[]> {\n return Array.isArray(value);\n}\n","import { isTypedArray as isTypedArrayToolkit } from '../../predicate/isTypedArray.ts';\n\n/**\n * Checks if a value is a TypedArray.\n * @param {unknown} x The value to check.\n * @returns {x is\n * | Uint8Array\n * | Uint8ClampedArray\n * | Uint16Array\n * | Uint32Array\n * | BigUint64Array\n * | Int8Array\n * | Int16Array\n * | Int32Array\n * | BigInt64Array\n * | Float32Array\n * | Float64Array} Returns true if `x` is a TypedArray, false otherwise.\n */\nexport function isTypedArray(\n x?: unknown\n): x is\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array {\n return isTypedArrayToolkit(x);\n}\n","/**\n * Checks if a string contains another string at the beginning of the string.\n *\n * Checks if one string startsWith another string. Optional position parameter to start searching from a certain index.\n *\n * @param {string} str - The string that might contain the target string.\n * @param {string} target - The string to search for.\n * @param {number} position - An optional offset to start searching in the str string\n * @returns {boolean} - True if the str string starts with the target string.\n *\n * @example\n * const isPrefix = startsWith('fooBar', 'foo') // returns true\n * const isPrefix = startsWith('fooBar', 'bar') // returns false\n * const isPrefix = startsWith('fooBar', 'abc') // returns false\n * const isPrefix = startsWith('fooBar', 'Bar', 2) // returns true\n * const isPrefix = startsWith('fooBar', 'Bar', 5) // returns false\n */\nexport const startsWith = (str: string, target: string, position = 0): boolean => {\n return str.startsWith(target, position);\n};\n","/**\n * Checks if a string contains another string at the end of the string.\n *\n * Checks if one string endsWith another string. Optional position parameter to offset searching before a certain index.\n *\n * @param {string} str - The string that might contain the target string.\n * @param {string} target - The string to search for.\n * @param {number} position - An optional position from the start to search up to this index\n * @returns {boolean} - True if the str string ends with the target string.\n *\n * @example\n * const isPrefix = endsWith('fooBar', 'foo') // returns true\n * const isPrefix = endsWith('fooBar', 'bar') // returns false\n * const isPrefix = endsWith('fooBar', 'abc') // returns false\n * const isPrefix = endsWith('fooBar', 'foo', 3) // returns true\n * const isPrefix = endsWith('fooBar', 'abc', 5) // returns false\n */\nexport const endsWith = (str: string, target: string, position: number = str.length): boolean => {\n return str.endsWith(target, position);\n};\n","/**\n * Finds the element in an array that has the maximum value.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} items The array of elements to search.\n * @returns {T | undefined} The element with the maximum value.\n * @example\n * // Returns 9\n * max([3, 1, 4, 1, 5, 9])\n *\n * @example\n * // Returns 8\n * max([0, -3, 2, 8, 7])\n */\nexport function max<T>(items: readonly [T, ...T[]]): T;\nexport function max(): undefined;\nexport function max<T>(items?: readonly T[]): T | undefined;\nexport function max<T>(items: readonly T[] = []): T | undefined {\n let maxElement = items[0];\n let max = undefined;\n\n for (const element of items) {\n if (max == null || element > max) {\n max = element;\n maxElement = element;\n }\n }\n\n return maxElement;\n}\n","/**\n * Finds the element in an array that has the minimum value.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} items The array of elements to search.\n * @returns {T | undefined} The element with the minimum value.\n * @example\n * // Returns 1\n * min([3, 1, 4, 1, 5, 9])\n *\n * @example\n * // Returns -3\n * min([0, -3, 2, 8, 7])\n */\nexport function min<T>(items: readonly [T, ...T[]]): T;\nexport function min(): undefined;\nexport function min<T>(items?: readonly T[]): T | undefined;\nexport function min<T>(items: readonly T[] = []): T {\n let minElement = items[0];\n let min = undefined;\n\n for (const element of items) {\n if (min == null || element < min) {\n min = element;\n minElement = element;\n }\n }\n\n return minElement;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,KAAa,QAAgB,WAAW,MAAe;AAChF,SAAO,IAAI,WAAW,QAAQ,QAAQ;AACxC;;;ACFO,IAAM,WAAW,CAAC,KAAa,QAAgB,WAAmB,IAAI,WAAoB;AAC/F,SAAO,IAAI,SAAS,QAAQ,QAAQ;AACtC;;;ACFO,SAAS,IAAO,QAAsB,CAAC,GAAkB;AAC9D,MAAI,aAAa,MAAM,CAAC;AACxB,MAAIC,OAAM;AAEV,aAAW,WAAW,OAAO;AAC3B,QAAIA,QAAO,QAAQ,UAAUA,MAAK;AAChC,MAAAA,OAAM;AACN,mBAAa;AAAA,IACf;AAAA,EACF;AAEA,SAAO;AACT;;;ACZO,SAAS,IAAO,QAAsB,CAAC,GAAM;AAClD,MAAI,aAAa,MAAM,CAAC;AACxB,MAAIC,OAAM;AAEV,aAAW,WAAW,OAAO;AAC3B,QAAIA,QAAO,QAAQ,UAAUA,MAAK;AAChC,MAAAA,OAAM;AACN,mBAAa;AAAA,IACf;AAAA,EACF;AAEA,SAAO;AACT;","names":["chunk","difference","fill","isTypedArray","chunk","difference","fill","isTypedArray","max","min"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getWords
3
- } from "./chunk-WVQ7YVRK.mjs";
3
+ } from "./chunk-OG2RLT5U.mjs";
4
4
 
5
5
  // src/string/snakeCase.ts
6
6
  var snakeCase = (str) => {
@@ -11,4 +11,4 @@ var snakeCase = (str) => {
11
11
  export {
12
12
  snakeCase
13
13
  };
14
- //# sourceMappingURL=chunk-F3WCQQET.mjs.map
14
+ //# sourceMappingURL=chunk-IWXZI3QT.mjs.map
@@ -0,0 +1,10 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ export {
8
+ __export
9
+ };
10
+ //# sourceMappingURL=chunk-J5LGTIGS.mjs.map
@@ -77,7 +77,7 @@ function cloneDeepHelper(obj, clonedObj) {
77
77
  for (const key in obj) {
78
78
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
79
79
  const descriptor = Object.getOwnPropertyDescriptor(obj, key);
80
- if (((descriptor == null ? void 0 : descriptor.writable) || (descriptor == null ? void 0 : descriptor.set)) && typeof (descriptor == null ? void 0 : descriptor.value) !== "function") {
80
+ if ((descriptor?.writable || descriptor?.set) && typeof descriptor?.value !== "function") {
81
81
  clonedObj[key] = cloneDeep(obj[key]);
82
82
  }
83
83
  }
@@ -90,4 +90,4 @@ function isTypedArray(obj) {
90
90
  export {
91
91
  cloneDeep
92
92
  };
93
- //# sourceMappingURL=chunk-5CPXZFCB.mjs.map
93
+ //# sourceMappingURL=chunk-K5WL54BY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/object/cloneDeep.ts"],"sourcesContent":["/**\n * Creates a deep clone of the given object.\n *\n * @template T - The type of the object.\n * @param {T} obj - The object to clone.\n * @returns {T} - A deep clone of the given object.\n *\n * @example\n * // Clone a primitive values\n * const num = 29;\n * const clonedNum = clone(num);\n * console.log(clonedNum); // 29\n * console.log(clonedNum === num) ; // true\n *\n * @example\n * // Clone an array\n * const arr = [1, 2, 3];\n * const clonedArr = clone(arr);\n * console.log(clonedArr); // [1, 2, 3]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an array with nested objects\n * const arr = [1, { a: 1 }, [1, 2, 3]];\n * const clonedArr = clone(arr);\n * arr[1].a = 2;\n * console.log(arr); // [2, { a: 2 }, [1, 2, 3]]\n * console.log(clonedArr); // [1, { a: 1 }, [1, 2, 3]]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an object\n * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n * const clonedObj = clone(obj);\n * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n * console.log(clonedObj === obj); // false\n *\n * @example\n * // Clone an object with nested objects\n * const obj = { a: 1, b: { c: 1 } };\n * const clonedObj = clone(obj);\n * obj.b.c = 2;\n * console.log(obj); // { a: 1, b: { c: 2 } }\n * console.log(clonedObj); // { a: 1, b: { c: 1 } }\n * console.log(clonedObj === obj); // false\n */\nexport function cloneDeep<T>(obj: T): Resolved<T> {\n if (isPrimitive(obj)) {\n return obj as Resolved<T>;\n }\n\n if (Array.isArray(obj)) {\n return obj.map(item => cloneDeep(item)) as Resolved<T>;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as Resolved<T>;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as Resolved<T>;\n }\n\n if (obj instanceof Map) {\n const result = new Map();\n for (const [key, value] of obj.entries()) {\n result.set(key, cloneDeep(value));\n }\n return result as Resolved<T>;\n }\n\n if (obj instanceof Set) {\n const result = new Set();\n for (const value of obj.values()) {\n result.add(cloneDeep(value));\n }\n return result as Resolved<T>;\n }\n\n if (isTypedArray(obj)) {\n const result = new (Object.getPrototypeOf(obj).constructor)(obj.length);\n for (let i = 0; i < obj.length; i++) {\n result[i] = cloneDeep(obj[i]);\n }\n return result as Resolved<T>;\n }\n\n if (obj instanceof ArrayBuffer || obj instanceof SharedArrayBuffer) {\n return obj.slice(0) as Resolved<T>;\n }\n\n if (obj instanceof DataView) {\n const result = new DataView(obj.buffer.slice(0));\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n // For legacy NodeJS support\n if (typeof File !== 'undefined' && obj instanceof File) {\n const result = new File([obj], obj.name, { type: obj.type });\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (obj instanceof Blob) {\n const result = new Blob([obj], { type: obj.type });\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (obj instanceof Error) {\n const result = new (obj.constructor as { new (): Error })();\n result.message = obj.message;\n result.name = obj.name;\n result.stack = obj.stack;\n result.cause = obj.cause;\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (typeof obj === 'object' && obj !== null) {\n const result = {};\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (typeof obj === 'function') {\n return void 0 as Resolved<T>;\n }\n\n return obj as Resolved<T>;\n}\n\ntype Primitive = null | undefined | string | number | boolean | symbol | bigint;\nfunction isPrimitive(value: unknown): value is Primitive {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n\n// eslint-disable-next-line\nfunction cloneDeepHelper(obj: any, clonedObj: any): void {\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n const descriptor = Object.getOwnPropertyDescriptor(obj, key);\n if ((descriptor?.writable || descriptor?.set) && typeof descriptor?.value !== 'function') {\n clonedObj[key] = cloneDeep(obj[key]);\n }\n }\n }\n}\n\nfunction isTypedArray(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n obj: any\n): obj is\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array {\n return (\n obj instanceof Uint8Array ||\n obj instanceof Uint8ClampedArray ||\n obj instanceof Uint16Array ||\n obj instanceof Uint32Array ||\n obj instanceof BigUint64Array ||\n obj instanceof Int8Array ||\n obj instanceof Int16Array ||\n obj instanceof Int32Array ||\n obj instanceof BigInt64Array ||\n obj instanceof Float32Array ||\n obj instanceof Float64Array\n );\n}\n\nexport type Resolved<T> = Equal<T, ResolvedMain<T>> extends true ? T : ResolvedMain<T>;\n\ntype Equal<X, Y> = X extends Y ? (Y extends X ? true : false) : false;\n\ntype ResolvedMain<T> = T extends [never]\n ? never // (special trick for jsonable | null) type\n : ValueOf<T> extends boolean | number | bigint | string\n ? ValueOf<T>\n : T extends (...args: any[]) => any\n ? never\n : T extends object\n ? ResolvedObject<T>\n : ValueOf<T>;\n\ntype ResolvedObject<T extends object> =\n T extends Array<infer U>\n ? IsTuple<T> extends true\n ? ResolvedTuple<T>\n : Array<ResolvedMain<U>>\n : T extends Set<infer U>\n ? Set<ResolvedMain<U>>\n : T extends Map<infer K, infer V>\n ? Map<ResolvedMain<K>, ResolvedMain<V>>\n : T extends WeakSet<any> | WeakMap<any, any>\n ? never\n : T extends\n | Date\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array\n | ArrayBuffer\n | SharedArrayBuffer\n | DataView\n | Blob\n | File\n ? T\n : {\n [P in keyof T]: ResolvedMain<T[P]>;\n };\n\ntype ResolvedTuple<T extends readonly any[]> = T extends []\n ? []\n : T extends [infer F]\n ? [ResolvedMain<F>]\n : T extends [infer F, ...infer Rest extends readonly any[]]\n ? [ResolvedMain<F>, ...ResolvedTuple<Rest>]\n : T extends [(infer F)?]\n ? [ResolvedMain<F>?]\n : T extends [(infer F)?, ...infer Rest extends readonly any[]]\n ? [ResolvedMain<F>?, ...ResolvedTuple<Rest>]\n : [];\n\ntype IsTuple<T extends readonly any[] | { length: number }> = [T] extends [never]\n ? false\n : T extends readonly any[]\n ? number extends T['length']\n ? false\n : true\n : false;\n\ntype ValueOf<Instance> =\n IsValueOf<Instance, boolean> extends true\n ? boolean\n : IsValueOf<Instance, number> extends true\n ? number\n : IsValueOf<Instance, string> extends true\n ? string\n : Instance;\n\ntype IsValueOf<Instance, O extends IValueOf<any>> = Instance extends O\n ? O extends IValueOf<infer Primitive>\n ? Instance extends Primitive\n ? false\n : true // not Primitive, but Object\n : false // cannot be\n : false;\n\ninterface IValueOf<T> {\n valueOf(): T;\n}\n"],"mappings":";AA8CO,SAAS,UAAa,KAAqB;AAChD,MAAI,YAAY,GAAG,GAAG;AACpB,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,IAAI,IAAI,UAAQ,UAAU,IAAI,CAAC;AAAA,EACxC;AAEA,MAAI,eAAe,MAAM;AACvB,WAAO,IAAI,KAAK,IAAI,QAAQ,CAAC;AAAA,EAC/B;AAEA,MAAI,eAAe,QAAQ;AACz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IAAK,IAAI,YAAkC;AAC1D,WAAO,UAAU,IAAI;AACrB,WAAO,OAAO,IAAI;AAClB,WAAO,QAAQ,IAAI;AACnB,WAAO,QAAQ,IAAI;AACnB,oBAAgB,KAAK,MAAM;AAC3B,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,QAAQ,YAAY,QAAQ,MAAM;AAC3C,UAAM,SAAS,CAAC;AAChB,oBAAgB,KAAK,MAAM;AAC3B,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,QAAQ,YAAY;AAC7B,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAGA,SAAS,YAAY,OAAoC;AACvD,SAAO,SAAS,QAAS,OAAO,UAAU,YAAY,OAAO,UAAU;AACzE;AAGA,SAAS,gBAAgB,KAAU,WAAsB;AACvD,aAAW,OAAO,KAAK;AACrB,QAAI,OAAO,UAAU,eAAe,KAAK,KAAK,GAAG,GAAG;AAClD,YAAM,aAAa,OAAO,yBAAyB,KAAK,GAAG;AAC3D,YAAK,yCAAY,cAAY,yCAAY,SAAQ,QAAO,yCAAY,WAAU,YAAY;AACxF,kBAAU,GAAG,IAAI,UAAU,IAAI,GAAG,CAAC;AAAA,MACrC;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,aAEP,KAYe;AACf,SACE,eAAe,cACf,eAAe,qBACf,eAAe,eACf,eAAe,eACf,eAAe,kBACf,eAAe,aACf,eAAe,cACf,eAAe,cACf,eAAe,iBACf,eAAe,gBACf,eAAe;AAEnB;","names":[]}
1
+ {"version":3,"sources":["../src/object/cloneDeep.ts"],"sourcesContent":["/**\n * Creates a deep clone of the given object.\n *\n * @template T - The type of the object.\n * @param {T} obj - The object to clone.\n * @returns {T} - A deep clone of the given object.\n *\n * @example\n * // Clone a primitive values\n * const num = 29;\n * const clonedNum = clone(num);\n * console.log(clonedNum); // 29\n * console.log(clonedNum === num) ; // true\n *\n * @example\n * // Clone an array\n * const arr = [1, 2, 3];\n * const clonedArr = clone(arr);\n * console.log(clonedArr); // [1, 2, 3]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an array with nested objects\n * const arr = [1, { a: 1 }, [1, 2, 3]];\n * const clonedArr = clone(arr);\n * arr[1].a = 2;\n * console.log(arr); // [2, { a: 2 }, [1, 2, 3]]\n * console.log(clonedArr); // [1, { a: 1 }, [1, 2, 3]]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an object\n * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n * const clonedObj = clone(obj);\n * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n * console.log(clonedObj === obj); // false\n *\n * @example\n * // Clone an object with nested objects\n * const obj = { a: 1, b: { c: 1 } };\n * const clonedObj = clone(obj);\n * obj.b.c = 2;\n * console.log(obj); // { a: 1, b: { c: 2 } }\n * console.log(clonedObj); // { a: 1, b: { c: 1 } }\n * console.log(clonedObj === obj); // false\n */\nexport function cloneDeep<T>(obj: T): Resolved<T> {\n if (isPrimitive(obj)) {\n return obj as Resolved<T>;\n }\n\n if (Array.isArray(obj)) {\n return obj.map(item => cloneDeep(item)) as Resolved<T>;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as Resolved<T>;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as Resolved<T>;\n }\n\n if (obj instanceof Map) {\n const result = new Map();\n for (const [key, value] of obj.entries()) {\n result.set(key, cloneDeep(value));\n }\n return result as Resolved<T>;\n }\n\n if (obj instanceof Set) {\n const result = new Set();\n for (const value of obj.values()) {\n result.add(cloneDeep(value));\n }\n return result as Resolved<T>;\n }\n\n if (isTypedArray(obj)) {\n const result = new (Object.getPrototypeOf(obj).constructor)(obj.length);\n for (let i = 0; i < obj.length; i++) {\n result[i] = cloneDeep(obj[i]);\n }\n return result as Resolved<T>;\n }\n\n if (obj instanceof ArrayBuffer || obj instanceof SharedArrayBuffer) {\n return obj.slice(0) as Resolved<T>;\n }\n\n if (obj instanceof DataView) {\n const result = new DataView(obj.buffer.slice(0));\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n // For legacy NodeJS support\n if (typeof File !== 'undefined' && obj instanceof File) {\n const result = new File([obj], obj.name, { type: obj.type });\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (obj instanceof Blob) {\n const result = new Blob([obj], { type: obj.type });\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (obj instanceof Error) {\n const result = new (obj.constructor as { new (): Error })();\n result.message = obj.message;\n result.name = obj.name;\n result.stack = obj.stack;\n result.cause = obj.cause;\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (typeof obj === 'object' && obj !== null) {\n const result = {};\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (typeof obj === 'function') {\n return void 0 as Resolved<T>;\n }\n\n return obj as Resolved<T>;\n}\n\ntype Primitive = null | undefined | string | number | boolean | symbol | bigint;\nfunction isPrimitive(value: unknown): value is Primitive {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n\n// eslint-disable-next-line\nfunction cloneDeepHelper(obj: any, clonedObj: any): void {\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n const descriptor = Object.getOwnPropertyDescriptor(obj, key);\n if ((descriptor?.writable || descriptor?.set) && typeof descriptor?.value !== 'function') {\n clonedObj[key] = cloneDeep(obj[key]);\n }\n }\n }\n}\n\nfunction isTypedArray(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n obj: any\n): obj is\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array {\n return (\n obj instanceof Uint8Array ||\n obj instanceof Uint8ClampedArray ||\n obj instanceof Uint16Array ||\n obj instanceof Uint32Array ||\n obj instanceof BigUint64Array ||\n obj instanceof Int8Array ||\n obj instanceof Int16Array ||\n obj instanceof Int32Array ||\n obj instanceof BigInt64Array ||\n obj instanceof Float32Array ||\n obj instanceof Float64Array\n );\n}\n\nexport type Resolved<T> = Equal<T, ResolvedMain<T>> extends true ? T : ResolvedMain<T>;\n\ntype Equal<X, Y> = X extends Y ? (Y extends X ? true : false) : false;\n\ntype ResolvedMain<T> = T extends [never]\n ? never // (special trick for jsonable | null) type\n : ValueOf<T> extends boolean | number | bigint | string\n ? ValueOf<T>\n : T extends (...args: any[]) => any\n ? never\n : T extends object\n ? ResolvedObject<T>\n : ValueOf<T>;\n\ntype ResolvedObject<T extends object> =\n T extends Array<infer U>\n ? IsTuple<T> extends true\n ? ResolvedTuple<T>\n : Array<ResolvedMain<U>>\n : T extends Set<infer U>\n ? Set<ResolvedMain<U>>\n : T extends Map<infer K, infer V>\n ? Map<ResolvedMain<K>, ResolvedMain<V>>\n : T extends WeakSet<any> | WeakMap<any, any>\n ? never\n : T extends\n | Date\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array\n | ArrayBuffer\n | SharedArrayBuffer\n | DataView\n | Blob\n | File\n ? T\n : {\n [P in keyof T]: ResolvedMain<T[P]>;\n };\n\ntype ResolvedTuple<T extends readonly any[]> = T extends []\n ? []\n : T extends [infer F]\n ? [ResolvedMain<F>]\n : T extends [infer F, ...infer Rest extends readonly any[]]\n ? [ResolvedMain<F>, ...ResolvedTuple<Rest>]\n : T extends [(infer F)?]\n ? [ResolvedMain<F>?]\n : T extends [(infer F)?, ...infer Rest extends readonly any[]]\n ? [ResolvedMain<F>?, ...ResolvedTuple<Rest>]\n : [];\n\ntype IsTuple<T extends readonly any[] | { length: number }> = [T] extends [never]\n ? false\n : T extends readonly any[]\n ? number extends T['length']\n ? false\n : true\n : false;\n\ntype ValueOf<Instance> =\n IsValueOf<Instance, boolean> extends true\n ? boolean\n : IsValueOf<Instance, number> extends true\n ? number\n : IsValueOf<Instance, string> extends true\n ? string\n : Instance;\n\ntype IsValueOf<Instance, O extends IValueOf<any>> = Instance extends O\n ? O extends IValueOf<infer Primitive>\n ? Instance extends Primitive\n ? false\n : true // not Primitive, but Object\n : false // cannot be\n : false;\n\ninterface IValueOf<T> {\n valueOf(): T;\n}\n"],"mappings":";AA8CO,SAAS,UAAa,KAAqB;AAChD,MAAI,YAAY,GAAG,GAAG;AACpB,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,IAAI,IAAI,UAAQ,UAAU,IAAI,CAAC;AAAA,EACxC;AAEA,MAAI,eAAe,MAAM;AACvB,WAAO,IAAI,KAAK,IAAI,QAAQ,CAAC;AAAA,EAC/B;AAEA,MAAI,eAAe,QAAQ;AACzB,WAAO,IAAI,OAAO,IAAI,QAAQ,IAAI,KAAK;AAAA,EACzC;AAEA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAI;AACvB,eAAW,CAAC,KAAK,KAAK,KAAK,IAAI,QAAQ,GAAG;AACxC,aAAO,IAAI,KAAK,UAAU,KAAK,CAAC;AAAA,IAClC;AACA,WAAO;AAAA,EACT;AAEA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAI;AACvB,eAAW,SAAS,IAAI,OAAO,GAAG;AAChC,aAAO,IAAI,UAAU,KAAK,CAAC;AAAA,IAC7B;AACA,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,GAAG,GAAG;AACrB,UAAM,SAAS,KAAK,OAAO,eAAe,GAAG,GAAE,YAAa,IAAI,MAAM;AACtE,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,aAAO,CAAC,IAAI,UAAU,IAAI,CAAC,CAAC;AAAA,IAC9B;AACA,WAAO;AAAA,EACT;AAEA,MAAI,eAAe,eAAe,eAAe,mBAAmB;AAClE,WAAO,IAAI,MAAM,CAAC;AAAA,EACpB;AAEA,MAAI,eAAe,UAAU;AAC3B,U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;AACF;AAEA,SAAS,aAEP,KAYe;AACf,SACE,eAAe,cACf,eAAe,qBACf,eAAe,eACf,eAAe,eACf,eAAe,kBACf,eAAe,aACf,eAAe,cACf,eAAe,cACf,eAAe,iBACf,eAAe,gBACf,eAAe;AAEnB;","names":[]}
@@ -5,7 +5,7 @@ function debounce(func, debounceMs, { signal } = {}) {
5
5
  if (timeoutId !== null) {
6
6
  clearTimeout(timeoutId);
7
7
  }
8
- if (signal == null ? void 0 : signal.aborted) {
8
+ if (signal?.aborted) {
9
9
  return;
10
10
  }
11
11
  timeoutId = setTimeout(() => {
@@ -22,11 +22,11 @@ function debounce(func, debounceMs, { signal } = {}) {
22
22
  timeoutId = null;
23
23
  }
24
24
  };
25
- signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
25
+ signal?.addEventListener("abort", onAbort, { once: true });
26
26
  return debounced;
27
27
  }
28
28
 
29
29
  export {
30
30
  debounce
31
31
  };
32
- //# sourceMappingURL=chunk-3IP4JVLL.mjs.map
32
+ //# sourceMappingURL=chunk-MSHSKENG.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/function/debounce.ts"],"sourcesContent":["interface DebounceOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @template F - The type of function.\n * @param {F} func - The function to debounce.\n * @param {number} debounceMs - The number of milliseconds to delay.\n * @param {DebounceOptions} options - The options object.\n * @param {AbortSignal} options.signal - An optional AbortSignal to cancel the debounced function.\n * @returns {F & { cancel: () => void }} A new debounced function with a `cancel` method.\n *\n * @example\n * const debouncedFunction = debounce(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' after 1 second if not called again in that time\n * debouncedFunction();\n *\n * // Will not log anything as the previous call is canceled\n * debouncedFunction.cancel();\n *\n * // With AbortSignal\n * const controller = new AbortController();\n * const signal = controller.signal;\n * const debouncedWithSignal = debounce(() => {\n * console.log('Function executed');\n * }, 1000, { signal });\n *\n * debouncedWithSignal();\n *\n * // Will cancel the debounced function call\n * controller.abort();\n */\nexport function debounce<F extends (...args: any[]) => void>(\n func: F,\n debounceMs: number,\n { signal }: DebounceOptions = {}\n): F & { cancel: () => void } {\n let timeoutId: number | null = null;\n\n const debounced = function (...args: Parameters<F>) {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n if (signal?.aborted) {\n return;\n }\n\n timeoutId = setTimeout(() => {\n func(...args);\n timeoutId = null;\n }, debounceMs) as any;\n } as F & { cancel: () => void };\n\n const onAbort = function () {\n debounced.cancel();\n };\n\n debounced.cancel = function () {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n\n signal?.addEventListener('abort', onAbort, { once: true });\n\n return debounced;\n}\n"],"mappings":";AAuCO,SAAS,SACd,MACA,YACA,EAAE,OAAO,IAAqB,CAAC,GACH;AAC5B,MAAI,YAA2B;AAE/B,QAAM,YAAY,YAAa,MAAqB;AAClD,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AAAA,IACxB;AAEA,QAAI,iCAAQ,SAAS;AACnB;AAAA,IACF;AAEA,gBAAY,WAAW,MAAM;AAC3B,WAAK,GAAG,IAAI;AACZ,kBAAY;AAAA,IACd,GAAG,UAAU;AAAA,EACf;AAEA,QAAM,UAAU,WAAY;AAC1B,cAAU,OAAO;AAAA,EACnB;AAEA,YAAU,SAAS,WAAY;AAC7B,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AACtB,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,mCAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK;AAExD,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/function/debounce.ts"],"sourcesContent":["interface DebounceOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @template F - The type of function.\n * @param {F} func - The function to debounce.\n * @param {number} debounceMs - The number of milliseconds to delay.\n * @param {DebounceOptions} options - The options object.\n * @param {AbortSignal} options.signal - An optional AbortSignal to cancel the debounced function.\n * @returns {F & { cancel: () => void }} A new debounced function with a `cancel` method.\n *\n * @example\n * const debouncedFunction = debounce(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' after 1 second if not called again in that time\n * debouncedFunction();\n *\n * // Will not log anything as the previous call is canceled\n * debouncedFunction.cancel();\n *\n * // With AbortSignal\n * const controller = new AbortController();\n * const signal = controller.signal;\n * const debouncedWithSignal = debounce(() => {\n * console.log('Function executed');\n * }, 1000, { signal });\n *\n * debouncedWithSignal();\n *\n * // Will cancel the debounced function call\n * controller.abort();\n */\nexport function debounce<F extends (...args: any[]) => void>(\n func: F,\n debounceMs: number,\n { signal }: DebounceOptions = {}\n): F & { cancel: () => void } {\n let timeoutId: number | null = null;\n\n const debounced = function (...args: Parameters<F>) {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n if (signal?.aborted) {\n return;\n }\n\n timeoutId = setTimeout(() => {\n func(...args);\n timeoutId = null;\n }, debounceMs) as any;\n } as F & { cancel: () => void };\n\n const onAbort = function () {\n debounced.cancel();\n };\n\n debounced.cancel = function () {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n\n signal?.addEventListener('abort', onAbort, { once: true });\n\n return debounced;\n}\n"],"mappings":";AAuCO,SAAS,SACd,MACA,YACA,EAAE,OAAO,IAAqB,CAAC,GACH;AAC5B,MAAI,YAA2B;AAE/B,QAAM,YAAY,YAAa,MAAqB;AAClD,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AAAA,IACxB;AAEA,QAAI,QAAQ,SAAS;AACnB;AAAA,IACF;AAEA,gBAAY,WAAW,MAAM;AAC3B,WAAK,GAAG,IAAI;AACZ,kBAAY;AAAA,IACd,GAAG,UAAU;AAAA,EACf;AAEA,QAAM,UAAU,WAAY;AAC1B,cAAU,OAAO;AAAA,EACnB;AAEA,YAAU,SAAS,WAAY;AAC7B,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AACtB,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,UAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;AAEzD,SAAO;AACT;","names":[]}
@@ -1,11 +1,10 @@
1
1
  // src/string/_internal/getWords.ts
2
2
  var CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;
3
3
  function getWords(str) {
4
- var _a;
5
- return Array.from((_a = str.match(CASE_SPLIT_PATTERN)) != null ? _a : []);
4
+ return Array.from(str.match(CASE_SPLIT_PATTERN) ?? []);
6
5
  }
7
6
 
8
7
  export {
9
8
  getWords
10
9
  };
11
- //# sourceMappingURL=chunk-WVQ7YVRK.mjs.map
10
+ //# sourceMappingURL=chunk-OG2RLT5U.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/string/_internal/getWords.ts"],"sourcesContent":["/**\n * Regular expression pattern to split strings into words for various case conversions\n *\n * This pattern matchs sequences of characters in a string, considering the following case:\n * - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n * - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n * - Single uppercase letters\n * - Sequences of digis\n *\n * The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n * a consistent format like snake case.\n *\n * @example\n * const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n * // matchs: ['camel', 'Case', 'HTTP', 'Request']\n */\nconst CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;\n\nexport function getWords(str: string): string[] {\n return Array.from(str.match(CASE_SPLIT_PATTERN) ?? []);\n}\n"],"mappings":";AAgBA,IAAM,qBAAqB;AAEpB,SAAS,SAAS,KAAuB;AAlBhD;AAmBE,SAAO,MAAM,MAAK,SAAI,MAAM,kBAAkB,MAA5B,YAAiC,CAAC,CAAC;AACvD;","names":[]}
1
+ {"version":3,"sources":["../src/string/_internal/getWords.ts"],"sourcesContent":["/**\n * Regular expression pattern to split strings into words for various case conversions\n *\n * This pattern matchs sequences of characters in a string, considering the following case:\n * - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n * - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n * - Single uppercase letters\n * - Sequences of digis\n *\n * The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n * a consistent format like snake case.\n *\n * @example\n * const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n * // matchs: ['camel', 'Case', 'HTTP', 'Request']\n */\nconst CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;\n\nexport function getWords(str: string): string[] {\n return Array.from(str.match(CASE_SPLIT_PATTERN) ?? []);\n}\n"],"mappings":";AAgBA,IAAM,qBAAqB;AAEpB,SAAS,SAAS,KAAuB;AAC9C,SAAO,MAAM,KAAK,IAAI,MAAM,kBAAkB,KAAK,CAAC,CAAC;AACvD;","names":[]}
@@ -0,0 +1,9 @@
1
+ // src/predicate/isPrimitive.ts
2
+ function isPrimitive(value) {
3
+ return value == null || typeof value !== "object" && typeof value !== "function";
4
+ }
5
+
6
+ export {
7
+ isPrimitive
8
+ };
9
+ //# sourceMappingURL=chunk-R6GLTTAB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/predicate/isPrimitive.ts"],"sourcesContent":["/**\n * Checks whether a value is a JavaScript primitive.\n * JavaScript primitives include null, undefined, strings, numbers, booleans, symbols, and bigints.\n *\n * @param {unknown} x The value to check.\n * @returns {x is\n * | null\n * | undefined\n * | string\n * | number\n * | boolean\n * | symbol\n * | bigint} Returns true if `x` is a primitive, false otherwise.\n */\nexport function isPrimitive(value: unknown): value is null | undefined | string | number | boolean | symbol | bigint {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n"],"mappings":";AAcO,SAAS,YAAY,OAAyF;AACnH,SAAO,SAAS,QAAS,OAAO,UAAU,YAAY,OAAO,UAAU;AACzE;","names":[]}