es-toolkit 1.13.1-dev.320 → 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 (202) 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 +62 -62
  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 +22 -58
  58. package/dist/browser.js.map +1 -1
  59. package/dist/browser.mjs +46 -45
  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-YNJH6GEG.mjs → chunk-IGM5IABU.mjs} +90 -87
  69. package/dist/{chunk-YNJH6GEG.mjs.map → chunk-IGM5IABU.mjs.map} +1 -1
  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-WFZXCGEG.mjs → chunk-YOPFSFTD.mjs} +2 -6
  82. package/dist/{chunk-WFZXCGEG.mjs.map → chunk-YOPFSFTD.mjs.map} +1 -1
  83. package/dist/chunk-YXD3AQAK.mjs +1 -0
  84. package/dist/{chunk-CRSKT4WW.mjs → chunk-Z7HWEOQX.mjs} +2 -3
  85. package/dist/{chunk-CRSKT4WW.mjs.map → chunk-Z7HWEOQX.mjs.map} +1 -1
  86. package/dist/chunk-ZPNX2QDE.mjs +13 -0
  87. package/dist/{chunk-IIDZ3KAJ.mjs.map → chunk-ZPNX2QDE.mjs.map} +1 -1
  88. package/dist/compat/index.d.mts +1 -0
  89. package/dist/compat/index.d.ts +1 -0
  90. package/dist/compat/index.js +23 -57
  91. package/dist/compat/index.js.map +1 -1
  92. package/dist/compat/index.mjs +90 -86
  93. package/dist/error/AbortError.mjs +1 -1
  94. package/dist/error/TimeoutError.mjs +1 -1
  95. package/dist/error/index.mjs +4 -4
  96. package/dist/function/after.mjs +1 -1
  97. package/dist/function/debounce.js +2 -2
  98. package/dist/function/debounce.js.map +1 -1
  99. package/dist/function/debounce.mjs +2 -2
  100. package/dist/function/index.js +2 -2
  101. package/dist/function/index.js.map +1 -1
  102. package/dist/function/index.mjs +2 -2
  103. package/dist/function/negate.mjs +1 -1
  104. package/dist/function/noop.mjs +1 -1
  105. package/dist/function/once.mjs +1 -1
  106. package/dist/function/throttle.mjs +1 -1
  107. package/dist/index.d.mts +1 -0
  108. package/dist/index.d.ts +1 -0
  109. package/dist/index.js +20 -53
  110. package/dist/index.js.map +1 -1
  111. package/dist/index.mjs +90 -86
  112. package/dist/math/clamp.mjs +1 -1
  113. package/dist/math/inRange.mjs +1 -1
  114. package/dist/math/index.mjs +1 -1
  115. package/dist/math/mean.mjs +1 -1
  116. package/dist/math/meanBy.mjs +1 -1
  117. package/dist/math/random.mjs +1 -1
  118. package/dist/math/randomInt.mjs +1 -1
  119. package/dist/math/range.mjs +1 -1
  120. package/dist/math/round.mjs +1 -1
  121. package/dist/math/sum.mjs +1 -1
  122. package/dist/math/sumBy.mjs +1 -1
  123. package/dist/object/clone.mjs +1 -1
  124. package/dist/object/cloneDeep.js +1 -1
  125. package/dist/object/cloneDeep.js.map +1 -1
  126. package/dist/object/cloneDeep.mjs +2 -2
  127. package/dist/object/flattenObject.mjs +1 -1
  128. package/dist/object/index.js +2 -16
  129. package/dist/object/index.js.map +1 -1
  130. package/dist/object/index.mjs +3 -3
  131. package/dist/object/invert.mjs +1 -1
  132. package/dist/object/omit.js +1 -15
  133. package/dist/object/omit.js.map +1 -1
  134. package/dist/object/omit.mjs +2 -2
  135. package/dist/object/omitBy.mjs +1 -1
  136. package/dist/object/pick.mjs +1 -1
  137. package/dist/object/pickBy.mjs +1 -1
  138. package/dist/predicate/index.d.mts +1 -0
  139. package/dist/predicate/index.d.ts +1 -0
  140. package/dist/predicate/index.js +7 -0
  141. package/dist/predicate/index.js.map +1 -1
  142. package/dist/predicate/index.mjs +9 -5
  143. package/dist/predicate/isArrayLike.mjs +1 -1
  144. package/dist/predicate/isEqual.mjs +1 -1
  145. package/dist/predicate/isFunction.mjs +1 -1
  146. package/dist/predicate/isLength.mjs +1 -1
  147. package/dist/predicate/isNil.mjs +1 -1
  148. package/dist/predicate/isNotNil.mjs +1 -1
  149. package/dist/predicate/isNull.mjs +1 -1
  150. package/dist/predicate/isPlainObject.mjs +1 -1
  151. package/dist/predicate/isPrimitive.d.mts +17 -0
  152. package/dist/predicate/isPrimitive.d.ts +17 -0
  153. package/dist/predicate/isPrimitive.js +33 -0
  154. package/dist/predicate/isPrimitive.js.map +1 -0
  155. package/dist/predicate/isPrimitive.mjs +8 -0
  156. package/dist/predicate/isPrimitive.mjs.map +1 -0
  157. package/dist/predicate/isTypedArray.mjs +1 -1
  158. package/dist/predicate/isUndefined.mjs +1 -1
  159. package/dist/promise/delay.js +2 -2
  160. package/dist/promise/delay.js.map +1 -1
  161. package/dist/promise/delay.mjs +2 -2
  162. package/dist/promise/index.js +7 -31
  163. package/dist/promise/index.js.map +1 -1
  164. package/dist/promise/index.mjs +5 -5
  165. package/dist/promise/timeout.js +5 -27
  166. package/dist/promise/timeout.js.map +1 -1
  167. package/dist/promise/timeout.mjs +4 -4
  168. package/dist/promise/withTimeout.js +7 -31
  169. package/dist/promise/withTimeout.js.map +1 -1
  170. package/dist/promise/withTimeout.mjs +5 -5
  171. package/dist/string/camelCase.js +1 -2
  172. package/dist/string/camelCase.js.map +1 -1
  173. package/dist/string/camelCase.mjs +3 -3
  174. package/dist/string/capitalize.mjs +1 -1
  175. package/dist/string/index.js +1 -2
  176. package/dist/string/index.js.map +1 -1
  177. package/dist/string/index.mjs +9 -9
  178. package/dist/string/kebabCase.js +1 -2
  179. package/dist/string/kebabCase.js.map +1 -1
  180. package/dist/string/kebabCase.mjs +3 -3
  181. package/dist/string/lowerCase.js +1 -2
  182. package/dist/string/lowerCase.js.map +1 -1
  183. package/dist/string/lowerCase.mjs +3 -3
  184. package/dist/string/snakeCase.js +1 -2
  185. package/dist/string/snakeCase.js.map +1 -1
  186. package/dist/string/snakeCase.mjs +3 -3
  187. package/dist/string/startCase.js +1 -2
  188. package/dist/string/startCase.js.map +1 -1
  189. package/dist/string/startCase.mjs +3 -3
  190. package/package.json +1 -1
  191. package/umd/browser.global.js +1 -1
  192. package/dist/chunk-24FKGR6U.mjs +0 -47
  193. package/dist/chunk-CVVZHOJX.mjs +0 -22
  194. package/dist/chunk-IIDZ3KAJ.mjs +0 -18
  195. package/dist/chunk-STL6TD3L.mjs +0 -1
  196. /package/dist/{chunk-QXTNZR7B.mjs.map → chunk-3SBT6WDU.mjs.map} +0 -0
  197. /package/dist/{chunk-Y5V7UAZZ.mjs.map → chunk-4ZES5T6V.mjs.map} +0 -0
  198. /package/dist/{chunk-EYYZQFOP.mjs.map → chunk-ET33L3MQ.mjs.map} +0 -0
  199. /package/dist/{chunk-F3WCQQET.mjs.map → chunk-IWXZI3QT.mjs.map} +0 -0
  200. /package/dist/{chunk-24FKGR6U.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  201. /package/dist/{chunk-5IKVJGHO.mjs.map → chunk-RTFTLCF3.mjs.map} +0 -0
  202. /package/dist/{chunk-STL6TD3L.mjs.map → chunk-YXD3AQAK.mjs.map} +0 -0
@@ -13,37 +13,40 @@ import {
13
13
  set,
14
14
  startsWith,
15
15
  zipObjectDeep
16
- } from "../chunk-YNJH6GEG.mjs";
16
+ } from "../chunk-IGM5IABU.mjs";
17
17
  import "../chunk-NKLIE2OI.mjs";
18
18
  import "../chunk-4OIZM4HS.mjs";
19
19
  import {
20
20
  withTimeout
21
- } from "../chunk-IIDZ3KAJ.mjs";
22
- import "../chunk-CVVZHOJX.mjs";
21
+ } from "../chunk-ZPNX2QDE.mjs";
22
+ import "../chunk-EZYYB34V.mjs";
23
23
  import {
24
24
  delay
25
- } from "../chunk-O64NE2P4.mjs";
25
+ } from "../chunk-4DFAGGIM.mjs";
26
26
  import "../chunk-XT74R35S.mjs";
27
+ import {
28
+ kebabCase
29
+ } from "../chunk-ET33L3MQ.mjs";
27
30
  import {
28
31
  lowerCase
29
- } from "../chunk-5IKVJGHO.mjs";
32
+ } from "../chunk-RTFTLCF3.mjs";
30
33
  import {
31
34
  snakeCase
32
- } from "../chunk-F3WCQQET.mjs";
35
+ } from "../chunk-IWXZI3QT.mjs";
33
36
  import {
34
37
  startCase
35
- } from "../chunk-QXTNZR7B.mjs";
38
+ } from "../chunk-3SBT6WDU.mjs";
36
39
  import {
37
40
  camelCase
38
- } from "../chunk-Y5V7UAZZ.mjs";
41
+ } from "../chunk-4ZES5T6V.mjs";
42
+ import "../chunk-OG2RLT5U.mjs";
39
43
  import {
40
44
  capitalize
41
45
  } from "../chunk-U56ZOM7L.mjs";
46
+ import "../chunk-YXD3AQAK.mjs";
42
47
  import {
43
- kebabCase
44
- } from "../chunk-EYYZQFOP.mjs";
45
- import "../chunk-WVQ7YVRK.mjs";
46
- import "../chunk-STL6TD3L.mjs";
48
+ isUndefined
49
+ } from "../chunk-VH2PV426.mjs";
47
50
  import {
48
51
  isFunction
49
52
  } from "../chunk-74CREQXW.mjs";
@@ -56,10 +59,10 @@ import {
56
59
  import {
57
60
  isNull
58
61
  } from "../chunk-AIRSKN47.mjs";
59
- import "../chunk-SXFMQQ6F.mjs";
60
62
  import {
61
- isUndefined
62
- } from "../chunk-VH2PV426.mjs";
63
+ isPrimitive
64
+ } from "../chunk-R6GLTTAB.mjs";
65
+ import "../chunk-SXFMQQ6F.mjs";
63
66
  import {
64
67
  isArrayLike
65
68
  } from "../chunk-LPZZIY5Z.mjs";
@@ -75,7 +78,7 @@ import {
75
78
  } from "../chunk-OLX53VEF.mjs";
76
79
  import {
77
80
  omit
78
- } from "../chunk-WFZXCGEG.mjs";
81
+ } from "../chunk-YOPFSFTD.mjs";
79
82
  import {
80
83
  omitBy
81
84
  } from "../chunk-BCTYOXT7.mjs";
@@ -90,7 +93,7 @@ import {
90
93
  } from "../chunk-VRUTBJYS.mjs";
91
94
  import {
92
95
  cloneDeep
93
- } from "../chunk-5CPXZFCB.mjs";
96
+ } from "../chunk-K5WL54BY.mjs";
94
97
  import {
95
98
  flattenObject
96
99
  } from "../chunk-XGQWTHW6.mjs";
@@ -120,10 +123,6 @@ import {
120
123
  import {
121
124
  sum
122
125
  } from "../chunk-2SLTL4KL.mjs";
123
- import "../chunk-F47GLYUU.mjs";
124
- import {
125
- TimeoutError
126
- } from "../chunk-KIOYQRMQ.mjs";
127
126
  import "../chunk-ZA2XI3OV.mjs";
128
127
  import {
129
128
  throttle
@@ -133,7 +132,7 @@ import {
133
132
  } from "../chunk-OGZMEWPR.mjs";
134
133
  import {
135
134
  debounce
136
- } from "../chunk-3IP4JVLL.mjs";
135
+ } from "../chunk-MSHSKENG.mjs";
137
136
  import {
138
137
  negate
139
138
  } from "../chunk-BOOQBJN2.mjs";
@@ -143,40 +142,13 @@ import {
143
142
  import {
144
143
  once
145
144
  } from "../chunk-CMBC4MXG.mjs";
146
- import {
147
- AbortError
148
- } from "../chunk-DXB7EZUQ.mjs";
149
145
  import "../chunk-DDH7K4QM.mjs";
150
- import {
151
- xor
152
- } from "../chunk-L7FQX5MN.mjs";
153
- import {
154
- xorBy
155
- } from "../chunk-Q47NGNXT.mjs";
156
- import {
157
- xorWith
158
- } from "../chunk-QRSJBBFY.mjs";
159
- import {
160
- zip
161
- } from "../chunk-OLORW442.mjs";
162
146
  import {
163
147
  zipObject
164
148
  } from "../chunk-6GWEY5EL.mjs";
165
149
  import {
166
150
  zipWith
167
151
  } from "../chunk-4KYXHZ4R.mjs";
168
- import {
169
- unionBy
170
- } from "../chunk-NFS7RWWE.mjs";
171
- import {
172
- unionWith
173
- } from "../chunk-2ZCITDMK.mjs";
174
- import {
175
- uniqBy
176
- } from "../chunk-B4COTK4K.mjs";
177
- import {
178
- uniqWith
179
- } from "../chunk-237HGSZS.mjs";
180
152
  import {
181
153
  unzip
182
154
  } from "../chunk-UYZKMBDO.mjs";
@@ -187,17 +159,17 @@ import {
187
159
  without
188
160
  } from "../chunk-PYEYV7BY.mjs";
189
161
  import {
190
- shuffle
191
- } from "../chunk-G7UQ5PUR.mjs";
162
+ xor
163
+ } from "../chunk-L7FQX5MN.mjs";
192
164
  import {
193
- tail
194
- } from "../chunk-TJ4Z5I7M.mjs";
165
+ xorBy
166
+ } from "../chunk-Q47NGNXT.mjs";
195
167
  import {
196
- take
197
- } from "../chunk-ME352XO7.mjs";
168
+ xorWith
169
+ } from "../chunk-QRSJBBFY.mjs";
198
170
  import {
199
- takeRight
200
- } from "../chunk-N3QYJX4T.mjs";
171
+ zip
172
+ } from "../chunk-OLORW442.mjs";
201
173
  import {
202
174
  takeRightWhile
203
175
  } from "../chunk-NTLX2MPV.mjs";
@@ -211,20 +183,20 @@ import {
211
183
  union
212
184
  } from "../chunk-R6QA7PLZ.mjs";
213
185
  import {
214
- uniq
215
- } from "../chunk-DVK2N4KC.mjs";
186
+ unionBy
187
+ } from "../chunk-NFS7RWWE.mjs";
216
188
  import {
217
- keyBy
218
- } from "../chunk-AJKZMN2V.mjs";
189
+ unionWith
190
+ } from "../chunk-2ZCITDMK.mjs";
219
191
  import {
220
- last
221
- } from "../chunk-KPBQ7OUY.mjs";
192
+ uniqWith
193
+ } from "../chunk-237HGSZS.mjs";
222
194
  import {
223
- maxBy
224
- } from "../chunk-OOKNBU4V.mjs";
195
+ uniq
196
+ } from "../chunk-DVK2N4KC.mjs";
225
197
  import {
226
- minBy
227
- } from "../chunk-IJD7FE2Z.mjs";
198
+ uniqBy
199
+ } from "../chunk-B4COTK4K.mjs";
228
200
  import {
229
201
  orderBy
230
202
  } from "../chunk-7B7W36UP.mjs";
@@ -244,14 +216,17 @@ import {
244
216
  random
245
217
  } from "../chunk-SYWMYQYJ.mjs";
246
218
  import {
247
- forEachRight
248
- } from "../chunk-IEA53J7P.mjs";
219
+ shuffle
220
+ } from "../chunk-G7UQ5PUR.mjs";
249
221
  import {
250
- groupBy
251
- } from "../chunk-E6E4RZLN.mjs";
222
+ tail
223
+ } from "../chunk-TJ4Z5I7M.mjs";
252
224
  import {
253
- head
254
- } from "../chunk-HM2JT2RX.mjs";
225
+ take
226
+ } from "../chunk-ME352XO7.mjs";
227
+ import {
228
+ takeRight
229
+ } from "../chunk-N3QYJX4T.mjs";
255
230
  import {
256
231
  initial
257
232
  } from "../chunk-XPSOKBRZ.mjs";
@@ -265,17 +240,17 @@ import {
265
240
  intersectionWith
266
241
  } from "../chunk-XI7KRD2C.mjs";
267
242
  import {
268
- drop
269
- } from "../chunk-3EZAFZG3.mjs";
243
+ keyBy
244
+ } from "../chunk-AJKZMN2V.mjs";
270
245
  import {
271
- dropRight
272
- } from "../chunk-OXZCMC5I.mjs";
246
+ last
247
+ } from "../chunk-KPBQ7OUY.mjs";
273
248
  import {
274
- dropRightWhile
275
- } from "../chunk-M7SBBYV2.mjs";
249
+ maxBy
250
+ } from "../chunk-OOKNBU4V.mjs";
276
251
  import {
277
- dropWhile
278
- } from "../chunk-LJ2C6MVP.mjs";
252
+ minBy
253
+ } from "../chunk-IJD7FE2Z.mjs";
279
254
  import "../chunk-YFN6KOC4.mjs";
280
255
  import {
281
256
  flatMap
@@ -286,13 +261,18 @@ import {
286
261
  import {
287
262
  flatten
288
263
  } from "../chunk-33MSBDC6.mjs";
289
- import "../chunk-E6C5EZQA.mjs";
290
264
  import {
291
- compact
292
- } from "../chunk-DTJJIMKJ.mjs";
265
+ forEachRight
266
+ } from "../chunk-IEA53J7P.mjs";
267
+ import {
268
+ groupBy
269
+ } from "../chunk-E6E4RZLN.mjs";
270
+ import {
271
+ head
272
+ } from "../chunk-HM2JT2RX.mjs";
293
273
  import {
294
274
  countBy
295
- } from "../chunk-CRSKT4WW.mjs";
275
+ } from "../chunk-Z7HWEOQX.mjs";
296
276
  import "../chunk-JPUKH67K.mjs";
297
277
  import {
298
278
  differenceBy
@@ -300,7 +280,30 @@ import {
300
280
  import {
301
281
  differenceWith
302
282
  } from "../chunk-6NVQAHXP.mjs";
303
- import "../chunk-24FKGR6U.mjs";
283
+ import {
284
+ drop
285
+ } from "../chunk-3EZAFZG3.mjs";
286
+ import {
287
+ dropRight
288
+ } from "../chunk-OXZCMC5I.mjs";
289
+ import {
290
+ dropRightWhile
291
+ } from "../chunk-M7SBBYV2.mjs";
292
+ import {
293
+ dropWhile
294
+ } from "../chunk-LJ2C6MVP.mjs";
295
+ import "../chunk-F47GLYUU.mjs";
296
+ import {
297
+ AbortError
298
+ } from "../chunk-DXB7EZUQ.mjs";
299
+ import {
300
+ TimeoutError
301
+ } from "../chunk-KIOYQRMQ.mjs";
302
+ import "../chunk-E6C5EZQA.mjs";
303
+ import {
304
+ compact
305
+ } from "../chunk-DTJJIMKJ.mjs";
306
+ import "../chunk-J5LGTIGS.mjs";
304
307
  export {
305
308
  AbortError,
306
309
  TimeoutError,
@@ -349,6 +352,7 @@ export {
349
352
  isNotNil,
350
353
  isNull,
351
354
  isPlainObject,
355
+ isPrimitive,
352
356
  isTypedArray,
353
357
  isUndefined,
354
358
  kebabCase,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AbortError
3
3
  } from "../chunk-DXB7EZUQ.mjs";
4
- import "../chunk-24FKGR6U.mjs";
4
+ import "../chunk-J5LGTIGS.mjs";
5
5
  export {
6
6
  AbortError
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TimeoutError
3
3
  } from "../chunk-KIOYQRMQ.mjs";
4
- import "../chunk-24FKGR6U.mjs";
4
+ import "../chunk-J5LGTIGS.mjs";
5
5
  export {
6
6
  TimeoutError
7
7
  };
@@ -1,11 +1,11 @@
1
1
  import "../chunk-F47GLYUU.mjs";
2
- import {
3
- TimeoutError
4
- } from "../chunk-KIOYQRMQ.mjs";
5
2
  import {
6
3
  AbortError
7
4
  } from "../chunk-DXB7EZUQ.mjs";
8
- import "../chunk-24FKGR6U.mjs";
5
+ import {
6
+ TimeoutError
7
+ } from "../chunk-KIOYQRMQ.mjs";
8
+ import "../chunk-J5LGTIGS.mjs";
9
9
  export {
10
10
  AbortError,
11
11
  TimeoutError
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  after
3
3
  } from "../chunk-OGZMEWPR.mjs";
4
- import "../chunk-24FKGR6U.mjs";
4
+ import "../chunk-J5LGTIGS.mjs";
5
5
  export {
6
6
  after
7
7
  };
@@ -29,7 +29,7 @@ function debounce(func, debounceMs, { signal } = {}) {
29
29
  if (timeoutId !== null) {
30
30
  clearTimeout(timeoutId);
31
31
  }
32
- if (signal == null ? void 0 : signal.aborted) {
32
+ if (signal?.aborted) {
33
33
  return;
34
34
  }
35
35
  timeoutId = setTimeout(() => {
@@ -46,7 +46,7 @@ function debounce(func, debounceMs, { signal } = {}) {
46
46
  timeoutId = null;
47
47
  }
48
48
  };
49
- signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
49
+ signal?.addEventListener("abort", onAbort, { once: true });
50
50
  return debounced;
51
51
  }
52
52
  // Annotate the CommonJS export names for ESM import in node:
@@ -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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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,7 +1,7 @@
1
1
  import {
2
2
  debounce
3
- } from "../chunk-3IP4JVLL.mjs";
4
- import "../chunk-24FKGR6U.mjs";
3
+ } from "../chunk-MSHSKENG.mjs";
4
+ import "../chunk-J5LGTIGS.mjs";
5
5
  export {
6
6
  debounce
7
7
  };
@@ -50,7 +50,7 @@ function debounce(func, debounceMs, { signal } = {}) {
50
50
  if (timeoutId !== null) {
51
51
  clearTimeout(timeoutId);
52
52
  }
53
- if (signal == null ? void 0 : signal.aborted) {
53
+ if (signal?.aborted) {
54
54
  return;
55
55
  }
56
56
  timeoutId = setTimeout(() => {
@@ -67,7 +67,7 @@ function debounce(func, debounceMs, { signal } = {}) {
67
67
  timeoutId = null;
68
68
  }
69
69
  };
70
- signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
70
+ signal?.addEventListener("abort", onAbort, { once: true });
71
71
  return debounced;
72
72
  }
73
73
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/function/index.ts","../../src/function/after.ts","../../src/function/debounce.ts","../../src/function/noop.ts","../../src/function/once.ts","../../src/function/throttle.ts","../../src/function/negate.ts"],"sourcesContent":["export { after } from './after.ts';\nexport { debounce } from './debounce.ts';\nexport { noop } from './noop.ts';\nexport { once } from './once.ts';\nexport { throttle } from './throttle.ts';\nexport { negate } from './negate.ts';\n","/**\n * Creates a function that only executes starting from the `n`-th call.\n * The provided function will be invoked starting from the `n`-th call.\n *\n * This is particularly useful for scenarios involving events or asynchronous operations\n * where an action should occur only after a certain number of invocations.\n *\n * @template F - The type of the function to be invoked.\n * @param {number} n - The number of calls required for `func` to execute.\n * @param {F} func - The function to be invoked.\n * @returns {F} - A new function that:\n * - Tracks the number of calls.\n * - Invokes `func` starting from the `n`-th call.\n * - Returns `undefined` if fewer than `n` calls have been made.\n * @throws {Error} - Throws an error if `n` is negative.\n * @example\n *\n * const afterFn = after(3, () => {\n * console.log(\"called\")\n * });\n *\n * // Will not log anything.\n * afterFn()\n * // Will not log anything.\n * afterFn()\n * // Will log 'called'.\n * afterFn()\n */\n\nexport const after = <F extends (...args: any[]) => any>(n: number, func: F): F => {\n if (!Number.isInteger(n) || n < 0) {\n throw new Error(`n must be a non-negative integer.`);\n }\n\n let counter = 0;\n return ((...args: Parameters<F>) => {\n if (++counter >= n) {\n return func(...args);\n }\n return undefined;\n }) as F;\n};\n","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","/**\n * A no-operation function that does nothing.\n * This can be used as a placeholder or default function.\n *\n * @example\n * noop(); // Does nothing\n *\n * @returns {void} This function does not return anything.\n */\nexport function noop(): void {}\n","/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @template F - The type of function.\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n *\n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n","/**\n * Creates a throttled function that only invokes the provided function at most once\n * per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n * within the wait time will not trigger the execution of the original function.\n *\n * @template F - The type of function.\n * @param {F} func - The function to throttle.\n * @param {number} throttleMs - The number of milliseconds to throttle executions to.\n * @returns {F} A new throttled function that accepts the same parameters as the original function.\n *\n * @example\n * const throttledFunction = throttle(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' immediately\n * throttledFunction();\n *\n * // Will not log anything as it is within the throttle time\n * throttledFunction();\n *\n * // After 1 second\n * setTimeout(() => {\n * throttledFunction(); // Will log 'Function executed'\n * }, 1000);\n */\nexport function throttle<F extends (...args: any[]) => void>(func: F, throttleMs: number): F {\n let lastCallTime: number | null;\n\n const throttledFunction = function (...args: Parameters<F>) {\n const now = Date.now();\n\n if (lastCallTime == null || now - lastCallTime >= throttleMs) {\n lastCallTime = now;\n func(...args);\n }\n } as F;\n\n return throttledFunction;\n}\n","/**\n * Creates a function that negates the result of the predicate function.\n *\n * @template F - The type of the function to negate.\n * @param {F} func - The function to negate.\n * @returns {F} The new negated function, which negates the boolean result of `func`.\n */\nexport function negate<F extends (...args: unknown[]) => boolean>(func: F): F {\n return ((...args: any[]) => !func(...args)) as F;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC6BO,IAAM,QAAQ,CAAoC,GAAW,SAAe;AACjF,MAAI,CAAC,OAAO,UAAU,CAAC,KAAK,IAAI,GAAG;AACjC,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AAEA,MAAI,UAAU;AACd,SAAQ,IAAI,SAAwB;AAClC,QAAI,EAAE,WAAW,GAAG;AAClB,aAAO,KAAK,GAAG,IAAI;AAAA,IACrB;AACA,WAAO;AAAA,EACT;AACF;;;ACFO,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;;;AClEO,SAAS,OAAa;AAAC;;;ACQvB,SAAS,KAA0B,MAAY;AACpD,MAAI,SAAS;AACb,MAAI;AAEJ,SAAO,WAAY;AACjB,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK;AAEpB,aAAS;AACT,YAAQ;AAER,WAAO;AAAA,EACT;AACF;;;ACPO,SAAS,SAA6C,MAAS,YAAuB;AAC3F,MAAI;AAEJ,QAAM,oBAAoB,YAAa,MAAqB;AAC1D,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,gBAAgB,QAAQ,MAAM,gBAAgB,YAAY;AAC5D,qBAAe;AACf,WAAK,GAAG,IAAI;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AACT;;;AChCO,SAAS,OAAkD,MAAY;AAC1E,SAAQ,IAAI,SAAgB,CAAC,KAAK,GAAG,IAAI;AAC7C;","names":[]}
1
+ {"version":3,"sources":["../../src/function/index.ts","../../src/function/after.ts","../../src/function/debounce.ts","../../src/function/noop.ts","../../src/function/once.ts","../../src/function/throttle.ts","../../src/function/negate.ts"],"sourcesContent":["export { after } from './after.ts';\nexport { debounce } from './debounce.ts';\nexport { noop } from './noop.ts';\nexport { once } from './once.ts';\nexport { throttle } from './throttle.ts';\nexport { negate } from './negate.ts';\n","/**\n * Creates a function that only executes starting from the `n`-th call.\n * The provided function will be invoked starting from the `n`-th call.\n *\n * This is particularly useful for scenarios involving events or asynchronous operations\n * where an action should occur only after a certain number of invocations.\n *\n * @template F - The type of the function to be invoked.\n * @param {number} n - The number of calls required for `func` to execute.\n * @param {F} func - The function to be invoked.\n * @returns {F} - A new function that:\n * - Tracks the number of calls.\n * - Invokes `func` starting from the `n`-th call.\n * - Returns `undefined` if fewer than `n` calls have been made.\n * @throws {Error} - Throws an error if `n` is negative.\n * @example\n *\n * const afterFn = after(3, () => {\n * console.log(\"called\")\n * });\n *\n * // Will not log anything.\n * afterFn()\n * // Will not log anything.\n * afterFn()\n * // Will log 'called'.\n * afterFn()\n */\n\nexport const after = <F extends (...args: any[]) => any>(n: number, func: F): F => {\n if (!Number.isInteger(n) || n < 0) {\n throw new Error(`n must be a non-negative integer.`);\n }\n\n let counter = 0;\n return ((...args: Parameters<F>) => {\n if (++counter >= n) {\n return func(...args);\n }\n return undefined;\n }) as F;\n};\n","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","/**\n * A no-operation function that does nothing.\n * This can be used as a placeholder or default function.\n *\n * @example\n * noop(); // Does nothing\n *\n * @returns {void} This function does not return anything.\n */\nexport function noop(): void {}\n","/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @template F - The type of function.\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n *\n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n","/**\n * Creates a throttled function that only invokes the provided function at most once\n * per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n * within the wait time will not trigger the execution of the original function.\n *\n * @template F - The type of function.\n * @param {F} func - The function to throttle.\n * @param {number} throttleMs - The number of milliseconds to throttle executions to.\n * @returns {F} A new throttled function that accepts the same parameters as the original function.\n *\n * @example\n * const throttledFunction = throttle(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' immediately\n * throttledFunction();\n *\n * // Will not log anything as it is within the throttle time\n * throttledFunction();\n *\n * // After 1 second\n * setTimeout(() => {\n * throttledFunction(); // Will log 'Function executed'\n * }, 1000);\n */\nexport function throttle<F extends (...args: any[]) => void>(func: F, throttleMs: number): F {\n let lastCallTime: number | null;\n\n const throttledFunction = function (...args: Parameters<F>) {\n const now = Date.now();\n\n if (lastCallTime == null || now - lastCallTime >= throttleMs) {\n lastCallTime = now;\n func(...args);\n }\n } as F;\n\n return throttledFunction;\n}\n","/**\n * Creates a function that negates the result of the predicate function.\n *\n * @template F - The type of the function to negate.\n * @param {F} func - The function to negate.\n * @returns {F} The new negated function, which negates the boolean result of `func`.\n */\nexport function negate<F extends (...args: unknown[]) => boolean>(func: F): F {\n return ((...args: any[]) => !func(...args)) as F;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC6BO,IAAM,QAAQ,CAAoC,GAAW,SAAe;AACjF,MAAI,CAAC,OAAO,UAAU,CAAC,KAAK,IAAI,GAAG;AACjC,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AAEA,MAAI,UAAU;AACd,SAAQ,IAAI,SAAwB;AAClC,QAAI,EAAE,WAAW,GAAG;AAClB,aAAO,KAAK,GAAG,IAAI;AAAA,IACrB;AACA,WAAO;AAAA,EACT;AACF;;;ACFO,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;;;AClEO,SAAS,OAAa;AAAC;;;ACQvB,SAAS,KAA0B,MAAY;AACpD,MAAI,SAAS;AACb,MAAI;AAEJ,SAAO,WAAY;AACjB,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK;AAEpB,aAAS;AACT,YAAQ;AAER,WAAO;AAAA,EACT;AACF;;;ACPO,SAAS,SAA6C,MAAS,YAAuB;AAC3F,MAAI;AAEJ,QAAM,oBAAoB,YAAa,MAAqB;AAC1D,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,gBAAgB,QAAQ,MAAM,gBAAgB,YAAY;AAC5D,qBAAe;AACf,WAAK,GAAG,IAAI;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AACT;;;AChCO,SAAS,OAAkD,MAAY;AAC1E,SAAQ,IAAI,SAAgB,CAAC,KAAK,GAAG,IAAI;AAC7C;","names":[]}
@@ -7,7 +7,7 @@ import {
7
7
  } from "../chunk-OGZMEWPR.mjs";
8
8
  import {
9
9
  debounce
10
- } from "../chunk-3IP4JVLL.mjs";
10
+ } from "../chunk-MSHSKENG.mjs";
11
11
  import {
12
12
  negate
13
13
  } from "../chunk-BOOQBJN2.mjs";
@@ -17,7 +17,7 @@ import {
17
17
  import {
18
18
  once
19
19
  } from "../chunk-CMBC4MXG.mjs";
20
- import "../chunk-24FKGR6U.mjs";
20
+ import "../chunk-J5LGTIGS.mjs";
21
21
  export {
22
22
  after,
23
23
  debounce,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  negate
3
3
  } from "../chunk-BOOQBJN2.mjs";
4
- import "../chunk-24FKGR6U.mjs";
4
+ import "../chunk-J5LGTIGS.mjs";
5
5
  export {
6
6
  negate
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  noop
3
3
  } from "../chunk-LKXCOLNY.mjs";
4
- import "../chunk-24FKGR6U.mjs";
4
+ import "../chunk-J5LGTIGS.mjs";
5
5
  export {
6
6
  noop
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  once
3
3
  } from "../chunk-CMBC4MXG.mjs";
4
- import "../chunk-24FKGR6U.mjs";
4
+ import "../chunk-J5LGTIGS.mjs";
5
5
  export {
6
6
  once
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  throttle
3
3
  } from "../chunk-QOJGMVVR.mjs";
4
- import "../chunk-24FKGR6U.mjs";
4
+ import "../chunk-J5LGTIGS.mjs";
5
5
  export {
6
6
  throttle
7
7
  };
package/dist/index.d.mts CHANGED
@@ -85,6 +85,7 @@ export { isPlainObject } from './predicate/isPlainObject.mjs';
85
85
  export { isFunction } from './predicate/isFunction.mjs';
86
86
  export { isArrayLike } from './predicate/isArrayLike.mjs';
87
87
  export { isTypedArray } from './predicate/isTypedArray.mjs';
88
+ export { isPrimitive } from './predicate/isPrimitive.mjs';
88
89
  export { delay } from './promise/delay.mjs';
89
90
  export { withTimeout } from './promise/withTimeout.mjs';
90
91
  export { camelCase } from './string/camelCase.mjs';
package/dist/index.d.ts CHANGED
@@ -85,6 +85,7 @@ export { isPlainObject } from './predicate/isPlainObject.js';
85
85
  export { isFunction } from './predicate/isFunction.js';
86
86
  export { isArrayLike } from './predicate/isArrayLike.js';
87
87
  export { isTypedArray } from './predicate/isTypedArray.js';
88
+ export { isPrimitive } from './predicate/isPrimitive.js';
88
89
  export { delay } from './promise/delay.js';
89
90
  export { withTimeout } from './promise/withTimeout.js';
90
91
  export { camelCase } from './string/camelCase.js';