@vielzeug/arsenal 3.0.0 → 26.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/dist/_common/_lruMap.cjs +1 -1
  2. package/dist/_common/_lruMap.cjs.map +1 -1
  3. package/dist/_common/_lruMap.js +1 -17
  4. package/dist/_common/_lruMap.js.map +1 -1
  5. package/dist/_common/_selectorSet.cjs +1 -1
  6. package/dist/_common/_selectorSet.cjs.map +1 -1
  7. package/dist/_common/_selectorSet.js +1 -15
  8. package/dist/_common/_selectorSet.js.map +1 -1
  9. package/dist/_common/unsafePaths.cjs +1 -1
  10. package/dist/_common/unsafePaths.cjs.map +1 -1
  11. package/dist/_common/unsafePaths.js +1 -12
  12. package/dist/_common/unsafePaths.js.map +1 -1
  13. package/dist/_dev.cjs +1 -1
  14. package/dist/_dev.cjs.map +1 -1
  15. package/dist/_dev.js +1 -5
  16. package/dist/_dev.js.map +1 -1
  17. package/dist/array/chunk.cjs +1 -1
  18. package/dist/array/chunk.cjs.map +1 -1
  19. package/dist/array/chunk.js +1 -9
  20. package/dist/array/chunk.js.map +1 -1
  21. package/dist/array/compact.cjs +1 -1
  22. package/dist/array/compact.cjs.map +1 -1
  23. package/dist/array/compact.js +1 -7
  24. package/dist/array/compact.js.map +1 -1
  25. package/dist/array/compare.cjs +1 -1
  26. package/dist/array/compare.cjs.map +1 -1
  27. package/dist/array/compare.js +1 -18
  28. package/dist/array/compare.js.map +1 -1
  29. package/dist/array/compareBy.cjs +1 -1
  30. package/dist/array/compareBy.cjs.map +1 -1
  31. package/dist/array/compareBy.js +1 -15
  32. package/dist/array/compareBy.js.map +1 -1
  33. package/dist/array/contains.cjs +1 -1
  34. package/dist/array/contains.cjs.map +1 -1
  35. package/dist/array/contains.js +1 -8
  36. package/dist/array/contains.js.map +1 -1
  37. package/dist/array/countBy.cjs +1 -1
  38. package/dist/array/countBy.cjs.map +1 -1
  39. package/dist/array/countBy.js +1 -13
  40. package/dist/array/countBy.js.map +1 -1
  41. package/dist/array/difference.cjs +1 -1
  42. package/dist/array/difference.cjs.map +1 -1
  43. package/dist/array/difference.js +1 -13
  44. package/dist/array/difference.js.map +1 -1
  45. package/dist/array/drop.cjs +1 -1
  46. package/dist/array/drop.cjs.map +1 -1
  47. package/dist/array/drop.js +1 -8
  48. package/dist/array/drop.js.map +1 -1
  49. package/dist/array/dropLast.cjs +1 -1
  50. package/dist/array/dropLast.cjs.map +1 -1
  51. package/dist/array/dropLast.js +1 -8
  52. package/dist/array/dropLast.js.map +1 -1
  53. package/dist/array/filterMap.cjs +1 -1
  54. package/dist/array/filterMap.cjs.map +1 -1
  55. package/dist/array/filterMap.js +1 -12
  56. package/dist/array/filterMap.js.map +1 -1
  57. package/dist/array/first.cjs +1 -1
  58. package/dist/array/first.cjs.map +1 -1
  59. package/dist/array/first.js +1 -7
  60. package/dist/array/first.js.map +1 -1
  61. package/dist/array/groupBy.cjs +1 -1
  62. package/dist/array/groupBy.cjs.map +1 -1
  63. package/dist/array/groupBy.js +1 -13
  64. package/dist/array/groupBy.js.map +1 -1
  65. package/dist/array/index.js +1 -28
  66. package/dist/array/indexBy.cjs +1 -1
  67. package/dist/array/indexBy.cjs.map +1 -1
  68. package/dist/array/indexBy.js +1 -13
  69. package/dist/array/indexBy.js.map +1 -1
  70. package/dist/array/intersection.cjs +1 -1
  71. package/dist/array/intersection.cjs.map +1 -1
  72. package/dist/array/intersection.js +1 -13
  73. package/dist/array/intersection.js.map +1 -1
  74. package/dist/array/last.cjs +1 -1
  75. package/dist/array/last.cjs.map +1 -1
  76. package/dist/array/last.js +1 -7
  77. package/dist/array/last.js.map +1 -1
  78. package/dist/array/partition.cjs +1 -1
  79. package/dist/array/partition.cjs.map +1 -1
  80. package/dist/array/partition.js +1 -9
  81. package/dist/array/partition.js.map +1 -1
  82. package/dist/array/replace.cjs +1 -1
  83. package/dist/array/replace.cjs.map +1 -1
  84. package/dist/array/replace.js +1 -12
  85. package/dist/array/replace.js.map +1 -1
  86. package/dist/array/rotate.cjs +1 -1
  87. package/dist/array/rotate.cjs.map +1 -1
  88. package/dist/array/rotate.js +1 -9
  89. package/dist/array/rotate.js.map +1 -1
  90. package/dist/array/search.cjs +1 -1
  91. package/dist/array/search.cjs.map +1 -1
  92. package/dist/array/search.js +1 -29
  93. package/dist/array/search.js.map +1 -1
  94. package/dist/array/sort.cjs +1 -1
  95. package/dist/array/sort.cjs.map +1 -1
  96. package/dist/array/sort.js +1 -14
  97. package/dist/array/sort.js.map +1 -1
  98. package/dist/array/take.cjs +1 -1
  99. package/dist/array/take.cjs.map +1 -1
  100. package/dist/array/take.js +1 -8
  101. package/dist/array/take.js.map +1 -1
  102. package/dist/array/takeLast.cjs +1 -1
  103. package/dist/array/takeLast.cjs.map +1 -1
  104. package/dist/array/takeLast.js +1 -8
  105. package/dist/array/takeLast.js.map +1 -1
  106. package/dist/array/toggle.cjs +1 -1
  107. package/dist/array/toggle.cjs.map +1 -1
  108. package/dist/array/toggle.js +1 -8
  109. package/dist/array/toggle.js.map +1 -1
  110. package/dist/array/union.cjs +1 -1
  111. package/dist/array/union.cjs.map +1 -1
  112. package/dist/array/union.js +1 -8
  113. package/dist/array/union.js.map +1 -1
  114. package/dist/array/uniq.cjs +1 -1
  115. package/dist/array/uniq.cjs.map +1 -1
  116. package/dist/array/uniq.js +1 -8
  117. package/dist/array/uniq.js.map +1 -1
  118. package/dist/array/unzip.cjs +1 -1
  119. package/dist/array/unzip.cjs.map +1 -1
  120. package/dist/array/unzip.js +1 -10
  121. package/dist/array/unzip.js.map +1 -1
  122. package/dist/array/zip.cjs +1 -1
  123. package/dist/array/zip.cjs.map +1 -1
  124. package/dist/array/zip.js +1 -10
  125. package/dist/array/zip.js.map +1 -1
  126. package/dist/arsenal.cjs +1 -1
  127. package/dist/arsenal.cjs.map +1 -1
  128. package/dist/arsenal.iife.js +1 -1
  129. package/dist/arsenal.iife.js.map +1 -1
  130. package/dist/arsenal.js +1 -1
  131. package/dist/arsenal.js.map +1 -1
  132. package/dist/async/abortError.cjs +1 -1
  133. package/dist/async/abortError.cjs.map +1 -1
  134. package/dist/async/abortError.js +1 -7
  135. package/dist/async/abortError.js.map +1 -1
  136. package/dist/async/abortable.cjs +1 -1
  137. package/dist/async/abortable.cjs.map +1 -1
  138. package/dist/async/abortable.js +1 -11
  139. package/dist/async/abortable.js.map +1 -1
  140. package/dist/async/attempt.cjs +1 -1
  141. package/dist/async/attempt.cjs.map +1 -1
  142. package/dist/async/attempt.js +1 -23
  143. package/dist/async/attempt.js.map +1 -1
  144. package/dist/async/backoff.cjs +1 -1
  145. package/dist/async/backoff.cjs.map +1 -1
  146. package/dist/async/backoff.js +1 -7
  147. package/dist/async/backoff.js.map +1 -1
  148. package/dist/async/index.js +1 -10
  149. package/dist/async/parallel.cjs +1 -1
  150. package/dist/async/parallel.cjs.map +1 -1
  151. package/dist/async/parallel.js +1 -24
  152. package/dist/async/parallel.js.map +1 -1
  153. package/dist/async/retry.cjs +1 -1
  154. package/dist/async/retry.cjs.map +1 -1
  155. package/dist/async/retry.d.ts +4 -6
  156. package/dist/async/retry.d.ts.map +1 -1
  157. package/dist/async/retry.js +1 -24
  158. package/dist/async/retry.js.map +1 -1
  159. package/dist/async/sleep.cjs +1 -1
  160. package/dist/async/sleep.cjs.map +1 -1
  161. package/dist/async/sleep.js +1 -15
  162. package/dist/async/sleep.js.map +1 -1
  163. package/dist/async/taskPool.cjs +1 -1
  164. package/dist/async/taskPool.cjs.map +1 -1
  165. package/dist/async/taskPool.js +1 -50
  166. package/dist/async/taskPool.js.map +1 -1
  167. package/dist/async/waitFor.cjs +1 -1
  168. package/dist/async/waitFor.cjs.map +1 -1
  169. package/dist/async/waitFor.js +1 -12
  170. package/dist/async/waitFor.js.map +1 -1
  171. package/dist/cache/cache.cjs +1 -1
  172. package/dist/cache/cache.cjs.map +1 -1
  173. package/dist/cache/cache.js +1 -59
  174. package/dist/cache/cache.js.map +1 -1
  175. package/dist/cache/index.js +1 -3
  176. package/dist/cache/memo.cjs +1 -1
  177. package/dist/cache/memo.cjs.map +1 -1
  178. package/dist/cache/memo.js +1 -37
  179. package/dist/cache/memo.js.map +1 -1
  180. package/dist/encoding/base64url.cjs +2 -0
  181. package/dist/encoding/base64url.cjs.map +1 -0
  182. package/dist/encoding/base64url.d.ts +9 -0
  183. package/dist/encoding/base64url.d.ts.map +1 -0
  184. package/dist/encoding/base64url.js +2 -0
  185. package/dist/encoding/base64url.js.map +1 -0
  186. package/dist/encoding/index.cjs +1 -0
  187. package/dist/encoding/index.d.ts +2 -0
  188. package/dist/encoding/index.d.ts.map +1 -0
  189. package/dist/encoding/index.js +1 -0
  190. package/dist/errors.cjs +1 -1
  191. package/dist/errors.cjs.map +1 -1
  192. package/dist/errors.js +1 -9
  193. package/dist/errors.js.map +1 -1
  194. package/dist/function/assert.cjs +1 -1
  195. package/dist/function/assert.cjs.map +1 -1
  196. package/dist/function/assert.js +1 -7
  197. package/dist/function/assert.js.map +1 -1
  198. package/dist/function/debounce.cjs +1 -1
  199. package/dist/function/debounce.cjs.map +1 -1
  200. package/dist/function/debounce.js +1 -26
  201. package/dist/function/debounce.js.map +1 -1
  202. package/dist/function/index.cjs +1 -1
  203. package/dist/function/index.d.ts +1 -0
  204. package/dist/function/index.d.ts.map +1 -1
  205. package/dist/function/index.js +1 -8
  206. package/dist/function/once.cjs +1 -1
  207. package/dist/function/once.cjs.map +1 -1
  208. package/dist/function/once.js +1 -10
  209. package/dist/function/once.js.map +1 -1
  210. package/dist/function/pipe.cjs +1 -1
  211. package/dist/function/pipe.cjs.map +1 -1
  212. package/dist/function/pipe.js +1 -9
  213. package/dist/function/pipe.js.map +1 -1
  214. package/dist/function/runAll.cjs +1 -1
  215. package/dist/function/runAll.cjs.map +1 -1
  216. package/dist/function/runAll.js +1 -18
  217. package/dist/function/runAll.js.map +1 -1
  218. package/dist/function/tap.cjs +1 -1
  219. package/dist/function/tap.cjs.map +1 -1
  220. package/dist/function/tap.js +1 -7
  221. package/dist/function/tap.js.map +1 -1
  222. package/dist/function/tapper.cjs +2 -0
  223. package/dist/function/tapper.cjs.map +1 -0
  224. package/dist/function/tapper.d.ts +27 -0
  225. package/dist/function/tapper.d.ts.map +1 -0
  226. package/dist/function/tapper.js +2 -0
  227. package/dist/function/tapper.js.map +1 -0
  228. package/dist/function/throttle.cjs +1 -1
  229. package/dist/function/throttle.cjs.map +1 -1
  230. package/dist/function/throttle.js +1 -35
  231. package/dist/function/throttle.js.map +1 -1
  232. package/dist/guards/combinators.cjs +1 -1
  233. package/dist/guards/combinators.cjs.map +1 -1
  234. package/dist/guards/combinators.js +1 -16
  235. package/dist/guards/combinators.js.map +1 -1
  236. package/dist/guards/index.js +1 -17
  237. package/dist/guards/isAbortError.cjs +1 -1
  238. package/dist/guards/isAbortError.cjs.map +1 -1
  239. package/dist/guards/isAbortError.js +1 -7
  240. package/dist/guards/isAbortError.js.map +1 -1
  241. package/dist/guards/isDate.cjs +1 -1
  242. package/dist/guards/isDate.cjs.map +1 -1
  243. package/dist/guards/isDate.js +1 -7
  244. package/dist/guards/isDate.js.map +1 -1
  245. package/dist/guards/isDefined.cjs +1 -1
  246. package/dist/guards/isDefined.cjs.map +1 -1
  247. package/dist/guards/isDefined.js +1 -7
  248. package/dist/guards/isDefined.js.map +1 -1
  249. package/dist/guards/isEmpty.cjs +1 -1
  250. package/dist/guards/isEmpty.cjs.map +1 -1
  251. package/dist/guards/isEmpty.js +1 -8
  252. package/dist/guards/isEmpty.js.map +1 -1
  253. package/dist/guards/isEqual.cjs +1 -1
  254. package/dist/guards/isEqual.cjs.map +1 -1
  255. package/dist/guards/isEqual.js +1 -33
  256. package/dist/guards/isEqual.js.map +1 -1
  257. package/dist/guards/isError.cjs +1 -1
  258. package/dist/guards/isError.cjs.map +1 -1
  259. package/dist/guards/isError.js +1 -7
  260. package/dist/guards/isError.js.map +1 -1
  261. package/dist/guards/isFunction.cjs +1 -1
  262. package/dist/guards/isFunction.cjs.map +1 -1
  263. package/dist/guards/isFunction.js +1 -7
  264. package/dist/guards/isFunction.js.map +1 -1
  265. package/dist/guards/isMatch.cjs +1 -1
  266. package/dist/guards/isMatch.cjs.map +1 -1
  267. package/dist/guards/isMatch.js +1 -22
  268. package/dist/guards/isMatch.js.map +1 -1
  269. package/dist/guards/isNil.cjs +1 -1
  270. package/dist/guards/isNil.cjs.map +1 -1
  271. package/dist/guards/isNil.js +1 -7
  272. package/dist/guards/isNil.js.map +1 -1
  273. package/dist/guards/isNumber.cjs +1 -1
  274. package/dist/guards/isNumber.cjs.map +1 -1
  275. package/dist/guards/isNumber.js +1 -7
  276. package/dist/guards/isNumber.js.map +1 -1
  277. package/dist/guards/isPlainObject.cjs +1 -1
  278. package/dist/guards/isPlainObject.cjs.map +1 -1
  279. package/dist/guards/isPlainObject.js +1 -9
  280. package/dist/guards/isPlainObject.js.map +1 -1
  281. package/dist/guards/isPrimitive.cjs +1 -1
  282. package/dist/guards/isPrimitive.cjs.map +1 -1
  283. package/dist/guards/isPrimitive.js +1 -7
  284. package/dist/guards/isPrimitive.js.map +1 -1
  285. package/dist/guards/isPromise.cjs +1 -1
  286. package/dist/guards/isPromise.cjs.map +1 -1
  287. package/dist/guards/isPromise.js +1 -7
  288. package/dist/guards/isPromise.js.map +1 -1
  289. package/dist/guards/isRegex.cjs +1 -1
  290. package/dist/guards/isRegex.cjs.map +1 -1
  291. package/dist/guards/isRegex.js +1 -7
  292. package/dist/guards/isRegex.js.map +1 -1
  293. package/dist/guards/shallowEqual.cjs +1 -1
  294. package/dist/guards/shallowEqual.cjs.map +1 -1
  295. package/dist/guards/shallowEqual.js +1 -19
  296. package/dist/guards/shallowEqual.js.map +1 -1
  297. package/dist/index.cjs +1 -1
  298. package/dist/index.d.ts +7 -0
  299. package/dist/index.d.ts.map +1 -1
  300. package/dist/index.js +1 -35
  301. package/dist/math/allocate.cjs +1 -1
  302. package/dist/math/allocate.cjs.map +1 -1
  303. package/dist/math/allocate.js +1 -18
  304. package/dist/math/allocate.js.map +1 -1
  305. package/dist/math/average.cjs +1 -1
  306. package/dist/math/average.cjs.map +1 -1
  307. package/dist/math/average.js +1 -8
  308. package/dist/math/average.js.map +1 -1
  309. package/dist/math/clamp.cjs +1 -1
  310. package/dist/math/clamp.cjs.map +1 -1
  311. package/dist/math/clamp.js +1 -7
  312. package/dist/math/clamp.js.map +1 -1
  313. package/dist/math/gcd.cjs +1 -1
  314. package/dist/math/gcd.cjs.map +1 -1
  315. package/dist/math/gcd.js +1 -13
  316. package/dist/math/gcd.js.map +1 -1
  317. package/dist/math/index.js +1 -16
  318. package/dist/math/lcm.cjs +1 -1
  319. package/dist/math/lcm.cjs.map +1 -1
  320. package/dist/math/lcm.js +1 -12
  321. package/dist/math/lcm.js.map +1 -1
  322. package/dist/math/lerp.cjs +1 -1
  323. package/dist/math/lerp.cjs.map +1 -1
  324. package/dist/math/lerp.js +1 -7
  325. package/dist/math/lerp.js.map +1 -1
  326. package/dist/math/linspace.cjs +1 -1
  327. package/dist/math/linspace.cjs.map +1 -1
  328. package/dist/math/linspace.js +1 -11
  329. package/dist/math/linspace.js.map +1 -1
  330. package/dist/math/median.cjs +1 -1
  331. package/dist/math/median.cjs.map +1 -1
  332. package/dist/math/median.js +1 -11
  333. package/dist/math/median.js.map +1 -1
  334. package/dist/math/mod.cjs +1 -1
  335. package/dist/math/mod.cjs.map +1 -1
  336. package/dist/math/mod.js +1 -8
  337. package/dist/math/mod.js.map +1 -1
  338. package/dist/math/normalize.cjs +1 -1
  339. package/dist/math/normalize.cjs.map +1 -1
  340. package/dist/math/normalize.js +1 -8
  341. package/dist/math/normalize.js.map +1 -1
  342. package/dist/math/range.cjs +1 -1
  343. package/dist/math/range.cjs.map +1 -1
  344. package/dist/math/range.js +1 -25
  345. package/dist/math/range.js.map +1 -1
  346. package/dist/math/round.cjs +1 -1
  347. package/dist/math/round.cjs.map +1 -1
  348. package/dist/math/round.js +1 -9
  349. package/dist/math/round.js.map +1 -1
  350. package/dist/math/standardDeviation.cjs +1 -1
  351. package/dist/math/standardDeviation.cjs.map +1 -1
  352. package/dist/math/standardDeviation.js +1 -8
  353. package/dist/math/standardDeviation.js.map +1 -1
  354. package/dist/math/sum.cjs +1 -1
  355. package/dist/math/sum.cjs.map +1 -1
  356. package/dist/math/sum.js +1 -11
  357. package/dist/math/sum.js.map +1 -1
  358. package/dist/math/variance.cjs +1 -1
  359. package/dist/math/variance.cjs.map +1 -1
  360. package/dist/math/variance.js +1 -10
  361. package/dist/math/variance.js.map +1 -1
  362. package/dist/object/defaults.cjs +1 -1
  363. package/dist/object/defaults.cjs.map +1 -1
  364. package/dist/object/defaults.js +1 -11
  365. package/dist/object/defaults.js.map +1 -1
  366. package/dist/object/diff.cjs +1 -1
  367. package/dist/object/diff.cjs.map +1 -1
  368. package/dist/object/diff.js +1 -26
  369. package/dist/object/diff.js.map +1 -1
  370. package/dist/object/filterValues.cjs +1 -1
  371. package/dist/object/filterValues.cjs.map +1 -1
  372. package/dist/object/filterValues.js +1 -10
  373. package/dist/object/filterValues.js.map +1 -1
  374. package/dist/object/flattenPaths.cjs +1 -1
  375. package/dist/object/flattenPaths.cjs.map +1 -1
  376. package/dist/object/flattenPaths.js +1 -30
  377. package/dist/object/flattenPaths.js.map +1 -1
  378. package/dist/object/getPath.cjs +1 -1
  379. package/dist/object/getPath.cjs.map +1 -1
  380. package/dist/object/getPath.js +1 -25
  381. package/dist/object/getPath.js.map +1 -1
  382. package/dist/object/hash.cjs +1 -1
  383. package/dist/object/hash.cjs.map +1 -1
  384. package/dist/object/hash.js +1 -27
  385. package/dist/object/hash.js.map +1 -1
  386. package/dist/object/index.js +1 -15
  387. package/dist/object/invert.cjs +1 -1
  388. package/dist/object/invert.cjs.map +1 -1
  389. package/dist/object/invert.js +1 -10
  390. package/dist/object/invert.js.map +1 -1
  391. package/dist/object/mapKeys.cjs +1 -1
  392. package/dist/object/mapKeys.cjs.map +1 -1
  393. package/dist/object/mapKeys.js +1 -14
  394. package/dist/object/mapKeys.js.map +1 -1
  395. package/dist/object/mapValues.cjs +1 -1
  396. package/dist/object/mapValues.cjs.map +1 -1
  397. package/dist/object/mapValues.js +1 -10
  398. package/dist/object/mapValues.js.map +1 -1
  399. package/dist/object/merge.cjs +1 -1
  400. package/dist/object/merge.cjs.map +1 -1
  401. package/dist/object/merge.js +1 -25
  402. package/dist/object/merge.js.map +1 -1
  403. package/dist/object/omit.cjs +1 -1
  404. package/dist/object/omit.cjs.map +1 -1
  405. package/dist/object/omit.js +1 -10
  406. package/dist/object/omit.js.map +1 -1
  407. package/dist/object/pick.cjs +1 -1
  408. package/dist/object/pick.cjs.map +1 -1
  409. package/dist/object/pick.js +1 -10
  410. package/dist/object/pick.js.map +1 -1
  411. package/dist/object/prune.cjs +1 -1
  412. package/dist/object/prune.cjs.map +1 -1
  413. package/dist/object/prune.js +1 -33
  414. package/dist/object/prune.js.map +1 -1
  415. package/dist/object/tryParseJson.cjs +1 -1
  416. package/dist/object/tryParseJson.cjs.map +1 -1
  417. package/dist/object/tryParseJson.js +1 -17
  418. package/dist/object/tryParseJson.js.map +1 -1
  419. package/dist/random/_index.cjs +1 -1
  420. package/dist/random/_index.cjs.map +1 -1
  421. package/dist/random/_index.js +1 -8
  422. package/dist/random/_index.js.map +1 -1
  423. package/dist/random/draw.cjs +1 -1
  424. package/dist/random/draw.cjs.map +1 -1
  425. package/dist/random/draw.js +1 -20
  426. package/dist/random/draw.js.map +1 -1
  427. package/dist/random/index.js +1 -5
  428. package/dist/random/random.cjs +1 -1
  429. package/dist/random/random.cjs.map +1 -1
  430. package/dist/random/random.js +1 -9
  431. package/dist/random/random.js.map +1 -1
  432. package/dist/random/shuffle.cjs +1 -1
  433. package/dist/random/shuffle.cjs.map +1 -1
  434. package/dist/random/shuffle.js +1 -13
  435. package/dist/random/shuffle.js.map +1 -1
  436. package/dist/random/source.cjs +1 -1
  437. package/dist/random/source.cjs.map +1 -1
  438. package/dist/random/source.js +1 -9
  439. package/dist/random/source.js.map +1 -1
  440. package/dist/string/_caseUtils.cjs +1 -1
  441. package/dist/string/_caseUtils.cjs.map +1 -1
  442. package/dist/string/_caseUtils.js +1 -12
  443. package/dist/string/_caseUtils.js.map +1 -1
  444. package/dist/string/camelCase.cjs +1 -1
  445. package/dist/string/camelCase.cjs.map +1 -1
  446. package/dist/string/camelCase.js +1 -8
  447. package/dist/string/camelCase.js.map +1 -1
  448. package/dist/string/escape.cjs +1 -1
  449. package/dist/string/escape.cjs.map +1 -1
  450. package/dist/string/escape.js +1 -14
  451. package/dist/string/escape.js.map +1 -1
  452. package/dist/string/index.js +1 -12
  453. package/dist/string/kebabCase.cjs +1 -1
  454. package/dist/string/kebabCase.cjs.map +1 -1
  455. package/dist/string/kebabCase.js +1 -8
  456. package/dist/string/kebabCase.js.map +1 -1
  457. package/dist/string/padCenter.cjs +1 -1
  458. package/dist/string/padCenter.cjs.map +1 -1
  459. package/dist/string/padCenter.js +1 -9
  460. package/dist/string/padCenter.js.map +1 -1
  461. package/dist/string/pascalCase.cjs +1 -1
  462. package/dist/string/pascalCase.cjs.map +1 -1
  463. package/dist/string/pascalCase.js +1 -8
  464. package/dist/string/pascalCase.js.map +1 -1
  465. package/dist/string/similarity.cjs +1 -1
  466. package/dist/string/similarity.cjs.map +1 -1
  467. package/dist/string/similarity.js +1 -22
  468. package/dist/string/similarity.js.map +1 -1
  469. package/dist/string/snakeCase.cjs +1 -1
  470. package/dist/string/snakeCase.cjs.map +1 -1
  471. package/dist/string/snakeCase.js +1 -8
  472. package/dist/string/snakeCase.js.map +1 -1
  473. package/dist/string/titleCase.cjs +1 -1
  474. package/dist/string/titleCase.cjs.map +1 -1
  475. package/dist/string/titleCase.js +1 -8
  476. package/dist/string/titleCase.js.map +1 -1
  477. package/dist/string/truncate.cjs +1 -1
  478. package/dist/string/truncate.cjs.map +1 -1
  479. package/dist/string/truncate.js +1 -15
  480. package/dist/string/truncate.js.map +1 -1
  481. package/dist/string/unescape.cjs +1 -1
  482. package/dist/string/unescape.cjs.map +1 -1
  483. package/dist/string/unescape.js +1 -14
  484. package/dist/string/unescape.js.map +1 -1
  485. package/dist/string/words.cjs +1 -1
  486. package/dist/string/words.cjs.map +1 -1
  487. package/dist/string/words.js +1 -9
  488. package/dist/string/words.js.map +1 -1
  489. package/dist/types.d.ts +10 -0
  490. package/dist/types.d.ts.map +1 -1
  491. package/package.json +13 -5
@@ -1,26 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- import { isPlainObject as t } from "../guards/isPlainObject.js";
3
- //#region src/object/merge.ts
4
- function n(r, i, a) {
5
- if (!t(i)) return i;
6
- let o = { ...r };
7
- for (let r of Object.keys(i)) {
8
- if (e(r)) continue;
9
- let s = i[r], c = o[r];
10
- o[r] = Array.isArray(s) && Array.isArray(c) ? a.arrayStrategy === "concat" ? [...c, ...s] : s : t(s) && t(c) ? n(c, s, a) : s;
11
- }
12
- return o;
13
- }
14
- function r(e, t = {}) {
15
- return e.reduce((e, r) => n(e, r, t), {});
16
- }
17
- function i(...t) {
18
- if (t.length === 0) return {};
19
- let n = {};
20
- for (let r of t) for (let t of Object.keys(r)) e(t) || (n[t] = r[t]);
21
- return n;
22
- }
23
- //#endregion
24
- export { r as deepMerge, i as shallowMerge };
25
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";import{isPlainObject as t}from"../guards/isPlainObject.js";function mergeObjects(n,r,i){if(!t(r))return r;let a={...n};for(let n of Object.keys(r)){if(e(n))continue;let o=r[n],s=a[n];a[n]=Array.isArray(o)&&Array.isArray(s)?i.arrayStrategy===`concat`?[...s,...o]:o:t(o)&&t(s)?mergeObjects(s,o,i):o}return a}function deepMerge(e,t={}){return e.reduce((e,n)=>mergeObjects(e,n,t),{})}function shallowMerge(...t){if(t.length===0)return{};let n={};for(let r of t)for(let t of Object.keys(r))e(t)||(n[t]=r[t]);return n}export{deepMerge,shallowMerge};
26
2
  //# sourceMappingURL=merge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"merge.js","names":[],"sources":["../../src/object/merge.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { isPlainObject } from '../guards/isPlainObject';\nimport type { Obj } from '../types';\n\nexport type DeepMergeOptions = {\n /** How to handle arrays when both source and target contain one. Default: `'replace'`. */\n arrayStrategy?: 'concat' | 'replace';\n};\n\ntype DeepMerge<T, U> = T extends Obj\n ? U extends Obj\n ? {\n [K in keyof T | keyof U]: K extends keyof T\n ? K extends keyof U\n ? DeepMerge<T[K], U[K]>\n : T[K]\n : K extends keyof U\n ? U[K]\n : never;\n }\n : U\n : U;\n\ntype Merge<T extends Obj[]> = T extends [infer First, ...infer Rest]\n ? First extends Obj\n ? Rest extends Obj[]\n ? DeepMerge<First, Merge<Rest>>\n : First\n : Obj\n : Obj;\n\nfunction mergeObjects<T extends Obj, U extends Obj>(target: T, source: U, options: DeepMergeOptions): DeepMerge<T, U> {\n if (!isPlainObject(source)) return source as DeepMerge<T, U>;\n\n const result = { ...target } as DeepMerge<T, U>;\n\n for (const key of Object.keys(source)) {\n // Guard against prototype pollution: skip dangerous keys\n if (isUnsafeKey(key)) {\n continue;\n }\n\n const sourceValue = source[key];\n const targetValue = result[key];\n\n (result as Record<string, unknown>)[key] =\n Array.isArray(sourceValue) && Array.isArray(targetValue)\n ? options.arrayStrategy === 'concat'\n ? [...targetValue, ...sourceValue]\n : sourceValue\n : isPlainObject(sourceValue) && isPlainObject(targetValue)\n ? mergeObjects(targetValue as Obj, sourceValue as Obj, options)\n : sourceValue;\n }\n\n return result;\n}\n\n/**\n * Deeply merges two or more objects. Arrays in source objects **replace** the target array by default.\n * Pass `{ arrayStrategy: 'concat' }` as the last argument to concatenate arrays instead.\n *\n * @example\n * ```ts\n * deepMerge({ a: 1, b: { x: 1 } }, { b: { y: 2 }, c: 3 });\n * // { a: 1, b: { x: 1, y: 2 }, c: 3 }\n *\n * deepMerge({ tags: ['a'] }, { tags: ['b'] });\n * // { tags: ['b'] } ← arrays replaced\n *\n * deepMerge({ tags: ['a'] }, { tags: ['b'] }, { arrayStrategy: 'concat' });\n * // { tags: ['a', 'b'] }\n * ```\n */\nexport function deepMerge<T extends Obj[]>(items: readonly [...T], options: DeepMergeOptions = {}): Merge<T> {\n return items.reduce((acc: Obj, item) => mergeObjects(acc, item, options) as Obj, {} as Obj) as Merge<T>;\n}\n\n/**\n * Shallowly merges two or more objects. Later sources win for duplicate keys.\n * Dangerous keys (`__proto__`, `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * shallowMerge({ a: 1, b: { x: 1 } }, { b: { y: 2 } });\n * // { a: 1, b: { y: 2 } } ← nested object replaced, not merged\n *\n * shallowMerge(defaults, overrides, extras);\n * ```\n */\nexport function shallowMerge<T extends Obj[]>(...items: [...T]): Merge<T> {\n if (items.length === 0) return {} as Merge<T>;\n\n const result: Obj = {};\n\n for (const item of items) {\n for (const key of Object.keys(item)) {\n if (isUnsafeKey(key)) continue;\n\n result[key] = item[key];\n }\n }\n\n return result as Merge<T>;\n}\n"],"mappings":";;;AA+BA,SAAS,EAA2C,GAAW,GAAW,GAA4C;CACpH,IAAI,CAAC,EAAc,CAAM,GAAG,OAAO;CAEnC,IAAM,IAAS,EAAE,GAAG,EAAO;CAE3B,KAAK,IAAM,KAAO,OAAO,KAAK,CAAM,GAAG;EAErC,IAAI,EAAY,CAAG,GACjB;EAGF,IAAM,IAAc,EAAO,IACrB,IAAc,EAAO;EAE3B,EAAoC,KAClC,MAAM,QAAQ,CAAW,KAAK,MAAM,QAAQ,CAAW,IACnD,EAAQ,kBAAkB,WACxB,CAAC,GAAG,GAAa,GAAG,CAAW,IAC/B,IACF,EAAc,CAAW,KAAK,EAAc,CAAW,IACrD,EAAa,GAAoB,GAAoB,CAAO,IAC5D;CACV;CAEA,OAAO;AACT;AAkBA,SAAgB,EAA2B,GAAwB,IAA4B,CAAC,GAAa;CAC3G,OAAO,EAAM,QAAQ,GAAU,MAAS,EAAa,GAAK,GAAM,CAAO,GAAU,CAAC,CAAQ;AAC5F;AAcA,SAAgB,EAA8B,GAAG,GAAyB;CACxE,IAAI,EAAM,WAAW,GAAG,OAAO,CAAC;CAEhC,IAAM,IAAc,CAAC;CAErB,KAAK,IAAM,KAAQ,GACjB,KAAK,IAAM,KAAO,OAAO,KAAK,CAAI,GAC5B,EAAY,CAAG,MAEnB,EAAO,KAAO,EAAK;CAIvB,OAAO;AACT"}
1
+ {"version":3,"file":"merge.js","names":[],"sources":["../../src/object/merge.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { isPlainObject } from '../guards/isPlainObject';\nimport type { Obj } from '../types';\n\nexport type DeepMergeOptions = {\n /** How to handle arrays when both source and target contain one. Default: `'replace'`. */\n arrayStrategy?: 'concat' | 'replace';\n};\n\ntype DeepMerge<T, U> = T extends Obj\n ? U extends Obj\n ? {\n [K in keyof T | keyof U]: K extends keyof T\n ? K extends keyof U\n ? DeepMerge<T[K], U[K]>\n : T[K]\n : K extends keyof U\n ? U[K]\n : never;\n }\n : U\n : U;\n\ntype Merge<T extends Obj[]> = T extends [infer First, ...infer Rest]\n ? First extends Obj\n ? Rest extends Obj[]\n ? DeepMerge<First, Merge<Rest>>\n : First\n : Obj\n : Obj;\n\nfunction mergeObjects<T extends Obj, U extends Obj>(target: T, source: U, options: DeepMergeOptions): DeepMerge<T, U> {\n if (!isPlainObject(source)) return source as DeepMerge<T, U>;\n\n const result = { ...target } as DeepMerge<T, U>;\n\n for (const key of Object.keys(source)) {\n // Guard against prototype pollution: skip dangerous keys\n if (isUnsafeKey(key)) {\n continue;\n }\n\n const sourceValue = source[key];\n const targetValue = result[key];\n\n (result as Record<string, unknown>)[key] =\n Array.isArray(sourceValue) && Array.isArray(targetValue)\n ? options.arrayStrategy === 'concat'\n ? [...targetValue, ...sourceValue]\n : sourceValue\n : isPlainObject(sourceValue) && isPlainObject(targetValue)\n ? mergeObjects(targetValue as Obj, sourceValue as Obj, options)\n : sourceValue;\n }\n\n return result;\n}\n\n/**\n * Deeply merges two or more objects. Arrays in source objects **replace** the target array by default.\n * Pass `{ arrayStrategy: 'concat' }` as the last argument to concatenate arrays instead.\n *\n * @example\n * ```ts\n * deepMerge({ a: 1, b: { x: 1 } }, { b: { y: 2 }, c: 3 });\n * // { a: 1, b: { x: 1, y: 2 }, c: 3 }\n *\n * deepMerge({ tags: ['a'] }, { tags: ['b'] });\n * // { tags: ['b'] } ← arrays replaced\n *\n * deepMerge({ tags: ['a'] }, { tags: ['b'] }, { arrayStrategy: 'concat' });\n * // { tags: ['a', 'b'] }\n * ```\n */\nexport function deepMerge<T extends Obj[]>(items: readonly [...T], options: DeepMergeOptions = {}): Merge<T> {\n return items.reduce((acc: Obj, item) => mergeObjects(acc, item, options) as Obj, {} as Obj) as Merge<T>;\n}\n\n/**\n * Shallowly merges two or more objects. Later sources win for duplicate keys.\n * Dangerous keys (`__proto__`, `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * shallowMerge({ a: 1, b: { x: 1 } }, { b: { y: 2 } });\n * // { a: 1, b: { y: 2 } } ← nested object replaced, not merged\n *\n * shallowMerge(defaults, overrides, extras);\n * ```\n */\nexport function shallowMerge<T extends Obj[]>(...items: [...T]): Merge<T> {\n if (items.length === 0) return {} as Merge<T>;\n\n const result: Obj = {};\n\n for (const item of items) {\n for (const key of Object.keys(item)) {\n if (isUnsafeKey(key)) continue;\n\n result[key] = item[key];\n }\n }\n\n return result as Merge<T>;\n}\n"],"mappings":"mHA+BA,SAAS,aAA2C,EAAW,EAAW,EAA4C,CACpH,GAAI,CAAC,EAAc,CAAM,EAAG,OAAO,EAEnC,IAAM,EAAS,CAAE,GAAG,CAAO,EAE3B,IAAK,IAAM,KAAO,OAAO,KAAK,CAAM,EAAG,CAErC,GAAI,EAAY,CAAG,EACjB,SAGF,IAAM,EAAc,EAAO,GACrB,EAAc,EAAO,GAE3B,EAAoC,GAClC,MAAM,QAAQ,CAAW,GAAK,MAAM,QAAQ,CAAW,EACnD,EAAQ,gBAAkB,SACxB,CAAC,GAAG,EAAa,GAAG,CAAW,EAC/B,EACF,EAAc,CAAW,GAAK,EAAc,CAAW,EACrD,aAAa,EAAoB,EAAoB,CAAO,EAC5D,CACV,CAEA,OAAO,CACT,CAkBA,SAAgB,UAA2B,EAAwB,EAA4B,CAAC,EAAa,CAC3G,OAAO,EAAM,QAAQ,EAAU,IAAS,aAAa,EAAK,EAAM,CAAO,EAAU,CAAC,CAAQ,CAC5F,CAcA,SAAgB,aAA8B,GAAG,EAAyB,CACxE,GAAI,EAAM,SAAW,EAAG,MAAO,CAAC,EAEhC,IAAM,EAAc,CAAC,EAErB,IAAK,IAAM,KAAQ,EACjB,IAAK,IAAM,KAAO,OAAO,KAAK,CAAI,EAC5B,EAAY,CAAG,IAEnB,EAAO,GAAO,EAAK,IAIvB,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs");function t(t,n){let r=new Set(n),i={};for(let n of Object.keys(t))e.isUnsafeKey(n)||r.has(n)||(i[n]=t[n]);return i}exports.omit=t;
1
+ const e=require("../_common/unsafePaths.cjs");function omit(t,n){let r=new Set(n),i={};for(let n of Object.keys(t))e.isUnsafeKey(n)||r.has(n)||(i[n]=t[n]);return i}exports.omit=omit;
2
2
  //# sourceMappingURL=omit.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"omit.cjs","names":[],"sources":["../../src/object/omit.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Creates a new object without the selected keys. Only `obj`'s own enumerable keys are\n * considered; dangerous keys (`__proto__`, `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * omit({ a: 1, b: 2, c: 3 }, ['b']); // { a: 1, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param omittedKeys - The keys to exclude.\n * @returns A new object with `omittedKeys` removed.\n */\nexport function omit<T extends Obj, K extends keyof T>(obj: T, omittedKeys: readonly K[]): Omit<T, K> {\n const blacklist = new Set<PropertyKey>(omittedKeys as readonly PropertyKey[]);\n const out = {} as Omit<T, K>;\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (!blacklist.has(key)) {\n (out as T)[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":"8CAgBA,SAAgB,EAAuC,EAAQ,EAAuC,CACpG,IAAM,EAAY,IAAI,IAAiB,CAAqC,EACtE,EAAM,CAAC,EAEb,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAC3B,EAAA,YAAY,CAAkB,GAE7B,EAAU,IAAI,CAAG,IACpB,EAAW,GAAO,EAAI,IAI1B,OAAO,CACT"}
1
+ {"version":3,"file":"omit.cjs","names":[],"sources":["../../src/object/omit.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Creates a new object without the selected keys. Only `obj`'s own enumerable keys are\n * considered; dangerous keys (`__proto__`, `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * omit({ a: 1, b: 2, c: 3 }, ['b']); // { a: 1, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param omittedKeys - The keys to exclude.\n * @returns A new object with `omittedKeys` removed.\n */\nexport function omit<T extends Obj, K extends keyof T>(obj: T, omittedKeys: readonly K[]): Omit<T, K> {\n const blacklist = new Set<PropertyKey>(omittedKeys as readonly PropertyKey[]);\n const out = {} as Omit<T, K>;\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (!blacklist.has(key)) {\n (out as T)[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":"8CAgBA,SAAgB,KAAuC,EAAQ,EAAuC,CACpG,IAAM,EAAY,IAAI,IAAiB,CAAqC,EACtE,EAAM,CAAC,EAEb,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAC3B,EAAA,YAAY,CAAkB,GAE7B,EAAU,IAAI,CAAG,IACpB,EAAW,GAAO,EAAI,IAI1B,OAAO,CACT"}
@@ -1,11 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- //#region src/object/omit.ts
3
- function t(t, n) {
4
- let r = new Set(n), i = {};
5
- for (let n of Object.keys(t)) e(n) || r.has(n) || (i[n] = t[n]);
6
- return i;
7
- }
8
- //#endregion
9
- export { t as omit };
10
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";function omit(t,n){let r=new Set(n),i={};for(let n of Object.keys(t))e(n)||r.has(n)||(i[n]=t[n]);return i}export{omit};
11
2
  //# sourceMappingURL=omit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"omit.js","names":[],"sources":["../../src/object/omit.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Creates a new object without the selected keys. Only `obj`'s own enumerable keys are\n * considered; dangerous keys (`__proto__`, `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * omit({ a: 1, b: 2, c: 3 }, ['b']); // { a: 1, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param omittedKeys - The keys to exclude.\n * @returns A new object with `omittedKeys` removed.\n */\nexport function omit<T extends Obj, K extends keyof T>(obj: T, omittedKeys: readonly K[]): Omit<T, K> {\n const blacklist = new Set<PropertyKey>(omittedKeys as readonly PropertyKey[]);\n const out = {} as Omit<T, K>;\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (!blacklist.has(key)) {\n (out as T)[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":";;AAgBA,SAAgB,EAAuC,GAAQ,GAAuC;CACpG,IAAM,IAAY,IAAI,IAAiB,CAAqC,GACtE,IAAM,CAAC;CAEb,KAAK,IAAM,KAAO,OAAO,KAAK,CAAG,GAC3B,EAAY,CAAkB,KAE7B,EAAU,IAAI,CAAG,MACpB,EAAW,KAAO,EAAI;CAI1B,OAAO;AACT"}
1
+ {"version":3,"file":"omit.js","names":[],"sources":["../../src/object/omit.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Creates a new object without the selected keys. Only `obj`'s own enumerable keys are\n * considered; dangerous keys (`__proto__`, `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * omit({ a: 1, b: 2, c: 3 }, ['b']); // { a: 1, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param omittedKeys - The keys to exclude.\n * @returns A new object with `omittedKeys` removed.\n */\nexport function omit<T extends Obj, K extends keyof T>(obj: T, omittedKeys: readonly K[]): Omit<T, K> {\n const blacklist = new Set<PropertyKey>(omittedKeys as readonly PropertyKey[]);\n const out = {} as Omit<T, K>;\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (!blacklist.has(key)) {\n (out as T)[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":"wDAgBA,SAAgB,KAAuC,EAAQ,EAAuC,CACpG,IAAM,EAAY,IAAI,IAAiB,CAAqC,EACtE,EAAM,CAAC,EAEb,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAC3B,EAAY,CAAkB,GAE7B,EAAU,IAAI,CAAG,IACpB,EAAW,GAAO,EAAI,IAI1B,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs");function t(t,n){let r={};for(let i of n)e.isUnsafeKey(i)||Object.hasOwn(t,i)&&(r[i]=t[i]);return r}exports.pick=t;
1
+ const e=require("../_common/unsafePaths.cjs");function pick(t,n){let r={};for(let i of n)e.isUnsafeKey(i)||Object.hasOwn(t,i)&&(r[i]=t[i]);return r}exports.pick=pick;
2
2
  //# sourceMappingURL=pick.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"pick.cjs","names":[],"sources":["../../src/object/pick.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Creates a new object containing only selected keys. Only `obj`'s own enumerable keys are\n * considered — inherited properties (e.g. `toString`) are never picked, and dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * pick({ a: 1, b: 2, c: 3 }, ['a', 'c']); // { a: 1, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param selectedKeys - The keys to keep.\n * @returns A new object containing only `selectedKeys` that exist as own properties of `obj`.\n */\nexport function pick<T extends Obj, K extends keyof T>(obj: T, selectedKeys: readonly K[]): Pick<T, K> {\n const out = {} as Pick<T, K>;\n\n for (const key of selectedKeys) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (Object.hasOwn(obj, key)) {\n out[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":"8CAiBA,SAAgB,EAAuC,EAAQ,EAAwC,CACrG,IAAM,EAAM,CAAC,EAEb,IAAK,IAAM,KAAO,EACZ,EAAA,YAAY,CAAkB,GAE9B,OAAO,OAAO,EAAK,CAAG,IACxB,EAAI,GAAO,EAAI,IAInB,OAAO,CACT"}
1
+ {"version":3,"file":"pick.cjs","names":[],"sources":["../../src/object/pick.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Creates a new object containing only selected keys. Only `obj`'s own enumerable keys are\n * considered — inherited properties (e.g. `toString`) are never picked, and dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * pick({ a: 1, b: 2, c: 3 }, ['a', 'c']); // { a: 1, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param selectedKeys - The keys to keep.\n * @returns A new object containing only `selectedKeys` that exist as own properties of `obj`.\n */\nexport function pick<T extends Obj, K extends keyof T>(obj: T, selectedKeys: readonly K[]): Pick<T, K> {\n const out = {} as Pick<T, K>;\n\n for (const key of selectedKeys) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (Object.hasOwn(obj, key)) {\n out[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":"8CAiBA,SAAgB,KAAuC,EAAQ,EAAwC,CACrG,IAAM,EAAM,CAAC,EAEb,IAAK,IAAM,KAAO,EACZ,EAAA,YAAY,CAAkB,GAE9B,OAAO,OAAO,EAAK,CAAG,IACxB,EAAI,GAAO,EAAI,IAInB,OAAO,CACT"}
@@ -1,11 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- //#region src/object/pick.ts
3
- function t(t, n) {
4
- let r = {};
5
- for (let i of n) e(i) || Object.hasOwn(t, i) && (r[i] = t[i]);
6
- return r;
7
- }
8
- //#endregion
9
- export { t as pick };
10
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";function pick(t,n){let r={};for(let i of n)e(i)||Object.hasOwn(t,i)&&(r[i]=t[i]);return r}export{pick};
11
2
  //# sourceMappingURL=pick.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pick.js","names":[],"sources":["../../src/object/pick.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Creates a new object containing only selected keys. Only `obj`'s own enumerable keys are\n * considered — inherited properties (e.g. `toString`) are never picked, and dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * pick({ a: 1, b: 2, c: 3 }, ['a', 'c']); // { a: 1, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param selectedKeys - The keys to keep.\n * @returns A new object containing only `selectedKeys` that exist as own properties of `obj`.\n */\nexport function pick<T extends Obj, K extends keyof T>(obj: T, selectedKeys: readonly K[]): Pick<T, K> {\n const out = {} as Pick<T, K>;\n\n for (const key of selectedKeys) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (Object.hasOwn(obj, key)) {\n out[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":";;AAiBA,SAAgB,EAAuC,GAAQ,GAAwC;CACrG,IAAM,IAAM,CAAC;CAEb,KAAK,IAAM,KAAO,GACZ,EAAY,CAAkB,KAE9B,OAAO,OAAO,GAAK,CAAG,MACxB,EAAI,KAAO,EAAI;CAInB,OAAO;AACT"}
1
+ {"version":3,"file":"pick.js","names":[],"sources":["../../src/object/pick.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Creates a new object containing only selected keys. Only `obj`'s own enumerable keys are\n * considered — inherited properties (e.g. `toString`) are never picked, and dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * pick({ a: 1, b: 2, c: 3 }, ['a', 'c']); // { a: 1, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param selectedKeys - The keys to keep.\n * @returns A new object containing only `selectedKeys` that exist as own properties of `obj`.\n */\nexport function pick<T extends Obj, K extends keyof T>(obj: T, selectedKeys: readonly K[]): Pick<T, K> {\n const out = {} as Pick<T, K>;\n\n for (const key of selectedKeys) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (Object.hasOwn(obj, key)) {\n out[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":"wDAiBA,SAAgB,KAAuC,EAAQ,EAAwC,CACrG,IAAM,EAAM,CAAC,EAEb,IAAK,IAAM,KAAO,EACZ,EAAY,CAAkB,GAE9B,OAAO,OAAO,EAAK,CAAG,IACxB,EAAI,GAAO,EAAI,IAInB,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs"),t=require("../array/filterMap.cjs"),n=require("../guards/isPlainObject.cjs"),r=require("../guards/isEmpty.cjs");function i(a){if(a!=null){if(typeof a==`string`){let e=a.trim();return e===``?void 0:e}if(Array.isArray(a)){let e=t.filterMap(a,e=>{let t=i(e);return r.isEmpty(t)?void 0:t});return e.length===0?void 0:e}if(n.isPlainObject(a)){let t={};for(let[n,o]of Object.entries(a)){if(e.isUnsafeKey(n))continue;let a=i(o);r.isEmpty(a)||(t[n]=a)}return Object.keys(t).length===0?void 0:t}return a}}exports.prune=i;
1
+ const e=require("../_common/unsafePaths.cjs"),t=require("../array/filterMap.cjs"),n=require("../guards/isPlainObject.cjs"),r=require("../guards/isEmpty.cjs");function prune(i){if(i!=null){if(typeof i==`string`){let e=i.trim();return e===``?void 0:e}if(Array.isArray(i)){let e=t.filterMap(i,e=>{let t=prune(e);return r.isEmpty(t)?void 0:t});return e.length===0?void 0:e}if(n.isPlainObject(i)){let t={};for(let[n,a]of Object.entries(i)){if(e.isUnsafeKey(n))continue;let i=prune(a);r.isEmpty(i)||(t[n]=i)}return Object.keys(t).length===0?void 0:t}return i}}exports.prune=prune;
2
2
  //# sourceMappingURL=prune.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"prune.cjs","names":[],"sources":["../../src/object/prune.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { filterMap } from '../array/filterMap';\nimport { isEmpty } from '../guards/isEmpty';\nimport { isPlainObject } from '../guards/isPlainObject';\n\n/**\n * Removes all nullable and empty values from strings, arrays, or objects.\n *\n * - For strings: trims whitespace and returns `undefined` if the result is empty.\n * - For arrays: recursively removes `null`, `undefined`, empty strings, and empty objects/arrays.\n * - For objects: recursively removes properties whose pruned value is empty. Dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are always skipped.\n * - For any other type: returns the value unchanged.\n *\n * @example\n * ```ts\n * prune(' hello '); // 'hello'\n * prune(' '); // undefined\n * prune([1, null, '', 2, undefined, 3]); // [1, 2, 3]\n * prune({ a: 1, b: null, c: '', d: 2 }); // { a: 1, d: 2 }\n * prune({ a: { b: null, c: '' }, d: 1 }); // { d: 1 }\n * ```\n *\n * @param value - The value to prune.\n * @returns The pruned value, or `undefined` if the result would be empty.\n */\nexport function prune(value: string): string | undefined;\nexport function prune<T>(value: T[]): Array<NonNullable<T>> | undefined;\nexport function prune<T extends Record<string, unknown>>(value: T): Partial<T> | undefined;\nexport function prune<T>(value: T): T | undefined;\nexport function prune<T>(value: T): T | undefined {\n if (value === null || value === undefined) return undefined;\n\n if (typeof value === 'string') {\n const trimmed = value.trim();\n\n return (trimmed === '' ? undefined : trimmed) as T | undefined;\n }\n\n if (Array.isArray(value)) {\n const cleaned = filterMap(value as unknown[], (item) => {\n const pruned = prune(item);\n\n return isEmpty(pruned) ? undefined : (pruned as unknown);\n });\n\n return (cleaned.length === 0 ? undefined : cleaned) as T | undefined;\n }\n\n if (isPlainObject(value)) {\n const cleaned: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(value)) {\n if (isUnsafeKey(key)) continue;\n\n const cleanedValue = prune(val);\n\n if (!isEmpty(cleanedValue)) {\n cleaned[key] = cleanedValue;\n }\n }\n\n return (Object.keys(cleaned).length === 0 ? undefined : cleaned) as T | undefined;\n }\n\n return value;\n}\n"],"mappings":"8JA8BA,SAAgB,EAAS,EAAyB,CAC5C,MAAU,KAEd,IAAI,OAAO,GAAU,SAAU,CAC7B,IAAM,EAAU,EAAM,KAAK,EAE3B,OAAQ,IAAY,GAAK,IAAA,GAAY,CACvC,CAEA,GAAI,MAAM,QAAQ,CAAK,EAAG,CACxB,IAAM,EAAU,EAAA,UAAU,EAAqB,GAAS,CACtD,IAAM,EAAS,EAAM,CAAI,EAEzB,OAAO,EAAA,QAAQ,CAAM,EAAI,IAAA,GAAa,CACxC,CAAC,EAED,OAAQ,EAAQ,SAAW,EAAI,IAAA,GAAY,CAC7C,CAEA,GAAI,EAAA,cAAc,CAAK,EAAG,CACxB,IAAM,EAAmC,CAAC,EAE1C,IAAK,GAAM,CAAC,EAAK,KAAQ,OAAO,QAAQ,CAAK,EAAG,CAC9C,GAAI,EAAA,YAAY,CAAG,EAAG,SAEtB,IAAM,EAAe,EAAM,CAAG,EAEzB,EAAA,QAAQ,CAAY,IACvB,EAAQ,GAAO,EAEnB,CAEA,OAAQ,OAAO,KAAK,CAAO,CAAC,CAAC,SAAW,EAAI,IAAA,GAAY,CAC1D,CAEA,OAAO,CA5BP,CA6BF"}
1
+ {"version":3,"file":"prune.cjs","names":[],"sources":["../../src/object/prune.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { filterMap } from '../array/filterMap';\nimport { isEmpty } from '../guards/isEmpty';\nimport { isPlainObject } from '../guards/isPlainObject';\n\n/**\n * Removes all nullable and empty values from strings, arrays, or objects.\n *\n * - For strings: trims whitespace and returns `undefined` if the result is empty.\n * - For arrays: recursively removes `null`, `undefined`, empty strings, and empty objects/arrays.\n * - For objects: recursively removes properties whose pruned value is empty. Dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are always skipped.\n * - For any other type: returns the value unchanged.\n *\n * @example\n * ```ts\n * prune(' hello '); // 'hello'\n * prune(' '); // undefined\n * prune([1, null, '', 2, undefined, 3]); // [1, 2, 3]\n * prune({ a: 1, b: null, c: '', d: 2 }); // { a: 1, d: 2 }\n * prune({ a: { b: null, c: '' }, d: 1 }); // { d: 1 }\n * ```\n *\n * @param value - The value to prune.\n * @returns The pruned value, or `undefined` if the result would be empty.\n */\nexport function prune(value: string): string | undefined;\nexport function prune<T>(value: T[]): Array<NonNullable<T>> | undefined;\nexport function prune<T extends Record<string, unknown>>(value: T): Partial<T> | undefined;\nexport function prune<T>(value: T): T | undefined;\nexport function prune<T>(value: T): T | undefined {\n if (value === null || value === undefined) return undefined;\n\n if (typeof value === 'string') {\n const trimmed = value.trim();\n\n return (trimmed === '' ? undefined : trimmed) as T | undefined;\n }\n\n if (Array.isArray(value)) {\n const cleaned = filterMap(value as unknown[], (item) => {\n const pruned = prune(item);\n\n return isEmpty(pruned) ? undefined : (pruned as unknown);\n });\n\n return (cleaned.length === 0 ? undefined : cleaned) as T | undefined;\n }\n\n if (isPlainObject(value)) {\n const cleaned: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(value)) {\n if (isUnsafeKey(key)) continue;\n\n const cleanedValue = prune(val);\n\n if (!isEmpty(cleanedValue)) {\n cleaned[key] = cleanedValue;\n }\n }\n\n return (Object.keys(cleaned).length === 0 ? undefined : cleaned) as T | undefined;\n }\n\n return value;\n}\n"],"mappings":"8JA8BA,SAAgB,MAAS,EAAyB,CAC5C,MAAU,KAEd,IAAI,OAAO,GAAU,SAAU,CAC7B,IAAM,EAAU,EAAM,KAAK,EAE3B,OAAQ,IAAY,GAAK,IAAA,GAAY,CACvC,CAEA,GAAI,MAAM,QAAQ,CAAK,EAAG,CACxB,IAAM,EAAU,EAAA,UAAU,EAAqB,GAAS,CACtD,IAAM,EAAS,MAAM,CAAI,EAEzB,OAAO,EAAA,QAAQ,CAAM,EAAI,IAAA,GAAa,CACxC,CAAC,EAED,OAAQ,EAAQ,SAAW,EAAI,IAAA,GAAY,CAC7C,CAEA,GAAI,EAAA,cAAc,CAAK,EAAG,CACxB,IAAM,EAAmC,CAAC,EAE1C,IAAK,GAAM,CAAC,EAAK,KAAQ,OAAO,QAAQ,CAAK,EAAG,CAC9C,GAAI,EAAA,YAAY,CAAG,EAAG,SAEtB,IAAM,EAAe,MAAM,CAAG,EAEzB,EAAA,QAAQ,CAAY,IACvB,EAAQ,GAAO,EAEnB,CAEA,OAAQ,OAAO,KAAK,CAAO,CAAC,CAAC,SAAW,EAAI,IAAA,GAAY,CAC1D,CAEA,OAAO,CA5BP,CA6BF"}
@@ -1,34 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- import { filterMap as t } from "../array/filterMap.js";
3
- import { isPlainObject as n } from "../guards/isPlainObject.js";
4
- import { isEmpty as r } from "../guards/isEmpty.js";
5
- //#region src/object/prune.ts
6
- function i(a) {
7
- if (a != null) {
8
- if (typeof a == "string") {
9
- let e = a.trim();
10
- return e === "" ? void 0 : e;
11
- }
12
- if (Array.isArray(a)) {
13
- let e = t(a, (e) => {
14
- let t = i(e);
15
- return r(t) ? void 0 : t;
16
- });
17
- return e.length === 0 ? void 0 : e;
18
- }
19
- if (n(a)) {
20
- let t = {};
21
- for (let [n, o] of Object.entries(a)) {
22
- if (e(n)) continue;
23
- let a = i(o);
24
- r(a) || (t[n] = a);
25
- }
26
- return Object.keys(t).length === 0 ? void 0 : t;
27
- }
28
- return a;
29
- }
30
- }
31
- //#endregion
32
- export { i as prune };
33
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";import{filterMap as t}from"../array/filterMap.js";import{isPlainObject as n}from"../guards/isPlainObject.js";import{isEmpty as r}from"../guards/isEmpty.js";function prune(i){if(i!=null){if(typeof i==`string`){let e=i.trim();return e===``?void 0:e}if(Array.isArray(i)){let e=t(i,e=>{let t=prune(e);return r(t)?void 0:t});return e.length===0?void 0:e}if(n(i)){let t={};for(let[n,a]of Object.entries(i)){if(e(n))continue;let i=prune(a);r(i)||(t[n]=i)}return Object.keys(t).length===0?void 0:t}return i}}export{prune};
34
2
  //# sourceMappingURL=prune.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prune.js","names":[],"sources":["../../src/object/prune.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { filterMap } from '../array/filterMap';\nimport { isEmpty } from '../guards/isEmpty';\nimport { isPlainObject } from '../guards/isPlainObject';\n\n/**\n * Removes all nullable and empty values from strings, arrays, or objects.\n *\n * - For strings: trims whitespace and returns `undefined` if the result is empty.\n * - For arrays: recursively removes `null`, `undefined`, empty strings, and empty objects/arrays.\n * - For objects: recursively removes properties whose pruned value is empty. Dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are always skipped.\n * - For any other type: returns the value unchanged.\n *\n * @example\n * ```ts\n * prune(' hello '); // 'hello'\n * prune(' '); // undefined\n * prune([1, null, '', 2, undefined, 3]); // [1, 2, 3]\n * prune({ a: 1, b: null, c: '', d: 2 }); // { a: 1, d: 2 }\n * prune({ a: { b: null, c: '' }, d: 1 }); // { d: 1 }\n * ```\n *\n * @param value - The value to prune.\n * @returns The pruned value, or `undefined` if the result would be empty.\n */\nexport function prune(value: string): string | undefined;\nexport function prune<T>(value: T[]): Array<NonNullable<T>> | undefined;\nexport function prune<T extends Record<string, unknown>>(value: T): Partial<T> | undefined;\nexport function prune<T>(value: T): T | undefined;\nexport function prune<T>(value: T): T | undefined {\n if (value === null || value === undefined) return undefined;\n\n if (typeof value === 'string') {\n const trimmed = value.trim();\n\n return (trimmed === '' ? undefined : trimmed) as T | undefined;\n }\n\n if (Array.isArray(value)) {\n const cleaned = filterMap(value as unknown[], (item) => {\n const pruned = prune(item);\n\n return isEmpty(pruned) ? undefined : (pruned as unknown);\n });\n\n return (cleaned.length === 0 ? undefined : cleaned) as T | undefined;\n }\n\n if (isPlainObject(value)) {\n const cleaned: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(value)) {\n if (isUnsafeKey(key)) continue;\n\n const cleanedValue = prune(val);\n\n if (!isEmpty(cleanedValue)) {\n cleaned[key] = cleanedValue;\n }\n }\n\n return (Object.keys(cleaned).length === 0 ? undefined : cleaned) as T | undefined;\n }\n\n return value;\n}\n"],"mappings":";;;;;AA8BA,SAAgB,EAAS,GAAyB;CAC5C,SAAU,MAEd;MAAI,OAAO,KAAU,UAAU;GAC7B,IAAM,IAAU,EAAM,KAAK;GAE3B,OAAQ,MAAY,KAAK,KAAA,IAAY;EACvC;EAEA,IAAI,MAAM,QAAQ,CAAK,GAAG;GACxB,IAAM,IAAU,EAAU,IAAqB,MAAS;IACtD,IAAM,IAAS,EAAM,CAAI;IAEzB,OAAO,EAAQ,CAAM,IAAI,KAAA,IAAa;GACxC,CAAC;GAED,OAAQ,EAAQ,WAAW,IAAI,KAAA,IAAY;EAC7C;EAEA,IAAI,EAAc,CAAK,GAAG;GACxB,IAAM,IAAmC,CAAC;GAE1C,KAAK,IAAM,CAAC,GAAK,MAAQ,OAAO,QAAQ,CAAK,GAAG;IAC9C,IAAI,EAAY,CAAG,GAAG;IAEtB,IAAM,IAAe,EAAM,CAAG;IAE9B,AAAK,EAAQ,CAAY,MACvB,EAAQ,KAAO;GAEnB;GAEA,OAAQ,OAAO,KAAK,CAAO,CAAC,CAAC,WAAW,IAAI,KAAA,IAAY;EAC1D;EAEA,OAAO;CA5BP;AA6BF"}
1
+ {"version":3,"file":"prune.js","names":[],"sources":["../../src/object/prune.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { filterMap } from '../array/filterMap';\nimport { isEmpty } from '../guards/isEmpty';\nimport { isPlainObject } from '../guards/isPlainObject';\n\n/**\n * Removes all nullable and empty values from strings, arrays, or objects.\n *\n * - For strings: trims whitespace and returns `undefined` if the result is empty.\n * - For arrays: recursively removes `null`, `undefined`, empty strings, and empty objects/arrays.\n * - For objects: recursively removes properties whose pruned value is empty. Dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are always skipped.\n * - For any other type: returns the value unchanged.\n *\n * @example\n * ```ts\n * prune(' hello '); // 'hello'\n * prune(' '); // undefined\n * prune([1, null, '', 2, undefined, 3]); // [1, 2, 3]\n * prune({ a: 1, b: null, c: '', d: 2 }); // { a: 1, d: 2 }\n * prune({ a: { b: null, c: '' }, d: 1 }); // { d: 1 }\n * ```\n *\n * @param value - The value to prune.\n * @returns The pruned value, or `undefined` if the result would be empty.\n */\nexport function prune(value: string): string | undefined;\nexport function prune<T>(value: T[]): Array<NonNullable<T>> | undefined;\nexport function prune<T extends Record<string, unknown>>(value: T): Partial<T> | undefined;\nexport function prune<T>(value: T): T | undefined;\nexport function prune<T>(value: T): T | undefined {\n if (value === null || value === undefined) return undefined;\n\n if (typeof value === 'string') {\n const trimmed = value.trim();\n\n return (trimmed === '' ? undefined : trimmed) as T | undefined;\n }\n\n if (Array.isArray(value)) {\n const cleaned = filterMap(value as unknown[], (item) => {\n const pruned = prune(item);\n\n return isEmpty(pruned) ? undefined : (pruned as unknown);\n });\n\n return (cleaned.length === 0 ? undefined : cleaned) as T | undefined;\n }\n\n if (isPlainObject(value)) {\n const cleaned: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(value)) {\n if (isUnsafeKey(key)) continue;\n\n const cleanedValue = prune(val);\n\n if (!isEmpty(cleanedValue)) {\n cleaned[key] = cleanedValue;\n }\n }\n\n return (Object.keys(cleaned).length === 0 ? undefined : cleaned) as T | undefined;\n }\n\n return value;\n}\n"],"mappings":"oNA8BA,SAAgB,MAAS,EAAyB,CAC5C,MAAU,KAEd,IAAI,OAAO,GAAU,SAAU,CAC7B,IAAM,EAAU,EAAM,KAAK,EAE3B,OAAQ,IAAY,GAAK,IAAA,GAAY,CACvC,CAEA,GAAI,MAAM,QAAQ,CAAK,EAAG,CACxB,IAAM,EAAU,EAAU,EAAqB,GAAS,CACtD,IAAM,EAAS,MAAM,CAAI,EAEzB,OAAO,EAAQ,CAAM,EAAI,IAAA,GAAa,CACxC,CAAC,EAED,OAAQ,EAAQ,SAAW,EAAI,IAAA,GAAY,CAC7C,CAEA,GAAI,EAAc,CAAK,EAAG,CACxB,IAAM,EAAmC,CAAC,EAE1C,IAAK,GAAM,CAAC,EAAK,KAAQ,OAAO,QAAQ,CAAK,EAAG,CAC9C,GAAI,EAAY,CAAG,EAAG,SAEtB,IAAM,EAAe,MAAM,CAAG,EAEzB,EAAQ,CAAY,IACvB,EAAQ,GAAO,EAEnB,CAEA,OAAQ,OAAO,KAAK,CAAO,CAAC,CAAC,SAAW,EAAI,IAAA,GAAY,CAC1D,CAEA,OAAO,CA5BP,CA6BF"}
@@ -1,2 +1,2 @@
1
- function e(e){try{return{ok:!0,value:JSON.parse(e)}}catch(e){return{error:e,ok:!1}}}exports.tryParseJson=e;
1
+ function tryParseJson(e){try{return{ok:!0,value:JSON.parse(e)}}catch(e){return{error:e,ok:!1}}}exports.tryParseJson=tryParseJson;
2
2
  //# sourceMappingURL=tryParseJson.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tryParseJson.cjs","names":[],"sources":["../../src/object/tryParseJson.ts"],"sourcesContent":["export type JsonParseResult = { ok: true; value: unknown } | { error: SyntaxError; ok: false };\n\nexport function tryParseJson(text: string): JsonParseResult {\n try {\n return { ok: true, value: JSON.parse(text) as unknown };\n } catch (error) {\n return { error: error as SyntaxError, ok: false };\n }\n}\n"],"mappings":"AAEA,SAAgB,EAAa,EAA+B,CAC1D,GAAI,CACF,MAAO,CAAE,GAAI,GAAM,MAAO,KAAK,MAAM,CAAI,CAAa,CACxD,OAAS,EAAO,CACd,MAAO,CAAS,QAAsB,GAAI,EAAM,CAClD,CACF"}
1
+ {"version":3,"file":"tryParseJson.cjs","names":[],"sources":["../../src/object/tryParseJson.ts"],"sourcesContent":["export type JsonParseResult = { ok: true; value: unknown } | { error: SyntaxError; ok: false };\n\nexport function tryParseJson(text: string): JsonParseResult {\n try {\n return { ok: true, value: JSON.parse(text) as unknown };\n } catch (error) {\n return { error: error as SyntaxError, ok: false };\n }\n}\n"],"mappings":"AAEA,SAAgB,aAAa,EAA+B,CAC1D,GAAI,CACF,MAAO,CAAE,GAAI,GAAM,MAAO,KAAK,MAAM,CAAI,CAAa,CACxD,OAAS,EAAO,CACd,MAAO,CAAS,QAAsB,GAAI,EAAM,CAClD,CACF"}
@@ -1,18 +1,2 @@
1
- //#region src/object/tryParseJson.ts
2
- function e(e) {
3
- try {
4
- return {
5
- ok: !0,
6
- value: JSON.parse(e)
7
- };
8
- } catch (e) {
9
- return {
10
- error: e,
11
- ok: !1
12
- };
13
- }
14
- }
15
- //#endregion
16
- export { e as tryParseJson };
17
-
1
+ function tryParseJson(e){try{return{ok:!0,value:JSON.parse(e)}}catch(e){return{error:e,ok:!1}}}export{tryParseJson};
18
2
  //# sourceMappingURL=tryParseJson.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tryParseJson.js","names":[],"sources":["../../src/object/tryParseJson.ts"],"sourcesContent":["export type JsonParseResult = { ok: true; value: unknown } | { error: SyntaxError; ok: false };\n\nexport function tryParseJson(text: string): JsonParseResult {\n try {\n return { ok: true, value: JSON.parse(text) as unknown };\n } catch (error) {\n return { error: error as SyntaxError, ok: false };\n }\n}\n"],"mappings":";AAEA,SAAgB,EAAa,GAA+B;CAC1D,IAAI;EACF,OAAO;GAAE,IAAI;GAAM,OAAO,KAAK,MAAM,CAAI;EAAa;CACxD,SAAS,GAAO;EACd,OAAO;GAAS;GAAsB,IAAI;EAAM;CAClD;AACF"}
1
+ {"version":3,"file":"tryParseJson.js","names":[],"sources":["../../src/object/tryParseJson.ts"],"sourcesContent":["export type JsonParseResult = { ok: true; value: unknown } | { error: SyntaxError; ok: false };\n\nexport function tryParseJson(text: string): JsonParseResult {\n try {\n return { ok: true, value: JSON.parse(text) as unknown };\n } catch (error) {\n return { error: error as SyntaxError, ok: false };\n }\n}\n"],"mappings":"AAEA,SAAgB,aAAa,EAA+B,CAC1D,GAAI,CACF,MAAO,CAAE,GAAI,GAAM,MAAO,KAAK,MAAM,CAAI,CAAa,CACxD,OAAS,EAAO,CACd,MAAO,CAAS,QAAsB,GAAI,EAAM,CAClD,CACF"}
@@ -1,2 +1,2 @@
1
- const e=require("./source.cjs");function t(t,n){return Math.floor(e.randomFloat(n)*t)}exports.randomIndex=t;
1
+ const e=require("./source.cjs");function randomIndex(t,n){return Math.floor(e.randomFloat(n)*t)}exports.randomIndex=randomIndex;
2
2
  //# sourceMappingURL=_index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"_index.cjs","names":[],"sources":["../../src/random/_index.ts"],"sourcesContent":["import { type RandomSource, randomFloat } from './source';\n\nexport function randomIndex(exclusiveMax: number, source?: RandomSource): number {\n return Math.floor(randomFloat(source) * exclusiveMax);\n}\n"],"mappings":"gCAEA,SAAgB,EAAY,EAAsB,EAA+B,CAC/E,OAAO,KAAK,MAAM,EAAA,YAAY,CAAM,EAAI,CAAY,CACtD"}
1
+ {"version":3,"file":"_index.cjs","names":[],"sources":["../../src/random/_index.ts"],"sourcesContent":["import { type RandomSource, randomFloat } from './source';\n\nexport function randomIndex(exclusiveMax: number, source?: RandomSource): number {\n return Math.floor(randomFloat(source) * exclusiveMax);\n}\n"],"mappings":"gCAEA,SAAgB,YAAY,EAAsB,EAA+B,CAC/E,OAAO,KAAK,MAAM,EAAA,YAAY,CAAM,EAAI,CAAY,CACtD"}
@@ -1,9 +1,2 @@
1
- import { randomFloat as e } from "./source.js";
2
- //#region src/random/_index.ts
3
- function t(t, n) {
4
- return Math.floor(e(n) * t);
5
- }
6
- //#endregion
7
- export { t as randomIndex };
8
-
1
+ import{randomFloat as e}from"./source.js";function randomIndex(t,n){return Math.floor(e(n)*t)}export{randomIndex};
9
2
  //# sourceMappingURL=_index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_index.js","names":[],"sources":["../../src/random/_index.ts"],"sourcesContent":["import { type RandomSource, randomFloat } from './source';\n\nexport function randomIndex(exclusiveMax: number, source?: RandomSource): number {\n return Math.floor(randomFloat(source) * exclusiveMax);\n}\n"],"mappings":";;AAEA,SAAgB,EAAY,GAAsB,GAA+B;CAC/E,OAAO,KAAK,MAAM,EAAY,CAAM,IAAI,CAAY;AACtD"}
1
+ {"version":3,"file":"_index.js","names":[],"sources":["../../src/random/_index.ts"],"sourcesContent":["import { type RandomSource, randomFloat } from './source';\n\nexport function randomIndex(exclusiveMax: number, source?: RandomSource): number {\n return Math.floor(randomFloat(source) * exclusiveMax);\n}\n"],"mappings":"0CAEA,SAAgB,YAAY,EAAsB,EAA+B,CAC/E,OAAO,KAAK,MAAM,EAAY,CAAM,EAAI,CAAY,CACtD"}
@@ -1,2 +1,2 @@
1
- const e=require("./_index.cjs"),t=require("./random.cjs");function n(e,n){if(e.length!==0)return e[t.random(0,e.length-1,n)]}function r(t,n,r){let i=Math.max(0,Math.min(t.length,Math.floor(n)));if(i===0)return[];if(i===t.length)return[...t];let a=[...t];for(let t=a.length-1;t>0;t--){let n=e.randomIndex(t+1,r),i=a[t];a[t]=a[n],a[n]=i}return a.slice(0,i)}exports.draw=n,exports.drawMany=r;
1
+ const e=require("./_index.cjs"),t=require("./random.cjs");function draw(e,n){if(e.length!==0)return e[t.random(0,e.length-1,n)]}function drawMany(t,n,r){let i=Math.max(0,Math.min(t.length,Math.floor(n)));if(i===0)return[];if(i===t.length)return[...t];let a=[...t];for(let t=a.length-1;t>0;t--){let n=e.randomIndex(t+1,r),i=a[t];a[t]=a[n],a[n]=i}return a.slice(0,i)}exports.draw=draw,exports.drawMany=drawMany;
2
2
  //# sourceMappingURL=draw.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"draw.cjs","names":[],"sources":["../../src/random/draw.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport { random } from './random';\nimport type { RandomSource } from './source';\n\n/**\n * Picks a single random item from an array.\n * Returns `undefined` if the array is empty.\n *\n * @example\n * ```ts\n * draw([1, 2, 3]); // e.g. 2\n * draw([]); // undefined\n * ```\n */\nexport function draw<T>(array: T[], source?: RandomSource): T | undefined {\n if (array.length === 0) return undefined;\n\n return array[random(0, array.length - 1, source)];\n}\n\n/**\n * Picks up to `n` unique random items from an array using a cryptographically\n * random shuffle (Fisher-Yates via `crypto.getRandomValues`).\n * Returns a new array; does not mutate the input.\n *\n * @example\n * ```ts\n * drawMany([1, 2, 3, 4, 5], 3); // e.g. [4, 1, 3]\n * drawMany([1, 2], 10); // [1, 2] (clamped to array length)\n * ```\n */\nexport function drawMany<T>(array: T[], n: number, source?: RandomSource): T[] {\n const count = Math.max(0, Math.min(array.length, Math.floor(n)));\n\n if (count === 0) return [];\n\n if (count === array.length) return [...array];\n\n const copy = [...array];\n\n for (let index = copy.length - 1; index > 0; index--) {\n const selectedIndex = randomIndex(index + 1, source);\n const temp = copy[index];\n\n copy[index] = copy[selectedIndex]!;\n copy[selectedIndex] = temp!;\n }\n\n return copy.slice(0, count);\n}\n"],"mappings":"0DAcA,SAAgB,EAAQ,EAAY,EAAsC,CACpE,KAAM,SAAW,EAErB,OAAO,EAAM,EAAA,OAAO,EAAG,EAAM,OAAS,EAAG,CAAM,EACjD,CAaA,SAAgB,EAAY,EAAY,EAAW,EAA4B,CAC7E,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,IAAI,EAAM,OAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,EAE/D,GAAI,IAAU,EAAG,MAAO,CAAC,EAEzB,GAAI,IAAU,EAAM,OAAQ,MAAO,CAAC,GAAG,CAAK,EAE5C,IAAM,EAAO,CAAC,GAAG,CAAK,EAEtB,IAAK,IAAI,EAAQ,EAAK,OAAS,EAAG,EAAQ,EAAG,IAAS,CACpD,IAAM,EAAgB,EAAA,YAAY,EAAQ,EAAG,CAAM,EAC7C,EAAO,EAAK,GAElB,EAAK,GAAS,EAAK,GACnB,EAAK,GAAiB,CACxB,CAEA,OAAO,EAAK,MAAM,EAAG,CAAK,CAC5B"}
1
+ {"version":3,"file":"draw.cjs","names":[],"sources":["../../src/random/draw.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport { random } from './random';\nimport type { RandomSource } from './source';\n\n/**\n * Picks a single random item from an array.\n * Returns `undefined` if the array is empty.\n *\n * @example\n * ```ts\n * draw([1, 2, 3]); // e.g. 2\n * draw([]); // undefined\n * ```\n */\nexport function draw<T>(array: T[], source?: RandomSource): T | undefined {\n if (array.length === 0) return undefined;\n\n return array[random(0, array.length - 1, source)];\n}\n\n/**\n * Picks up to `n` unique random items from an array using a cryptographically\n * random shuffle (Fisher-Yates via `crypto.getRandomValues`).\n * Returns a new array; does not mutate the input.\n *\n * @example\n * ```ts\n * drawMany([1, 2, 3, 4, 5], 3); // e.g. [4, 1, 3]\n * drawMany([1, 2], 10); // [1, 2] (clamped to array length)\n * ```\n */\nexport function drawMany<T>(array: T[], n: number, source?: RandomSource): T[] {\n const count = Math.max(0, Math.min(array.length, Math.floor(n)));\n\n if (count === 0) return [];\n\n if (count === array.length) return [...array];\n\n const copy = [...array];\n\n for (let index = copy.length - 1; index > 0; index--) {\n const selectedIndex = randomIndex(index + 1, source);\n const temp = copy[index];\n\n copy[index] = copy[selectedIndex]!;\n copy[selectedIndex] = temp!;\n }\n\n return copy.slice(0, count);\n}\n"],"mappings":"0DAcA,SAAgB,KAAQ,EAAY,EAAsC,CACpE,KAAM,SAAW,EAErB,OAAO,EAAM,EAAA,OAAO,EAAG,EAAM,OAAS,EAAG,CAAM,EACjD,CAaA,SAAgB,SAAY,EAAY,EAAW,EAA4B,CAC7E,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,IAAI,EAAM,OAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,EAE/D,GAAI,IAAU,EAAG,MAAO,CAAC,EAEzB,GAAI,IAAU,EAAM,OAAQ,MAAO,CAAC,GAAG,CAAK,EAE5C,IAAM,EAAO,CAAC,GAAG,CAAK,EAEtB,IAAK,IAAI,EAAQ,EAAK,OAAS,EAAG,EAAQ,EAAG,IAAS,CACpD,IAAM,EAAgB,EAAA,YAAY,EAAQ,EAAG,CAAM,EAC7C,EAAO,EAAK,GAElB,EAAK,GAAS,EAAK,GACnB,EAAK,GAAiB,CACxB,CAEA,OAAO,EAAK,MAAM,EAAG,CAAK,CAC5B"}
@@ -1,21 +1,2 @@
1
- import { randomIndex as e } from "./_index.js";
2
- import { random as t } from "./random.js";
3
- //#region src/random/draw.ts
4
- function n(e, n) {
5
- if (e.length !== 0) return e[t(0, e.length - 1, n)];
6
- }
7
- function r(t, n, r) {
8
- let i = Math.max(0, Math.min(t.length, Math.floor(n)));
9
- if (i === 0) return [];
10
- if (i === t.length) return [...t];
11
- let a = [...t];
12
- for (let t = a.length - 1; t > 0; t--) {
13
- let n = e(t + 1, r), i = a[t];
14
- a[t] = a[n], a[n] = i;
15
- }
16
- return a.slice(0, i);
17
- }
18
- //#endregion
19
- export { n as draw, r as drawMany };
20
-
1
+ import{randomIndex as e}from"./_index.js";import{random as t}from"./random.js";function draw(e,n){if(e.length!==0)return e[t(0,e.length-1,n)]}function drawMany(t,n,r){let i=Math.max(0,Math.min(t.length,Math.floor(n)));if(i===0)return[];if(i===t.length)return[...t];let a=[...t];for(let t=a.length-1;t>0;t--){let n=e(t+1,r),i=a[t];a[t]=a[n],a[n]=i}return a.slice(0,i)}export{draw,drawMany};
21
2
  //# sourceMappingURL=draw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"draw.js","names":[],"sources":["../../src/random/draw.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport { random } from './random';\nimport type { RandomSource } from './source';\n\n/**\n * Picks a single random item from an array.\n * Returns `undefined` if the array is empty.\n *\n * @example\n * ```ts\n * draw([1, 2, 3]); // e.g. 2\n * draw([]); // undefined\n * ```\n */\nexport function draw<T>(array: T[], source?: RandomSource): T | undefined {\n if (array.length === 0) return undefined;\n\n return array[random(0, array.length - 1, source)];\n}\n\n/**\n * Picks up to `n` unique random items from an array using a cryptographically\n * random shuffle (Fisher-Yates via `crypto.getRandomValues`).\n * Returns a new array; does not mutate the input.\n *\n * @example\n * ```ts\n * drawMany([1, 2, 3, 4, 5], 3); // e.g. [4, 1, 3]\n * drawMany([1, 2], 10); // [1, 2] (clamped to array length)\n * ```\n */\nexport function drawMany<T>(array: T[], n: number, source?: RandomSource): T[] {\n const count = Math.max(0, Math.min(array.length, Math.floor(n)));\n\n if (count === 0) return [];\n\n if (count === array.length) return [...array];\n\n const copy = [...array];\n\n for (let index = copy.length - 1; index > 0; index--) {\n const selectedIndex = randomIndex(index + 1, source);\n const temp = copy[index];\n\n copy[index] = copy[selectedIndex]!;\n copy[selectedIndex] = temp!;\n }\n\n return copy.slice(0, count);\n}\n"],"mappings":";;;AAcA,SAAgB,EAAQ,GAAY,GAAsC;CACpE,MAAM,WAAW,GAErB,OAAO,EAAM,EAAO,GAAG,EAAM,SAAS,GAAG,CAAM;AACjD;AAaA,SAAgB,EAAY,GAAY,GAAW,GAA4B;CAC7E,IAAM,IAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,EAAM,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC;CAE/D,IAAI,MAAU,GAAG,OAAO,CAAC;CAEzB,IAAI,MAAU,EAAM,QAAQ,OAAO,CAAC,GAAG,CAAK;CAE5C,IAAM,IAAO,CAAC,GAAG,CAAK;CAEtB,KAAK,IAAI,IAAQ,EAAK,SAAS,GAAG,IAAQ,GAAG,KAAS;EACpD,IAAM,IAAgB,EAAY,IAAQ,GAAG,CAAM,GAC7C,IAAO,EAAK;EAGlB,AADA,EAAK,KAAS,EAAK,IACnB,EAAK,KAAiB;CACxB;CAEA,OAAO,EAAK,MAAM,GAAG,CAAK;AAC5B"}
1
+ {"version":3,"file":"draw.js","names":[],"sources":["../../src/random/draw.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport { random } from './random';\nimport type { RandomSource } from './source';\n\n/**\n * Picks a single random item from an array.\n * Returns `undefined` if the array is empty.\n *\n * @example\n * ```ts\n * draw([1, 2, 3]); // e.g. 2\n * draw([]); // undefined\n * ```\n */\nexport function draw<T>(array: T[], source?: RandomSource): T | undefined {\n if (array.length === 0) return undefined;\n\n return array[random(0, array.length - 1, source)];\n}\n\n/**\n * Picks up to `n` unique random items from an array using a cryptographically\n * random shuffle (Fisher-Yates via `crypto.getRandomValues`).\n * Returns a new array; does not mutate the input.\n *\n * @example\n * ```ts\n * drawMany([1, 2, 3, 4, 5], 3); // e.g. [4, 1, 3]\n * drawMany([1, 2], 10); // [1, 2] (clamped to array length)\n * ```\n */\nexport function drawMany<T>(array: T[], n: number, source?: RandomSource): T[] {\n const count = Math.max(0, Math.min(array.length, Math.floor(n)));\n\n if (count === 0) return [];\n\n if (count === array.length) return [...array];\n\n const copy = [...array];\n\n for (let index = copy.length - 1; index > 0; index--) {\n const selectedIndex = randomIndex(index + 1, source);\n const temp = copy[index];\n\n copy[index] = copy[selectedIndex]!;\n copy[selectedIndex] = temp!;\n }\n\n return copy.slice(0, count);\n}\n"],"mappings":"+EAcA,SAAgB,KAAQ,EAAY,EAAsC,CACpE,KAAM,SAAW,EAErB,OAAO,EAAM,EAAO,EAAG,EAAM,OAAS,EAAG,CAAM,EACjD,CAaA,SAAgB,SAAY,EAAY,EAAW,EAA4B,CAC7E,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,IAAI,EAAM,OAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,EAE/D,GAAI,IAAU,EAAG,MAAO,CAAC,EAEzB,GAAI,IAAU,EAAM,OAAQ,MAAO,CAAC,GAAG,CAAK,EAE5C,IAAM,EAAO,CAAC,GAAG,CAAK,EAEtB,IAAK,IAAI,EAAQ,EAAK,OAAS,EAAG,EAAQ,EAAG,IAAS,CACpD,IAAM,EAAgB,EAAY,EAAQ,EAAG,CAAM,EAC7C,EAAO,EAAK,GAElB,EAAK,GAAS,EAAK,GACnB,EAAK,GAAiB,CACxB,CAEA,OAAO,EAAK,MAAM,EAAG,CAAK,CAC5B"}
@@ -1,5 +1 @@
1
- import { randomFloat as e } from "./source.js";
2
- import { random as t } from "./random.js";
3
- import { draw as n, drawMany as r } from "./draw.js";
4
- import { shuffle as i } from "./shuffle.js";
5
- export { n as draw, r as drawMany, t as random, e as randomFloat, i as shuffle };
1
+ import{randomFloat as e}from"./source.js";import{random as t}from"./random.js";import{draw as n,drawMany as r}from"./draw.js";import{shuffle as i}from"./shuffle.js";export{n as draw,r as drawMany,t as random,e as randomFloat,i as shuffle};
@@ -1,2 +1,2 @@
1
- const e=require("./_index.cjs");function t(t,n,r){if(t>n)throw RangeError(`random: minimum value must not be greater than maximum value`);return e.randomIndex(n-t+1,r)+t}exports.random=t;
1
+ const e=require("./_index.cjs");function random(t,n,r){if(t>n)throw RangeError(`random: minimum value must not be greater than maximum value`);return e.randomIndex(n-t+1,r)+t}exports.random=random;
2
2
  //# sourceMappingURL=random.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"random.cjs","names":[],"sources":["../../src/random/random.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport type { RandomSource } from './source';\n\n/**\n * Generates a random integer between two values, inclusive.\n *\n * @example\n * ```ts\n * random(1, 10); // a random integer between 1 and 10\n * ```\n *\n * @param min - The minimum value.\n * @param max - The maximum value.\n * @returns A random integer between min and max.\n */\nexport function random(min: number, max: number, source?: RandomSource): number {\n if (min > max) throw new RangeError('random: minimum value must not be greater than maximum value');\n\n return randomIndex(max - min + 1, source) + min;\n}\n"],"mappings":"gCAeA,SAAgB,EAAO,EAAa,EAAa,EAA+B,CAC9E,GAAI,EAAM,EAAK,MAAU,WAAW,8DAA8D,EAElG,OAAO,EAAA,YAAY,EAAM,EAAM,EAAG,CAAM,EAAI,CAC9C"}
1
+ {"version":3,"file":"random.cjs","names":[],"sources":["../../src/random/random.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport type { RandomSource } from './source';\n\n/**\n * Generates a random integer between two values, inclusive.\n *\n * @example\n * ```ts\n * random(1, 10); // a random integer between 1 and 10\n * ```\n *\n * @param min - The minimum value.\n * @param max - The maximum value.\n * @returns A random integer between min and max.\n */\nexport function random(min: number, max: number, source?: RandomSource): number {\n if (min > max) throw new RangeError('random: minimum value must not be greater than maximum value');\n\n return randomIndex(max - min + 1, source) + min;\n}\n"],"mappings":"gCAeA,SAAgB,OAAO,EAAa,EAAa,EAA+B,CAC9E,GAAI,EAAM,EAAK,MAAU,WAAW,8DAA8D,EAElG,OAAO,EAAA,YAAY,EAAM,EAAM,EAAG,CAAM,EAAI,CAC9C"}
@@ -1,10 +1,2 @@
1
- import { randomIndex as e } from "./_index.js";
2
- //#region src/random/random.ts
3
- function t(t, n, r) {
4
- if (t > n) throw RangeError("random: minimum value must not be greater than maximum value");
5
- return e(n - t + 1, r) + t;
6
- }
7
- //#endregion
8
- export { t as random };
9
-
1
+ import{randomIndex as e}from"./_index.js";function random(t,n,r){if(t>n)throw RangeError(`random: minimum value must not be greater than maximum value`);return e(n-t+1,r)+t}export{random};
10
2
  //# sourceMappingURL=random.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"random.js","names":[],"sources":["../../src/random/random.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport type { RandomSource } from './source';\n\n/**\n * Generates a random integer between two values, inclusive.\n *\n * @example\n * ```ts\n * random(1, 10); // a random integer between 1 and 10\n * ```\n *\n * @param min - The minimum value.\n * @param max - The maximum value.\n * @returns A random integer between min and max.\n */\nexport function random(min: number, max: number, source?: RandomSource): number {\n if (min > max) throw new RangeError('random: minimum value must not be greater than maximum value');\n\n return randomIndex(max - min + 1, source) + min;\n}\n"],"mappings":";;AAeA,SAAgB,EAAO,GAAa,GAAa,GAA+B;CAC9E,IAAI,IAAM,GAAK,MAAU,WAAW,8DAA8D;CAElG,OAAO,EAAY,IAAM,IAAM,GAAG,CAAM,IAAI;AAC9C"}
1
+ {"version":3,"file":"random.js","names":[],"sources":["../../src/random/random.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport type { RandomSource } from './source';\n\n/**\n * Generates a random integer between two values, inclusive.\n *\n * @example\n * ```ts\n * random(1, 10); // a random integer between 1 and 10\n * ```\n *\n * @param min - The minimum value.\n * @param max - The maximum value.\n * @returns A random integer between min and max.\n */\nexport function random(min: number, max: number, source?: RandomSource): number {\n if (min > max) throw new RangeError('random: minimum value must not be greater than maximum value');\n\n return randomIndex(max - min + 1, source) + min;\n}\n"],"mappings":"0CAeA,SAAgB,OAAO,EAAa,EAAa,EAA+B,CAC9E,GAAI,EAAM,EAAK,MAAU,WAAW,8DAA8D,EAElG,OAAO,EAAY,EAAM,EAAM,EAAG,CAAM,EAAI,CAC9C"}
@@ -1,2 +1,2 @@
1
- const e=require("./_index.cjs");function t(t,n){let r=[...t];for(let t=r.length-1;t>0;t--){let i=e.randomIndex(t+1,n);[r[t],r[i]]=[r[i],r[t]]}return r}exports.shuffle=t;
1
+ const e=require("./_index.cjs");function shuffle(t,n){let r=[...t];for(let t=r.length-1;t>0;t--){let i=e.randomIndex(t+1,n);[r[t],r[i]]=[r[i],r[t]]}return r}exports.shuffle=shuffle;
2
2
  //# sourceMappingURL=shuffle.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"shuffle.cjs","names":[],"sources":["../../src/random/shuffle.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport type { RandomSource } from './source';\n\n/**\n * Returns a new randomly-shuffled copy of the array using Fisher-Yates\n * with `crypto.getRandomValues`. Does not mutate the input.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, 4];\n * shuffle(arr); // e.g. [3, 1, 4, 2]\n * ```\n */\nexport function shuffle<T>(array: T[], source?: RandomSource): T[] {\n const result = [...array];\n\n for (let i = result.length - 1; i > 0; i--) {\n const j = randomIndex(i + 1, source);\n\n [result[i], result[j]] = [result[j], result[i]];\n }\n\n return result;\n}\n"],"mappings":"gCAaA,SAAgB,EAAW,EAAY,EAA4B,CACjE,IAAM,EAAS,CAAC,GAAG,CAAK,EAExB,IAAK,IAAI,EAAI,EAAO,OAAS,EAAG,EAAI,EAAG,IAAK,CAC1C,IAAM,EAAI,EAAA,YAAY,EAAI,EAAG,CAAM,EAEnC,CAAC,EAAO,GAAI,EAAO,IAAM,CAAC,EAAO,GAAI,EAAO,EAAE,CAChD,CAEA,OAAO,CACT"}
1
+ {"version":3,"file":"shuffle.cjs","names":[],"sources":["../../src/random/shuffle.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport type { RandomSource } from './source';\n\n/**\n * Returns a new randomly-shuffled copy of the array using Fisher-Yates\n * with `crypto.getRandomValues`. Does not mutate the input.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, 4];\n * shuffle(arr); // e.g. [3, 1, 4, 2]\n * ```\n */\nexport function shuffle<T>(array: T[], source?: RandomSource): T[] {\n const result = [...array];\n\n for (let i = result.length - 1; i > 0; i--) {\n const j = randomIndex(i + 1, source);\n\n [result[i], result[j]] = [result[j], result[i]];\n }\n\n return result;\n}\n"],"mappings":"gCAaA,SAAgB,QAAW,EAAY,EAA4B,CACjE,IAAM,EAAS,CAAC,GAAG,CAAK,EAExB,IAAK,IAAI,EAAI,EAAO,OAAS,EAAG,EAAI,EAAG,IAAK,CAC1C,IAAM,EAAI,EAAA,YAAY,EAAI,EAAG,CAAM,EAEnC,CAAC,EAAO,GAAI,EAAO,IAAM,CAAC,EAAO,GAAI,EAAO,EAAE,CAChD,CAEA,OAAO,CACT"}
@@ -1,14 +1,2 @@
1
- import { randomIndex as e } from "./_index.js";
2
- //#region src/random/shuffle.ts
3
- function t(t, n) {
4
- let r = [...t];
5
- for (let t = r.length - 1; t > 0; t--) {
6
- let i = e(t + 1, n);
7
- [r[t], r[i]] = [r[i], r[t]];
8
- }
9
- return r;
10
- }
11
- //#endregion
12
- export { t as shuffle };
13
-
1
+ import{randomIndex as e}from"./_index.js";function shuffle(t,n){let r=[...t];for(let t=r.length-1;t>0;t--){let i=e(t+1,n);[r[t],r[i]]=[r[i],r[t]]}return r}export{shuffle};
14
2
  //# sourceMappingURL=shuffle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shuffle.js","names":[],"sources":["../../src/random/shuffle.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport type { RandomSource } from './source';\n\n/**\n * Returns a new randomly-shuffled copy of the array using Fisher-Yates\n * with `crypto.getRandomValues`. Does not mutate the input.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, 4];\n * shuffle(arr); // e.g. [3, 1, 4, 2]\n * ```\n */\nexport function shuffle<T>(array: T[], source?: RandomSource): T[] {\n const result = [...array];\n\n for (let i = result.length - 1; i > 0; i--) {\n const j = randomIndex(i + 1, source);\n\n [result[i], result[j]] = [result[j], result[i]];\n }\n\n return result;\n}\n"],"mappings":";;AAaA,SAAgB,EAAW,GAAY,GAA4B;CACjE,IAAM,IAAS,CAAC,GAAG,CAAK;CAExB,KAAK,IAAI,IAAI,EAAO,SAAS,GAAG,IAAI,GAAG,KAAK;EAC1C,IAAM,IAAI,EAAY,IAAI,GAAG,CAAM;EAEnC,CAAC,EAAO,IAAI,EAAO,MAAM,CAAC,EAAO,IAAI,EAAO,EAAE;CAChD;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"shuffle.js","names":[],"sources":["../../src/random/shuffle.ts"],"sourcesContent":["import { randomIndex } from './_index';\nimport type { RandomSource } from './source';\n\n/**\n * Returns a new randomly-shuffled copy of the array using Fisher-Yates\n * with `crypto.getRandomValues`. Does not mutate the input.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, 4];\n * shuffle(arr); // e.g. [3, 1, 4, 2]\n * ```\n */\nexport function shuffle<T>(array: T[], source?: RandomSource): T[] {\n const result = [...array];\n\n for (let i = result.length - 1; i > 0; i--) {\n const j = randomIndex(i + 1, source);\n\n [result[i], result[j]] = [result[j], result[i]];\n }\n\n return result;\n}\n"],"mappings":"0CAaA,SAAgB,QAAW,EAAY,EAA4B,CACjE,IAAM,EAAS,CAAC,GAAG,CAAK,EAExB,IAAK,IAAI,EAAI,EAAO,OAAS,EAAG,EAAI,EAAG,IAAK,CAC1C,IAAM,EAAI,EAAY,EAAI,EAAG,CAAM,EAEnC,CAAC,EAAO,GAAI,EAAO,IAAM,CAAC,EAAO,GAAI,EAAO,EAAE,CAChD,CAEA,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- function e(e){let t=e?.next()??crypto.getRandomValues(new Uint32Array(1))[0]/4294967296;if(!Number.isFinite(t)||t<0||t>=1)throw RangeError(`random source must return a finite number in [0, 1)`);return t}exports.randomFloat=e;
1
+ function randomFloat(e){let t=e?.next()??crypto.getRandomValues(new Uint32Array(1))[0]/4294967296;if(!Number.isFinite(t)||t<0||t>=1)throw RangeError(`random source must return a finite number in [0, 1)`);return t}exports.randomFloat=randomFloat;
2
2
  //# sourceMappingURL=source.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"source.cjs","names":[],"sources":["../../src/random/source.ts"],"sourcesContent":["export type RandomSource = {\n next(): number;\n};\n\n/** Returns a validated random float in `[0, 1)`. */\nexport function randomFloat(source?: RandomSource): number {\n const value = source?.next() ?? crypto.getRandomValues(new Uint32Array(1))[0]! / 0x100000000;\n\n if (!Number.isFinite(value) || value < 0 || value >= 1) {\n throw new RangeError('random source must return a finite number in [0, 1)');\n }\n\n return value;\n}\n"],"mappings":"AAKA,SAAgB,EAAY,EAA+B,CACzD,IAAM,EAAQ,GAAQ,KAAK,GAAK,OAAO,gBAAgB,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,GAAM,WAEjF,GAAI,CAAC,OAAO,SAAS,CAAK,GAAK,EAAQ,GAAK,GAAS,EACnD,MAAU,WAAW,qDAAqD,EAG5E,OAAO,CACT"}
1
+ {"version":3,"file":"source.cjs","names":[],"sources":["../../src/random/source.ts"],"sourcesContent":["export type RandomSource = {\n next(): number;\n};\n\n/** Returns a validated random float in `[0, 1)`. */\nexport function randomFloat(source?: RandomSource): number {\n const value = source?.next() ?? crypto.getRandomValues(new Uint32Array(1))[0]! / 0x100000000;\n\n if (!Number.isFinite(value) || value < 0 || value >= 1) {\n throw new RangeError('random source must return a finite number in [0, 1)');\n }\n\n return value;\n}\n"],"mappings":"AAKA,SAAgB,YAAY,EAA+B,CACzD,IAAM,EAAQ,GAAQ,KAAK,GAAK,OAAO,gBAAgB,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,GAAM,WAEjF,GAAI,CAAC,OAAO,SAAS,CAAK,GAAK,EAAQ,GAAK,GAAS,EACnD,MAAU,WAAW,qDAAqD,EAG5E,OAAO,CACT"}
@@ -1,10 +1,2 @@
1
- //#region src/random/source.ts
2
- function e(e) {
3
- let t = e?.next() ?? crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0] / 4294967296;
4
- if (!Number.isFinite(t) || t < 0 || t >= 1) throw RangeError("random source must return a finite number in [0, 1)");
5
- return t;
6
- }
7
- //#endregion
8
- export { e as randomFloat };
9
-
1
+ function randomFloat(e){let t=e?.next()??crypto.getRandomValues(new Uint32Array(1))[0]/4294967296;if(!Number.isFinite(t)||t<0||t>=1)throw RangeError(`random source must return a finite number in [0, 1)`);return t}export{randomFloat};
10
2
  //# sourceMappingURL=source.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","names":[],"sources":["../../src/random/source.ts"],"sourcesContent":["export type RandomSource = {\n next(): number;\n};\n\n/** Returns a validated random float in `[0, 1)`. */\nexport function randomFloat(source?: RandomSource): number {\n const value = source?.next() ?? crypto.getRandomValues(new Uint32Array(1))[0]! / 0x100000000;\n\n if (!Number.isFinite(value) || value < 0 || value >= 1) {\n throw new RangeError('random source must return a finite number in [0, 1)');\n }\n\n return value;\n}\n"],"mappings":";AAKA,SAAgB,EAAY,GAA+B;CACzD,IAAM,IAAQ,GAAQ,KAAK,KAAK,OAAO,gCAAgB,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,KAAM;CAEjF,IAAI,CAAC,OAAO,SAAS,CAAK,KAAK,IAAQ,KAAK,KAAS,GACnD,MAAU,WAAW,qDAAqD;CAG5E,OAAO;AACT"}
1
+ {"version":3,"file":"source.js","names":[],"sources":["../../src/random/source.ts"],"sourcesContent":["export type RandomSource = {\n next(): number;\n};\n\n/** Returns a validated random float in `[0, 1)`. */\nexport function randomFloat(source?: RandomSource): number {\n const value = source?.next() ?? crypto.getRandomValues(new Uint32Array(1))[0]! / 0x100000000;\n\n if (!Number.isFinite(value) || value < 0 || value >= 1) {\n throw new RangeError('random source must return a finite number in [0, 1)');\n }\n\n return value;\n}\n"],"mappings":"AAKA,SAAgB,YAAY,EAA+B,CACzD,IAAM,EAAQ,GAAQ,KAAK,GAAK,OAAO,gBAAgB,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,GAAM,WAEjF,GAAI,CAAC,OAAO,SAAS,CAAK,GAAK,EAAQ,GAAK,GAAS,EACnD,MAAU,WAAW,qDAAqD,EAG5E,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- var e=/(\p{Ll})(\p{Lu}|\p{N})|(\p{Lu}|\p{N})(\p{Lu}\p{Ll})|(\p{N})(\p{L})/gu;function t(e){return e.replace(/[.*+?^${}()|[\]\\/-]/g,`\\$&`)}function n(n,r=` `){let i=t(r);return n.trim().replace(e,`$1$3$5${r}$2$4$6`).replace(/[^\p{L}\p{N}]+/gu,r).replace(RegExp(`^(?:${i})+|(?:${i})+$`,`g`),``)}exports.normalizeCase=n;
1
+ var e=/(\p{Ll})(\p{Lu}|\p{N})|(\p{Lu}|\p{N})(\p{Lu}\p{Ll})|(\p{N})(\p{L})/gu;function escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\/-]/g,`\\$&`)}function normalizeCase(t,n=` `){let r=escapeRegex(n);return t.trim().replace(e,`$1$3$5${n}$2$4$6`).replace(/[^\p{L}\p{N}]+/gu,n).replace(RegExp(`^(?:${r})+|(?:${r})+$`,`g`),``)}exports.normalizeCase=normalizeCase;
2
2
  //# sourceMappingURL=_caseUtils.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"_caseUtils.cjs","names":[],"sources":["../../src/string/_caseUtils.ts"],"sourcesContent":["/**\n * Shared regex pattern for splitting words in case conversion utilities.\n * Module-private (underscore-prefixed file is not barrel-exported).\n * Used only with String.prototype.replace — which always resets lastIndex.\n * Uses Unicode property escapes (`\\p{Ll}`/`\\p{Lu}`/`\\p{N}`) instead of `[a-z]`/`[A-Z]` so\n * accented and non-Latin letters (e.g. `café`, `日本語`) are treated as letters, not stripped.\n */\nconst CASE_SPLIT_PATTERN = /(\\p{Ll})(\\p{Lu}|\\p{N})|(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})|(\\p{N})(\\p{L})/gu;\n\n/** Escapes all regex metacharacters in a string (per MDN spec). */\nfunction escapeRegex(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\/-]/g, '\\\\$&');\n}\n\n/**\n * Normalizes a string by splitting on word boundaries and removing special characters\n *\n * @param str - The string to normalize\n * @param separator - The separator to use for splitting (default: space)\n * @returns The normalized string\n */\nexport function normalizeCase(str: string, separator = ' '): string {\n const escapedSep = escapeRegex(separator);\n\n return str\n .trim()\n .replace(CASE_SPLIT_PATTERN, `$1$3$5${separator}$2$4$6`)\n .replace(/[^\\p{L}\\p{N}]+/gu, separator)\n .replace(new RegExp(`^(?:${escapedSep})+|(?:${escapedSep})+$`, 'g'), '');\n}\n"],"mappings":"AAOA,IAAM,EAAqB,uEAG3B,SAAS,EAAY,EAAqB,CACxC,OAAO,EAAI,QAAQ,wBAAyB,MAAM,CACpD,CASA,SAAgB,EAAc,EAAa,EAAY,IAAa,CAClE,IAAM,EAAa,EAAY,CAAS,EAExC,OAAO,EACJ,KAAK,CAAC,CACN,QAAQ,EAAoB,SAAS,EAAU,OAAO,CAAC,CACvD,QAAQ,mBAAoB,CAAS,CAAC,CACtC,QAAY,OAAO,OAAO,EAAW,QAAQ,EAAW,KAAM,GAAG,EAAG,EAAE,CAC3E"}
1
+ {"version":3,"file":"_caseUtils.cjs","names":[],"sources":["../../src/string/_caseUtils.ts"],"sourcesContent":["/**\n * Shared regex pattern for splitting words in case conversion utilities.\n * Module-private (underscore-prefixed file is not barrel-exported).\n * Used only with String.prototype.replace — which always resets lastIndex.\n * Uses Unicode property escapes (`\\p{Ll}`/`\\p{Lu}`/`\\p{N}`) instead of `[a-z]`/`[A-Z]` so\n * accented and non-Latin letters (e.g. `café`, `日本語`) are treated as letters, not stripped.\n */\nconst CASE_SPLIT_PATTERN = /(\\p{Ll})(\\p{Lu}|\\p{N})|(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})|(\\p{N})(\\p{L})/gu;\n\n/** Escapes all regex metacharacters in a string (per MDN spec). */\nfunction escapeRegex(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\/-]/g, '\\\\$&');\n}\n\n/**\n * Normalizes a string by splitting on word boundaries and removing special characters\n *\n * @param str - The string to normalize\n * @param separator - The separator to use for splitting (default: space)\n * @returns The normalized string\n */\nexport function normalizeCase(str: string, separator = ' '): string {\n const escapedSep = escapeRegex(separator);\n\n return str\n .trim()\n .replace(CASE_SPLIT_PATTERN, `$1$3$5${separator}$2$4$6`)\n .replace(/[^\\p{L}\\p{N}]+/gu, separator)\n .replace(new RegExp(`^(?:${escapedSep})+|(?:${escapedSep})+$`, 'g'), '');\n}\n"],"mappings":"AAOA,IAAM,EAAqB,uEAG3B,SAAS,YAAY,EAAqB,CACxC,OAAO,EAAI,QAAQ,wBAAyB,MAAM,CACpD,CASA,SAAgB,cAAc,EAAa,EAAY,IAAa,CAClE,IAAM,EAAa,YAAY,CAAS,EAExC,OAAO,EACJ,KAAK,CAAC,CACN,QAAQ,EAAoB,SAAS,EAAU,OAAO,CAAC,CACvD,QAAQ,mBAAoB,CAAS,CAAC,CACtC,QAAY,OAAO,OAAO,EAAW,QAAQ,EAAW,KAAM,GAAG,EAAG,EAAE,CAC3E"}
@@ -1,13 +1,2 @@
1
- //#region src/string/_caseUtils.ts
2
- var e = /(\p{Ll})(\p{Lu}|\p{N})|(\p{Lu}|\p{N})(\p{Lu}\p{Ll})|(\p{N})(\p{L})/gu;
3
- function t(e) {
4
- return e.replace(/[.*+?^${}()|[\]\\/-]/g, "\\$&");
5
- }
6
- function n(n, r = " ") {
7
- let i = t(r);
8
- return n.trim().replace(e, `$1$3$5${r}$2$4$6`).replace(/[^\p{L}\p{N}]+/gu, r).replace(RegExp(`^(?:${i})+|(?:${i})+$`, "g"), "");
9
- }
10
- //#endregion
11
- export { n as normalizeCase };
12
-
1
+ var e=/(\p{Ll})(\p{Lu}|\p{N})|(\p{Lu}|\p{N})(\p{Lu}\p{Ll})|(\p{N})(\p{L})/gu;function escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\/-]/g,`\\$&`)}function normalizeCase(t,n=` `){let r=escapeRegex(n);return t.trim().replace(e,`$1$3$5${n}$2$4$6`).replace(/[^\p{L}\p{N}]+/gu,n).replace(RegExp(`^(?:${r})+|(?:${r})+$`,`g`),``)}export{normalizeCase};
13
2
  //# sourceMappingURL=_caseUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_caseUtils.js","names":[],"sources":["../../src/string/_caseUtils.ts"],"sourcesContent":["/**\n * Shared regex pattern for splitting words in case conversion utilities.\n * Module-private (underscore-prefixed file is not barrel-exported).\n * Used only with String.prototype.replace — which always resets lastIndex.\n * Uses Unicode property escapes (`\\p{Ll}`/`\\p{Lu}`/`\\p{N}`) instead of `[a-z]`/`[A-Z]` so\n * accented and non-Latin letters (e.g. `café`, `日本語`) are treated as letters, not stripped.\n */\nconst CASE_SPLIT_PATTERN = /(\\p{Ll})(\\p{Lu}|\\p{N})|(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})|(\\p{N})(\\p{L})/gu;\n\n/** Escapes all regex metacharacters in a string (per MDN spec). */\nfunction escapeRegex(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\/-]/g, '\\\\$&');\n}\n\n/**\n * Normalizes a string by splitting on word boundaries and removing special characters\n *\n * @param str - The string to normalize\n * @param separator - The separator to use for splitting (default: space)\n * @returns The normalized string\n */\nexport function normalizeCase(str: string, separator = ' '): string {\n const escapedSep = escapeRegex(separator);\n\n return str\n .trim()\n .replace(CASE_SPLIT_PATTERN, `$1$3$5${separator}$2$4$6`)\n .replace(/[^\\p{L}\\p{N}]+/gu, separator)\n .replace(new RegExp(`^(?:${escapedSep})+|(?:${escapedSep})+$`, 'g'), '');\n}\n"],"mappings":";AAOA,IAAM,IAAqB;AAG3B,SAAS,EAAY,GAAqB;CACxC,OAAO,EAAI,QAAQ,yBAAyB,MAAM;AACpD;AASA,SAAgB,EAAc,GAAa,IAAY,KAAa;CAClE,IAAM,IAAa,EAAY,CAAS;CAExC,OAAO,EACJ,KAAK,CAAC,CACN,QAAQ,GAAoB,SAAS,EAAU,OAAO,CAAC,CACvD,QAAQ,oBAAoB,CAAS,CAAC,CACtC,QAAY,OAAO,OAAO,EAAW,QAAQ,EAAW,MAAM,GAAG,GAAG,EAAE;AAC3E"}
1
+ {"version":3,"file":"_caseUtils.js","names":[],"sources":["../../src/string/_caseUtils.ts"],"sourcesContent":["/**\n * Shared regex pattern for splitting words in case conversion utilities.\n * Module-private (underscore-prefixed file is not barrel-exported).\n * Used only with String.prototype.replace — which always resets lastIndex.\n * Uses Unicode property escapes (`\\p{Ll}`/`\\p{Lu}`/`\\p{N}`) instead of `[a-z]`/`[A-Z]` so\n * accented and non-Latin letters (e.g. `café`, `日本語`) are treated as letters, not stripped.\n */\nconst CASE_SPLIT_PATTERN = /(\\p{Ll})(\\p{Lu}|\\p{N})|(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})|(\\p{N})(\\p{L})/gu;\n\n/** Escapes all regex metacharacters in a string (per MDN spec). */\nfunction escapeRegex(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\/-]/g, '\\\\$&');\n}\n\n/**\n * Normalizes a string by splitting on word boundaries and removing special characters\n *\n * @param str - The string to normalize\n * @param separator - The separator to use for splitting (default: space)\n * @returns The normalized string\n */\nexport function normalizeCase(str: string, separator = ' '): string {\n const escapedSep = escapeRegex(separator);\n\n return str\n .trim()\n .replace(CASE_SPLIT_PATTERN, `$1$3$5${separator}$2$4$6`)\n .replace(/[^\\p{L}\\p{N}]+/gu, separator)\n .replace(new RegExp(`^(?:${escapedSep})+|(?:${escapedSep})+$`, 'g'), '');\n}\n"],"mappings":"AAOA,IAAM,EAAqB,uEAG3B,SAAS,YAAY,EAAqB,CACxC,OAAO,EAAI,QAAQ,wBAAyB,MAAM,CACpD,CASA,SAAgB,cAAc,EAAa,EAAY,IAAa,CAClE,IAAM,EAAa,YAAY,CAAS,EAExC,OAAO,EACJ,KAAK,CAAC,CACN,QAAQ,EAAoB,SAAS,EAAU,OAAO,CAAC,CACvD,QAAQ,mBAAoB,CAAS,CAAC,CACtC,QAAY,OAAO,OAAO,EAAW,QAAQ,EAAW,KAAM,GAAG,EAAG,EAAE,CAC3E"}
@@ -1,2 +1,2 @@
1
- const e=require("./_caseUtils.cjs");function t(t){return e.normalizeCase(t,` `).replace(/[^\p{L}\p{N}]+(.)/gu,(e,t)=>t.toUpperCase()).replace(/^./,e=>e.toLowerCase())}exports.camelCase=t;
1
+ const e=require("./_caseUtils.cjs");function camelCase(t){return e.normalizeCase(t,` `).replace(/[^\p{L}\p{N}]+(.)/gu,(e,t)=>t.toUpperCase()).replace(/^./,e=>e.toLowerCase())}exports.camelCase=camelCase;
2
2
  //# sourceMappingURL=camelCase.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"camelCase.cjs","names":[],"sources":["../../src/string/camelCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to camel case.\n *\n * @example\n * ```ts\n * const text = 'hello world';\n * camelCase(text); // 'helloWorld'\n * ```\n *\n * @param str - The string to convert.\n * @returns The converted string.\n */\nexport function camelCase(str: string): string {\n return normalizeCase(str, ' ')\n .replace(/[^\\p{L}\\p{N}]+(.)/gu, (_, char) => char.toUpperCase())\n .replace(/^./, (char) => char.toLowerCase());\n}\n"],"mappings":"oCAcA,SAAgB,EAAU,EAAqB,CAC7C,OAAO,EAAA,cAAc,EAAK,GAAG,CAAC,CAC3B,QAAQ,uBAAwB,EAAG,IAAS,EAAK,YAAY,CAAC,CAAC,CAC/D,QAAQ,KAAO,GAAS,EAAK,YAAY,CAAC,CAC/C"}
1
+ {"version":3,"file":"camelCase.cjs","names":[],"sources":["../../src/string/camelCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to camel case.\n *\n * @example\n * ```ts\n * const text = 'hello world';\n * camelCase(text); // 'helloWorld'\n * ```\n *\n * @param str - The string to convert.\n * @returns The converted string.\n */\nexport function camelCase(str: string): string {\n return normalizeCase(str, ' ')\n .replace(/[^\\p{L}\\p{N}]+(.)/gu, (_, char) => char.toUpperCase())\n .replace(/^./, (char) => char.toLowerCase());\n}\n"],"mappings":"oCAcA,SAAgB,UAAU,EAAqB,CAC7C,OAAO,EAAA,cAAc,EAAK,GAAG,CAAC,CAC3B,QAAQ,uBAAwB,EAAG,IAAS,EAAK,YAAY,CAAC,CAAC,CAC/D,QAAQ,KAAO,GAAS,EAAK,YAAY,CAAC,CAC/C"}
@@ -1,9 +1,2 @@
1
- import { normalizeCase as e } from "./_caseUtils.js";
2
- //#region src/string/camelCase.ts
3
- function t(t) {
4
- return e(t, " ").replace(/[^\p{L}\p{N}]+(.)/gu, (e, t) => t.toUpperCase()).replace(/^./, (e) => e.toLowerCase());
5
- }
6
- //#endregion
7
- export { t as camelCase };
8
-
1
+ import{normalizeCase as e}from"./_caseUtils.js";function camelCase(t){return e(t,` `).replace(/[^\p{L}\p{N}]+(.)/gu,(e,t)=>t.toUpperCase()).replace(/^./,e=>e.toLowerCase())}export{camelCase};
9
2
  //# sourceMappingURL=camelCase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"camelCase.js","names":[],"sources":["../../src/string/camelCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to camel case.\n *\n * @example\n * ```ts\n * const text = 'hello world';\n * camelCase(text); // 'helloWorld'\n * ```\n *\n * @param str - The string to convert.\n * @returns The converted string.\n */\nexport function camelCase(str: string): string {\n return normalizeCase(str, ' ')\n .replace(/[^\\p{L}\\p{N}]+(.)/gu, (_, char) => char.toUpperCase())\n .replace(/^./, (char) => char.toLowerCase());\n}\n"],"mappings":";;AAcA,SAAgB,EAAU,GAAqB;CAC7C,OAAO,EAAc,GAAK,GAAG,CAAC,CAC3B,QAAQ,wBAAwB,GAAG,MAAS,EAAK,YAAY,CAAC,CAAC,CAC/D,QAAQ,OAAO,MAAS,EAAK,YAAY,CAAC;AAC/C"}
1
+ {"version":3,"file":"camelCase.js","names":[],"sources":["../../src/string/camelCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to camel case.\n *\n * @example\n * ```ts\n * const text = 'hello world';\n * camelCase(text); // 'helloWorld'\n * ```\n *\n * @param str - The string to convert.\n * @returns The converted string.\n */\nexport function camelCase(str: string): string {\n return normalizeCase(str, ' ')\n .replace(/[^\\p{L}\\p{N}]+(.)/gu, (_, char) => char.toUpperCase())\n .replace(/^./, (char) => char.toLowerCase());\n}\n"],"mappings":"gDAcA,SAAgB,UAAU,EAAqB,CAC7C,OAAO,EAAc,EAAK,GAAG,CAAC,CAC3B,QAAQ,uBAAwB,EAAG,IAAS,EAAK,YAAY,CAAC,CAAC,CAC/D,QAAQ,KAAO,GAAS,EAAK,YAAY,CAAC,CAC/C"}
@@ -1,2 +1,2 @@
1
- var e={"'":`&#39;`,'"':`&quot;`,"&":`&amp;`,"<":`&lt;`,">":`&gt;`};function t(t){return t.replace(/[&<>"']/g,t=>e[t])}exports.escape=t;
1
+ var e={"'":`&#39;`,'"':`&quot;`,"&":`&amp;`,"<":`&lt;`,">":`&gt;`};function escape(t){return t.replace(/[&<>"']/g,t=>e[t])}exports.escape=escape;
2
2
  //# sourceMappingURL=escape.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"escape.cjs","names":[],"sources":["../../src/string/escape.ts"],"sourcesContent":["const escapeMap: Record<string, string> = {\n \"'\": '&#39;',\n '\"': '&quot;',\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n};\n\n/**\n * Escapes HTML entities.\n */\nexport function escape(value: string): string {\n return value.replace(/[&<>\"']/g, (char) => escapeMap[char]);\n}\n"],"mappings":"AAAA,IAAM,EAAoC,CACxC,IAAK,QACL,IAAK,SACL,IAAK,QACL,IAAK,OACL,IAAK,MACP,EAKA,SAAgB,EAAO,EAAuB,CAC5C,OAAO,EAAM,QAAQ,WAAa,GAAS,EAAU,EAAK,CAC5D"}
1
+ {"version":3,"file":"escape.cjs","names":[],"sources":["../../src/string/escape.ts"],"sourcesContent":["const escapeMap: Record<string, string> = {\n \"'\": '&#39;',\n '\"': '&quot;',\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n};\n\n/**\n * Escapes HTML entities.\n */\nexport function escape(value: string): string {\n return value.replace(/[&<>\"']/g, (char) => escapeMap[char]);\n}\n"],"mappings":"AAAA,IAAM,EAAoC,CACxC,IAAK,QACL,IAAK,SACL,IAAK,QACL,IAAK,OACL,IAAK,MACP,EAKA,SAAgB,OAAO,EAAuB,CAC5C,OAAO,EAAM,QAAQ,WAAa,GAAS,EAAU,EAAK,CAC5D"}
@@ -1,15 +1,2 @@
1
- //#region src/string/escape.ts
2
- var e = {
3
- "'": "&#39;",
4
- "\"": "&quot;",
5
- "&": "&amp;",
6
- "<": "&lt;",
7
- ">": "&gt;"
8
- };
9
- function t(t) {
10
- return t.replace(/[&<>"']/g, (t) => e[t]);
11
- }
12
- //#endregion
13
- export { t as escape };
14
-
1
+ var e={"'":`&#39;`,'"':`&quot;`,"&":`&amp;`,"<":`&lt;`,">":`&gt;`};function escape(t){return t.replace(/[&<>"']/g,t=>e[t])}export{escape};
15
2
  //# sourceMappingURL=escape.js.map