@vielzeug/arsenal 2.1.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 (607) hide show
  1. package/README.md +5 -18
  2. package/dist/_common/_lruMap.cjs +1 -1
  3. package/dist/_common/_lruMap.cjs.map +1 -1
  4. package/dist/_common/_lruMap.js +1 -17
  5. package/dist/_common/_lruMap.js.map +1 -1
  6. package/dist/_common/_selectorSet.cjs +1 -1
  7. package/dist/_common/_selectorSet.cjs.map +1 -1
  8. package/dist/_common/_selectorSet.js +1 -15
  9. package/dist/_common/_selectorSet.js.map +1 -1
  10. package/dist/_common/unsafePaths.cjs +1 -1
  11. package/dist/_common/unsafePaths.cjs.map +1 -1
  12. package/dist/_common/unsafePaths.js +1 -12
  13. package/dist/_common/unsafePaths.js.map +1 -1
  14. package/dist/_dev.cjs +1 -1
  15. package/dist/_dev.cjs.map +1 -1
  16. package/dist/_dev.js +1 -5
  17. package/dist/_dev.js.map +1 -1
  18. package/dist/array/chunk.cjs +1 -1
  19. package/dist/array/chunk.cjs.map +1 -1
  20. package/dist/array/chunk.d.ts +1 -1
  21. package/dist/array/chunk.d.ts.map +1 -1
  22. package/dist/array/chunk.js +1 -9
  23. package/dist/array/chunk.js.map +1 -1
  24. package/dist/array/compact.cjs +1 -1
  25. package/dist/array/compact.cjs.map +1 -1
  26. package/dist/array/compact.d.ts +1 -1
  27. package/dist/array/compact.d.ts.map +1 -1
  28. package/dist/array/compact.js +1 -7
  29. package/dist/array/compact.js.map +1 -1
  30. package/dist/array/compare.cjs +1 -1
  31. package/dist/array/compare.cjs.map +1 -1
  32. package/dist/array/compare.js +1 -18
  33. package/dist/array/compare.js.map +1 -1
  34. package/dist/array/compareBy.cjs +1 -1
  35. package/dist/array/compareBy.cjs.map +1 -1
  36. package/dist/array/compareBy.js +1 -15
  37. package/dist/array/compareBy.js.map +1 -1
  38. package/dist/array/contains.cjs +1 -1
  39. package/dist/array/contains.cjs.map +1 -1
  40. package/dist/array/contains.d.ts +1 -1
  41. package/dist/array/contains.d.ts.map +1 -1
  42. package/dist/array/contains.js +1 -8
  43. package/dist/array/contains.js.map +1 -1
  44. package/dist/array/countBy.cjs +1 -1
  45. package/dist/array/countBy.cjs.map +1 -1
  46. package/dist/array/countBy.d.ts +1 -1
  47. package/dist/array/countBy.d.ts.map +1 -1
  48. package/dist/array/countBy.js +1 -13
  49. package/dist/array/countBy.js.map +1 -1
  50. package/dist/array/difference.cjs +1 -1
  51. package/dist/array/difference.cjs.map +1 -1
  52. package/dist/array/difference.d.ts +4 -2
  53. package/dist/array/difference.d.ts.map +1 -1
  54. package/dist/array/difference.js +1 -13
  55. package/dist/array/difference.js.map +1 -1
  56. package/dist/array/drop.cjs +1 -1
  57. package/dist/array/drop.cjs.map +1 -1
  58. package/dist/array/drop.d.ts +1 -1
  59. package/dist/array/drop.d.ts.map +1 -1
  60. package/dist/array/drop.js +1 -8
  61. package/dist/array/drop.js.map +1 -1
  62. package/dist/array/dropLast.cjs +1 -1
  63. package/dist/array/dropLast.cjs.map +1 -1
  64. package/dist/array/dropLast.d.ts +1 -1
  65. package/dist/array/dropLast.d.ts.map +1 -1
  66. package/dist/array/dropLast.js +1 -8
  67. package/dist/array/dropLast.js.map +1 -1
  68. package/dist/array/filterMap.cjs +1 -1
  69. package/dist/array/filterMap.cjs.map +1 -1
  70. package/dist/array/filterMap.d.ts +3 -1
  71. package/dist/array/filterMap.d.ts.map +1 -1
  72. package/dist/array/filterMap.js +1 -12
  73. package/dist/array/filterMap.js.map +1 -1
  74. package/dist/array/first.cjs +1 -1
  75. package/dist/array/first.cjs.map +1 -1
  76. package/dist/array/first.d.ts +1 -1
  77. package/dist/array/first.d.ts.map +1 -1
  78. package/dist/array/first.js +1 -7
  79. package/dist/array/first.js.map +1 -1
  80. package/dist/array/groupBy.cjs +1 -1
  81. package/dist/array/groupBy.cjs.map +1 -1
  82. package/dist/array/groupBy.d.ts +1 -1
  83. package/dist/array/groupBy.d.ts.map +1 -1
  84. package/dist/array/groupBy.js +1 -13
  85. package/dist/array/groupBy.js.map +1 -1
  86. package/dist/array/index.cjs +1 -1
  87. package/dist/array/index.d.ts +0 -1
  88. package/dist/array/index.d.ts.map +1 -1
  89. package/dist/array/index.js +1 -29
  90. package/dist/array/indexBy.cjs +1 -1
  91. package/dist/array/indexBy.cjs.map +1 -1
  92. package/dist/array/indexBy.d.ts +1 -1
  93. package/dist/array/indexBy.d.ts.map +1 -1
  94. package/dist/array/indexBy.js +1 -13
  95. package/dist/array/indexBy.js.map +1 -1
  96. package/dist/array/intersection.cjs +1 -1
  97. package/dist/array/intersection.cjs.map +1 -1
  98. package/dist/array/intersection.d.ts +4 -2
  99. package/dist/array/intersection.d.ts.map +1 -1
  100. package/dist/array/intersection.js +1 -13
  101. package/dist/array/intersection.js.map +1 -1
  102. package/dist/array/last.cjs +1 -1
  103. package/dist/array/last.cjs.map +1 -1
  104. package/dist/array/last.d.ts +1 -1
  105. package/dist/array/last.d.ts.map +1 -1
  106. package/dist/array/last.js +1 -7
  107. package/dist/array/last.js.map +1 -1
  108. package/dist/array/partition.cjs +1 -1
  109. package/dist/array/partition.cjs.map +1 -1
  110. package/dist/array/partition.d.ts +3 -1
  111. package/dist/array/partition.d.ts.map +1 -1
  112. package/dist/array/partition.js +1 -9
  113. package/dist/array/partition.js.map +1 -1
  114. package/dist/array/replace.cjs +1 -1
  115. package/dist/array/replace.cjs.map +1 -1
  116. package/dist/array/replace.d.ts +2 -15
  117. package/dist/array/replace.d.ts.map +1 -1
  118. package/dist/array/replace.js +1 -12
  119. package/dist/array/replace.js.map +1 -1
  120. package/dist/array/rotate.cjs +1 -1
  121. package/dist/array/rotate.cjs.map +1 -1
  122. package/dist/array/rotate.d.ts +5 -17
  123. package/dist/array/rotate.d.ts.map +1 -1
  124. package/dist/array/rotate.js +1 -9
  125. package/dist/array/rotate.js.map +1 -1
  126. package/dist/array/search.cjs +1 -1
  127. package/dist/array/search.cjs.map +1 -1
  128. package/dist/array/search.js +1 -29
  129. package/dist/array/search.js.map +1 -1
  130. package/dist/array/sort.cjs +1 -1
  131. package/dist/array/sort.cjs.map +1 -1
  132. package/dist/array/sort.d.ts +2 -2
  133. package/dist/array/sort.d.ts.map +1 -1
  134. package/dist/array/sort.js +1 -14
  135. package/dist/array/sort.js.map +1 -1
  136. package/dist/array/take.cjs +1 -1
  137. package/dist/array/take.cjs.map +1 -1
  138. package/dist/array/take.d.ts +1 -1
  139. package/dist/array/take.d.ts.map +1 -1
  140. package/dist/array/take.js +1 -8
  141. package/dist/array/take.js.map +1 -1
  142. package/dist/array/takeLast.cjs +1 -1
  143. package/dist/array/takeLast.cjs.map +1 -1
  144. package/dist/array/takeLast.d.ts +1 -1
  145. package/dist/array/takeLast.d.ts.map +1 -1
  146. package/dist/array/takeLast.js +1 -8
  147. package/dist/array/takeLast.js.map +1 -1
  148. package/dist/array/toggle.cjs +1 -1
  149. package/dist/array/toggle.cjs.map +1 -1
  150. package/dist/array/toggle.d.ts +1 -1
  151. package/dist/array/toggle.d.ts.map +1 -1
  152. package/dist/array/toggle.js +1 -8
  153. package/dist/array/toggle.js.map +1 -1
  154. package/dist/array/union.cjs +1 -1
  155. package/dist/array/union.cjs.map +1 -1
  156. package/dist/array/union.d.ts +4 -2
  157. package/dist/array/union.d.ts.map +1 -1
  158. package/dist/array/union.js +1 -8
  159. package/dist/array/union.js.map +1 -1
  160. package/dist/array/uniq.cjs +1 -1
  161. package/dist/array/uniq.cjs.map +1 -1
  162. package/dist/array/uniq.d.ts +1 -1
  163. package/dist/array/uniq.d.ts.map +1 -1
  164. package/dist/array/uniq.js +1 -8
  165. package/dist/array/uniq.js.map +1 -1
  166. package/dist/array/unzip.cjs +1 -1
  167. package/dist/array/unzip.cjs.map +1 -1
  168. package/dist/array/unzip.js +1 -10
  169. package/dist/array/unzip.js.map +1 -1
  170. package/dist/array/zip.cjs +1 -1
  171. package/dist/array/zip.cjs.map +1 -1
  172. package/dist/array/zip.d.ts +1 -1
  173. package/dist/array/zip.d.ts.map +1 -1
  174. package/dist/array/zip.js +1 -10
  175. package/dist/array/zip.js.map +1 -1
  176. package/dist/arsenal.cjs +1 -1
  177. package/dist/arsenal.cjs.map +1 -1
  178. package/dist/arsenal.iife.js +1 -1
  179. package/dist/arsenal.iife.js.map +1 -1
  180. package/dist/arsenal.js +1 -1
  181. package/dist/arsenal.js.map +1 -1
  182. package/dist/async/abortError.cjs +1 -1
  183. package/dist/async/abortError.cjs.map +1 -1
  184. package/dist/async/abortError.d.ts +3 -2
  185. package/dist/async/abortError.d.ts.map +1 -1
  186. package/dist/async/abortError.js +1 -7
  187. package/dist/async/abortError.js.map +1 -1
  188. package/dist/async/abortable.cjs +1 -1
  189. package/dist/async/abortable.cjs.map +1 -1
  190. package/dist/async/abortable.js +1 -11
  191. package/dist/async/abortable.js.map +1 -1
  192. package/dist/async/attempt.cjs +1 -1
  193. package/dist/async/attempt.cjs.map +1 -1
  194. package/dist/async/attempt.js +1 -23
  195. package/dist/async/attempt.js.map +1 -1
  196. package/dist/async/backoff.cjs +1 -1
  197. package/dist/async/backoff.cjs.map +1 -1
  198. package/dist/async/backoff.js +1 -7
  199. package/dist/async/backoff.js.map +1 -1
  200. package/dist/async/index.js +1 -10
  201. package/dist/async/parallel.cjs +1 -1
  202. package/dist/async/parallel.cjs.map +1 -1
  203. package/dist/async/parallel.js +1 -24
  204. package/dist/async/parallel.js.map +1 -1
  205. package/dist/async/retry.cjs +1 -1
  206. package/dist/async/retry.cjs.map +1 -1
  207. package/dist/async/retry.d.ts +4 -6
  208. package/dist/async/retry.d.ts.map +1 -1
  209. package/dist/async/retry.js +1 -24
  210. package/dist/async/retry.js.map +1 -1
  211. package/dist/async/sleep.cjs +1 -1
  212. package/dist/async/sleep.cjs.map +1 -1
  213. package/dist/async/sleep.js +1 -15
  214. package/dist/async/sleep.js.map +1 -1
  215. package/dist/async/taskPool.cjs +1 -1
  216. package/dist/async/taskPool.cjs.map +1 -1
  217. package/dist/async/taskPool.js +1 -50
  218. package/dist/async/taskPool.js.map +1 -1
  219. package/dist/async/waitFor.cjs +1 -1
  220. package/dist/async/waitFor.cjs.map +1 -1
  221. package/dist/async/waitFor.js +1 -12
  222. package/dist/async/waitFor.js.map +1 -1
  223. package/dist/cache/cache.cjs +1 -1
  224. package/dist/cache/cache.cjs.map +1 -1
  225. package/dist/cache/cache.d.ts +1 -0
  226. package/dist/cache/cache.d.ts.map +1 -1
  227. package/dist/cache/cache.js +1 -58
  228. package/dist/cache/cache.js.map +1 -1
  229. package/dist/cache/index.js +1 -3
  230. package/dist/cache/memo.cjs +1 -1
  231. package/dist/cache/memo.cjs.map +1 -1
  232. package/dist/cache/memo.js +1 -37
  233. package/dist/cache/memo.js.map +1 -1
  234. package/dist/encoding/base64url.cjs +2 -0
  235. package/dist/encoding/base64url.cjs.map +1 -0
  236. package/dist/encoding/base64url.d.ts +9 -0
  237. package/dist/encoding/base64url.d.ts.map +1 -0
  238. package/dist/encoding/base64url.js +2 -0
  239. package/dist/encoding/base64url.js.map +1 -0
  240. package/dist/encoding/index.cjs +1 -0
  241. package/dist/encoding/index.d.ts +2 -0
  242. package/dist/encoding/index.d.ts.map +1 -0
  243. package/dist/encoding/index.js +1 -0
  244. package/dist/errors.cjs +1 -1
  245. package/dist/errors.cjs.map +1 -1
  246. package/dist/errors.js +1 -9
  247. package/dist/errors.js.map +1 -1
  248. package/dist/function/assert.cjs +1 -1
  249. package/dist/function/assert.cjs.map +1 -1
  250. package/dist/function/assert.d.ts +1 -1
  251. package/dist/function/assert.js +1 -7
  252. package/dist/function/assert.js.map +1 -1
  253. package/dist/function/debounce.cjs +1 -1
  254. package/dist/function/debounce.cjs.map +1 -1
  255. package/dist/function/debounce.js +1 -26
  256. package/dist/function/debounce.js.map +1 -1
  257. package/dist/function/index.cjs +1 -1
  258. package/dist/function/index.d.ts +1 -0
  259. package/dist/function/index.d.ts.map +1 -1
  260. package/dist/function/index.js +1 -8
  261. package/dist/function/once.cjs +1 -1
  262. package/dist/function/once.cjs.map +1 -1
  263. package/dist/function/once.js +1 -10
  264. package/dist/function/once.js.map +1 -1
  265. package/dist/function/pipe.cjs +1 -1
  266. package/dist/function/pipe.cjs.map +1 -1
  267. package/dist/function/pipe.js +1 -9
  268. package/dist/function/pipe.js.map +1 -1
  269. package/dist/function/runAll.cjs +1 -1
  270. package/dist/function/runAll.cjs.map +1 -1
  271. package/dist/function/runAll.js +1 -18
  272. package/dist/function/runAll.js.map +1 -1
  273. package/dist/function/tap.cjs +1 -1
  274. package/dist/function/tap.cjs.map +1 -1
  275. package/dist/function/tap.js +1 -7
  276. package/dist/function/tap.js.map +1 -1
  277. package/dist/function/tapper.cjs +2 -0
  278. package/dist/function/tapper.cjs.map +1 -0
  279. package/dist/function/tapper.d.ts +27 -0
  280. package/dist/function/tapper.d.ts.map +1 -0
  281. package/dist/function/tapper.js +2 -0
  282. package/dist/function/tapper.js.map +1 -0
  283. package/dist/function/throttle.cjs +1 -1
  284. package/dist/function/throttle.cjs.map +1 -1
  285. package/dist/function/throttle.js +1 -35
  286. package/dist/function/throttle.js.map +1 -1
  287. package/dist/guards/combinators.cjs +1 -1
  288. package/dist/guards/combinators.cjs.map +1 -1
  289. package/dist/guards/combinators.js +1 -16
  290. package/dist/guards/combinators.js.map +1 -1
  291. package/dist/guards/index.cjs +1 -1
  292. package/dist/guards/index.js +1 -17
  293. package/dist/guards/isAbortError.cjs +1 -1
  294. package/dist/guards/isAbortError.cjs.map +1 -1
  295. package/dist/guards/isAbortError.js +1 -7
  296. package/dist/guards/isAbortError.js.map +1 -1
  297. package/dist/guards/isDate.cjs +1 -1
  298. package/dist/guards/isDate.cjs.map +1 -1
  299. package/dist/guards/isDate.js +1 -7
  300. package/dist/guards/isDate.js.map +1 -1
  301. package/dist/guards/isDefined.cjs +1 -1
  302. package/dist/guards/isDefined.cjs.map +1 -1
  303. package/dist/guards/isDefined.js +1 -7
  304. package/dist/guards/isDefined.js.map +1 -1
  305. package/dist/guards/isEmpty.cjs +1 -1
  306. package/dist/guards/isEmpty.cjs.map +1 -1
  307. package/dist/guards/isEmpty.d.ts.map +1 -1
  308. package/dist/guards/isEmpty.js +1 -9
  309. package/dist/guards/isEmpty.js.map +1 -1
  310. package/dist/guards/isEqual.cjs +1 -1
  311. package/dist/guards/isEqual.cjs.map +1 -1
  312. package/dist/guards/isEqual.js +1 -33
  313. package/dist/guards/isEqual.js.map +1 -1
  314. package/dist/guards/isError.cjs +1 -1
  315. package/dist/guards/isError.cjs.map +1 -1
  316. package/dist/guards/isError.js +1 -7
  317. package/dist/guards/isError.js.map +1 -1
  318. package/dist/guards/isFunction.cjs +1 -1
  319. package/dist/guards/isFunction.cjs.map +1 -1
  320. package/dist/guards/isFunction.d.ts +1 -1
  321. package/dist/guards/isFunction.d.ts.map +1 -1
  322. package/dist/guards/isFunction.js +1 -7
  323. package/dist/guards/isFunction.js.map +1 -1
  324. package/dist/guards/isMatch.cjs +1 -1
  325. package/dist/guards/isMatch.cjs.map +1 -1
  326. package/dist/guards/isMatch.js +1 -22
  327. package/dist/guards/isMatch.js.map +1 -1
  328. package/dist/guards/isNil.cjs +1 -1
  329. package/dist/guards/isNil.cjs.map +1 -1
  330. package/dist/guards/isNil.js +1 -7
  331. package/dist/guards/isNil.js.map +1 -1
  332. package/dist/guards/isNumber.cjs +1 -1
  333. package/dist/guards/isNumber.cjs.map +1 -1
  334. package/dist/guards/isNumber.js +1 -7
  335. package/dist/guards/isNumber.js.map +1 -1
  336. package/dist/guards/isPlainObject.cjs +1 -1
  337. package/dist/guards/isPlainObject.cjs.map +1 -1
  338. package/dist/guards/isPlainObject.js +1 -9
  339. package/dist/guards/isPlainObject.js.map +1 -1
  340. package/dist/guards/isPrimitive.cjs +1 -1
  341. package/dist/guards/isPrimitive.cjs.map +1 -1
  342. package/dist/guards/isPrimitive.d.ts +4 -17
  343. package/dist/guards/isPrimitive.d.ts.map +1 -1
  344. package/dist/guards/isPrimitive.js +1 -8
  345. package/dist/guards/isPrimitive.js.map +1 -1
  346. package/dist/guards/isPromise.cjs +1 -1
  347. package/dist/guards/isPromise.cjs.map +1 -1
  348. package/dist/guards/isPromise.js +1 -7
  349. package/dist/guards/isPromise.js.map +1 -1
  350. package/dist/guards/isRegex.cjs +1 -1
  351. package/dist/guards/isRegex.cjs.map +1 -1
  352. package/dist/guards/isRegex.js +1 -7
  353. package/dist/guards/isRegex.js.map +1 -1
  354. package/dist/guards/shallowEqual.cjs +1 -1
  355. package/dist/guards/shallowEqual.cjs.map +1 -1
  356. package/dist/guards/shallowEqual.js +1 -19
  357. package/dist/guards/shallowEqual.js.map +1 -1
  358. package/dist/index.cjs +1 -1
  359. package/dist/index.d.ts +13 -1
  360. package/dist/index.d.ts.map +1 -1
  361. package/dist/index.js +1 -30
  362. package/dist/math/allocate.cjs +1 -1
  363. package/dist/math/allocate.cjs.map +1 -1
  364. package/dist/math/allocate.js +1 -18
  365. package/dist/math/allocate.js.map +1 -1
  366. package/dist/math/average.cjs +1 -1
  367. package/dist/math/average.cjs.map +1 -1
  368. package/dist/math/average.d.ts +3 -2
  369. package/dist/math/average.d.ts.map +1 -1
  370. package/dist/math/average.js +1 -13
  371. package/dist/math/average.js.map +1 -1
  372. package/dist/math/clamp.cjs +1 -1
  373. package/dist/math/clamp.cjs.map +1 -1
  374. package/dist/math/clamp.js +1 -7
  375. package/dist/math/clamp.js.map +1 -1
  376. package/dist/math/gcd.cjs +1 -1
  377. package/dist/math/gcd.cjs.map +1 -1
  378. package/dist/math/gcd.d.ts.map +1 -1
  379. package/dist/math/gcd.js +1 -12
  380. package/dist/math/gcd.js.map +1 -1
  381. package/dist/math/index.cjs +1 -1
  382. package/dist/math/index.d.ts +0 -1
  383. package/dist/math/index.d.ts.map +1 -1
  384. package/dist/math/index.js +1 -17
  385. package/dist/math/lcm.cjs +1 -1
  386. package/dist/math/lcm.cjs.map +1 -1
  387. package/dist/math/lcm.d.ts.map +1 -1
  388. package/dist/math/lcm.js +1 -8
  389. package/dist/math/lcm.js.map +1 -1
  390. package/dist/math/lerp.cjs +1 -1
  391. package/dist/math/lerp.cjs.map +1 -1
  392. package/dist/math/lerp.js +1 -7
  393. package/dist/math/lerp.js.map +1 -1
  394. package/dist/math/linspace.cjs +1 -1
  395. package/dist/math/linspace.cjs.map +1 -1
  396. package/dist/math/linspace.d.ts.map +1 -1
  397. package/dist/math/linspace.js +1 -10
  398. package/dist/math/linspace.js.map +1 -1
  399. package/dist/math/median.cjs +1 -1
  400. package/dist/math/median.cjs.map +1 -1
  401. package/dist/math/median.d.ts +1 -1
  402. package/dist/math/median.d.ts.map +1 -1
  403. package/dist/math/median.js +1 -11
  404. package/dist/math/median.js.map +1 -1
  405. package/dist/math/mod.cjs +1 -1
  406. package/dist/math/mod.cjs.map +1 -1
  407. package/dist/math/mod.js +1 -8
  408. package/dist/math/mod.js.map +1 -1
  409. package/dist/math/normalize.cjs +1 -1
  410. package/dist/math/normalize.cjs.map +1 -1
  411. package/dist/math/normalize.js +1 -8
  412. package/dist/math/normalize.js.map +1 -1
  413. package/dist/math/range.cjs +1 -1
  414. package/dist/math/range.cjs.map +1 -1
  415. package/dist/math/range.js +1 -25
  416. package/dist/math/range.js.map +1 -1
  417. package/dist/math/round.cjs +1 -1
  418. package/dist/math/round.cjs.map +1 -1
  419. package/dist/math/round.js +1 -9
  420. package/dist/math/round.js.map +1 -1
  421. package/dist/math/standardDeviation.cjs +1 -1
  422. package/dist/math/standardDeviation.cjs.map +1 -1
  423. package/dist/math/standardDeviation.d.ts +1 -1
  424. package/dist/math/standardDeviation.d.ts.map +1 -1
  425. package/dist/math/standardDeviation.js +1 -8
  426. package/dist/math/standardDeviation.js.map +1 -1
  427. package/dist/math/sum.cjs +1 -1
  428. package/dist/math/sum.cjs.map +1 -1
  429. package/dist/math/sum.d.ts +1 -1
  430. package/dist/math/sum.d.ts.map +1 -1
  431. package/dist/math/sum.js +1 -11
  432. package/dist/math/sum.js.map +1 -1
  433. package/dist/math/variance.cjs +1 -1
  434. package/dist/math/variance.cjs.map +1 -1
  435. package/dist/math/variance.d.ts +1 -1
  436. package/dist/math/variance.d.ts.map +1 -1
  437. package/dist/math/variance.js +1 -10
  438. package/dist/math/variance.js.map +1 -1
  439. package/dist/object/defaults.cjs +1 -1
  440. package/dist/object/defaults.cjs.map +1 -1
  441. package/dist/object/defaults.js +1 -11
  442. package/dist/object/defaults.js.map +1 -1
  443. package/dist/object/diff.cjs +1 -1
  444. package/dist/object/diff.cjs.map +1 -1
  445. package/dist/object/diff.d.ts +1 -1
  446. package/dist/object/diff.d.ts.map +1 -1
  447. package/dist/object/diff.js +1 -26
  448. package/dist/object/diff.js.map +1 -1
  449. package/dist/object/filterValues.cjs +1 -1
  450. package/dist/object/filterValues.cjs.map +1 -1
  451. package/dist/object/filterValues.js +1 -10
  452. package/dist/object/filterValues.js.map +1 -1
  453. package/dist/object/flattenPaths.cjs +1 -1
  454. package/dist/object/flattenPaths.cjs.map +1 -1
  455. package/dist/object/flattenPaths.js +1 -30
  456. package/dist/object/flattenPaths.js.map +1 -1
  457. package/dist/object/getPath.cjs +1 -1
  458. package/dist/object/getPath.cjs.map +1 -1
  459. package/dist/object/getPath.js +1 -25
  460. package/dist/object/getPath.js.map +1 -1
  461. package/dist/object/hash.cjs +1 -1
  462. package/dist/object/hash.cjs.map +1 -1
  463. package/dist/object/hash.js +1 -27
  464. package/dist/object/hash.js.map +1 -1
  465. package/dist/object/index.js +1 -15
  466. package/dist/object/invert.cjs +1 -1
  467. package/dist/object/invert.cjs.map +1 -1
  468. package/dist/object/invert.js +1 -10
  469. package/dist/object/invert.js.map +1 -1
  470. package/dist/object/mapKeys.cjs +1 -1
  471. package/dist/object/mapKeys.cjs.map +1 -1
  472. package/dist/object/mapKeys.js +1 -14
  473. package/dist/object/mapKeys.js.map +1 -1
  474. package/dist/object/mapValues.cjs +1 -1
  475. package/dist/object/mapValues.cjs.map +1 -1
  476. package/dist/object/mapValues.js +1 -10
  477. package/dist/object/mapValues.js.map +1 -1
  478. package/dist/object/merge.cjs +1 -1
  479. package/dist/object/merge.cjs.map +1 -1
  480. package/dist/object/merge.js +1 -25
  481. package/dist/object/merge.js.map +1 -1
  482. package/dist/object/omit.cjs +1 -1
  483. package/dist/object/omit.cjs.map +1 -1
  484. package/dist/object/omit.js +1 -10
  485. package/dist/object/omit.js.map +1 -1
  486. package/dist/object/pick.cjs +1 -1
  487. package/dist/object/pick.cjs.map +1 -1
  488. package/dist/object/pick.js +1 -10
  489. package/dist/object/pick.js.map +1 -1
  490. package/dist/object/prune.cjs +1 -1
  491. package/dist/object/prune.cjs.map +1 -1
  492. package/dist/object/prune.d.ts.map +1 -1
  493. package/dist/object/prune.js +1 -34
  494. package/dist/object/prune.js.map +1 -1
  495. package/dist/object/tryParseJson.cjs +1 -1
  496. package/dist/object/tryParseJson.cjs.map +1 -1
  497. package/dist/object/tryParseJson.js +1 -17
  498. package/dist/object/tryParseJson.js.map +1 -1
  499. package/dist/random/_index.cjs +1 -1
  500. package/dist/random/_index.cjs.map +1 -1
  501. package/dist/random/_index.d.ts +1 -1
  502. package/dist/random/_index.d.ts.map +1 -1
  503. package/dist/random/_index.js +1 -9
  504. package/dist/random/_index.js.map +1 -1
  505. package/dist/random/draw.cjs +1 -1
  506. package/dist/random/draw.cjs.map +1 -1
  507. package/dist/random/draw.js +1 -20
  508. package/dist/random/draw.js.map +1 -1
  509. package/dist/random/index.cjs +1 -1
  510. package/dist/random/index.d.ts +0 -1
  511. package/dist/random/index.d.ts.map +1 -1
  512. package/dist/random/index.js +1 -5
  513. package/dist/random/random.cjs +1 -1
  514. package/dist/random/random.cjs.map +1 -1
  515. package/dist/random/random.js +1 -9
  516. package/dist/random/random.js.map +1 -1
  517. package/dist/random/shuffle.cjs +1 -1
  518. package/dist/random/shuffle.cjs.map +1 -1
  519. package/dist/random/shuffle.js +1 -13
  520. package/dist/random/shuffle.js.map +1 -1
  521. package/dist/random/source.cjs +2 -0
  522. package/dist/random/source.cjs.map +1 -0
  523. package/dist/random/source.d.ts +2 -0
  524. package/dist/random/source.d.ts.map +1 -1
  525. package/dist/random/source.js +2 -0
  526. package/dist/random/source.js.map +1 -0
  527. package/dist/string/_caseUtils.cjs +1 -1
  528. package/dist/string/_caseUtils.cjs.map +1 -1
  529. package/dist/string/_caseUtils.js +1 -12
  530. package/dist/string/_caseUtils.js.map +1 -1
  531. package/dist/string/camelCase.cjs +1 -1
  532. package/dist/string/camelCase.cjs.map +1 -1
  533. package/dist/string/camelCase.js +1 -8
  534. package/dist/string/camelCase.js.map +1 -1
  535. package/dist/string/escape.cjs +1 -1
  536. package/dist/string/escape.cjs.map +1 -1
  537. package/dist/string/escape.js +1 -14
  538. package/dist/string/escape.js.map +1 -1
  539. package/dist/string/index.cjs +1 -1
  540. package/dist/string/index.d.ts +1 -1
  541. package/dist/string/index.d.ts.map +1 -1
  542. package/dist/string/index.js +1 -12
  543. package/dist/string/kebabCase.cjs +1 -1
  544. package/dist/string/kebabCase.cjs.map +1 -1
  545. package/dist/string/kebabCase.js +1 -8
  546. package/dist/string/kebabCase.js.map +1 -1
  547. package/dist/string/padCenter.cjs +2 -0
  548. package/dist/string/padCenter.cjs.map +1 -0
  549. package/dist/string/padCenter.d.ts +3 -0
  550. package/dist/string/padCenter.d.ts.map +1 -0
  551. package/dist/string/padCenter.js +2 -0
  552. package/dist/string/padCenter.js.map +1 -0
  553. package/dist/string/pascalCase.cjs +1 -1
  554. package/dist/string/pascalCase.cjs.map +1 -1
  555. package/dist/string/pascalCase.js +1 -8
  556. package/dist/string/pascalCase.js.map +1 -1
  557. package/dist/string/similarity.cjs +1 -1
  558. package/dist/string/similarity.cjs.map +1 -1
  559. package/dist/string/similarity.js +1 -22
  560. package/dist/string/similarity.js.map +1 -1
  561. package/dist/string/snakeCase.cjs +1 -1
  562. package/dist/string/snakeCase.cjs.map +1 -1
  563. package/dist/string/snakeCase.js +1 -8
  564. package/dist/string/snakeCase.js.map +1 -1
  565. package/dist/string/titleCase.cjs +1 -1
  566. package/dist/string/titleCase.cjs.map +1 -1
  567. package/dist/string/titleCase.js +1 -8
  568. package/dist/string/titleCase.js.map +1 -1
  569. package/dist/string/truncate.cjs +1 -1
  570. package/dist/string/truncate.cjs.map +1 -1
  571. package/dist/string/truncate.js +1 -15
  572. package/dist/string/truncate.js.map +1 -1
  573. package/dist/string/unescape.cjs +1 -1
  574. package/dist/string/unescape.cjs.map +1 -1
  575. package/dist/string/unescape.js +1 -14
  576. package/dist/string/unescape.js.map +1 -1
  577. package/dist/string/words.cjs +1 -1
  578. package/dist/string/words.cjs.map +1 -1
  579. package/dist/string/words.js +1 -9
  580. package/dist/string/words.js.map +1 -1
  581. package/dist/types.d.ts +10 -0
  582. package/dist/types.d.ts.map +1 -1
  583. package/package.json +16 -8
  584. package/dist/array/flatten.cjs +0 -2
  585. package/dist/array/flatten.cjs.map +0 -1
  586. package/dist/array/flatten.d.ts +0 -5
  587. package/dist/array/flatten.d.ts.map +0 -1
  588. package/dist/array/flatten.js +0 -11
  589. package/dist/array/flatten.js.map +0 -1
  590. package/dist/math/percent.cjs +0 -2
  591. package/dist/math/percent.cjs.map +0 -1
  592. package/dist/math/percent.d.ts +0 -19
  593. package/dist/math/percent.d.ts.map +0 -1
  594. package/dist/math/percent.js +0 -8
  595. package/dist/math/percent.js.map +0 -1
  596. package/dist/random/uuid.cjs +0 -2
  597. package/dist/random/uuid.cjs.map +0 -1
  598. package/dist/random/uuid.d.ts +0 -12
  599. package/dist/random/uuid.d.ts.map +0 -1
  600. package/dist/random/uuid.js +0 -8
  601. package/dist/random/uuid.js.map +0 -1
  602. package/dist/string/pad.cjs +0 -2
  603. package/dist/string/pad.cjs.map +0 -1
  604. package/dist/string/pad.d.ts +0 -5
  605. package/dist/string/pad.d.ts.map +0 -1
  606. package/dist/string/pad.js +0 -10
  607. package/dist/string/pad.js.map +0 -1
@@ -1,15 +1 @@
1
- import { getPath as e, getPathOr as t, requirePath as n } from "./getPath.js";
2
- import { hash as r } from "./hash.js";
3
- import { omit as i } from "./omit.js";
4
- import { pick as a } from "./pick.js";
5
- import { defaults as o } from "./defaults.js";
6
- import { diff as s, diffArrays as c } from "./diff.js";
7
- import { filterValues as l } from "./filterValues.js";
8
- import { flattenPaths as u, unflattenPaths as d } from "./flattenPaths.js";
9
- import { invert as f } from "./invert.js";
10
- import { mapKeys as p } from "./mapKeys.js";
11
- import { mapValues as m } from "./mapValues.js";
12
- import { deepMerge as h, shallowMerge as g } from "./merge.js";
13
- import { prune as _ } from "./prune.js";
14
- import { tryParseJson as v } from "./tryParseJson.js";
15
- export { h as deepMerge, o as defaults, s as diff, c as diffArrays, l as filterValues, u as flattenPaths, e as getPath, t as getPathOr, r as hash, f as invert, p as mapKeys, m as mapValues, i as omit, a as pick, _ as prune, n as requirePath, g as shallowMerge, v as tryParseJson, d as unflattenPaths };
1
+ import{getPath as e,getPathOr as t,requirePath as n}from"./getPath.js";import{hash as r}from"./hash.js";import{omit as i}from"./omit.js";import{pick as a}from"./pick.js";import{defaults as o}from"./defaults.js";import{diff as s,diffArrays as c}from"./diff.js";import{filterValues as l}from"./filterValues.js";import{flattenPaths as u,unflattenPaths as d}from"./flattenPaths.js";import{invert as f}from"./invert.js";import{mapKeys as p}from"./mapKeys.js";import{mapValues as m}from"./mapValues.js";import{deepMerge as h,shallowMerge as g}from"./merge.js";import{prune as _}from"./prune.js";import{tryParseJson as v}from"./tryParseJson.js";export{h as deepMerge,o as defaults,s as diff,c as diffArrays,l as filterValues,u as flattenPaths,e as getPath,t as getPathOr,r as hash,f as invert,p as mapKeys,m as mapValues,i as omit,a as pick,_ as prune,n as requirePath,g as shallowMerge,v as tryParseJson,d as unflattenPaths};
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs");function t(t){let n={};for(let[r,i]of Object.entries(t))e.isUnsafeKey(i)||(n[i]=r);return n}exports.invert=t;
1
+ const e=require("../_common/unsafePaths.cjs");function invert(t){let n={};for(let[r,i]of Object.entries(t))e.isUnsafeKey(i)||(n[i]=r);return n}exports.invert=invert;
2
2
  //# sourceMappingURL=invert.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"invert.cjs","names":[],"sources":["../../src/object/invert.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\n\n/**\n * Inverts key-value pairs, so each value becomes a key and each key becomes its value.\n * Entries whose value is a dangerous key (`__proto__`, `constructor`, `prototype`) are skipped\n * to avoid prototype pollution. If multiple keys share the same value, the last one wins.\n *\n * @example\n * ```ts\n * invert({ a: 'x', b: 'y' }); // { x: 'a', y: 'b' }\n * ```\n *\n * @param obj - The source object. Values must be valid property keys (string, number, or symbol).\n * @returns A new object with keys and values swapped.\n */\nexport function invert<T extends Record<PropertyKey, PropertyKey>>(obj: T): Record<T[keyof T], keyof T> {\n const out = {} as Record<T[keyof T], keyof T>;\n\n for (const [key, value] of Object.entries(obj) as Array<[keyof T, T[keyof T]]>) {\n if (isUnsafeKey(value)) continue;\n\n out[value] = key;\n }\n\n return out;\n}\n"],"mappings":"8CAeA,SAAgB,EAAmD,EAAqC,CACtG,IAAM,EAAM,CAAC,EAEb,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAG,EACvC,EAAA,YAAY,CAAK,IAErB,EAAI,GAAS,GAGf,OAAO,CACT"}
1
+ {"version":3,"file":"invert.cjs","names":[],"sources":["../../src/object/invert.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\n\n/**\n * Inverts key-value pairs, so each value becomes a key and each key becomes its value.\n * Entries whose value is a dangerous key (`__proto__`, `constructor`, `prototype`) are skipped\n * to avoid prototype pollution. If multiple keys share the same value, the last one wins.\n *\n * @example\n * ```ts\n * invert({ a: 'x', b: 'y' }); // { x: 'a', y: 'b' }\n * ```\n *\n * @param obj - The source object. Values must be valid property keys (string, number, or symbol).\n * @returns A new object with keys and values swapped.\n */\nexport function invert<T extends Record<PropertyKey, PropertyKey>>(obj: T): Record<T[keyof T], keyof T> {\n const out = {} as Record<T[keyof T], keyof T>;\n\n for (const [key, value] of Object.entries(obj) as Array<[keyof T, T[keyof T]]>) {\n if (isUnsafeKey(value)) continue;\n\n out[value] = key;\n }\n\n return out;\n}\n"],"mappings":"8CAeA,SAAgB,OAAmD,EAAqC,CACtG,IAAM,EAAM,CAAC,EAEb,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAG,EACvC,EAAA,YAAY,CAAK,IAErB,EAAI,GAAS,GAGf,OAAO,CACT"}
@@ -1,11 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- //#region src/object/invert.ts
3
- function t(t) {
4
- let n = {};
5
- for (let [r, i] of Object.entries(t)) e(i) || (n[i] = r);
6
- return n;
7
- }
8
- //#endregion
9
- export { t as invert };
10
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";function invert(t){let n={};for(let[r,i]of Object.entries(t))e(i)||(n[i]=r);return n}export{invert};
11
2
  //# sourceMappingURL=invert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"invert.js","names":[],"sources":["../../src/object/invert.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\n\n/**\n * Inverts key-value pairs, so each value becomes a key and each key becomes its value.\n * Entries whose value is a dangerous key (`__proto__`, `constructor`, `prototype`) are skipped\n * to avoid prototype pollution. If multiple keys share the same value, the last one wins.\n *\n * @example\n * ```ts\n * invert({ a: 'x', b: 'y' }); // { x: 'a', y: 'b' }\n * ```\n *\n * @param obj - The source object. Values must be valid property keys (string, number, or symbol).\n * @returns A new object with keys and values swapped.\n */\nexport function invert<T extends Record<PropertyKey, PropertyKey>>(obj: T): Record<T[keyof T], keyof T> {\n const out = {} as Record<T[keyof T], keyof T>;\n\n for (const [key, value] of Object.entries(obj) as Array<[keyof T, T[keyof T]]>) {\n if (isUnsafeKey(value)) continue;\n\n out[value] = key;\n }\n\n return out;\n}\n"],"mappings":";;AAeA,SAAgB,EAAmD,GAAqC;CACtG,IAAM,IAAM,CAAC;CAEb,KAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,CAAG,GACvC,EAAY,CAAK,MAErB,EAAI,KAAS;CAGf,OAAO;AACT"}
1
+ {"version":3,"file":"invert.js","names":[],"sources":["../../src/object/invert.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\n\n/**\n * Inverts key-value pairs, so each value becomes a key and each key becomes its value.\n * Entries whose value is a dangerous key (`__proto__`, `constructor`, `prototype`) are skipped\n * to avoid prototype pollution. If multiple keys share the same value, the last one wins.\n *\n * @example\n * ```ts\n * invert({ a: 'x', b: 'y' }); // { x: 'a', y: 'b' }\n * ```\n *\n * @param obj - The source object. Values must be valid property keys (string, number, or symbol).\n * @returns A new object with keys and values swapped.\n */\nexport function invert<T extends Record<PropertyKey, PropertyKey>>(obj: T): Record<T[keyof T], keyof T> {\n const out = {} as Record<T[keyof T], keyof T>;\n\n for (const [key, value] of Object.entries(obj) as Array<[keyof T, T[keyof T]]>) {\n if (isUnsafeKey(value)) continue;\n\n out[value] = key;\n }\n\n return out;\n}\n"],"mappings":"wDAeA,SAAgB,OAAmD,EAAqC,CACtG,IAAM,EAAM,CAAC,EAEb,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAG,EACvC,EAAY,CAAK,IAErB,EAAI,GAAS,GAGf,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs");function t(t,n){let r={};for(let i of Object.keys(t)){if(e.isUnsafeKey(i))continue;let a=n(i,t[i],t);e.isUnsafeKey(a)||(r[a]=t[i])}return r}exports.mapKeys=t;
1
+ const e=require("../_common/unsafePaths.cjs");function mapKeys(t,n){let r={};for(let i of Object.keys(t)){if(e.isUnsafeKey(i))continue;let a=n(i,t[i],t);e.isUnsafeKey(a)||(r[a]=t[i])}return r}exports.mapKeys=mapKeys;
2
2
  //# sourceMappingURL=mapKeys.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapKeys.cjs","names":[],"sources":["../../src/object/mapKeys.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Maps object keys while preserving values. Both the original key and any mapped key that\n * resolve to a dangerous key (`__proto__`, `constructor`, `prototype`) are skipped.\n *\n * @example\n * ```ts\n * mapKeys({ a: 1, b: 2 }, (key) => `x_${String(key)}`); // { x_a: 1, x_b: 2 }\n * ```\n *\n * @param obj - The source object.\n * @param mapper - Function producing the new key for each entry.\n * @returns A new object with mapped keys and the original values.\n */\nexport function mapKeys<T extends Obj>(\n obj: T,\n mapper: (key: keyof T, value: T[keyof T], obj: T) => PropertyKey,\n): Record<PropertyKey, T[keyof T]> {\n const out: Record<PropertyKey, T[keyof T]> = {};\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n const mappedKey = mapper(key, obj[key], obj);\n\n if (isUnsafeKey(mappedKey)) continue;\n\n out[mappedKey] = obj[key];\n }\n\n return out;\n}\n"],"mappings":"8CAgBA,SAAgB,EACd,EACA,EACiC,CACjC,IAAM,EAAuC,CAAC,EAE9C,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAAqB,CACpD,GAAI,EAAA,YAAY,CAAkB,EAAG,SAErC,IAAM,EAAY,EAAO,EAAK,EAAI,GAAM,CAAG,EAEvC,EAAA,YAAY,CAAS,IAEzB,EAAI,GAAa,EAAI,GACvB,CAEA,OAAO,CACT"}
1
+ {"version":3,"file":"mapKeys.cjs","names":[],"sources":["../../src/object/mapKeys.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Maps object keys while preserving values. Both the original key and any mapped key that\n * resolve to a dangerous key (`__proto__`, `constructor`, `prototype`) are skipped.\n *\n * @example\n * ```ts\n * mapKeys({ a: 1, b: 2 }, (key) => `x_${String(key)}`); // { x_a: 1, x_b: 2 }\n * ```\n *\n * @param obj - The source object.\n * @param mapper - Function producing the new key for each entry.\n * @returns A new object with mapped keys and the original values.\n */\nexport function mapKeys<T extends Obj>(\n obj: T,\n mapper: (key: keyof T, value: T[keyof T], obj: T) => PropertyKey,\n): Record<PropertyKey, T[keyof T]> {\n const out: Record<PropertyKey, T[keyof T]> = {};\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n const mappedKey = mapper(key, obj[key], obj);\n\n if (isUnsafeKey(mappedKey)) continue;\n\n out[mappedKey] = obj[key];\n }\n\n return out;\n}\n"],"mappings":"8CAgBA,SAAgB,QACd,EACA,EACiC,CACjC,IAAM,EAAuC,CAAC,EAE9C,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAAqB,CACpD,GAAI,EAAA,YAAY,CAAkB,EAAG,SAErC,IAAM,EAAY,EAAO,EAAK,EAAI,GAAM,CAAG,EAEvC,EAAA,YAAY,CAAS,IAEzB,EAAI,GAAa,EAAI,GACvB,CAEA,OAAO,CACT"}
@@ -1,15 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- //#region src/object/mapKeys.ts
3
- function t(t, n) {
4
- let r = {};
5
- for (let i of Object.keys(t)) {
6
- if (e(i)) continue;
7
- let a = n(i, t[i], t);
8
- e(a) || (r[a] = t[i]);
9
- }
10
- return r;
11
- }
12
- //#endregion
13
- export { t as mapKeys };
14
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";function mapKeys(t,n){let r={};for(let i of Object.keys(t)){if(e(i))continue;let a=n(i,t[i],t);e(a)||(r[a]=t[i])}return r}export{mapKeys};
15
2
  //# sourceMappingURL=mapKeys.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapKeys.js","names":[],"sources":["../../src/object/mapKeys.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Maps object keys while preserving values. Both the original key and any mapped key that\n * resolve to a dangerous key (`__proto__`, `constructor`, `prototype`) are skipped.\n *\n * @example\n * ```ts\n * mapKeys({ a: 1, b: 2 }, (key) => `x_${String(key)}`); // { x_a: 1, x_b: 2 }\n * ```\n *\n * @param obj - The source object.\n * @param mapper - Function producing the new key for each entry.\n * @returns A new object with mapped keys and the original values.\n */\nexport function mapKeys<T extends Obj>(\n obj: T,\n mapper: (key: keyof T, value: T[keyof T], obj: T) => PropertyKey,\n): Record<PropertyKey, T[keyof T]> {\n const out: Record<PropertyKey, T[keyof T]> = {};\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n const mappedKey = mapper(key, obj[key], obj);\n\n if (isUnsafeKey(mappedKey)) continue;\n\n out[mappedKey] = obj[key];\n }\n\n return out;\n}\n"],"mappings":";;AAgBA,SAAgB,EACd,GACA,GACiC;CACjC,IAAM,IAAuC,CAAC;CAE9C,KAAK,IAAM,KAAO,OAAO,KAAK,CAAG,GAAqB;EACpD,IAAI,EAAY,CAAkB,GAAG;EAErC,IAAM,IAAY,EAAO,GAAK,EAAI,IAAM,CAAG;EAEvC,EAAY,CAAS,MAEzB,EAAI,KAAa,EAAI;CACvB;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"mapKeys.js","names":[],"sources":["../../src/object/mapKeys.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Maps object keys while preserving values. Both the original key and any mapped key that\n * resolve to a dangerous key (`__proto__`, `constructor`, `prototype`) are skipped.\n *\n * @example\n * ```ts\n * mapKeys({ a: 1, b: 2 }, (key) => `x_${String(key)}`); // { x_a: 1, x_b: 2 }\n * ```\n *\n * @param obj - The source object.\n * @param mapper - Function producing the new key for each entry.\n * @returns A new object with mapped keys and the original values.\n */\nexport function mapKeys<T extends Obj>(\n obj: T,\n mapper: (key: keyof T, value: T[keyof T], obj: T) => PropertyKey,\n): Record<PropertyKey, T[keyof T]> {\n const out: Record<PropertyKey, T[keyof T]> = {};\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n const mappedKey = mapper(key, obj[key], obj);\n\n if (isUnsafeKey(mappedKey)) continue;\n\n out[mappedKey] = obj[key];\n }\n\n return out;\n}\n"],"mappings":"wDAgBA,SAAgB,QACd,EACA,EACiC,CACjC,IAAM,EAAuC,CAAC,EAE9C,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAAqB,CACpD,GAAI,EAAY,CAAkB,EAAG,SAErC,IAAM,EAAY,EAAO,EAAK,EAAI,GAAM,CAAG,EAEvC,EAAY,CAAS,IAEzB,EAAI,GAAa,EAAI,GACvB,CAEA,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs");function t(t,n){let r={};for(let i of Object.keys(t))e.isUnsafeKey(i)||(r[i]=n(t[i],i,t));return r}exports.mapValues=t;
1
+ const e=require("../_common/unsafePaths.cjs");function mapValues(t,n){let r={};for(let i of Object.keys(t))e.isUnsafeKey(i)||(r[i]=n(t[i],i,t));return r}exports.mapValues=mapValues;
2
2
  //# sourceMappingURL=mapValues.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapValues.cjs","names":[],"sources":["../../src/object/mapValues.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Maps object values while preserving the original keys. Dangerous keys (`__proto__`,\n * `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * mapValues({ a: 1, b: 2 }, (value) => value * 2); // { a: 2, b: 4 }\n * ```\n *\n * @param obj - The source object.\n * @param mapper - Function producing the new value for each entry.\n * @returns A new object with the same keys and mapped values.\n */\nexport function mapValues<T extends Obj, R>(\n obj: T,\n mapper: (value: T[keyof T], key: keyof T, obj: T) => R,\n): { [K in keyof T]: R } {\n const out = {} as { [K in keyof T]: R };\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n out[key] = mapper(obj[key], key, obj);\n }\n\n return out;\n}\n"],"mappings":"8CAgBA,SAAgB,EACd,EACA,EACuB,CACvB,IAAM,EAAM,CAAC,EAEb,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAC3B,EAAA,YAAY,CAAkB,IAElC,EAAI,GAAO,EAAO,EAAI,GAAM,EAAK,CAAG,GAGtC,OAAO,CACT"}
1
+ {"version":3,"file":"mapValues.cjs","names":[],"sources":["../../src/object/mapValues.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Maps object values while preserving the original keys. Dangerous keys (`__proto__`,\n * `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * mapValues({ a: 1, b: 2 }, (value) => value * 2); // { a: 2, b: 4 }\n * ```\n *\n * @param obj - The source object.\n * @param mapper - Function producing the new value for each entry.\n * @returns A new object with the same keys and mapped values.\n */\nexport function mapValues<T extends Obj, R>(\n obj: T,\n mapper: (value: T[keyof T], key: keyof T, obj: T) => R,\n): { [K in keyof T]: R } {\n const out = {} as { [K in keyof T]: R };\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n out[key] = mapper(obj[key], key, obj);\n }\n\n return out;\n}\n"],"mappings":"8CAgBA,SAAgB,UACd,EACA,EACuB,CACvB,IAAM,EAAM,CAAC,EAEb,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAC3B,EAAA,YAAY,CAAkB,IAElC,EAAI,GAAO,EAAO,EAAI,GAAM,EAAK,CAAG,GAGtC,OAAO,CACT"}
@@ -1,11 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- //#region src/object/mapValues.ts
3
- function t(t, n) {
4
- let r = {};
5
- for (let i of Object.keys(t)) e(i) || (r[i] = n(t[i], i, t));
6
- return r;
7
- }
8
- //#endregion
9
- export { t as mapValues };
10
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";function mapValues(t,n){let r={};for(let i of Object.keys(t))e(i)||(r[i]=n(t[i],i,t));return r}export{mapValues};
11
2
  //# sourceMappingURL=mapValues.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapValues.js","names":[],"sources":["../../src/object/mapValues.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Maps object values while preserving the original keys. Dangerous keys (`__proto__`,\n * `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * mapValues({ a: 1, b: 2 }, (value) => value * 2); // { a: 2, b: 4 }\n * ```\n *\n * @param obj - The source object.\n * @param mapper - Function producing the new value for each entry.\n * @returns A new object with the same keys and mapped values.\n */\nexport function mapValues<T extends Obj, R>(\n obj: T,\n mapper: (value: T[keyof T], key: keyof T, obj: T) => R,\n): { [K in keyof T]: R } {\n const out = {} as { [K in keyof T]: R };\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n out[key] = mapper(obj[key], key, obj);\n }\n\n return out;\n}\n"],"mappings":";;AAgBA,SAAgB,EACd,GACA,GACuB;CACvB,IAAM,IAAM,CAAC;CAEb,KAAK,IAAM,KAAO,OAAO,KAAK,CAAG,GAC3B,EAAY,CAAkB,MAElC,EAAI,KAAO,EAAO,EAAI,IAAM,GAAK,CAAG;CAGtC,OAAO;AACT"}
1
+ {"version":3,"file":"mapValues.js","names":[],"sources":["../../src/object/mapValues.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Maps object values while preserving the original keys. Dangerous keys (`__proto__`,\n * `constructor`, `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * mapValues({ a: 1, b: 2 }, (value) => value * 2); // { a: 2, b: 4 }\n * ```\n *\n * @param obj - The source object.\n * @param mapper - Function producing the new value for each entry.\n * @returns A new object with the same keys and mapped values.\n */\nexport function mapValues<T extends Obj, R>(\n obj: T,\n mapper: (value: T[keyof T], key: keyof T, obj: T) => R,\n): { [K in keyof T]: R } {\n const out = {} as { [K in keyof T]: R };\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n out[key] = mapper(obj[key], key, obj);\n }\n\n return out;\n}\n"],"mappings":"wDAgBA,SAAgB,UACd,EACA,EACuB,CACvB,IAAM,EAAM,CAAC,EAEb,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAC3B,EAAY,CAAkB,IAElC,EAAI,GAAO,EAAO,EAAI,GAAM,EAAK,CAAG,GAGtC,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs"),t=require("../guards/isPlainObject.cjs");function n(r,i,a){if(!t.isPlainObject(i))return i;let o={...r};for(let r of Object.keys(i)){if(e.isUnsafeKey(r))continue;let s=i[r],c=o[r];o[r]=Array.isArray(s)&&Array.isArray(c)?a.arrayStrategy===`concat`?[...c,...s]:s:t.isPlainObject(s)&&t.isPlainObject(c)?n(c,s,a):s}return o}function r(e,t={}){return e.reduce((e,r)=>n(e,r,t),{})}function i(...t){if(t.length===0)return{};let n={};for(let r of t)for(let t of Object.keys(r))e.isUnsafeKey(t)||(n[t]=r[t]);return n}exports.deepMerge=r,exports.shallowMerge=i;
1
+ const e=require("../_common/unsafePaths.cjs"),t=require("../guards/isPlainObject.cjs");function mergeObjects(n,r,i){if(!t.isPlainObject(r))return r;let a={...n};for(let n of Object.keys(r)){if(e.isUnsafeKey(n))continue;let o=r[n],s=a[n];a[n]=Array.isArray(o)&&Array.isArray(s)?i.arrayStrategy===`concat`?[...s,...o]:o:t.isPlainObject(o)&&t.isPlainObject(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.isUnsafeKey(t)||(n[t]=r[t]);return n}exports.deepMerge=deepMerge,exports.shallowMerge=shallowMerge;
2
2
  //# sourceMappingURL=merge.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"merge.cjs","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":"uFA+BA,SAAS,EAA2C,EAAW,EAAW,EAA4C,CACpH,GAAI,CAAC,EAAA,cAAc,CAAM,EAAG,OAAO,EAEnC,IAAM,EAAS,CAAE,GAAG,CAAO,EAE3B,IAAK,IAAM,KAAO,OAAO,KAAK,CAAM,EAAG,CAErC,GAAI,EAAA,YAAY,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,EAAA,cAAc,CAAW,GAAK,EAAA,cAAc,CAAW,EACrD,EAAa,EAAoB,EAAoB,CAAO,EAC5D,CACV,CAEA,OAAO,CACT,CAkBA,SAAgB,EAA2B,EAAwB,EAA4B,CAAC,EAAa,CAC3G,OAAO,EAAM,QAAQ,EAAU,IAAS,EAAa,EAAK,EAAM,CAAO,EAAU,CAAC,CAAQ,CAC5F,CAcA,SAAgB,EAA8B,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,EAAA,YAAY,CAAG,IAEnB,EAAO,GAAO,EAAK,IAIvB,OAAO,CACT"}
1
+ {"version":3,"file":"merge.cjs","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":"uFA+BA,SAAS,aAA2C,EAAW,EAAW,EAA4C,CACpH,GAAI,CAAC,EAAA,cAAc,CAAM,EAAG,OAAO,EAEnC,IAAM,EAAS,CAAE,GAAG,CAAO,EAE3B,IAAK,IAAM,KAAO,OAAO,KAAK,CAAM,EAAG,CAErC,GAAI,EAAA,YAAY,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,EAAA,cAAc,CAAW,GAAK,EAAA,cAAc,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,EAAA,YAAY,CAAG,IAEnB,EAAO,GAAO,EAAK,IAIvB,OAAO,CACT"}
@@ -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/isNil.cjs"),r=require("../guards/isPlainObject.cjs"),i=require("../guards/isEmpty.cjs");function a(o){if(!n.isNil(o)){if(typeof o==`string`){let e=o.trim();return e===``?void 0:e}if(Array.isArray(o)){let e=t.filterMap(o,e=>{let t=a(e);return i.isEmpty(t)?void 0:t});return e.length===0?void 0:e}if(r.isPlainObject(o)){let t={};for(let[n,r]of Object.entries(o)){if(e.isUnsafeKey(n))continue;let o=a(r);i.isEmpty(o)||(t[n]=o)}return Object.keys(t).length===0?void 0:t}return o}}exports.prune=a;
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 { isNil } from '../guards/isNil';\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 (isNil(value)) 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":"+LA+BA,SAAgB,EAAS,EAAyB,CAC5C,MAAA,MAAM,CAAK,EAEf,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 +1 @@
1
- {"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../src/object/prune.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AACzD,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AACxE,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAC3F,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../src/object/prune.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AACzD,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AACxE,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAC3F,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC"}
@@ -1,35 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- import { filterMap as t } from "../array/filterMap.js";
3
- import { isNil as n } from "../guards/isNil.js";
4
- import { isPlainObject as r } from "../guards/isPlainObject.js";
5
- import { isEmpty as i } from "../guards/isEmpty.js";
6
- //#region src/object/prune.ts
7
- function a(o) {
8
- if (!n(o)) {
9
- if (typeof o == "string") {
10
- let e = o.trim();
11
- return e === "" ? void 0 : e;
12
- }
13
- if (Array.isArray(o)) {
14
- let e = t(o, (e) => {
15
- let t = a(e);
16
- return i(t) ? void 0 : t;
17
- });
18
- return e.length === 0 ? void 0 : e;
19
- }
20
- if (r(o)) {
21
- let t = {};
22
- for (let [n, r] of Object.entries(o)) {
23
- if (e(n)) continue;
24
- let o = a(r);
25
- i(o) || (t[n] = o);
26
- }
27
- return Object.keys(t).length === 0 ? void 0 : t;
28
- }
29
- return o;
30
- }
31
- }
32
- //#endregion
33
- export { a as prune };
34
-
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};
35
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 { isNil } from '../guards/isNil';\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 (isNil(value)) 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":";;;;;;AA+BA,SAAgB,EAAS,GAAyB;CAC5C,OAAM,CAAK,GAEf;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
- function e(e,t){let n=t?.next()??crypto.getRandomValues(new Uint32Array(1))[0]/4294967296;if(!Number.isFinite(n)||n<0||n>=1)throw RangeError(`random source must return a finite number in [0, 1)`);return Math.floor(n*e)}exports.randomIndex=e;
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 } from './source';\n\nexport function randomIndex(exclusiveMax: number, 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 Math.floor(value * exclusiveMax);\n}\n"],"mappings":"AAEA,SAAgB,EAAY,EAAsB,EAA+B,CAC/E,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,KAAK,MAAM,EAAQ,CAAY,CACxC"}
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,3 +1,3 @@
1
- import type { RandomSource } from './source';
1
+ import { type RandomSource } from './source';
2
2
  export declare function randomIndex(exclusiveMax: number, source?: RandomSource): number;
3
3
  //# sourceMappingURL=_index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"_index.d.ts","sourceRoot":"","sources":["../../src/random/_index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAQ/E"}
1
+ {"version":3,"file":"_index.d.ts","sourceRoot":"","sources":["../../src/random/_index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,UAAU,CAAC;AAE1D,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAE/E"}
@@ -1,10 +1,2 @@
1
- //#region src/random/_index.ts
2
- function e(e, t) {
3
- let n = t?.next() ?? crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0] / 4294967296;
4
- if (!Number.isFinite(n) || n < 0 || n >= 1) throw RangeError("random source must return a finite number in [0, 1)");
5
- return Math.floor(n * e);
6
- }
7
- //#endregion
8
- export { e as randomIndex };
9
-
1
+ import{randomFloat as e}from"./source.js";function randomIndex(t,n){return Math.floor(e(n)*t)}export{randomIndex};
10
2
  //# sourceMappingURL=_index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_index.js","names":[],"sources":["../../src/random/_index.ts"],"sourcesContent":["import type { RandomSource } from './source';\n\nexport function randomIndex(exclusiveMax: number, 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 Math.floor(value * exclusiveMax);\n}\n"],"mappings":";AAEA,SAAgB,EAAY,GAAsB,GAA+B;CAC/E,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,KAAK,MAAM,IAAQ,CAAY;AACxC"}
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 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./uuid.cjs"),t=require("./random.cjs"),n=require("./draw.cjs"),r=require("./shuffle.cjs");exports.draw=n.draw,exports.drawMany=n.drawMany,exports.random=t.random,exports.shuffle=r.shuffle,exports.uuid=e.uuid;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./source.cjs"),t=require("./random.cjs"),n=require("./draw.cjs"),r=require("./shuffle.cjs");exports.draw=n.draw,exports.drawMany=n.drawMany,exports.random=t.random,exports.randomFloat=e.randomFloat,exports.shuffle=r.shuffle;
@@ -2,5 +2,4 @@ export * from './draw';
2
2
  export * from './random';
3
3
  export * from './shuffle';
4
4
  export * from './source';
5
- export * from './uuid';
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/random/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/random/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
@@ -1,5 +1 @@
1
- import { uuid as e } from "./uuid.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, i as shuffle, e as uuid };
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};