@vielzeug/arsenal 3.0.0 → 26.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/dist/_common/_lruMap.cjs +1 -1
  2. package/dist/_common/_lruMap.cjs.map +1 -1
  3. package/dist/_common/_lruMap.js +1 -17
  4. package/dist/_common/_lruMap.js.map +1 -1
  5. package/dist/_common/_selectorSet.cjs +1 -1
  6. package/dist/_common/_selectorSet.cjs.map +1 -1
  7. package/dist/_common/_selectorSet.js +1 -15
  8. package/dist/_common/_selectorSet.js.map +1 -1
  9. package/dist/_common/unsafePaths.cjs +1 -1
  10. package/dist/_common/unsafePaths.cjs.map +1 -1
  11. package/dist/_common/unsafePaths.js +1 -12
  12. package/dist/_common/unsafePaths.js.map +1 -1
  13. package/dist/_dev.cjs +1 -1
  14. package/dist/_dev.cjs.map +1 -1
  15. package/dist/_dev.js +1 -5
  16. package/dist/_dev.js.map +1 -1
  17. package/dist/array/chunk.cjs +1 -1
  18. package/dist/array/chunk.cjs.map +1 -1
  19. package/dist/array/chunk.js +1 -9
  20. package/dist/array/chunk.js.map +1 -1
  21. package/dist/array/compact.cjs +1 -1
  22. package/dist/array/compact.cjs.map +1 -1
  23. package/dist/array/compact.js +1 -7
  24. package/dist/array/compact.js.map +1 -1
  25. package/dist/array/compare.cjs +1 -1
  26. package/dist/array/compare.cjs.map +1 -1
  27. package/dist/array/compare.js +1 -18
  28. package/dist/array/compare.js.map +1 -1
  29. package/dist/array/compareBy.cjs +1 -1
  30. package/dist/array/compareBy.cjs.map +1 -1
  31. package/dist/array/compareBy.js +1 -15
  32. package/dist/array/compareBy.js.map +1 -1
  33. package/dist/array/contains.cjs +1 -1
  34. package/dist/array/contains.cjs.map +1 -1
  35. package/dist/array/contains.js +1 -8
  36. package/dist/array/contains.js.map +1 -1
  37. package/dist/array/countBy.cjs +1 -1
  38. package/dist/array/countBy.cjs.map +1 -1
  39. package/dist/array/countBy.js +1 -13
  40. package/dist/array/countBy.js.map +1 -1
  41. package/dist/array/difference.cjs +1 -1
  42. package/dist/array/difference.cjs.map +1 -1
  43. package/dist/array/difference.js +1 -13
  44. package/dist/array/difference.js.map +1 -1
  45. package/dist/array/drop.cjs +1 -1
  46. package/dist/array/drop.cjs.map +1 -1
  47. package/dist/array/drop.js +1 -8
  48. package/dist/array/drop.js.map +1 -1
  49. package/dist/array/dropLast.cjs +1 -1
  50. package/dist/array/dropLast.cjs.map +1 -1
  51. package/dist/array/dropLast.js +1 -8
  52. package/dist/array/dropLast.js.map +1 -1
  53. package/dist/array/filterMap.cjs +1 -1
  54. package/dist/array/filterMap.cjs.map +1 -1
  55. package/dist/array/filterMap.js +1 -12
  56. package/dist/array/filterMap.js.map +1 -1
  57. package/dist/array/first.cjs +1 -1
  58. package/dist/array/first.cjs.map +1 -1
  59. package/dist/array/first.js +1 -7
  60. package/dist/array/first.js.map +1 -1
  61. package/dist/array/groupBy.cjs +1 -1
  62. package/dist/array/groupBy.cjs.map +1 -1
  63. package/dist/array/groupBy.js +1 -13
  64. package/dist/array/groupBy.js.map +1 -1
  65. package/dist/array/index.js +1 -28
  66. package/dist/array/indexBy.cjs +1 -1
  67. package/dist/array/indexBy.cjs.map +1 -1
  68. package/dist/array/indexBy.js +1 -13
  69. package/dist/array/indexBy.js.map +1 -1
  70. package/dist/array/intersection.cjs +1 -1
  71. package/dist/array/intersection.cjs.map +1 -1
  72. package/dist/array/intersection.js +1 -13
  73. package/dist/array/intersection.js.map +1 -1
  74. package/dist/array/last.cjs +1 -1
  75. package/dist/array/last.cjs.map +1 -1
  76. package/dist/array/last.js +1 -7
  77. package/dist/array/last.js.map +1 -1
  78. package/dist/array/partition.cjs +1 -1
  79. package/dist/array/partition.cjs.map +1 -1
  80. package/dist/array/partition.js +1 -9
  81. package/dist/array/partition.js.map +1 -1
  82. package/dist/array/replace.cjs +1 -1
  83. package/dist/array/replace.cjs.map +1 -1
  84. package/dist/array/replace.js +1 -12
  85. package/dist/array/replace.js.map +1 -1
  86. package/dist/array/rotate.cjs +1 -1
  87. package/dist/array/rotate.cjs.map +1 -1
  88. package/dist/array/rotate.js +1 -9
  89. package/dist/array/rotate.js.map +1 -1
  90. package/dist/array/search.cjs +1 -1
  91. package/dist/array/search.cjs.map +1 -1
  92. package/dist/array/search.js +1 -29
  93. package/dist/array/search.js.map +1 -1
  94. package/dist/array/sort.cjs +1 -1
  95. package/dist/array/sort.cjs.map +1 -1
  96. package/dist/array/sort.js +1 -14
  97. package/dist/array/sort.js.map +1 -1
  98. package/dist/array/take.cjs +1 -1
  99. package/dist/array/take.cjs.map +1 -1
  100. package/dist/array/take.js +1 -8
  101. package/dist/array/take.js.map +1 -1
  102. package/dist/array/takeLast.cjs +1 -1
  103. package/dist/array/takeLast.cjs.map +1 -1
  104. package/dist/array/takeLast.js +1 -8
  105. package/dist/array/takeLast.js.map +1 -1
  106. package/dist/array/toggle.cjs +1 -1
  107. package/dist/array/toggle.cjs.map +1 -1
  108. package/dist/array/toggle.js +1 -8
  109. package/dist/array/toggle.js.map +1 -1
  110. package/dist/array/union.cjs +1 -1
  111. package/dist/array/union.cjs.map +1 -1
  112. package/dist/array/union.js +1 -8
  113. package/dist/array/union.js.map +1 -1
  114. package/dist/array/uniq.cjs +1 -1
  115. package/dist/array/uniq.cjs.map +1 -1
  116. package/dist/array/uniq.js +1 -8
  117. package/dist/array/uniq.js.map +1 -1
  118. package/dist/array/unzip.cjs +1 -1
  119. package/dist/array/unzip.cjs.map +1 -1
  120. package/dist/array/unzip.js +1 -10
  121. package/dist/array/unzip.js.map +1 -1
  122. package/dist/array/zip.cjs +1 -1
  123. package/dist/array/zip.cjs.map +1 -1
  124. package/dist/array/zip.js +1 -10
  125. package/dist/array/zip.js.map +1 -1
  126. package/dist/arsenal.cjs +1 -1
  127. package/dist/arsenal.cjs.map +1 -1
  128. package/dist/arsenal.iife.js +1 -1
  129. package/dist/arsenal.iife.js.map +1 -1
  130. package/dist/arsenal.js +1 -1
  131. package/dist/arsenal.js.map +1 -1
  132. package/dist/async/abortError.cjs +1 -1
  133. package/dist/async/abortError.cjs.map +1 -1
  134. package/dist/async/abortError.js +1 -7
  135. package/dist/async/abortError.js.map +1 -1
  136. package/dist/async/abortable.cjs +1 -1
  137. package/dist/async/abortable.cjs.map +1 -1
  138. package/dist/async/abortable.js +1 -11
  139. package/dist/async/abortable.js.map +1 -1
  140. package/dist/async/attempt.cjs +1 -1
  141. package/dist/async/attempt.cjs.map +1 -1
  142. package/dist/async/attempt.js +1 -23
  143. package/dist/async/attempt.js.map +1 -1
  144. package/dist/async/backoff.cjs +1 -1
  145. package/dist/async/backoff.cjs.map +1 -1
  146. package/dist/async/backoff.js +1 -7
  147. package/dist/async/backoff.js.map +1 -1
  148. package/dist/async/index.js +1 -10
  149. package/dist/async/parallel.cjs +1 -1
  150. package/dist/async/parallel.cjs.map +1 -1
  151. package/dist/async/parallel.js +1 -24
  152. package/dist/async/parallel.js.map +1 -1
  153. package/dist/async/retry.cjs +1 -1
  154. package/dist/async/retry.cjs.map +1 -1
  155. package/dist/async/retry.d.ts +4 -6
  156. package/dist/async/retry.d.ts.map +1 -1
  157. package/dist/async/retry.js +1 -24
  158. package/dist/async/retry.js.map +1 -1
  159. package/dist/async/sleep.cjs +1 -1
  160. package/dist/async/sleep.cjs.map +1 -1
  161. package/dist/async/sleep.js +1 -15
  162. package/dist/async/sleep.js.map +1 -1
  163. package/dist/async/taskPool.cjs +1 -1
  164. package/dist/async/taskPool.cjs.map +1 -1
  165. package/dist/async/taskPool.js +1 -50
  166. package/dist/async/taskPool.js.map +1 -1
  167. package/dist/async/waitFor.cjs +1 -1
  168. package/dist/async/waitFor.cjs.map +1 -1
  169. package/dist/async/waitFor.js +1 -12
  170. package/dist/async/waitFor.js.map +1 -1
  171. package/dist/cache/cache.cjs +1 -1
  172. package/dist/cache/cache.cjs.map +1 -1
  173. package/dist/cache/cache.js +1 -59
  174. package/dist/cache/cache.js.map +1 -1
  175. package/dist/cache/index.js +1 -3
  176. package/dist/cache/memo.cjs +1 -1
  177. package/dist/cache/memo.cjs.map +1 -1
  178. package/dist/cache/memo.js +1 -37
  179. package/dist/cache/memo.js.map +1 -1
  180. package/dist/encoding/base64url.cjs +2 -0
  181. package/dist/encoding/base64url.cjs.map +1 -0
  182. package/dist/encoding/base64url.d.ts +9 -0
  183. package/dist/encoding/base64url.d.ts.map +1 -0
  184. package/dist/encoding/base64url.js +2 -0
  185. package/dist/encoding/base64url.js.map +1 -0
  186. package/dist/encoding/index.cjs +1 -0
  187. package/dist/encoding/index.d.ts +2 -0
  188. package/dist/encoding/index.d.ts.map +1 -0
  189. package/dist/encoding/index.js +1 -0
  190. package/dist/errors.cjs +1 -1
  191. package/dist/errors.cjs.map +1 -1
  192. package/dist/errors.js +1 -9
  193. package/dist/errors.js.map +1 -1
  194. package/dist/function/assert.cjs +1 -1
  195. package/dist/function/assert.cjs.map +1 -1
  196. package/dist/function/assert.js +1 -7
  197. package/dist/function/assert.js.map +1 -1
  198. package/dist/function/debounce.cjs +1 -1
  199. package/dist/function/debounce.cjs.map +1 -1
  200. package/dist/function/debounce.js +1 -26
  201. package/dist/function/debounce.js.map +1 -1
  202. package/dist/function/index.cjs +1 -1
  203. package/dist/function/index.d.ts +1 -0
  204. package/dist/function/index.d.ts.map +1 -1
  205. package/dist/function/index.js +1 -8
  206. package/dist/function/once.cjs +1 -1
  207. package/dist/function/once.cjs.map +1 -1
  208. package/dist/function/once.js +1 -10
  209. package/dist/function/once.js.map +1 -1
  210. package/dist/function/pipe.cjs +1 -1
  211. package/dist/function/pipe.cjs.map +1 -1
  212. package/dist/function/pipe.js +1 -9
  213. package/dist/function/pipe.js.map +1 -1
  214. package/dist/function/runAll.cjs +1 -1
  215. package/dist/function/runAll.cjs.map +1 -1
  216. package/dist/function/runAll.js +1 -18
  217. package/dist/function/runAll.js.map +1 -1
  218. package/dist/function/tap.cjs +1 -1
  219. package/dist/function/tap.cjs.map +1 -1
  220. package/dist/function/tap.js +1 -7
  221. package/dist/function/tap.js.map +1 -1
  222. package/dist/function/tapper.cjs +2 -0
  223. package/dist/function/tapper.cjs.map +1 -0
  224. package/dist/function/tapper.d.ts +27 -0
  225. package/dist/function/tapper.d.ts.map +1 -0
  226. package/dist/function/tapper.js +2 -0
  227. package/dist/function/tapper.js.map +1 -0
  228. package/dist/function/throttle.cjs +1 -1
  229. package/dist/function/throttle.cjs.map +1 -1
  230. package/dist/function/throttle.js +1 -35
  231. package/dist/function/throttle.js.map +1 -1
  232. package/dist/guards/combinators.cjs +1 -1
  233. package/dist/guards/combinators.cjs.map +1 -1
  234. package/dist/guards/combinators.js +1 -16
  235. package/dist/guards/combinators.js.map +1 -1
  236. package/dist/guards/index.js +1 -17
  237. package/dist/guards/isAbortError.cjs +1 -1
  238. package/dist/guards/isAbortError.cjs.map +1 -1
  239. package/dist/guards/isAbortError.js +1 -7
  240. package/dist/guards/isAbortError.js.map +1 -1
  241. package/dist/guards/isDate.cjs +1 -1
  242. package/dist/guards/isDate.cjs.map +1 -1
  243. package/dist/guards/isDate.js +1 -7
  244. package/dist/guards/isDate.js.map +1 -1
  245. package/dist/guards/isDefined.cjs +1 -1
  246. package/dist/guards/isDefined.cjs.map +1 -1
  247. package/dist/guards/isDefined.js +1 -7
  248. package/dist/guards/isDefined.js.map +1 -1
  249. package/dist/guards/isEmpty.cjs +1 -1
  250. package/dist/guards/isEmpty.cjs.map +1 -1
  251. package/dist/guards/isEmpty.js +1 -8
  252. package/dist/guards/isEmpty.js.map +1 -1
  253. package/dist/guards/isEqual.cjs +1 -1
  254. package/dist/guards/isEqual.cjs.map +1 -1
  255. package/dist/guards/isEqual.js +1 -33
  256. package/dist/guards/isEqual.js.map +1 -1
  257. package/dist/guards/isError.cjs +1 -1
  258. package/dist/guards/isError.cjs.map +1 -1
  259. package/dist/guards/isError.js +1 -7
  260. package/dist/guards/isError.js.map +1 -1
  261. package/dist/guards/isFunction.cjs +1 -1
  262. package/dist/guards/isFunction.cjs.map +1 -1
  263. package/dist/guards/isFunction.js +1 -7
  264. package/dist/guards/isFunction.js.map +1 -1
  265. package/dist/guards/isMatch.cjs +1 -1
  266. package/dist/guards/isMatch.cjs.map +1 -1
  267. package/dist/guards/isMatch.js +1 -22
  268. package/dist/guards/isMatch.js.map +1 -1
  269. package/dist/guards/isNil.cjs +1 -1
  270. package/dist/guards/isNil.cjs.map +1 -1
  271. package/dist/guards/isNil.js +1 -7
  272. package/dist/guards/isNil.js.map +1 -1
  273. package/dist/guards/isNumber.cjs +1 -1
  274. package/dist/guards/isNumber.cjs.map +1 -1
  275. package/dist/guards/isNumber.js +1 -7
  276. package/dist/guards/isNumber.js.map +1 -1
  277. package/dist/guards/isPlainObject.cjs +1 -1
  278. package/dist/guards/isPlainObject.cjs.map +1 -1
  279. package/dist/guards/isPlainObject.js +1 -9
  280. package/dist/guards/isPlainObject.js.map +1 -1
  281. package/dist/guards/isPrimitive.cjs +1 -1
  282. package/dist/guards/isPrimitive.cjs.map +1 -1
  283. package/dist/guards/isPrimitive.js +1 -7
  284. package/dist/guards/isPrimitive.js.map +1 -1
  285. package/dist/guards/isPromise.cjs +1 -1
  286. package/dist/guards/isPromise.cjs.map +1 -1
  287. package/dist/guards/isPromise.js +1 -7
  288. package/dist/guards/isPromise.js.map +1 -1
  289. package/dist/guards/isRegex.cjs +1 -1
  290. package/dist/guards/isRegex.cjs.map +1 -1
  291. package/dist/guards/isRegex.js +1 -7
  292. package/dist/guards/isRegex.js.map +1 -1
  293. package/dist/guards/shallowEqual.cjs +1 -1
  294. package/dist/guards/shallowEqual.cjs.map +1 -1
  295. package/dist/guards/shallowEqual.js +1 -19
  296. package/dist/guards/shallowEqual.js.map +1 -1
  297. package/dist/index.cjs +1 -1
  298. package/dist/index.d.ts +7 -0
  299. package/dist/index.d.ts.map +1 -1
  300. package/dist/index.js +1 -35
  301. package/dist/math/allocate.cjs +1 -1
  302. package/dist/math/allocate.cjs.map +1 -1
  303. package/dist/math/allocate.js +1 -18
  304. package/dist/math/allocate.js.map +1 -1
  305. package/dist/math/average.cjs +1 -1
  306. package/dist/math/average.cjs.map +1 -1
  307. package/dist/math/average.js +1 -8
  308. package/dist/math/average.js.map +1 -1
  309. package/dist/math/clamp.cjs +1 -1
  310. package/dist/math/clamp.cjs.map +1 -1
  311. package/dist/math/clamp.js +1 -7
  312. package/dist/math/clamp.js.map +1 -1
  313. package/dist/math/gcd.cjs +1 -1
  314. package/dist/math/gcd.cjs.map +1 -1
  315. package/dist/math/gcd.js +1 -13
  316. package/dist/math/gcd.js.map +1 -1
  317. package/dist/math/index.js +1 -16
  318. package/dist/math/lcm.cjs +1 -1
  319. package/dist/math/lcm.cjs.map +1 -1
  320. package/dist/math/lcm.js +1 -12
  321. package/dist/math/lcm.js.map +1 -1
  322. package/dist/math/lerp.cjs +1 -1
  323. package/dist/math/lerp.cjs.map +1 -1
  324. package/dist/math/lerp.js +1 -7
  325. package/dist/math/lerp.js.map +1 -1
  326. package/dist/math/linspace.cjs +1 -1
  327. package/dist/math/linspace.cjs.map +1 -1
  328. package/dist/math/linspace.js +1 -11
  329. package/dist/math/linspace.js.map +1 -1
  330. package/dist/math/median.cjs +1 -1
  331. package/dist/math/median.cjs.map +1 -1
  332. package/dist/math/median.js +1 -11
  333. package/dist/math/median.js.map +1 -1
  334. package/dist/math/mod.cjs +1 -1
  335. package/dist/math/mod.cjs.map +1 -1
  336. package/dist/math/mod.js +1 -8
  337. package/dist/math/mod.js.map +1 -1
  338. package/dist/math/normalize.cjs +1 -1
  339. package/dist/math/normalize.cjs.map +1 -1
  340. package/dist/math/normalize.js +1 -8
  341. package/dist/math/normalize.js.map +1 -1
  342. package/dist/math/range.cjs +1 -1
  343. package/dist/math/range.cjs.map +1 -1
  344. package/dist/math/range.js +1 -25
  345. package/dist/math/range.js.map +1 -1
  346. package/dist/math/round.cjs +1 -1
  347. package/dist/math/round.cjs.map +1 -1
  348. package/dist/math/round.js +1 -9
  349. package/dist/math/round.js.map +1 -1
  350. package/dist/math/standardDeviation.cjs +1 -1
  351. package/dist/math/standardDeviation.cjs.map +1 -1
  352. package/dist/math/standardDeviation.js +1 -8
  353. package/dist/math/standardDeviation.js.map +1 -1
  354. package/dist/math/sum.cjs +1 -1
  355. package/dist/math/sum.cjs.map +1 -1
  356. package/dist/math/sum.js +1 -11
  357. package/dist/math/sum.js.map +1 -1
  358. package/dist/math/variance.cjs +1 -1
  359. package/dist/math/variance.cjs.map +1 -1
  360. package/dist/math/variance.js +1 -10
  361. package/dist/math/variance.js.map +1 -1
  362. package/dist/object/defaults.cjs +1 -1
  363. package/dist/object/defaults.cjs.map +1 -1
  364. package/dist/object/defaults.js +1 -11
  365. package/dist/object/defaults.js.map +1 -1
  366. package/dist/object/diff.cjs +1 -1
  367. package/dist/object/diff.cjs.map +1 -1
  368. package/dist/object/diff.js +1 -26
  369. package/dist/object/diff.js.map +1 -1
  370. package/dist/object/filterValues.cjs +1 -1
  371. package/dist/object/filterValues.cjs.map +1 -1
  372. package/dist/object/filterValues.js +1 -10
  373. package/dist/object/filterValues.js.map +1 -1
  374. package/dist/object/flattenPaths.cjs +1 -1
  375. package/dist/object/flattenPaths.cjs.map +1 -1
  376. package/dist/object/flattenPaths.js +1 -30
  377. package/dist/object/flattenPaths.js.map +1 -1
  378. package/dist/object/getPath.cjs +1 -1
  379. package/dist/object/getPath.cjs.map +1 -1
  380. package/dist/object/getPath.js +1 -25
  381. package/dist/object/getPath.js.map +1 -1
  382. package/dist/object/hash.cjs +1 -1
  383. package/dist/object/hash.cjs.map +1 -1
  384. package/dist/object/hash.js +1 -27
  385. package/dist/object/hash.js.map +1 -1
  386. package/dist/object/index.js +1 -15
  387. package/dist/object/invert.cjs +1 -1
  388. package/dist/object/invert.cjs.map +1 -1
  389. package/dist/object/invert.js +1 -10
  390. package/dist/object/invert.js.map +1 -1
  391. package/dist/object/mapKeys.cjs +1 -1
  392. package/dist/object/mapKeys.cjs.map +1 -1
  393. package/dist/object/mapKeys.js +1 -14
  394. package/dist/object/mapKeys.js.map +1 -1
  395. package/dist/object/mapValues.cjs +1 -1
  396. package/dist/object/mapValues.cjs.map +1 -1
  397. package/dist/object/mapValues.js +1 -10
  398. package/dist/object/mapValues.js.map +1 -1
  399. package/dist/object/merge.cjs +1 -1
  400. package/dist/object/merge.cjs.map +1 -1
  401. package/dist/object/merge.js +1 -25
  402. package/dist/object/merge.js.map +1 -1
  403. package/dist/object/omit.cjs +1 -1
  404. package/dist/object/omit.cjs.map +1 -1
  405. package/dist/object/omit.js +1 -10
  406. package/dist/object/omit.js.map +1 -1
  407. package/dist/object/pick.cjs +1 -1
  408. package/dist/object/pick.cjs.map +1 -1
  409. package/dist/object/pick.js +1 -10
  410. package/dist/object/pick.js.map +1 -1
  411. package/dist/object/prune.cjs +1 -1
  412. package/dist/object/prune.cjs.map +1 -1
  413. package/dist/object/prune.js +1 -33
  414. package/dist/object/prune.js.map +1 -1
  415. package/dist/object/tryParseJson.cjs +1 -1
  416. package/dist/object/tryParseJson.cjs.map +1 -1
  417. package/dist/object/tryParseJson.js +1 -17
  418. package/dist/object/tryParseJson.js.map +1 -1
  419. package/dist/random/_index.cjs +1 -1
  420. package/dist/random/_index.cjs.map +1 -1
  421. package/dist/random/_index.js +1 -8
  422. package/dist/random/_index.js.map +1 -1
  423. package/dist/random/draw.cjs +1 -1
  424. package/dist/random/draw.cjs.map +1 -1
  425. package/dist/random/draw.js +1 -20
  426. package/dist/random/draw.js.map +1 -1
  427. package/dist/random/index.js +1 -5
  428. package/dist/random/random.cjs +1 -1
  429. package/dist/random/random.cjs.map +1 -1
  430. package/dist/random/random.js +1 -9
  431. package/dist/random/random.js.map +1 -1
  432. package/dist/random/shuffle.cjs +1 -1
  433. package/dist/random/shuffle.cjs.map +1 -1
  434. package/dist/random/shuffle.js +1 -13
  435. package/dist/random/shuffle.js.map +1 -1
  436. package/dist/random/source.cjs +1 -1
  437. package/dist/random/source.cjs.map +1 -1
  438. package/dist/random/source.js +1 -9
  439. package/dist/random/source.js.map +1 -1
  440. package/dist/string/_caseUtils.cjs +1 -1
  441. package/dist/string/_caseUtils.cjs.map +1 -1
  442. package/dist/string/_caseUtils.js +1 -12
  443. package/dist/string/_caseUtils.js.map +1 -1
  444. package/dist/string/camelCase.cjs +1 -1
  445. package/dist/string/camelCase.cjs.map +1 -1
  446. package/dist/string/camelCase.js +1 -8
  447. package/dist/string/camelCase.js.map +1 -1
  448. package/dist/string/escape.cjs +1 -1
  449. package/dist/string/escape.cjs.map +1 -1
  450. package/dist/string/escape.js +1 -14
  451. package/dist/string/escape.js.map +1 -1
  452. package/dist/string/index.js +1 -12
  453. package/dist/string/kebabCase.cjs +1 -1
  454. package/dist/string/kebabCase.cjs.map +1 -1
  455. package/dist/string/kebabCase.js +1 -8
  456. package/dist/string/kebabCase.js.map +1 -1
  457. package/dist/string/padCenter.cjs +1 -1
  458. package/dist/string/padCenter.cjs.map +1 -1
  459. package/dist/string/padCenter.js +1 -9
  460. package/dist/string/padCenter.js.map +1 -1
  461. package/dist/string/pascalCase.cjs +1 -1
  462. package/dist/string/pascalCase.cjs.map +1 -1
  463. package/dist/string/pascalCase.js +1 -8
  464. package/dist/string/pascalCase.js.map +1 -1
  465. package/dist/string/similarity.cjs +1 -1
  466. package/dist/string/similarity.cjs.map +1 -1
  467. package/dist/string/similarity.js +1 -22
  468. package/dist/string/similarity.js.map +1 -1
  469. package/dist/string/snakeCase.cjs +1 -1
  470. package/dist/string/snakeCase.cjs.map +1 -1
  471. package/dist/string/snakeCase.js +1 -8
  472. package/dist/string/snakeCase.js.map +1 -1
  473. package/dist/string/titleCase.cjs +1 -1
  474. package/dist/string/titleCase.cjs.map +1 -1
  475. package/dist/string/titleCase.js +1 -8
  476. package/dist/string/titleCase.js.map +1 -1
  477. package/dist/string/truncate.cjs +1 -1
  478. package/dist/string/truncate.cjs.map +1 -1
  479. package/dist/string/truncate.js +1 -15
  480. package/dist/string/truncate.js.map +1 -1
  481. package/dist/string/unescape.cjs +1 -1
  482. package/dist/string/unescape.cjs.map +1 -1
  483. package/dist/string/unescape.js +1 -14
  484. package/dist/string/unescape.js.map +1 -1
  485. package/dist/string/words.cjs +1 -1
  486. package/dist/string/words.cjs.map +1 -1
  487. package/dist/string/words.js +1 -9
  488. package/dist/string/words.js.map +1 -1
  489. package/dist/types.d.ts +10 -0
  490. package/dist/types.d.ts.map +1 -1
  491. package/package.json +13 -5
@@ -1 +1 @@
1
- {"version":3,"file":"diff.cjs","names":[],"sources":["../../src/object/diff.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { isEqual } from '../guards/isEqual';\nimport type { Obj } from '../types';\n\nexport type DiffResult<T extends Obj> = {\n /** Keys present in `after` but not in `before`. */\n added: Array<keyof T & string>;\n /** Keys present in both objects whose values differ. Maps key → `{ before, after }`. */\n changed: { [K in keyof T]?: { after: T[K]; before: T[K] } };\n /** Keys present in `before` but not in `after`. */\n removed: Array<keyof T & string>;\n};\n\n/**\n * Computes the structural difference between two plain objects.\n * Returns an `{ added, removed, changed }` result — no sentinel symbols needed.\n * Dangerous keys (`__proto__`, `constructor`, `prototype`) are omitted from `changed`.\n *\n * @example\n * ```ts\n * diff({ a: 1, b: 2, c: 3 }, { a: 1, b: 99 });\n * // { added: [], removed: ['c'], changed: { b: { before: 2, after: 99 } } }\n *\n * diff({ x: { n: 1 } }, { x: { n: 2 } });\n * // { added: [], removed: [], changed: { x: { before: { n: 1 }, after: { n: 2 } } } }\n * ```\n *\n * @param before - The original object.\n * @param after - The updated object.\n * @param compareFn - Custom equality function. Defaults to deep `isEqual`.\n */\nexport function diff<T extends Obj>(\n before: T = {} as T,\n after: T = {} as T,\n compareFn: (a: unknown, b: unknown) => boolean = isEqual,\n): DiffResult<T> {\n const added: Array<keyof T & string> = [];\n const removed: Array<keyof T & string> = [];\n const changed: Record<string, { after: unknown; before: unknown }> = {};\n\n const beforeKeys = new Set(Object.keys(before));\n const afterKeys = new Set(Object.keys(after));\n\n for (const key of afterKeys) {\n if (!beforeKeys.has(key)) {\n added.push(key as keyof T & string);\n } else if (!isUnsafeKey(key) && !compareFn(before[key], after[key])) {\n changed[key] = { after: after[key], before: before[key] };\n }\n }\n\n for (const key of beforeKeys) {\n if (!afterKeys.has(key)) {\n removed.push(key as keyof T & string);\n }\n }\n\n return { added, changed: changed as DiffResult<T>['changed'], removed };\n}\n\nexport type ArrayDiff<T> = {\n added: T[];\n removed: T[];\n};\n\nexport type ArrayDiffOptions<T> = {\n compareFn?: (a: T, b: T) => boolean;\n};\n\n/**\n * Computes the set-difference between two arrays.\n * Items present in `after` but not `before` are `added`.\n * Items present in `before` but not `after` are `removed`.\n * Order-independent; uses deep equality by default.\n *\n * @example\n * ```ts\n * diffArrays([1, 2, 3], [2, 3, 4]); // { added: [4], removed: [1] }\n * diffArrays(\n * [{ id: 1 }, { id: 2 }],\n * [{ id: 2 }, { id: 3 }],\n * { compareFn: (a, b) => a.id === b.id },\n * ); // { added: [{ id: 3 }], removed: [{ id: 1 }] }\n * ```\n *\n * @param before - The original array.\n * @param after - The updated array.\n * @param [options.compareFn] - Custom equality function. Defaults to deep `isEqual`.\n * @returns An object with `added` and `removed` arrays.\n */\nexport function diffArrays<T>(before: readonly T[], after: readonly T[], options?: ArrayDiffOptions<T>): ArrayDiff<T> {\n const compareFn = options?.compareFn ?? ((a: T, b: T) => isEqual(a, b));\n\n return {\n added: after.filter((item) => !before.some((b) => compareFn(b, item))),\n removed: before.filter((item) => !after.some((a) => compareFn(item, a))),\n };\n}\n"],"mappings":"iFA+BA,SAAgB,EACd,EAAY,CAAC,EACb,EAAW,CAAC,EACZ,EAAiD,EAAA,QAClC,CACf,IAAM,EAAiC,CAAC,EAClC,EAAmC,CAAC,EACpC,EAA+D,CAAC,EAEhE,EAAa,IAAI,IAAI,OAAO,KAAK,CAAM,CAAC,EACxC,EAAY,IAAI,IAAI,OAAO,KAAK,CAAK,CAAC,EAE5C,IAAK,IAAM,KAAO,EACX,EAAW,IAAI,CAAG,EAEZ,CAAC,EAAA,YAAY,CAAG,GAAK,CAAC,EAAU,EAAO,GAAM,EAAM,EAAI,IAChE,EAAQ,GAAO,CAAE,MAAO,EAAM,GAAM,OAAQ,EAAO,EAAK,GAFxD,EAAM,KAAK,CAAuB,EAMtC,IAAK,IAAM,KAAO,EACX,EAAU,IAAI,CAAG,GACpB,EAAQ,KAAK,CAAuB,EAIxC,MAAO,CAAE,QAAgB,UAAqC,SAAQ,CACxE,CAgCA,SAAgB,EAAc,EAAsB,EAAqB,EAA6C,CACpH,IAAM,EAAY,GAAS,aAAe,EAAM,IAAS,EAAA,QAAQ,EAAG,CAAC,GAErE,MAAO,CACL,MAAO,EAAM,OAAQ,GAAS,CAAC,EAAO,KAAM,GAAM,EAAU,EAAG,CAAI,CAAC,CAAC,EACrE,QAAS,EAAO,OAAQ,GAAS,CAAC,EAAM,KAAM,GAAM,EAAU,EAAM,CAAC,CAAC,CAAC,CACzE,CACF"}
1
+ {"version":3,"file":"diff.cjs","names":[],"sources":["../../src/object/diff.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { isEqual } from '../guards/isEqual';\nimport type { Obj } from '../types';\n\nexport type DiffResult<T extends Obj> = {\n /** Keys present in `after` but not in `before`. */\n added: Array<keyof T & string>;\n /** Keys present in both objects whose values differ. Maps key → `{ before, after }`. */\n changed: { [K in keyof T]?: { after: T[K]; before: T[K] } };\n /** Keys present in `before` but not in `after`. */\n removed: Array<keyof T & string>;\n};\n\n/**\n * Computes the structural difference between two plain objects.\n * Returns an `{ added, removed, changed }` result — no sentinel symbols needed.\n * Dangerous keys (`__proto__`, `constructor`, `prototype`) are omitted from `changed`.\n *\n * @example\n * ```ts\n * diff({ a: 1, b: 2, c: 3 }, { a: 1, b: 99 });\n * // { added: [], removed: ['c'], changed: { b: { before: 2, after: 99 } } }\n *\n * diff({ x: { n: 1 } }, { x: { n: 2 } });\n * // { added: [], removed: [], changed: { x: { before: { n: 1 }, after: { n: 2 } } } }\n * ```\n *\n * @param before - The original object.\n * @param after - The updated object.\n * @param compareFn - Custom equality function. Defaults to deep `isEqual`.\n */\nexport function diff<T extends Obj>(\n before: T = {} as T,\n after: T = {} as T,\n compareFn: (a: unknown, b: unknown) => boolean = isEqual,\n): DiffResult<T> {\n const added: Array<keyof T & string> = [];\n const removed: Array<keyof T & string> = [];\n const changed: Record<string, { after: unknown; before: unknown }> = {};\n\n const beforeKeys = new Set(Object.keys(before));\n const afterKeys = new Set(Object.keys(after));\n\n for (const key of afterKeys) {\n if (!beforeKeys.has(key)) {\n added.push(key as keyof T & string);\n } else if (!isUnsafeKey(key) && !compareFn(before[key], after[key])) {\n changed[key] = { after: after[key], before: before[key] };\n }\n }\n\n for (const key of beforeKeys) {\n if (!afterKeys.has(key)) {\n removed.push(key as keyof T & string);\n }\n }\n\n return { added, changed: changed as DiffResult<T>['changed'], removed };\n}\n\nexport type ArrayDiff<T> = {\n added: T[];\n removed: T[];\n};\n\nexport type ArrayDiffOptions<T> = {\n compareFn?: (a: T, b: T) => boolean;\n};\n\n/**\n * Computes the set-difference between two arrays.\n * Items present in `after` but not `before` are `added`.\n * Items present in `before` but not `after` are `removed`.\n * Order-independent; uses deep equality by default.\n *\n * @example\n * ```ts\n * diffArrays([1, 2, 3], [2, 3, 4]); // { added: [4], removed: [1] }\n * diffArrays(\n * [{ id: 1 }, { id: 2 }],\n * [{ id: 2 }, { id: 3 }],\n * { compareFn: (a, b) => a.id === b.id },\n * ); // { added: [{ id: 3 }], removed: [{ id: 1 }] }\n * ```\n *\n * @param before - The original array.\n * @param after - The updated array.\n * @param [options.compareFn] - Custom equality function. Defaults to deep `isEqual`.\n * @returns An object with `added` and `removed` arrays.\n */\nexport function diffArrays<T>(before: readonly T[], after: readonly T[], options?: ArrayDiffOptions<T>): ArrayDiff<T> {\n const compareFn = options?.compareFn ?? ((a: T, b: T) => isEqual(a, b));\n\n return {\n added: after.filter((item) => !before.some((b) => compareFn(b, item))),\n removed: before.filter((item) => !after.some((a) => compareFn(item, a))),\n };\n}\n"],"mappings":"iFA+BA,SAAgB,KACd,EAAY,CAAC,EACb,EAAW,CAAC,EACZ,EAAiD,EAAA,QAClC,CACf,IAAM,EAAiC,CAAC,EAClC,EAAmC,CAAC,EACpC,EAA+D,CAAC,EAEhE,EAAa,IAAI,IAAI,OAAO,KAAK,CAAM,CAAC,EACxC,EAAY,IAAI,IAAI,OAAO,KAAK,CAAK,CAAC,EAE5C,IAAK,IAAM,KAAO,EACX,EAAW,IAAI,CAAG,EAEZ,CAAC,EAAA,YAAY,CAAG,GAAK,CAAC,EAAU,EAAO,GAAM,EAAM,EAAI,IAChE,EAAQ,GAAO,CAAE,MAAO,EAAM,GAAM,OAAQ,EAAO,EAAK,GAFxD,EAAM,KAAK,CAAuB,EAMtC,IAAK,IAAM,KAAO,EACX,EAAU,IAAI,CAAG,GACpB,EAAQ,KAAK,CAAuB,EAIxC,MAAO,CAAE,QAAgB,UAAqC,SAAQ,CACxE,CAgCA,SAAgB,WAAc,EAAsB,EAAqB,EAA6C,CACpH,IAAM,EAAY,GAAS,aAAe,EAAM,IAAS,EAAA,QAAQ,EAAG,CAAC,GAErE,MAAO,CACL,MAAO,EAAM,OAAQ,GAAS,CAAC,EAAO,KAAM,GAAM,EAAU,EAAG,CAAI,CAAC,CAAC,EACrE,QAAS,EAAO,OAAQ,GAAS,CAAC,EAAM,KAAM,GAAM,EAAU,EAAM,CAAC,CAAC,CAAC,CACzE,CACF"}
@@ -1,27 +1,2 @@
1
- import { isEqual as e } from "../guards/isEqual.js";
2
- import { isUnsafeKey as t } from "../_common/unsafePaths.js";
3
- //#region src/object/diff.ts
4
- function n(n = {}, r = {}, i = e) {
5
- let a = [], o = [], s = {}, c = new Set(Object.keys(n)), l = new Set(Object.keys(r));
6
- for (let e of l) c.has(e) ? !t(e) && !i(n[e], r[e]) && (s[e] = {
7
- after: r[e],
8
- before: n[e]
9
- }) : a.push(e);
10
- for (let e of c) l.has(e) || o.push(e);
11
- return {
12
- added: a,
13
- changed: s,
14
- removed: o
15
- };
16
- }
17
- function r(t, n, r) {
18
- let i = r?.compareFn ?? ((t, n) => e(t, n));
19
- return {
20
- added: n.filter((e) => !t.some((t) => i(t, e))),
21
- removed: t.filter((e) => !n.some((t) => i(e, t)))
22
- };
23
- }
24
- //#endregion
25
- export { n as diff, r as diffArrays };
26
-
1
+ import{isEqual as e}from"../guards/isEqual.js";import{isUnsafeKey as t}from"../_common/unsafePaths.js";function diff(n={},r={},i=e){let a=[],o=[],s={},c=new Set(Object.keys(n)),l=new Set(Object.keys(r));for(let e of l)c.has(e)?!t(e)&&!i(n[e],r[e])&&(s[e]={after:r[e],before:n[e]}):a.push(e);for(let e of c)l.has(e)||o.push(e);return{added:a,changed:s,removed:o}}function diffArrays(t,n,r){let i=r?.compareFn??((t,n)=>e(t,n));return{added:n.filter(e=>!t.some(t=>i(t,e))),removed:t.filter(e=>!n.some(t=>i(e,t)))}}export{diff,diffArrays};
27
2
  //# sourceMappingURL=diff.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"diff.js","names":[],"sources":["../../src/object/diff.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { isEqual } from '../guards/isEqual';\nimport type { Obj } from '../types';\n\nexport type DiffResult<T extends Obj> = {\n /** Keys present in `after` but not in `before`. */\n added: Array<keyof T & string>;\n /** Keys present in both objects whose values differ. Maps key → `{ before, after }`. */\n changed: { [K in keyof T]?: { after: T[K]; before: T[K] } };\n /** Keys present in `before` but not in `after`. */\n removed: Array<keyof T & string>;\n};\n\n/**\n * Computes the structural difference between two plain objects.\n * Returns an `{ added, removed, changed }` result — no sentinel symbols needed.\n * Dangerous keys (`__proto__`, `constructor`, `prototype`) are omitted from `changed`.\n *\n * @example\n * ```ts\n * diff({ a: 1, b: 2, c: 3 }, { a: 1, b: 99 });\n * // { added: [], removed: ['c'], changed: { b: { before: 2, after: 99 } } }\n *\n * diff({ x: { n: 1 } }, { x: { n: 2 } });\n * // { added: [], removed: [], changed: { x: { before: { n: 1 }, after: { n: 2 } } } }\n * ```\n *\n * @param before - The original object.\n * @param after - The updated object.\n * @param compareFn - Custom equality function. Defaults to deep `isEqual`.\n */\nexport function diff<T extends Obj>(\n before: T = {} as T,\n after: T = {} as T,\n compareFn: (a: unknown, b: unknown) => boolean = isEqual,\n): DiffResult<T> {\n const added: Array<keyof T & string> = [];\n const removed: Array<keyof T & string> = [];\n const changed: Record<string, { after: unknown; before: unknown }> = {};\n\n const beforeKeys = new Set(Object.keys(before));\n const afterKeys = new Set(Object.keys(after));\n\n for (const key of afterKeys) {\n if (!beforeKeys.has(key)) {\n added.push(key as keyof T & string);\n } else if (!isUnsafeKey(key) && !compareFn(before[key], after[key])) {\n changed[key] = { after: after[key], before: before[key] };\n }\n }\n\n for (const key of beforeKeys) {\n if (!afterKeys.has(key)) {\n removed.push(key as keyof T & string);\n }\n }\n\n return { added, changed: changed as DiffResult<T>['changed'], removed };\n}\n\nexport type ArrayDiff<T> = {\n added: T[];\n removed: T[];\n};\n\nexport type ArrayDiffOptions<T> = {\n compareFn?: (a: T, b: T) => boolean;\n};\n\n/**\n * Computes the set-difference between two arrays.\n * Items present in `after` but not `before` are `added`.\n * Items present in `before` but not `after` are `removed`.\n * Order-independent; uses deep equality by default.\n *\n * @example\n * ```ts\n * diffArrays([1, 2, 3], [2, 3, 4]); // { added: [4], removed: [1] }\n * diffArrays(\n * [{ id: 1 }, { id: 2 }],\n * [{ id: 2 }, { id: 3 }],\n * { compareFn: (a, b) => a.id === b.id },\n * ); // { added: [{ id: 3 }], removed: [{ id: 1 }] }\n * ```\n *\n * @param before - The original array.\n * @param after - The updated array.\n * @param [options.compareFn] - Custom equality function. Defaults to deep `isEqual`.\n * @returns An object with `added` and `removed` arrays.\n */\nexport function diffArrays<T>(before: readonly T[], after: readonly T[], options?: ArrayDiffOptions<T>): ArrayDiff<T> {\n const compareFn = options?.compareFn ?? ((a: T, b: T) => isEqual(a, b));\n\n return {\n added: after.filter((item) => !before.some((b) => compareFn(b, item))),\n removed: before.filter((item) => !after.some((a) => compareFn(item, a))),\n };\n}\n"],"mappings":";;;AA+BA,SAAgB,EACd,IAAY,CAAC,GACb,IAAW,CAAC,GACZ,IAAiD,GAClC;CACf,IAAM,IAAiC,CAAC,GAClC,IAAmC,CAAC,GACpC,IAA+D,CAAC,GAEhE,IAAa,IAAI,IAAI,OAAO,KAAK,CAAM,CAAC,GACxC,IAAY,IAAI,IAAI,OAAO,KAAK,CAAK,CAAC;CAE5C,KAAK,IAAM,KAAO,GAChB,AAAK,EAAW,IAAI,CAAG,IAEZ,CAAC,EAAY,CAAG,KAAK,CAAC,EAAU,EAAO,IAAM,EAAM,EAAI,MAChE,EAAQ,KAAO;EAAE,OAAO,EAAM;EAAM,QAAQ,EAAO;CAAK,KAFxD,EAAM,KAAK,CAAuB;CAMtC,KAAK,IAAM,KAAO,GAChB,AAAK,EAAU,IAAI,CAAG,KACpB,EAAQ,KAAK,CAAuB;CAIxC,OAAO;EAAE;EAAgB;EAAqC;CAAQ;AACxE;AAgCA,SAAgB,EAAc,GAAsB,GAAqB,GAA6C;CACpH,IAAM,IAAY,GAAS,eAAe,GAAM,MAAS,EAAQ,GAAG,CAAC;CAErE,OAAO;EACL,OAAO,EAAM,QAAQ,MAAS,CAAC,EAAO,MAAM,MAAM,EAAU,GAAG,CAAI,CAAC,CAAC;EACrE,SAAS,EAAO,QAAQ,MAAS,CAAC,EAAM,MAAM,MAAM,EAAU,GAAM,CAAC,CAAC,CAAC;CACzE;AACF"}
1
+ {"version":3,"file":"diff.js","names":[],"sources":["../../src/object/diff.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { isEqual } from '../guards/isEqual';\nimport type { Obj } from '../types';\n\nexport type DiffResult<T extends Obj> = {\n /** Keys present in `after` but not in `before`. */\n added: Array<keyof T & string>;\n /** Keys present in both objects whose values differ. Maps key → `{ before, after }`. */\n changed: { [K in keyof T]?: { after: T[K]; before: T[K] } };\n /** Keys present in `before` but not in `after`. */\n removed: Array<keyof T & string>;\n};\n\n/**\n * Computes the structural difference between two plain objects.\n * Returns an `{ added, removed, changed }` result — no sentinel symbols needed.\n * Dangerous keys (`__proto__`, `constructor`, `prototype`) are omitted from `changed`.\n *\n * @example\n * ```ts\n * diff({ a: 1, b: 2, c: 3 }, { a: 1, b: 99 });\n * // { added: [], removed: ['c'], changed: { b: { before: 2, after: 99 } } }\n *\n * diff({ x: { n: 1 } }, { x: { n: 2 } });\n * // { added: [], removed: [], changed: { x: { before: { n: 1 }, after: { n: 2 } } } }\n * ```\n *\n * @param before - The original object.\n * @param after - The updated object.\n * @param compareFn - Custom equality function. Defaults to deep `isEqual`.\n */\nexport function diff<T extends Obj>(\n before: T = {} as T,\n after: T = {} as T,\n compareFn: (a: unknown, b: unknown) => boolean = isEqual,\n): DiffResult<T> {\n const added: Array<keyof T & string> = [];\n const removed: Array<keyof T & string> = [];\n const changed: Record<string, { after: unknown; before: unknown }> = {};\n\n const beforeKeys = new Set(Object.keys(before));\n const afterKeys = new Set(Object.keys(after));\n\n for (const key of afterKeys) {\n if (!beforeKeys.has(key)) {\n added.push(key as keyof T & string);\n } else if (!isUnsafeKey(key) && !compareFn(before[key], after[key])) {\n changed[key] = { after: after[key], before: before[key] };\n }\n }\n\n for (const key of beforeKeys) {\n if (!afterKeys.has(key)) {\n removed.push(key as keyof T & string);\n }\n }\n\n return { added, changed: changed as DiffResult<T>['changed'], removed };\n}\n\nexport type ArrayDiff<T> = {\n added: T[];\n removed: T[];\n};\n\nexport type ArrayDiffOptions<T> = {\n compareFn?: (a: T, b: T) => boolean;\n};\n\n/**\n * Computes the set-difference between two arrays.\n * Items present in `after` but not `before` are `added`.\n * Items present in `before` but not `after` are `removed`.\n * Order-independent; uses deep equality by default.\n *\n * @example\n * ```ts\n * diffArrays([1, 2, 3], [2, 3, 4]); // { added: [4], removed: [1] }\n * diffArrays(\n * [{ id: 1 }, { id: 2 }],\n * [{ id: 2 }, { id: 3 }],\n * { compareFn: (a, b) => a.id === b.id },\n * ); // { added: [{ id: 3 }], removed: [{ id: 1 }] }\n * ```\n *\n * @param before - The original array.\n * @param after - The updated array.\n * @param [options.compareFn] - Custom equality function. Defaults to deep `isEqual`.\n * @returns An object with `added` and `removed` arrays.\n */\nexport function diffArrays<T>(before: readonly T[], after: readonly T[], options?: ArrayDiffOptions<T>): ArrayDiff<T> {\n const compareFn = options?.compareFn ?? ((a: T, b: T) => isEqual(a, b));\n\n return {\n added: after.filter((item) => !before.some((b) => compareFn(b, item))),\n removed: before.filter((item) => !after.some((a) => compareFn(item, a))),\n };\n}\n"],"mappings":"uGA+BA,SAAgB,KACd,EAAY,CAAC,EACb,EAAW,CAAC,EACZ,EAAiD,EAClC,CACf,IAAM,EAAiC,CAAC,EAClC,EAAmC,CAAC,EACpC,EAA+D,CAAC,EAEhE,EAAa,IAAI,IAAI,OAAO,KAAK,CAAM,CAAC,EACxC,EAAY,IAAI,IAAI,OAAO,KAAK,CAAK,CAAC,EAE5C,IAAK,IAAM,KAAO,EACX,EAAW,IAAI,CAAG,EAEZ,CAAC,EAAY,CAAG,GAAK,CAAC,EAAU,EAAO,GAAM,EAAM,EAAI,IAChE,EAAQ,GAAO,CAAE,MAAO,EAAM,GAAM,OAAQ,EAAO,EAAK,GAFxD,EAAM,KAAK,CAAuB,EAMtC,IAAK,IAAM,KAAO,EACX,EAAU,IAAI,CAAG,GACpB,EAAQ,KAAK,CAAuB,EAIxC,MAAO,CAAE,QAAgB,UAAqC,SAAQ,CACxE,CAgCA,SAAgB,WAAc,EAAsB,EAAqB,EAA6C,CACpH,IAAM,EAAY,GAAS,aAAe,EAAM,IAAS,EAAQ,EAAG,CAAC,GAErE,MAAO,CACL,MAAO,EAAM,OAAQ,GAAS,CAAC,EAAO,KAAM,GAAM,EAAU,EAAG,CAAI,CAAC,CAAC,EACrE,QAAS,EAAO,OAAQ,GAAS,CAAC,EAAM,KAAM,GAAM,EAAU,EAAM,CAAC,CAAC,CAAC,CACzE,CACF"}
@@ -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)||n(t[i],i,t)&&(r[i]=t[i]);return r}exports.filterValues=t;
1
+ const e=require("../_common/unsafePaths.cjs");function filterValues(t,n){let r={};for(let i of Object.keys(t))e.isUnsafeKey(i)||n(t[i],i,t)&&(r[i]=t[i]);return r}exports.filterValues=filterValues;
2
2
  //# sourceMappingURL=filterValues.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"filterValues.cjs","names":[],"sources":["../../src/object/filterValues.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Filters object entries using a value predicate. Dangerous keys (`__proto__`, `constructor`,\n * `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * filterValues({ a: 1, b: 2, c: 3 }, (value) => value > 1); // { b: 2, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param predicate - Returns `true` to keep an entry.\n * @returns A new object containing only entries for which `predicate` returned `true`.\n */\nexport function filterValues<T extends Obj>(\n obj: T,\n predicate: (value: T[keyof T], key: keyof T, obj: T) => boolean,\n): Partial<T> {\n const out: Partial<T> = {};\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (predicate(obj[key], key, obj)) {\n out[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":"8CAgBA,SAAgB,EACd,EACA,EACY,CACZ,IAAM,EAAkB,CAAC,EAEzB,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAC3B,EAAA,YAAY,CAAkB,GAE9B,EAAU,EAAI,GAAM,EAAK,CAAG,IAC9B,EAAI,GAAO,EAAI,IAInB,OAAO,CACT"}
1
+ {"version":3,"file":"filterValues.cjs","names":[],"sources":["../../src/object/filterValues.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Filters object entries using a value predicate. Dangerous keys (`__proto__`, `constructor`,\n * `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * filterValues({ a: 1, b: 2, c: 3 }, (value) => value > 1); // { b: 2, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param predicate - Returns `true` to keep an entry.\n * @returns A new object containing only entries for which `predicate` returned `true`.\n */\nexport function filterValues<T extends Obj>(\n obj: T,\n predicate: (value: T[keyof T], key: keyof T, obj: T) => boolean,\n): Partial<T> {\n const out: Partial<T> = {};\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (predicate(obj[key], key, obj)) {\n out[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":"8CAgBA,SAAgB,aACd,EACA,EACY,CACZ,IAAM,EAAkB,CAAC,EAEzB,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAC3B,EAAA,YAAY,CAAkB,GAE9B,EAAU,EAAI,GAAM,EAAK,CAAG,IAC9B,EAAI,GAAO,EAAI,IAInB,OAAO,CACT"}
@@ -1,11 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- //#region src/object/filterValues.ts
3
- function t(t, n) {
4
- let r = {};
5
- for (let i of Object.keys(t)) e(i) || n(t[i], i, t) && (r[i] = t[i]);
6
- return r;
7
- }
8
- //#endregion
9
- export { t as filterValues };
10
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";function filterValues(t,n){let r={};for(let i of Object.keys(t))e(i)||n(t[i],i,t)&&(r[i]=t[i]);return r}export{filterValues};
11
2
  //# sourceMappingURL=filterValues.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filterValues.js","names":[],"sources":["../../src/object/filterValues.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Filters object entries using a value predicate. Dangerous keys (`__proto__`, `constructor`,\n * `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * filterValues({ a: 1, b: 2, c: 3 }, (value) => value > 1); // { b: 2, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param predicate - Returns `true` to keep an entry.\n * @returns A new object containing only entries for which `predicate` returned `true`.\n */\nexport function filterValues<T extends Obj>(\n obj: T,\n predicate: (value: T[keyof T], key: keyof T, obj: T) => boolean,\n): Partial<T> {\n const out: Partial<T> = {};\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (predicate(obj[key], key, obj)) {\n out[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":";;AAgBA,SAAgB,EACd,GACA,GACY;CACZ,IAAM,IAAkB,CAAC;CAEzB,KAAK,IAAM,KAAO,OAAO,KAAK,CAAG,GAC3B,EAAY,CAAkB,KAE9B,EAAU,EAAI,IAAM,GAAK,CAAG,MAC9B,EAAI,KAAO,EAAI;CAInB,OAAO;AACT"}
1
+ {"version":3,"file":"filterValues.js","names":[],"sources":["../../src/object/filterValues.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\n/**\n * Filters object entries using a value predicate. Dangerous keys (`__proto__`, `constructor`,\n * `prototype`) are always skipped.\n *\n * @example\n * ```ts\n * filterValues({ a: 1, b: 2, c: 3 }, (value) => value > 1); // { b: 2, c: 3 }\n * ```\n *\n * @param obj - The source object.\n * @param predicate - Returns `true` to keep an entry.\n * @returns A new object containing only entries for which `predicate` returned `true`.\n */\nexport function filterValues<T extends Obj>(\n obj: T,\n predicate: (value: T[keyof T], key: keyof T, obj: T) => boolean,\n): Partial<T> {\n const out: Partial<T> = {};\n\n for (const key of Object.keys(obj) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (predicate(obj[key], key, obj)) {\n out[key] = obj[key];\n }\n }\n\n return out;\n}\n"],"mappings":"wDAgBA,SAAgB,aACd,EACA,EACY,CACZ,IAAM,EAAkB,CAAC,EAEzB,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EAC3B,EAAY,CAAkB,GAE9B,EAAU,EAAI,GAAM,EAAK,CAAG,IAC9B,EAAI,GAAO,EAAI,IAInB,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs"),t=require("../guards/isPlainObject.cjs");var n=10;function r(i,a,o){let s={};for(let[c,l]of Object.entries(i)){if(e.UNSAFE_PATH_SEGMENTS.has(c))continue;let i=a?`${a}.${c}`:c;t.isPlainObject(l)&&o<n?Object.assign(s,r(l,i,o+1)):s[i]=l}return s}function i(e){return r(e,``,0)}function a(n){let r={};for(let[i,a]of Object.entries(n)){let n=i.split(`.`);if(n.some(t=>e.UNSAFE_PATH_SEGMENTS.has(t)))continue;let o=r;for(let e=0;e<n.length-1;e++)t.isPlainObject(o[n[e]])||(o[n[e]]={}),o=o[n[e]];o[n[n.length-1]]=a}return r}exports.flattenPaths=i,exports.unflattenPaths=a;
1
+ const e=require("../_common/unsafePaths.cjs"),t=require("../guards/isPlainObject.cjs");var n=10;function _flattenPaths(r,i,a){let o={};for(let[s,c]of Object.entries(r)){if(e.UNSAFE_PATH_SEGMENTS.has(s))continue;let r=i?`${i}.${s}`:s;t.isPlainObject(c)&&a<n?Object.assign(o,_flattenPaths(c,r,a+1)):o[r]=c}return o}function flattenPaths(e){return _flattenPaths(e,``,0)}function unflattenPaths(n){let r={};for(let[i,a]of Object.entries(n)){let n=i.split(`.`);if(n.some(t=>e.UNSAFE_PATH_SEGMENTS.has(t)))continue;let o=r;for(let e=0;e<n.length-1;e++)t.isPlainObject(o[n[e]])||(o[n[e]]={}),o=o[n[e]];o[n[n.length-1]]=a}return r}exports.flattenPaths=flattenPaths,exports.unflattenPaths=unflattenPaths;
2
2
  //# sourceMappingURL=flattenPaths.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"flattenPaths.cjs","names":[],"sources":["../../src/object/flattenPaths.ts"],"sourcesContent":["import { UNSAFE_PATH_SEGMENTS } from '../_common/unsafePaths';\nimport { isPlainObject } from '../guards/isPlainObject';\n\n/**\n * Flattens a nested plain object into a map of dot-notation path keys to leaf values.\n * Keys containing unsafe segments (`__proto__`, `constructor`, `prototype`) are silently skipped.\n * Nesting beyond MAX_FLATTEN_DEPTH is treated as an opaque leaf value to prevent stack overflows.\n *\n * @example\n * ```ts\n * flattenPaths({ a: { b: 1, c: 2 }, d: 3 })\n * // { 'a.b': 1, 'a.c': 2, 'd': 3 }\n * ```\n */\nconst MAX_FLATTEN_DEPTH = 10;\n\nfunction _flattenPaths(obj: Record<string, unknown>, prefix: string, depth: number): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(obj)) {\n if (UNSAFE_PATH_SEGMENTS.has(key)) continue;\n\n const fullKey = prefix ? `${prefix}.${key}` : key;\n\n if (isPlainObject(val) && depth < MAX_FLATTEN_DEPTH) {\n Object.assign(result, _flattenPaths(val as Record<string, unknown>, fullKey, depth + 1));\n } else {\n result[fullKey] = val;\n }\n }\n\n return result;\n}\n\nexport function flattenPaths(obj: Record<string, unknown>): Record<string, unknown> {\n return _flattenPaths(obj, '', 0);\n}\n\n/**\n * Reconstructs a nested plain object from a map of dot-notation path keys to leaf values.\n * Any path containing an unsafe segment is silently skipped.\n *\n * @example\n * ```ts\n * unflattenPaths({ 'a.b': 1, 'a.c': 2, 'd': 3 })\n * // { a: { b: 1, c: 2 }, d: 3 }\n * ```\n */\nexport function unflattenPaths(flat: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(flat)) {\n const parts = key.split('.');\n\n if (parts.some((p) => UNSAFE_PATH_SEGMENTS.has(p))) continue;\n\n let obj = result;\n\n for (let i = 0; i < parts.length - 1; i++) {\n if (!isPlainObject(obj[parts[i]])) {\n obj[parts[i]] = {};\n }\n\n obj = obj[parts[i]] as Record<string, unknown>;\n }\n\n obj[parts[parts.length - 1]] = val;\n }\n\n return result;\n}\n"],"mappings":"uFAcA,IAAM,EAAoB,GAE1B,SAAS,EAAc,EAA8B,EAAgB,EAAwC,CAC3G,IAAM,EAAkC,CAAC,EAEzC,IAAK,GAAM,CAAC,EAAK,KAAQ,OAAO,QAAQ,CAAG,EAAG,CAC5C,GAAI,EAAA,qBAAqB,IAAI,CAAG,EAAG,SAEnC,IAAM,EAAU,EAAS,GAAG,EAAO,GAAG,IAAQ,EAE1C,EAAA,cAAc,CAAG,GAAK,EAAQ,EAChC,OAAO,OAAO,EAAQ,EAAc,EAAgC,EAAS,EAAQ,CAAC,CAAC,EAEvF,EAAO,GAAW,CAEtB,CAEA,OAAO,CACT,CAEA,SAAgB,EAAa,EAAuD,CAClF,OAAO,EAAc,EAAK,GAAI,CAAC,CACjC,CAYA,SAAgB,EAAe,EAAwD,CACrF,IAAM,EAAkC,CAAC,EAEzC,IAAK,GAAM,CAAC,EAAK,KAAQ,OAAO,QAAQ,CAAI,EAAG,CAC7C,IAAM,EAAQ,EAAI,MAAM,GAAG,EAE3B,GAAI,EAAM,KAAM,GAAM,EAAA,qBAAqB,IAAI,CAAC,CAAC,EAAG,SAEpD,IAAI,EAAM,EAEV,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAS,EAAG,IAC/B,EAAA,cAAc,EAAI,EAAM,GAAG,IAC9B,EAAI,EAAM,IAAM,CAAC,GAGnB,EAAM,EAAI,EAAM,IAGlB,EAAI,EAAM,EAAM,OAAS,IAAM,CACjC,CAEA,OAAO,CACT"}
1
+ {"version":3,"file":"flattenPaths.cjs","names":[],"sources":["../../src/object/flattenPaths.ts"],"sourcesContent":["import { UNSAFE_PATH_SEGMENTS } from '../_common/unsafePaths';\nimport { isPlainObject } from '../guards/isPlainObject';\n\n/**\n * Flattens a nested plain object into a map of dot-notation path keys to leaf values.\n * Keys containing unsafe segments (`__proto__`, `constructor`, `prototype`) are silently skipped.\n * Nesting beyond MAX_FLATTEN_DEPTH is treated as an opaque leaf value to prevent stack overflows.\n *\n * @example\n * ```ts\n * flattenPaths({ a: { b: 1, c: 2 }, d: 3 })\n * // { 'a.b': 1, 'a.c': 2, 'd': 3 }\n * ```\n */\nconst MAX_FLATTEN_DEPTH = 10;\n\nfunction _flattenPaths(obj: Record<string, unknown>, prefix: string, depth: number): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(obj)) {\n if (UNSAFE_PATH_SEGMENTS.has(key)) continue;\n\n const fullKey = prefix ? `${prefix}.${key}` : key;\n\n if (isPlainObject(val) && depth < MAX_FLATTEN_DEPTH) {\n Object.assign(result, _flattenPaths(val as Record<string, unknown>, fullKey, depth + 1));\n } else {\n result[fullKey] = val;\n }\n }\n\n return result;\n}\n\nexport function flattenPaths(obj: Record<string, unknown>): Record<string, unknown> {\n return _flattenPaths(obj, '', 0);\n}\n\n/**\n * Reconstructs a nested plain object from a map of dot-notation path keys to leaf values.\n * Any path containing an unsafe segment is silently skipped.\n *\n * @example\n * ```ts\n * unflattenPaths({ 'a.b': 1, 'a.c': 2, 'd': 3 })\n * // { a: { b: 1, c: 2 }, d: 3 }\n * ```\n */\nexport function unflattenPaths(flat: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(flat)) {\n const parts = key.split('.');\n\n if (parts.some((p) => UNSAFE_PATH_SEGMENTS.has(p))) continue;\n\n let obj = result;\n\n for (let i = 0; i < parts.length - 1; i++) {\n if (!isPlainObject(obj[parts[i]])) {\n obj[parts[i]] = {};\n }\n\n obj = obj[parts[i]] as Record<string, unknown>;\n }\n\n obj[parts[parts.length - 1]] = val;\n }\n\n return result;\n}\n"],"mappings":"uFAcA,IAAM,EAAoB,GAE1B,SAAS,cAAc,EAA8B,EAAgB,EAAwC,CAC3G,IAAM,EAAkC,CAAC,EAEzC,IAAK,GAAM,CAAC,EAAK,KAAQ,OAAO,QAAQ,CAAG,EAAG,CAC5C,GAAI,EAAA,qBAAqB,IAAI,CAAG,EAAG,SAEnC,IAAM,EAAU,EAAS,GAAG,EAAO,GAAG,IAAQ,EAE1C,EAAA,cAAc,CAAG,GAAK,EAAQ,EAChC,OAAO,OAAO,EAAQ,cAAc,EAAgC,EAAS,EAAQ,CAAC,CAAC,EAEvF,EAAO,GAAW,CAEtB,CAEA,OAAO,CACT,CAEA,SAAgB,aAAa,EAAuD,CAClF,OAAO,cAAc,EAAK,GAAI,CAAC,CACjC,CAYA,SAAgB,eAAe,EAAwD,CACrF,IAAM,EAAkC,CAAC,EAEzC,IAAK,GAAM,CAAC,EAAK,KAAQ,OAAO,QAAQ,CAAI,EAAG,CAC7C,IAAM,EAAQ,EAAI,MAAM,GAAG,EAE3B,GAAI,EAAM,KAAM,GAAM,EAAA,qBAAqB,IAAI,CAAC,CAAC,EAAG,SAEpD,IAAI,EAAM,EAEV,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAS,EAAG,IAC/B,EAAA,cAAc,EAAI,EAAM,GAAG,IAC9B,EAAI,EAAM,IAAM,CAAC,GAGnB,EAAM,EAAI,EAAM,IAGlB,EAAI,EAAM,EAAM,OAAS,IAAM,CACjC,CAEA,OAAO,CACT"}
@@ -1,31 +1,2 @@
1
- import { UNSAFE_PATH_SEGMENTS as e } from "../_common/unsafePaths.js";
2
- import { isPlainObject as t } from "../guards/isPlainObject.js";
3
- //#region src/object/flattenPaths.ts
4
- var n = 10;
5
- function r(i, a, o) {
6
- let s = {};
7
- for (let [c, l] of Object.entries(i)) {
8
- if (e.has(c)) continue;
9
- let i = a ? `${a}.${c}` : c;
10
- t(l) && o < n ? Object.assign(s, r(l, i, o + 1)) : s[i] = l;
11
- }
12
- return s;
13
- }
14
- function i(e) {
15
- return r(e, "", 0);
16
- }
17
- function a(n) {
18
- let r = {};
19
- for (let [i, a] of Object.entries(n)) {
20
- let n = i.split(".");
21
- if (n.some((t) => e.has(t))) continue;
22
- let o = r;
23
- for (let e = 0; e < n.length - 1; e++) t(o[n[e]]) || (o[n[e]] = {}), o = o[n[e]];
24
- o[n[n.length - 1]] = a;
25
- }
26
- return r;
27
- }
28
- //#endregion
29
- export { i as flattenPaths, a as unflattenPaths };
30
-
1
+ import{UNSAFE_PATH_SEGMENTS as e}from"../_common/unsafePaths.js";import{isPlainObject as t}from"../guards/isPlainObject.js";var n=10;function _flattenPaths(r,i,a){let o={};for(let[s,c]of Object.entries(r)){if(e.has(s))continue;let r=i?`${i}.${s}`:s;t(c)&&a<n?Object.assign(o,_flattenPaths(c,r,a+1)):o[r]=c}return o}function flattenPaths(e){return _flattenPaths(e,``,0)}function unflattenPaths(n){let r={};for(let[i,a]of Object.entries(n)){let n=i.split(`.`);if(n.some(t=>e.has(t)))continue;let o=r;for(let e=0;e<n.length-1;e++)t(o[n[e]])||(o[n[e]]={}),o=o[n[e]];o[n[n.length-1]]=a}return r}export{flattenPaths,unflattenPaths};
31
2
  //# sourceMappingURL=flattenPaths.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flattenPaths.js","names":[],"sources":["../../src/object/flattenPaths.ts"],"sourcesContent":["import { UNSAFE_PATH_SEGMENTS } from '../_common/unsafePaths';\nimport { isPlainObject } from '../guards/isPlainObject';\n\n/**\n * Flattens a nested plain object into a map of dot-notation path keys to leaf values.\n * Keys containing unsafe segments (`__proto__`, `constructor`, `prototype`) are silently skipped.\n * Nesting beyond MAX_FLATTEN_DEPTH is treated as an opaque leaf value to prevent stack overflows.\n *\n * @example\n * ```ts\n * flattenPaths({ a: { b: 1, c: 2 }, d: 3 })\n * // { 'a.b': 1, 'a.c': 2, 'd': 3 }\n * ```\n */\nconst MAX_FLATTEN_DEPTH = 10;\n\nfunction _flattenPaths(obj: Record<string, unknown>, prefix: string, depth: number): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(obj)) {\n if (UNSAFE_PATH_SEGMENTS.has(key)) continue;\n\n const fullKey = prefix ? `${prefix}.${key}` : key;\n\n if (isPlainObject(val) && depth < MAX_FLATTEN_DEPTH) {\n Object.assign(result, _flattenPaths(val as Record<string, unknown>, fullKey, depth + 1));\n } else {\n result[fullKey] = val;\n }\n }\n\n return result;\n}\n\nexport function flattenPaths(obj: Record<string, unknown>): Record<string, unknown> {\n return _flattenPaths(obj, '', 0);\n}\n\n/**\n * Reconstructs a nested plain object from a map of dot-notation path keys to leaf values.\n * Any path containing an unsafe segment is silently skipped.\n *\n * @example\n * ```ts\n * unflattenPaths({ 'a.b': 1, 'a.c': 2, 'd': 3 })\n * // { a: { b: 1, c: 2 }, d: 3 }\n * ```\n */\nexport function unflattenPaths(flat: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(flat)) {\n const parts = key.split('.');\n\n if (parts.some((p) => UNSAFE_PATH_SEGMENTS.has(p))) continue;\n\n let obj = result;\n\n for (let i = 0; i < parts.length - 1; i++) {\n if (!isPlainObject(obj[parts[i]])) {\n obj[parts[i]] = {};\n }\n\n obj = obj[parts[i]] as Record<string, unknown>;\n }\n\n obj[parts[parts.length - 1]] = val;\n }\n\n return result;\n}\n"],"mappings":";;;AAcA,IAAM,IAAoB;AAE1B,SAAS,EAAc,GAA8B,GAAgB,GAAwC;CAC3G,IAAM,IAAkC,CAAC;CAEzC,KAAK,IAAM,CAAC,GAAK,MAAQ,OAAO,QAAQ,CAAG,GAAG;EAC5C,IAAI,EAAqB,IAAI,CAAG,GAAG;EAEnC,IAAM,IAAU,IAAS,GAAG,EAAO,GAAG,MAAQ;EAE9C,AAAI,EAAc,CAAG,KAAK,IAAQ,IAChC,OAAO,OAAO,GAAQ,EAAc,GAAgC,GAAS,IAAQ,CAAC,CAAC,IAEvF,EAAO,KAAW;CAEtB;CAEA,OAAO;AACT;AAEA,SAAgB,EAAa,GAAuD;CAClF,OAAO,EAAc,GAAK,IAAI,CAAC;AACjC;AAYA,SAAgB,EAAe,GAAwD;CACrF,IAAM,IAAkC,CAAC;CAEzC,KAAK,IAAM,CAAC,GAAK,MAAQ,OAAO,QAAQ,CAAI,GAAG;EAC7C,IAAM,IAAQ,EAAI,MAAM,GAAG;EAE3B,IAAI,EAAM,MAAM,MAAM,EAAqB,IAAI,CAAC,CAAC,GAAG;EAEpD,IAAI,IAAM;EAEV,KAAK,IAAI,IAAI,GAAG,IAAI,EAAM,SAAS,GAAG,KAKpC,AAJK,EAAc,EAAI,EAAM,GAAG,MAC9B,EAAI,EAAM,MAAM,CAAC,IAGnB,IAAM,EAAI,EAAM;EAGlB,EAAI,EAAM,EAAM,SAAS,MAAM;CACjC;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"flattenPaths.js","names":[],"sources":["../../src/object/flattenPaths.ts"],"sourcesContent":["import { UNSAFE_PATH_SEGMENTS } from '../_common/unsafePaths';\nimport { isPlainObject } from '../guards/isPlainObject';\n\n/**\n * Flattens a nested plain object into a map of dot-notation path keys to leaf values.\n * Keys containing unsafe segments (`__proto__`, `constructor`, `prototype`) are silently skipped.\n * Nesting beyond MAX_FLATTEN_DEPTH is treated as an opaque leaf value to prevent stack overflows.\n *\n * @example\n * ```ts\n * flattenPaths({ a: { b: 1, c: 2 }, d: 3 })\n * // { 'a.b': 1, 'a.c': 2, 'd': 3 }\n * ```\n */\nconst MAX_FLATTEN_DEPTH = 10;\n\nfunction _flattenPaths(obj: Record<string, unknown>, prefix: string, depth: number): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(obj)) {\n if (UNSAFE_PATH_SEGMENTS.has(key)) continue;\n\n const fullKey = prefix ? `${prefix}.${key}` : key;\n\n if (isPlainObject(val) && depth < MAX_FLATTEN_DEPTH) {\n Object.assign(result, _flattenPaths(val as Record<string, unknown>, fullKey, depth + 1));\n } else {\n result[fullKey] = val;\n }\n }\n\n return result;\n}\n\nexport function flattenPaths(obj: Record<string, unknown>): Record<string, unknown> {\n return _flattenPaths(obj, '', 0);\n}\n\n/**\n * Reconstructs a nested plain object from a map of dot-notation path keys to leaf values.\n * Any path containing an unsafe segment is silently skipped.\n *\n * @example\n * ```ts\n * unflattenPaths({ 'a.b': 1, 'a.c': 2, 'd': 3 })\n * // { a: { b: 1, c: 2 }, d: 3 }\n * ```\n */\nexport function unflattenPaths(flat: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, val] of Object.entries(flat)) {\n const parts = key.split('.');\n\n if (parts.some((p) => UNSAFE_PATH_SEGMENTS.has(p))) continue;\n\n let obj = result;\n\n for (let i = 0; i < parts.length - 1; i++) {\n if (!isPlainObject(obj[parts[i]])) {\n obj[parts[i]] = {};\n }\n\n obj = obj[parts[i]] as Record<string, unknown>;\n }\n\n obj[parts[parts.length - 1]] = val;\n }\n\n return result;\n}\n"],"mappings":"4HAcA,IAAM,EAAoB,GAE1B,SAAS,cAAc,EAA8B,EAAgB,EAAwC,CAC3G,IAAM,EAAkC,CAAC,EAEzC,IAAK,GAAM,CAAC,EAAK,KAAQ,OAAO,QAAQ,CAAG,EAAG,CAC5C,GAAI,EAAqB,IAAI,CAAG,EAAG,SAEnC,IAAM,EAAU,EAAS,GAAG,EAAO,GAAG,IAAQ,EAE1C,EAAc,CAAG,GAAK,EAAQ,EAChC,OAAO,OAAO,EAAQ,cAAc,EAAgC,EAAS,EAAQ,CAAC,CAAC,EAEvF,EAAO,GAAW,CAEtB,CAEA,OAAO,CACT,CAEA,SAAgB,aAAa,EAAuD,CAClF,OAAO,cAAc,EAAK,GAAI,CAAC,CACjC,CAYA,SAAgB,eAAe,EAAwD,CACrF,IAAM,EAAkC,CAAC,EAEzC,IAAK,GAAM,CAAC,EAAK,KAAQ,OAAO,QAAQ,CAAI,EAAG,CAC7C,IAAM,EAAQ,EAAI,MAAM,GAAG,EAE3B,GAAI,EAAM,KAAM,GAAM,EAAqB,IAAI,CAAC,CAAC,EAAG,SAEpD,IAAI,EAAM,EAEV,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAS,EAAG,IAC/B,EAAc,EAAI,EAAM,GAAG,IAC9B,EAAI,EAAM,IAAM,CAAC,GAGnB,EAAM,EAAI,EAAM,IAGlB,EAAI,EAAM,EAAM,OAAS,IAAM,CACjC,CAEA,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs");function t(e){return e.replace(/\[(\d+)\]/g,`.$1`).replace(/^\.|\.$/g,``).split(`.`).filter(Boolean)}function n(n,r){let i=n;for(let n of t(r))if(e.UNSAFE_PATH_SEGMENTS.has(n)||typeof i!=`object`||!i||(i=i[n],i===void 0))return;return i}function r(e,t){return n(e,t)}function i(e,t,r){let i=n(e,t);return i===void 0?r:i}function a(e,t){let r=n(e,t);if(r===void 0)throw TypeError(`Path does not exist: '${t}'`);return r}exports.getPath=r,exports.getPathOr=i,exports.requirePath=a;
1
+ const e=require("../_common/unsafePaths.cjs");function pathSegments(e){return e.replace(/\[(\d+)\]/g,`.$1`).replace(/^\.|\.$/g,``).split(`.`).filter(Boolean)}function readPath(t,n){let r=t;for(let t of pathSegments(n))if(e.UNSAFE_PATH_SEGMENTS.has(t)||typeof r!=`object`||!r||(r=r[t],r===void 0))return;return r}function getPath(e,t){return readPath(e,t)}function getPathOr(e,t,n){let r=readPath(e,t);return r===void 0?n:r}function requirePath(e,t){let n=readPath(e,t);if(n===void 0)throw TypeError(`Path does not exist: '${t}'`);return n}exports.getPath=getPath,exports.getPathOr=getPathOr,exports.requirePath=requirePath;
2
2
  //# sourceMappingURL=getPath.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPath.cjs","names":[],"sources":["../../src/object/getPath.ts"],"sourcesContent":["import { UNSAFE_PATH_SEGMENTS } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\ntype PathValue<T, P extends string> = P extends `${infer Key}.${infer Rest}`\n ? Key extends keyof T\n ? PathValue<T[Key], Rest>\n : undefined\n : P extends keyof T\n ? T[P]\n : undefined;\n\nfunction pathSegments(path: string): string[] {\n return path\n .replace(/\\[(\\d+)\\]/g, '.$1')\n .replace(/^\\.|\\.$/g, '')\n .split('.')\n .filter(Boolean);\n}\n\nfunction readPath(item: Obj, path: string): unknown {\n let current: unknown = item;\n\n for (const segment of pathSegments(path)) {\n if (UNSAFE_PATH_SEGMENTS.has(segment) || current == null || typeof current !== 'object') return undefined;\n\n current = (current as Record<string, unknown>)[segment];\n\n if (current === undefined) return undefined;\n }\n\n return current;\n}\n\n/**\n * Retrieves a value at a dot-notation or numeric bracket-notation path.\n * Returns `undefined` when the path is missing or contains an unsafe segment.\n * Use `getPathOr` to supply a fallback or `requirePath` to throw on a missing path.\n */\nexport function getPath<T extends Obj, P extends string>(item: T, path: P): PathValue<T, P> | undefined {\n return readPath(item, path) as PathValue<T, P> | undefined;\n}\n\n/**\n * Retrieves a value at a path or returns `fallback` when the path is missing.\n */\nexport function getPathOr<T extends Obj, P extends string, F>(item: T, path: P, fallback: F): PathValue<T, P> | F {\n const value = readPath(item, path);\n\n return (value === undefined ? fallback : value) as PathValue<T, P> | F;\n}\n\n/**\n * Retrieves a value at a path or throws when the path is missing.\n */\nexport function requirePath<T extends Obj, P extends string>(item: T, path: P): Exclude<PathValue<T, P>, undefined> {\n const value = readPath(item, path);\n\n if (value === undefined) throw new TypeError(`Path does not exist: '${path}'`);\n\n return value as Exclude<PathValue<T, P>, undefined>;\n}\n"],"mappings":"8CAWA,SAAS,EAAa,EAAwB,CAC5C,OAAO,EACJ,QAAQ,aAAc,KAAK,CAAC,CAC5B,QAAQ,WAAY,EAAE,CAAC,CACvB,MAAM,GAAG,CAAC,CACV,OAAO,OAAO,CACnB,CAEA,SAAS,EAAS,EAAW,EAAuB,CAClD,IAAI,EAAmB,EAEvB,IAAK,IAAM,KAAW,EAAa,CAAI,EAKrC,GAJI,EAAA,qBAAqB,IAAI,CAAO,GAAwB,OAAO,GAAY,WAAtC,IAEzC,EAAW,EAAoC,GAE3C,IAAY,IAAA,IAAW,OAG7B,OAAO,CACT,CAOA,SAAgB,EAAyC,EAAS,EAAsC,CACtG,OAAO,EAAS,EAAM,CAAI,CAC5B,CAKA,SAAgB,EAA8C,EAAS,EAAS,EAAkC,CAChH,IAAM,EAAQ,EAAS,EAAM,CAAI,EAEjC,OAAQ,IAAU,IAAA,GAAY,EAAW,CAC3C,CAKA,SAAgB,EAA6C,EAAS,EAA8C,CAClH,IAAM,EAAQ,EAAS,EAAM,CAAI,EAEjC,GAAI,IAAU,IAAA,GAAW,MAAU,UAAU,yBAAyB,EAAK,EAAE,EAE7E,OAAO,CACT"}
1
+ {"version":3,"file":"getPath.cjs","names":[],"sources":["../../src/object/getPath.ts"],"sourcesContent":["import { UNSAFE_PATH_SEGMENTS } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\ntype PathValue<T, P extends string> = P extends `${infer Key}.${infer Rest}`\n ? Key extends keyof T\n ? PathValue<T[Key], Rest>\n : undefined\n : P extends keyof T\n ? T[P]\n : undefined;\n\nfunction pathSegments(path: string): string[] {\n return path\n .replace(/\\[(\\d+)\\]/g, '.$1')\n .replace(/^\\.|\\.$/g, '')\n .split('.')\n .filter(Boolean);\n}\n\nfunction readPath(item: Obj, path: string): unknown {\n let current: unknown = item;\n\n for (const segment of pathSegments(path)) {\n if (UNSAFE_PATH_SEGMENTS.has(segment) || current == null || typeof current !== 'object') return undefined;\n\n current = (current as Record<string, unknown>)[segment];\n\n if (current === undefined) return undefined;\n }\n\n return current;\n}\n\n/**\n * Retrieves a value at a dot-notation or numeric bracket-notation path.\n * Returns `undefined` when the path is missing or contains an unsafe segment.\n * Use `getPathOr` to supply a fallback or `requirePath` to throw on a missing path.\n */\nexport function getPath<T extends Obj, P extends string>(item: T, path: P): PathValue<T, P> | undefined {\n return readPath(item, path) as PathValue<T, P> | undefined;\n}\n\n/**\n * Retrieves a value at a path or returns `fallback` when the path is missing.\n */\nexport function getPathOr<T extends Obj, P extends string, F>(item: T, path: P, fallback: F): PathValue<T, P> | F {\n const value = readPath(item, path);\n\n return (value === undefined ? fallback : value) as PathValue<T, P> | F;\n}\n\n/**\n * Retrieves a value at a path or throws when the path is missing.\n */\nexport function requirePath<T extends Obj, P extends string>(item: T, path: P): Exclude<PathValue<T, P>, undefined> {\n const value = readPath(item, path);\n\n if (value === undefined) throw new TypeError(`Path does not exist: '${path}'`);\n\n return value as Exclude<PathValue<T, P>, undefined>;\n}\n"],"mappings":"8CAWA,SAAS,aAAa,EAAwB,CAC5C,OAAO,EACJ,QAAQ,aAAc,KAAK,CAAC,CAC5B,QAAQ,WAAY,EAAE,CAAC,CACvB,MAAM,GAAG,CAAC,CACV,OAAO,OAAO,CACnB,CAEA,SAAS,SAAS,EAAW,EAAuB,CAClD,IAAI,EAAmB,EAEvB,IAAK,IAAM,KAAW,aAAa,CAAI,EAKrC,GAJI,EAAA,qBAAqB,IAAI,CAAO,GAAwB,OAAO,GAAY,WAAtC,IAEzC,EAAW,EAAoC,GAE3C,IAAY,IAAA,IAAW,OAG7B,OAAO,CACT,CAOA,SAAgB,QAAyC,EAAS,EAAsC,CACtG,OAAO,SAAS,EAAM,CAAI,CAC5B,CAKA,SAAgB,UAA8C,EAAS,EAAS,EAAkC,CAChH,IAAM,EAAQ,SAAS,EAAM,CAAI,EAEjC,OAAQ,IAAU,IAAA,GAAY,EAAW,CAC3C,CAKA,SAAgB,YAA6C,EAAS,EAA8C,CAClH,IAAM,EAAQ,SAAS,EAAM,CAAI,EAEjC,GAAI,IAAU,IAAA,GAAW,MAAU,UAAU,yBAAyB,EAAK,EAAE,EAE7E,OAAO,CACT"}
@@ -1,26 +1,2 @@
1
- import { UNSAFE_PATH_SEGMENTS as e } from "../_common/unsafePaths.js";
2
- //#region src/object/getPath.ts
3
- function t(e) {
4
- return e.replace(/\[(\d+)\]/g, ".$1").replace(/^\.|\.$/g, "").split(".").filter(Boolean);
5
- }
6
- function n(n, r) {
7
- let i = n;
8
- for (let n of t(r)) if (e.has(n) || typeof i != "object" || !i || (i = i[n], i === void 0)) return;
9
- return i;
10
- }
11
- function r(e, t) {
12
- return n(e, t);
13
- }
14
- function i(e, t, r) {
15
- let i = n(e, t);
16
- return i === void 0 ? r : i;
17
- }
18
- function a(e, t) {
19
- let r = n(e, t);
20
- if (r === void 0) throw TypeError(`Path does not exist: '${t}'`);
21
- return r;
22
- }
23
- //#endregion
24
- export { r as getPath, i as getPathOr, a as requirePath };
25
-
1
+ import{UNSAFE_PATH_SEGMENTS as e}from"../_common/unsafePaths.js";function pathSegments(e){return e.replace(/\[(\d+)\]/g,`.$1`).replace(/^\.|\.$/g,``).split(`.`).filter(Boolean)}function readPath(t,n){let r=t;for(let t of pathSegments(n))if(e.has(t)||typeof r!=`object`||!r||(r=r[t],r===void 0))return;return r}function getPath(e,t){return readPath(e,t)}function getPathOr(e,t,n){let r=readPath(e,t);return r===void 0?n:r}function requirePath(e,t){let n=readPath(e,t);if(n===void 0)throw TypeError(`Path does not exist: '${t}'`);return n}export{getPath,getPathOr,requirePath};
26
2
  //# sourceMappingURL=getPath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPath.js","names":[],"sources":["../../src/object/getPath.ts"],"sourcesContent":["import { UNSAFE_PATH_SEGMENTS } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\ntype PathValue<T, P extends string> = P extends `${infer Key}.${infer Rest}`\n ? Key extends keyof T\n ? PathValue<T[Key], Rest>\n : undefined\n : P extends keyof T\n ? T[P]\n : undefined;\n\nfunction pathSegments(path: string): string[] {\n return path\n .replace(/\\[(\\d+)\\]/g, '.$1')\n .replace(/^\\.|\\.$/g, '')\n .split('.')\n .filter(Boolean);\n}\n\nfunction readPath(item: Obj, path: string): unknown {\n let current: unknown = item;\n\n for (const segment of pathSegments(path)) {\n if (UNSAFE_PATH_SEGMENTS.has(segment) || current == null || typeof current !== 'object') return undefined;\n\n current = (current as Record<string, unknown>)[segment];\n\n if (current === undefined) return undefined;\n }\n\n return current;\n}\n\n/**\n * Retrieves a value at a dot-notation or numeric bracket-notation path.\n * Returns `undefined` when the path is missing or contains an unsafe segment.\n * Use `getPathOr` to supply a fallback or `requirePath` to throw on a missing path.\n */\nexport function getPath<T extends Obj, P extends string>(item: T, path: P): PathValue<T, P> | undefined {\n return readPath(item, path) as PathValue<T, P> | undefined;\n}\n\n/**\n * Retrieves a value at a path or returns `fallback` when the path is missing.\n */\nexport function getPathOr<T extends Obj, P extends string, F>(item: T, path: P, fallback: F): PathValue<T, P> | F {\n const value = readPath(item, path);\n\n return (value === undefined ? fallback : value) as PathValue<T, P> | F;\n}\n\n/**\n * Retrieves a value at a path or throws when the path is missing.\n */\nexport function requirePath<T extends Obj, P extends string>(item: T, path: P): Exclude<PathValue<T, P>, undefined> {\n const value = readPath(item, path);\n\n if (value === undefined) throw new TypeError(`Path does not exist: '${path}'`);\n\n return value as Exclude<PathValue<T, P>, undefined>;\n}\n"],"mappings":";;AAWA,SAAS,EAAa,GAAwB;CAC5C,OAAO,EACJ,QAAQ,cAAc,KAAK,CAAC,CAC5B,QAAQ,YAAY,EAAE,CAAC,CACvB,MAAM,GAAG,CAAC,CACV,OAAO,OAAO;AACnB;AAEA,SAAS,EAAS,GAAW,GAAuB;CAClD,IAAI,IAAmB;CAEvB,KAAK,IAAM,KAAW,EAAa,CAAI,GAKrC,IAJI,EAAqB,IAAI,CAAO,KAAwB,OAAO,KAAY,aAAtC,MAEzC,IAAW,EAAoC,IAE3C,MAAY,KAAA,IAAW;CAG7B,OAAO;AACT;AAOA,SAAgB,EAAyC,GAAS,GAAsC;CACtG,OAAO,EAAS,GAAM,CAAI;AAC5B;AAKA,SAAgB,EAA8C,GAAS,GAAS,GAAkC;CAChH,IAAM,IAAQ,EAAS,GAAM,CAAI;CAEjC,OAAQ,MAAU,KAAA,IAAY,IAAW;AAC3C;AAKA,SAAgB,EAA6C,GAAS,GAA8C;CAClH,IAAM,IAAQ,EAAS,GAAM,CAAI;CAEjC,IAAI,MAAU,KAAA,GAAW,MAAU,UAAU,yBAAyB,EAAK,EAAE;CAE7E,OAAO;AACT"}
1
+ {"version":3,"file":"getPath.js","names":[],"sources":["../../src/object/getPath.ts"],"sourcesContent":["import { UNSAFE_PATH_SEGMENTS } from '../_common/unsafePaths';\nimport type { Obj } from '../types';\n\ntype PathValue<T, P extends string> = P extends `${infer Key}.${infer Rest}`\n ? Key extends keyof T\n ? PathValue<T[Key], Rest>\n : undefined\n : P extends keyof T\n ? T[P]\n : undefined;\n\nfunction pathSegments(path: string): string[] {\n return path\n .replace(/\\[(\\d+)\\]/g, '.$1')\n .replace(/^\\.|\\.$/g, '')\n .split('.')\n .filter(Boolean);\n}\n\nfunction readPath(item: Obj, path: string): unknown {\n let current: unknown = item;\n\n for (const segment of pathSegments(path)) {\n if (UNSAFE_PATH_SEGMENTS.has(segment) || current == null || typeof current !== 'object') return undefined;\n\n current = (current as Record<string, unknown>)[segment];\n\n if (current === undefined) return undefined;\n }\n\n return current;\n}\n\n/**\n * Retrieves a value at a dot-notation or numeric bracket-notation path.\n * Returns `undefined` when the path is missing or contains an unsafe segment.\n * Use `getPathOr` to supply a fallback or `requirePath` to throw on a missing path.\n */\nexport function getPath<T extends Obj, P extends string>(item: T, path: P): PathValue<T, P> | undefined {\n return readPath(item, path) as PathValue<T, P> | undefined;\n}\n\n/**\n * Retrieves a value at a path or returns `fallback` when the path is missing.\n */\nexport function getPathOr<T extends Obj, P extends string, F>(item: T, path: P, fallback: F): PathValue<T, P> | F {\n const value = readPath(item, path);\n\n return (value === undefined ? fallback : value) as PathValue<T, P> | F;\n}\n\n/**\n * Retrieves a value at a path or throws when the path is missing.\n */\nexport function requirePath<T extends Obj, P extends string>(item: T, path: P): Exclude<PathValue<T, P>, undefined> {\n const value = readPath(item, path);\n\n if (value === undefined) throw new TypeError(`Path does not exist: '${path}'`);\n\n return value as Exclude<PathValue<T, P>, undefined>;\n}\n"],"mappings":"iEAWA,SAAS,aAAa,EAAwB,CAC5C,OAAO,EACJ,QAAQ,aAAc,KAAK,CAAC,CAC5B,QAAQ,WAAY,EAAE,CAAC,CACvB,MAAM,GAAG,CAAC,CACV,OAAO,OAAO,CACnB,CAEA,SAAS,SAAS,EAAW,EAAuB,CAClD,IAAI,EAAmB,EAEvB,IAAK,IAAM,KAAW,aAAa,CAAI,EAKrC,GAJI,EAAqB,IAAI,CAAO,GAAwB,OAAO,GAAY,WAAtC,IAEzC,EAAW,EAAoC,GAE3C,IAAY,IAAA,IAAW,OAG7B,OAAO,CACT,CAOA,SAAgB,QAAyC,EAAS,EAAsC,CACtG,OAAO,SAAS,EAAM,CAAI,CAC5B,CAKA,SAAgB,UAA8C,EAAS,EAAS,EAAkC,CAChH,IAAM,EAAQ,SAAS,EAAM,CAAI,EAEjC,OAAQ,IAAU,IAAA,GAAY,EAAW,CAC3C,CAKA,SAAgB,YAA6C,EAAS,EAA8C,CAClH,IAAM,EAAQ,SAAS,EAAM,CAAI,EAEjC,GAAI,IAAU,IAAA,GAAW,MAAU,UAAU,yBAAyB,EAAK,EAAE,EAE7E,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("../errors.cjs");function t(n,r,i){if(n===void 0)return`undefined`;if(n===null)return`null`;if(typeof n==`bigint`)return`${n}n`;if(typeof n!=`object`)return JSON.stringify(n);if(i.has(n))return`[Circular]`;if(i.add(n),n instanceof Date)return`[Date:${Number.isNaN(n.getTime())?`Invalid`:n.toISOString()}]`;if(n instanceof RegExp)return`[RegExp:${n.source}/${n.flags}]`;if(n instanceof Set)return`[Set:${[...n].map(e=>t(e,r,i)).sort().join(`,`)}]`;if(n instanceof Map)return`[Map:${[...n.entries()].map(([e,n])=>[t(e,r,i),t(n,r,i)]).sort(([e,t],[n,r])=>e===n?t.localeCompare(r):e.localeCompare(n)).map(([e,t])=>`${e}=>${t}`).join(`,`)}]`;if(Array.isArray(n))return`[${n.map(e=>t(e,r,i)).join(`,`)}]`;let a=Object.getPrototypeOf(n);if(a!==Object.prototype&&a!==null){if(r?.onClassInstance===`throw`)throw new e.ArsenalSerializationError(`hash: unsupported type ${n.constructor?.name??`unknown`}`);return String(n)}let o=n;return`{${Object.keys(o).filter(e=>o[e]!==void 0).sort().map(e=>`${JSON.stringify(e)}:${t(o[e],r,i)}`).join(`,`)}}`}function n(e,n){return t(e,n,new Set)}exports.hash=n;
1
+ const e=require("../errors.cjs");function _hash(t,n,r){if(t===void 0)return`undefined`;if(t===null)return`null`;if(typeof t==`bigint`)return`${t}n`;if(typeof t!=`object`)return JSON.stringify(t);if(r.has(t))return`[Circular]`;if(r.add(t),t instanceof Date)return`[Date:${Number.isNaN(t.getTime())?`Invalid`:t.toISOString()}]`;if(t instanceof RegExp)return`[RegExp:${t.source}/${t.flags}]`;if(t instanceof Set)return`[Set:${[...t].map(e=>_hash(e,n,r)).sort().join(`,`)}]`;if(t instanceof Map)return`[Map:${[...t.entries()].map(([e,t])=>[_hash(e,n,r),_hash(t,n,r)]).sort(([e,t],[n,r])=>e===n?t.localeCompare(r):e.localeCompare(n)).map(([e,t])=>`${e}=>${t}`).join(`,`)}]`;if(Array.isArray(t))return`[${t.map(e=>_hash(e,n,r)).join(`,`)}]`;let i=Object.getPrototypeOf(t);if(i!==Object.prototype&&i!==null){if(n?.onClassInstance===`throw`)throw new e.ArsenalSerializationError(`hash: unsupported type ${t.constructor?.name??`unknown`}`);return String(t)}let a=t;return`{${Object.keys(a).filter(e=>a[e]!==void 0).sort().map(e=>`${JSON.stringify(e)}:${_hash(a[e],n,r)}`).join(`,`)}}`}function hash(e,t){return _hash(e,t,new Set)}exports.hash=hash;
2
2
  //# sourceMappingURL=hash.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"hash.cjs","names":[],"sources":["../../src/object/hash.ts"],"sourcesContent":["import { ArsenalSerializationError } from '../errors';\n\nexport type HashOptions = {\n /**\n * What to do when a class instance is encountered (an object whose prototype is\n * neither `Object.prototype` nor `null`).\n *\n * - `'coerce'` (default) — calls `String(value)`.\n * - `'throw'` — throws an `ArsenalSerializationError`.\n */\n onClassInstance?: 'coerce' | 'throw';\n};\n\n/**\n * Produces a deterministic, order-independent string representation of any value.\n * Object keys are sorted alphabetically, so `{ b: 1, a: 2 }` and `{ a: 2, b: 1 }` produce\n * the same output. Handles `Date`, `RegExp`, `Set`, `Map`, and `bigint` in addition to plain JSON.\n *\n * Useful for generating stable cache keys from arbitrary query parameters or options objects.\n *\n * Class instances fall back to `String(value)` by default.\n * Pass `{ onClassInstance: 'throw' }` to throw an `ArsenalSerializationError` instead.\n *\n * @example\n * ```ts\n * hash({ b: 2, a: 1 }) // '{\"a\":1,\"b\":2}'\n * hash([3, 1, 2]) // '[3,1,2]'\n * hash(new Date('2024-01-01T00:00:00Z')) // '[Date:2024-01-01T00:00:00.000Z]'\n * hash(new Set([3, 1, 2])) // '[Set:1,2,3]'\n * hash(new MyClass(), { onClassInstance: 'throw' }) // throws ArsenalSerializationError\n * ```\n *\n * @throws {ArsenalSerializationError} If `options.onClassInstance` is `'throw'` and a class instance is encountered.\n */\nfunction _hash(value: unknown, options: HashOptions | undefined, visited: Set<object>): string {\n if (value === undefined) return 'undefined';\n\n if (value === null) return 'null';\n\n if (typeof value === 'bigint') return `${value}n`;\n\n if (typeof value !== 'object') return JSON.stringify(value);\n\n if (visited.has(value as object)) return '[Circular]';\n\n visited.add(value as object);\n\n if (value instanceof Date) return `[Date:${Number.isNaN(value.getTime()) ? 'Invalid' : value.toISOString()}]`;\n\n if (value instanceof RegExp) return `[RegExp:${value.source}/${value.flags}]`;\n\n if (value instanceof Set)\n return `[Set:${[...value]\n .map((v) => _hash(v, options, visited))\n .sort()\n .join(',')}]`;\n\n if (value instanceof Map) {\n const entries = [...value.entries()]\n .map(([key, entryValue]) => [_hash(key, options, visited), _hash(entryValue, options, visited)] as const)\n .sort(([leftKey, leftValue], [rightKey, rightValue]) =>\n leftKey === rightKey ? leftValue.localeCompare(rightValue) : leftKey.localeCompare(rightKey),\n );\n\n return `[Map:${entries.map(([key, entryValue]) => `${key}=>${entryValue}`).join(',')}]`;\n }\n\n if (Array.isArray(value)) return `[${value.map((v) => _hash(v, options, visited)).join(',')}]`;\n\n const proto = Object.getPrototypeOf(value) as unknown;\n\n if (proto !== Object.prototype && proto !== null) {\n if (options?.onClassInstance === 'throw') {\n throw new ArsenalSerializationError(\n `hash: unsupported type ${(value as { constructor?: { name?: string } }).constructor?.name ?? 'unknown'}`,\n );\n }\n\n return String(value);\n }\n\n const rec = value as Record<string, unknown>;\n const keys = Object.keys(rec)\n .filter((k) => rec[k] !== undefined)\n .sort();\n\n return `{${keys.map((k) => `${JSON.stringify(k)}:${_hash(rec[k], options, visited)}`).join(',')}}`;\n}\n\nexport function hash(value: unknown, options?: HashOptions): string {\n return _hash(value, options, new Set<object>());\n}\n"],"mappings":"iCAkCA,SAAS,EAAM,EAAgB,EAAkC,EAA8B,CAC7F,GAAI,IAAU,IAAA,GAAW,MAAO,YAEhC,GAAI,IAAU,KAAM,MAAO,OAE3B,GAAI,OAAO,GAAU,SAAU,MAAO,GAAG,EAAM,GAE/C,GAAI,OAAO,GAAU,SAAU,OAAO,KAAK,UAAU,CAAK,EAE1D,GAAI,EAAQ,IAAI,CAAe,EAAG,MAAO,aAIzC,GAFA,EAAQ,IAAI,CAAe,EAEvB,aAAiB,KAAM,MAAO,SAAS,OAAO,MAAM,EAAM,QAAQ,CAAC,EAAI,UAAY,EAAM,YAAY,EAAE,GAE3G,GAAI,aAAiB,OAAQ,MAAO,WAAW,EAAM,OAAO,GAAG,EAAM,MAAM,GAE3E,GAAI,aAAiB,IACnB,MAAO,QAAQ,CAAC,GAAG,CAAK,CAAC,CACtB,IAAK,GAAM,EAAM,EAAG,EAAS,CAAO,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,KAAK,GAAG,EAAE,GAEf,GAAI,aAAiB,IAOnB,MAAO,QANS,CAAC,GAAG,EAAM,QAAQ,CAAC,CAAC,CACjC,KAAK,CAAC,EAAK,KAAgB,CAAC,EAAM,EAAK,EAAS,CAAO,EAAG,EAAM,EAAY,EAAS,CAAO,CAAC,CAAU,CAAC,CACxG,MAAM,CAAC,EAAS,GAAY,CAAC,EAAU,KACtC,IAAY,EAAW,EAAU,cAAc,CAAU,EAAI,EAAQ,cAAc,CAAQ,CAGhF,CAAA,CAAQ,KAAK,CAAC,EAAK,KAAgB,GAAG,EAAI,IAAI,GAAY,CAAC,CAAC,KAAK,GAAG,EAAE,GAGvF,GAAI,MAAM,QAAQ,CAAK,EAAG,MAAO,IAAI,EAAM,IAAK,GAAM,EAAM,EAAG,EAAS,CAAO,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,GAE5F,IAAM,EAAQ,OAAO,eAAe,CAAK,EAEzC,GAAI,IAAU,OAAO,WAAa,IAAU,KAAM,CAChD,GAAI,GAAS,kBAAoB,QAC/B,MAAM,IAAI,EAAA,0BACR,0BAA2B,EAA8C,aAAa,MAAQ,WAChG,EAGF,OAAO,OAAO,CAAK,CACrB,CAEA,IAAM,EAAM,EAKZ,MAAO,IAJM,OAAO,KAAK,CAAG,CAAC,CAC1B,OAAQ,GAAM,EAAI,KAAO,IAAA,EAAS,CAAC,CACnC,KAEQ,CAAA,CAAK,IAAK,GAAM,GAAG,KAAK,UAAU,CAAC,EAAE,GAAG,EAAM,EAAI,GAAI,EAAS,CAAO,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,EAClG,CAEA,SAAgB,EAAK,EAAgB,EAA+B,CAClE,OAAO,EAAM,EAAO,EAAS,IAAI,GAAa,CAChD"}
1
+ {"version":3,"file":"hash.cjs","names":[],"sources":["../../src/object/hash.ts"],"sourcesContent":["import { ArsenalSerializationError } from '../errors';\n\nexport type HashOptions = {\n /**\n * What to do when a class instance is encountered (an object whose prototype is\n * neither `Object.prototype` nor `null`).\n *\n * - `'coerce'` (default) — calls `String(value)`.\n * - `'throw'` — throws an `ArsenalSerializationError`.\n */\n onClassInstance?: 'coerce' | 'throw';\n};\n\n/**\n * Produces a deterministic, order-independent string representation of any value.\n * Object keys are sorted alphabetically, so `{ b: 1, a: 2 }` and `{ a: 2, b: 1 }` produce\n * the same output. Handles `Date`, `RegExp`, `Set`, `Map`, and `bigint` in addition to plain JSON.\n *\n * Useful for generating stable cache keys from arbitrary query parameters or options objects.\n *\n * Class instances fall back to `String(value)` by default.\n * Pass `{ onClassInstance: 'throw' }` to throw an `ArsenalSerializationError` instead.\n *\n * @example\n * ```ts\n * hash({ b: 2, a: 1 }) // '{\"a\":1,\"b\":2}'\n * hash([3, 1, 2]) // '[3,1,2]'\n * hash(new Date('2024-01-01T00:00:00Z')) // '[Date:2024-01-01T00:00:00.000Z]'\n * hash(new Set([3, 1, 2])) // '[Set:1,2,3]'\n * hash(new MyClass(), { onClassInstance: 'throw' }) // throws ArsenalSerializationError\n * ```\n *\n * @throws {ArsenalSerializationError} If `options.onClassInstance` is `'throw'` and a class instance is encountered.\n */\nfunction _hash(value: unknown, options: HashOptions | undefined, visited: Set<object>): string {\n if (value === undefined) return 'undefined';\n\n if (value === null) return 'null';\n\n if (typeof value === 'bigint') return `${value}n`;\n\n if (typeof value !== 'object') return JSON.stringify(value);\n\n if (visited.has(value as object)) return '[Circular]';\n\n visited.add(value as object);\n\n if (value instanceof Date) return `[Date:${Number.isNaN(value.getTime()) ? 'Invalid' : value.toISOString()}]`;\n\n if (value instanceof RegExp) return `[RegExp:${value.source}/${value.flags}]`;\n\n if (value instanceof Set)\n return `[Set:${[...value]\n .map((v) => _hash(v, options, visited))\n .sort()\n .join(',')}]`;\n\n if (value instanceof Map) {\n const entries = [...value.entries()]\n .map(([key, entryValue]) => [_hash(key, options, visited), _hash(entryValue, options, visited)] as const)\n .sort(([leftKey, leftValue], [rightKey, rightValue]) =>\n leftKey === rightKey ? leftValue.localeCompare(rightValue) : leftKey.localeCompare(rightKey),\n );\n\n return `[Map:${entries.map(([key, entryValue]) => `${key}=>${entryValue}`).join(',')}]`;\n }\n\n if (Array.isArray(value)) return `[${value.map((v) => _hash(v, options, visited)).join(',')}]`;\n\n const proto = Object.getPrototypeOf(value) as unknown;\n\n if (proto !== Object.prototype && proto !== null) {\n if (options?.onClassInstance === 'throw') {\n throw new ArsenalSerializationError(\n `hash: unsupported type ${(value as { constructor?: { name?: string } }).constructor?.name ?? 'unknown'}`,\n );\n }\n\n return String(value);\n }\n\n const rec = value as Record<string, unknown>;\n const keys = Object.keys(rec)\n .filter((k) => rec[k] !== undefined)\n .sort();\n\n return `{${keys.map((k) => `${JSON.stringify(k)}:${_hash(rec[k], options, visited)}`).join(',')}}`;\n}\n\nexport function hash(value: unknown, options?: HashOptions): string {\n return _hash(value, options, new Set<object>());\n}\n"],"mappings":"iCAkCA,SAAS,MAAM,EAAgB,EAAkC,EAA8B,CAC7F,GAAI,IAAU,IAAA,GAAW,MAAO,YAEhC,GAAI,IAAU,KAAM,MAAO,OAE3B,GAAI,OAAO,GAAU,SAAU,MAAO,GAAG,EAAM,GAE/C,GAAI,OAAO,GAAU,SAAU,OAAO,KAAK,UAAU,CAAK,EAE1D,GAAI,EAAQ,IAAI,CAAe,EAAG,MAAO,aAIzC,GAFA,EAAQ,IAAI,CAAe,EAEvB,aAAiB,KAAM,MAAO,SAAS,OAAO,MAAM,EAAM,QAAQ,CAAC,EAAI,UAAY,EAAM,YAAY,EAAE,GAE3G,GAAI,aAAiB,OAAQ,MAAO,WAAW,EAAM,OAAO,GAAG,EAAM,MAAM,GAE3E,GAAI,aAAiB,IACnB,MAAO,QAAQ,CAAC,GAAG,CAAK,CAAC,CACtB,IAAK,GAAM,MAAM,EAAG,EAAS,CAAO,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,KAAK,GAAG,EAAE,GAEf,GAAI,aAAiB,IAOnB,MAAO,QANS,CAAC,GAAG,EAAM,QAAQ,CAAC,CAAC,CACjC,KAAK,CAAC,EAAK,KAAgB,CAAC,MAAM,EAAK,EAAS,CAAO,EAAG,MAAM,EAAY,EAAS,CAAO,CAAC,CAAU,CAAC,CACxG,MAAM,CAAC,EAAS,GAAY,CAAC,EAAU,KACtC,IAAY,EAAW,EAAU,cAAc,CAAU,EAAI,EAAQ,cAAc,CAAQ,CAGhF,CAAA,CAAQ,KAAK,CAAC,EAAK,KAAgB,GAAG,EAAI,IAAI,GAAY,CAAC,CAAC,KAAK,GAAG,EAAE,GAGvF,GAAI,MAAM,QAAQ,CAAK,EAAG,MAAO,IAAI,EAAM,IAAK,GAAM,MAAM,EAAG,EAAS,CAAO,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,GAE5F,IAAM,EAAQ,OAAO,eAAe,CAAK,EAEzC,GAAI,IAAU,OAAO,WAAa,IAAU,KAAM,CAChD,GAAI,GAAS,kBAAoB,QAC/B,MAAM,IAAI,EAAA,0BACR,0BAA2B,EAA8C,aAAa,MAAQ,WAChG,EAGF,OAAO,OAAO,CAAK,CACrB,CAEA,IAAM,EAAM,EAKZ,MAAO,IAJM,OAAO,KAAK,CAAG,CAAC,CAC1B,OAAQ,GAAM,EAAI,KAAO,IAAA,EAAS,CAAC,CACnC,KAEQ,CAAA,CAAK,IAAK,GAAM,GAAG,KAAK,UAAU,CAAC,EAAE,GAAG,MAAM,EAAI,GAAI,EAAS,CAAO,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,EAClG,CAEA,SAAgB,KAAK,EAAgB,EAA+B,CAClE,OAAO,MAAM,EAAO,EAAS,IAAI,GAAa,CAChD"}
@@ -1,28 +1,2 @@
1
- import { ArsenalSerializationError as e } from "../errors.js";
2
- //#region src/object/hash.ts
3
- function t(n, r, i) {
4
- if (n === void 0) return "undefined";
5
- if (n === null) return "null";
6
- if (typeof n == "bigint") return `${n}n`;
7
- if (typeof n != "object") return JSON.stringify(n);
8
- if (i.has(n)) return "[Circular]";
9
- if (i.add(n), n instanceof Date) return `[Date:${Number.isNaN(n.getTime()) ? "Invalid" : n.toISOString()}]`;
10
- if (n instanceof RegExp) return `[RegExp:${n.source}/${n.flags}]`;
11
- if (n instanceof Set) return `[Set:${[...n].map((e) => t(e, r, i)).sort().join(",")}]`;
12
- if (n instanceof Map) return `[Map:${[...n.entries()].map(([e, n]) => [t(e, r, i), t(n, r, i)]).sort(([e, t], [n, r]) => e === n ? t.localeCompare(r) : e.localeCompare(n)).map(([e, t]) => `${e}=>${t}`).join(",")}]`;
13
- if (Array.isArray(n)) return `[${n.map((e) => t(e, r, i)).join(",")}]`;
14
- let a = Object.getPrototypeOf(n);
15
- if (a !== Object.prototype && a !== null) {
16
- if (r?.onClassInstance === "throw") throw new e(`hash: unsupported type ${n.constructor?.name ?? "unknown"}`);
17
- return String(n);
18
- }
19
- let o = n;
20
- return `{${Object.keys(o).filter((e) => o[e] !== void 0).sort().map((e) => `${JSON.stringify(e)}:${t(o[e], r, i)}`).join(",")}}`;
21
- }
22
- function n(e, n) {
23
- return t(e, n, /* @__PURE__ */ new Set());
24
- }
25
- //#endregion
26
- export { n as hash };
27
-
1
+ import{ArsenalSerializationError as e}from"../errors.js";function _hash(t,n,r){if(t===void 0)return`undefined`;if(t===null)return`null`;if(typeof t==`bigint`)return`${t}n`;if(typeof t!=`object`)return JSON.stringify(t);if(r.has(t))return`[Circular]`;if(r.add(t),t instanceof Date)return`[Date:${Number.isNaN(t.getTime())?`Invalid`:t.toISOString()}]`;if(t instanceof RegExp)return`[RegExp:${t.source}/${t.flags}]`;if(t instanceof Set)return`[Set:${[...t].map(e=>_hash(e,n,r)).sort().join(`,`)}]`;if(t instanceof Map)return`[Map:${[...t.entries()].map(([e,t])=>[_hash(e,n,r),_hash(t,n,r)]).sort(([e,t],[n,r])=>e===n?t.localeCompare(r):e.localeCompare(n)).map(([e,t])=>`${e}=>${t}`).join(`,`)}]`;if(Array.isArray(t))return`[${t.map(e=>_hash(e,n,r)).join(`,`)}]`;let i=Object.getPrototypeOf(t);if(i!==Object.prototype&&i!==null){if(n?.onClassInstance===`throw`)throw new e(`hash: unsupported type ${t.constructor?.name??`unknown`}`);return String(t)}let a=t;return`{${Object.keys(a).filter(e=>a[e]!==void 0).sort().map(e=>`${JSON.stringify(e)}:${_hash(a[e],n,r)}`).join(`,`)}}`}function hash(e,t){return _hash(e,t,new Set)}export{hash};
28
2
  //# sourceMappingURL=hash.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hash.js","names":[],"sources":["../../src/object/hash.ts"],"sourcesContent":["import { ArsenalSerializationError } from '../errors';\n\nexport type HashOptions = {\n /**\n * What to do when a class instance is encountered (an object whose prototype is\n * neither `Object.prototype` nor `null`).\n *\n * - `'coerce'` (default) — calls `String(value)`.\n * - `'throw'` — throws an `ArsenalSerializationError`.\n */\n onClassInstance?: 'coerce' | 'throw';\n};\n\n/**\n * Produces a deterministic, order-independent string representation of any value.\n * Object keys are sorted alphabetically, so `{ b: 1, a: 2 }` and `{ a: 2, b: 1 }` produce\n * the same output. Handles `Date`, `RegExp`, `Set`, `Map`, and `bigint` in addition to plain JSON.\n *\n * Useful for generating stable cache keys from arbitrary query parameters or options objects.\n *\n * Class instances fall back to `String(value)` by default.\n * Pass `{ onClassInstance: 'throw' }` to throw an `ArsenalSerializationError` instead.\n *\n * @example\n * ```ts\n * hash({ b: 2, a: 1 }) // '{\"a\":1,\"b\":2}'\n * hash([3, 1, 2]) // '[3,1,2]'\n * hash(new Date('2024-01-01T00:00:00Z')) // '[Date:2024-01-01T00:00:00.000Z]'\n * hash(new Set([3, 1, 2])) // '[Set:1,2,3]'\n * hash(new MyClass(), { onClassInstance: 'throw' }) // throws ArsenalSerializationError\n * ```\n *\n * @throws {ArsenalSerializationError} If `options.onClassInstance` is `'throw'` and a class instance is encountered.\n */\nfunction _hash(value: unknown, options: HashOptions | undefined, visited: Set<object>): string {\n if (value === undefined) return 'undefined';\n\n if (value === null) return 'null';\n\n if (typeof value === 'bigint') return `${value}n`;\n\n if (typeof value !== 'object') return JSON.stringify(value);\n\n if (visited.has(value as object)) return '[Circular]';\n\n visited.add(value as object);\n\n if (value instanceof Date) return `[Date:${Number.isNaN(value.getTime()) ? 'Invalid' : value.toISOString()}]`;\n\n if (value instanceof RegExp) return `[RegExp:${value.source}/${value.flags}]`;\n\n if (value instanceof Set)\n return `[Set:${[...value]\n .map((v) => _hash(v, options, visited))\n .sort()\n .join(',')}]`;\n\n if (value instanceof Map) {\n const entries = [...value.entries()]\n .map(([key, entryValue]) => [_hash(key, options, visited), _hash(entryValue, options, visited)] as const)\n .sort(([leftKey, leftValue], [rightKey, rightValue]) =>\n leftKey === rightKey ? leftValue.localeCompare(rightValue) : leftKey.localeCompare(rightKey),\n );\n\n return `[Map:${entries.map(([key, entryValue]) => `${key}=>${entryValue}`).join(',')}]`;\n }\n\n if (Array.isArray(value)) return `[${value.map((v) => _hash(v, options, visited)).join(',')}]`;\n\n const proto = Object.getPrototypeOf(value) as unknown;\n\n if (proto !== Object.prototype && proto !== null) {\n if (options?.onClassInstance === 'throw') {\n throw new ArsenalSerializationError(\n `hash: unsupported type ${(value as { constructor?: { name?: string } }).constructor?.name ?? 'unknown'}`,\n );\n }\n\n return String(value);\n }\n\n const rec = value as Record<string, unknown>;\n const keys = Object.keys(rec)\n .filter((k) => rec[k] !== undefined)\n .sort();\n\n return `{${keys.map((k) => `${JSON.stringify(k)}:${_hash(rec[k], options, visited)}`).join(',')}}`;\n}\n\nexport function hash(value: unknown, options?: HashOptions): string {\n return _hash(value, options, new Set<object>());\n}\n"],"mappings":";;AAkCA,SAAS,EAAM,GAAgB,GAAkC,GAA8B;CAC7F,IAAI,MAAU,KAAA,GAAW,OAAO;CAEhC,IAAI,MAAU,MAAM,OAAO;CAE3B,IAAI,OAAO,KAAU,UAAU,OAAO,GAAG,EAAM;CAE/C,IAAI,OAAO,KAAU,UAAU,OAAO,KAAK,UAAU,CAAK;CAE1D,IAAI,EAAQ,IAAI,CAAe,GAAG,OAAO;CAIzC,IAFA,EAAQ,IAAI,CAAe,GAEvB,aAAiB,MAAM,OAAO,SAAS,OAAO,MAAM,EAAM,QAAQ,CAAC,IAAI,YAAY,EAAM,YAAY,EAAE;CAE3G,IAAI,aAAiB,QAAQ,OAAO,WAAW,EAAM,OAAO,GAAG,EAAM,MAAM;CAE3E,IAAI,aAAiB,KACnB,OAAO,QAAQ,CAAC,GAAG,CAAK,CAAC,CACtB,KAAK,MAAM,EAAM,GAAG,GAAS,CAAO,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,KAAK,GAAG,EAAE;CAEf,IAAI,aAAiB,KAOnB,OAAO,QANS,CAAC,GAAG,EAAM,QAAQ,CAAC,CAAC,CACjC,KAAK,CAAC,GAAK,OAAgB,CAAC,EAAM,GAAK,GAAS,CAAO,GAAG,EAAM,GAAY,GAAS,CAAO,CAAC,CAAU,CAAC,CACxG,MAAM,CAAC,GAAS,IAAY,CAAC,GAAU,OACtC,MAAY,IAAW,EAAU,cAAc,CAAU,IAAI,EAAQ,cAAc,CAAQ,CAGhF,CAAA,CAAQ,KAAK,CAAC,GAAK,OAAgB,GAAG,EAAI,IAAI,GAAY,CAAC,CAAC,KAAK,GAAG,EAAE;CAGvF,IAAI,MAAM,QAAQ,CAAK,GAAG,OAAO,IAAI,EAAM,KAAK,MAAM,EAAM,GAAG,GAAS,CAAO,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;CAE5F,IAAM,IAAQ,OAAO,eAAe,CAAK;CAEzC,IAAI,MAAU,OAAO,aAAa,MAAU,MAAM;EAChD,IAAI,GAAS,oBAAoB,SAC/B,MAAM,IAAI,EACR,0BAA2B,EAA8C,aAAa,QAAQ,WAChG;EAGF,OAAO,OAAO,CAAK;CACrB;CAEA,IAAM,IAAM;CAKZ,OAAO,IAJM,OAAO,KAAK,CAAG,CAAC,CAC1B,QAAQ,MAAM,EAAI,OAAO,KAAA,CAAS,CAAC,CACnC,KAEQ,CAAA,CAAK,KAAK,MAAM,GAAG,KAAK,UAAU,CAAC,EAAE,GAAG,EAAM,EAAI,IAAI,GAAS,CAAO,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;AAClG;AAEA,SAAgB,EAAK,GAAgB,GAA+B;CAClE,OAAO,EAAM,GAAO,mBAAS,IAAI,IAAY,CAAC;AAChD"}
1
+ {"version":3,"file":"hash.js","names":[],"sources":["../../src/object/hash.ts"],"sourcesContent":["import { ArsenalSerializationError } from '../errors';\n\nexport type HashOptions = {\n /**\n * What to do when a class instance is encountered (an object whose prototype is\n * neither `Object.prototype` nor `null`).\n *\n * - `'coerce'` (default) — calls `String(value)`.\n * - `'throw'` — throws an `ArsenalSerializationError`.\n */\n onClassInstance?: 'coerce' | 'throw';\n};\n\n/**\n * Produces a deterministic, order-independent string representation of any value.\n * Object keys are sorted alphabetically, so `{ b: 1, a: 2 }` and `{ a: 2, b: 1 }` produce\n * the same output. Handles `Date`, `RegExp`, `Set`, `Map`, and `bigint` in addition to plain JSON.\n *\n * Useful for generating stable cache keys from arbitrary query parameters or options objects.\n *\n * Class instances fall back to `String(value)` by default.\n * Pass `{ onClassInstance: 'throw' }` to throw an `ArsenalSerializationError` instead.\n *\n * @example\n * ```ts\n * hash({ b: 2, a: 1 }) // '{\"a\":1,\"b\":2}'\n * hash([3, 1, 2]) // '[3,1,2]'\n * hash(new Date('2024-01-01T00:00:00Z')) // '[Date:2024-01-01T00:00:00.000Z]'\n * hash(new Set([3, 1, 2])) // '[Set:1,2,3]'\n * hash(new MyClass(), { onClassInstance: 'throw' }) // throws ArsenalSerializationError\n * ```\n *\n * @throws {ArsenalSerializationError} If `options.onClassInstance` is `'throw'` and a class instance is encountered.\n */\nfunction _hash(value: unknown, options: HashOptions | undefined, visited: Set<object>): string {\n if (value === undefined) return 'undefined';\n\n if (value === null) return 'null';\n\n if (typeof value === 'bigint') return `${value}n`;\n\n if (typeof value !== 'object') return JSON.stringify(value);\n\n if (visited.has(value as object)) return '[Circular]';\n\n visited.add(value as object);\n\n if (value instanceof Date) return `[Date:${Number.isNaN(value.getTime()) ? 'Invalid' : value.toISOString()}]`;\n\n if (value instanceof RegExp) return `[RegExp:${value.source}/${value.flags}]`;\n\n if (value instanceof Set)\n return `[Set:${[...value]\n .map((v) => _hash(v, options, visited))\n .sort()\n .join(',')}]`;\n\n if (value instanceof Map) {\n const entries = [...value.entries()]\n .map(([key, entryValue]) => [_hash(key, options, visited), _hash(entryValue, options, visited)] as const)\n .sort(([leftKey, leftValue], [rightKey, rightValue]) =>\n leftKey === rightKey ? leftValue.localeCompare(rightValue) : leftKey.localeCompare(rightKey),\n );\n\n return `[Map:${entries.map(([key, entryValue]) => `${key}=>${entryValue}`).join(',')}]`;\n }\n\n if (Array.isArray(value)) return `[${value.map((v) => _hash(v, options, visited)).join(',')}]`;\n\n const proto = Object.getPrototypeOf(value) as unknown;\n\n if (proto !== Object.prototype && proto !== null) {\n if (options?.onClassInstance === 'throw') {\n throw new ArsenalSerializationError(\n `hash: unsupported type ${(value as { constructor?: { name?: string } }).constructor?.name ?? 'unknown'}`,\n );\n }\n\n return String(value);\n }\n\n const rec = value as Record<string, unknown>;\n const keys = Object.keys(rec)\n .filter((k) => rec[k] !== undefined)\n .sort();\n\n return `{${keys.map((k) => `${JSON.stringify(k)}:${_hash(rec[k], options, visited)}`).join(',')}}`;\n}\n\nexport function hash(value: unknown, options?: HashOptions): string {\n return _hash(value, options, new Set<object>());\n}\n"],"mappings":"yDAkCA,SAAS,MAAM,EAAgB,EAAkC,EAA8B,CAC7F,GAAI,IAAU,IAAA,GAAW,MAAO,YAEhC,GAAI,IAAU,KAAM,MAAO,OAE3B,GAAI,OAAO,GAAU,SAAU,MAAO,GAAG,EAAM,GAE/C,GAAI,OAAO,GAAU,SAAU,OAAO,KAAK,UAAU,CAAK,EAE1D,GAAI,EAAQ,IAAI,CAAe,EAAG,MAAO,aAIzC,GAFA,EAAQ,IAAI,CAAe,EAEvB,aAAiB,KAAM,MAAO,SAAS,OAAO,MAAM,EAAM,QAAQ,CAAC,EAAI,UAAY,EAAM,YAAY,EAAE,GAE3G,GAAI,aAAiB,OAAQ,MAAO,WAAW,EAAM,OAAO,GAAG,EAAM,MAAM,GAE3E,GAAI,aAAiB,IACnB,MAAO,QAAQ,CAAC,GAAG,CAAK,CAAC,CACtB,IAAK,GAAM,MAAM,EAAG,EAAS,CAAO,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,KAAK,GAAG,EAAE,GAEf,GAAI,aAAiB,IAOnB,MAAO,QANS,CAAC,GAAG,EAAM,QAAQ,CAAC,CAAC,CACjC,KAAK,CAAC,EAAK,KAAgB,CAAC,MAAM,EAAK,EAAS,CAAO,EAAG,MAAM,EAAY,EAAS,CAAO,CAAC,CAAU,CAAC,CACxG,MAAM,CAAC,EAAS,GAAY,CAAC,EAAU,KACtC,IAAY,EAAW,EAAU,cAAc,CAAU,EAAI,EAAQ,cAAc,CAAQ,CAGhF,CAAA,CAAQ,KAAK,CAAC,EAAK,KAAgB,GAAG,EAAI,IAAI,GAAY,CAAC,CAAC,KAAK,GAAG,EAAE,GAGvF,GAAI,MAAM,QAAQ,CAAK,EAAG,MAAO,IAAI,EAAM,IAAK,GAAM,MAAM,EAAG,EAAS,CAAO,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,GAE5F,IAAM,EAAQ,OAAO,eAAe,CAAK,EAEzC,GAAI,IAAU,OAAO,WAAa,IAAU,KAAM,CAChD,GAAI,GAAS,kBAAoB,QAC/B,MAAM,IAAI,EACR,0BAA2B,EAA8C,aAAa,MAAQ,WAChG,EAGF,OAAO,OAAO,CAAK,CACrB,CAEA,IAAM,EAAM,EAKZ,MAAO,IAJM,OAAO,KAAK,CAAG,CAAC,CAC1B,OAAQ,GAAM,EAAI,KAAO,IAAA,EAAS,CAAC,CACnC,KAEQ,CAAA,CAAK,IAAK,GAAM,GAAG,KAAK,UAAU,CAAC,EAAE,GAAG,MAAM,EAAI,GAAI,EAAS,CAAO,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,EAClG,CAEA,SAAgB,KAAK,EAAgB,EAA+B,CAClE,OAAO,MAAM,EAAO,EAAS,IAAI,GAAa,CAChD"}
@@ -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"}