@pawells/typescript-common 1.4.1 → 2.1.5

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 (428) hide show
  1. package/README.md +350 -223
  2. package/{build → dist}/array/array-chunk.d.ts +1 -1
  3. package/{build → dist}/array/array-chunk.js +2 -3
  4. package/{build → dist}/array/array-compact.d.ts +1 -1
  5. package/{build → dist}/array/array-compact.js +1 -2
  6. package/{build → dist}/array/array-contains.d.ts +4 -1
  7. package/{build → dist}/array/array-contains.d.ts.map +1 -1
  8. package/{build → dist}/array/array-contains.js +6 -3
  9. package/{build → dist}/array/array-count-by.d.ts +3 -1
  10. package/dist/array/array-count-by.d.ts.map +1 -0
  11. package/{build → dist}/array/array-count-by.js +4 -2
  12. package/dist/array/array-difference.d.ts +43 -0
  13. package/dist/array/array-difference.d.ts.map +1 -0
  14. package/dist/array/array-difference.js +70 -0
  15. package/dist/array/array-element.js +1 -0
  16. package/{build → dist}/array/array-filter.d.ts +3 -1
  17. package/{build → dist}/array/array-filter.d.ts.map +1 -1
  18. package/{build → dist}/array/array-filter.js +5 -3
  19. package/{build → dist}/array/array-flatten.d.ts +2 -2
  20. package/{build → dist}/array/array-flatten.d.ts.map +1 -1
  21. package/{build → dist}/array/array-flatten.js +1 -2
  22. package/{build → dist}/array/array-group-by.d.ts +3 -1
  23. package/dist/array/array-group-by.d.ts.map +1 -0
  24. package/{build → dist}/array/array-group-by.js +12 -8
  25. package/dist/array/array-intersection.d.ts +43 -0
  26. package/dist/array/array-intersection.d.ts.map +1 -0
  27. package/dist/array/array-intersection.js +79 -0
  28. package/{build → dist}/array/array-partition.d.ts +3 -1
  29. package/{build → dist}/array/array-partition.d.ts.map +1 -1
  30. package/{build → dist}/array/array-partition.js +4 -2
  31. package/{build → dist}/array/array-range.d.ts +1 -1
  32. package/{build → dist}/array/array-range.js +1 -2
  33. package/{build → dist}/array/array-sample.d.ts +4 -4
  34. package/dist/array/array-sample.d.ts.map +1 -0
  35. package/{build → dist}/array/array-sample.js +4 -14
  36. package/{build → dist}/array/array-shuffle.d.ts +1 -1
  37. package/{build → dist}/array/array-shuffle.js +1 -2
  38. package/{build → dist}/array/array-sort-by.d.ts +1 -1
  39. package/{build → dist}/array/array-sort-by.js +1 -2
  40. package/{build → dist}/array/array-zip.d.ts +1 -1
  41. package/{build → dist}/array/array-zip.js +1 -2
  42. package/{build → dist}/array/assert.d.ts +27 -23
  43. package/dist/array/assert.d.ts.map +1 -0
  44. package/{build → dist}/array/assert.js +40 -37
  45. package/{build → dist}/array/index.js +0 -1
  46. package/{build → dist}/array/types.d.ts +29 -0
  47. package/dist/array/types.d.ts.map +1 -0
  48. package/dist/array/types.js +1 -0
  49. package/{build → dist}/array/unique.d.ts +3 -1
  50. package/{build → dist}/array/unique.d.ts.map +1 -1
  51. package/{build → dist}/array/unique.js +5 -3
  52. package/dist/asserts/errors.d.ts.map +1 -0
  53. package/{build → dist}/asserts/errors.js +5 -3
  54. package/{build → dist}/asserts/generic.d.ts +32 -3
  55. package/dist/asserts/generic.d.ts.map +1 -0
  56. package/{build → dist}/asserts/generic.js +63 -15
  57. package/dist/asserts/index.d.ts +47 -0
  58. package/dist/asserts/index.d.ts.map +1 -0
  59. package/dist/asserts/index.js +46 -0
  60. package/{build → dist}/asserts/internal-utils.d.ts.map +1 -1
  61. package/{build → dist}/asserts/internal-utils.js +0 -1
  62. package/{build → dist}/asserts/types.d.ts +56 -17
  63. package/dist/asserts/types.d.ts.map +1 -0
  64. package/dist/asserts/types.js +1 -0
  65. package/{build → dist}/asserts/utils.d.ts +18 -2
  66. package/dist/asserts/utils.d.ts.map +1 -0
  67. package/{build → dist}/asserts/utils.js +56 -1
  68. package/{build → dist}/boolean/assert.d.ts +1 -2
  69. package/{build → dist}/boolean/assert.d.ts.map +1 -1
  70. package/{build → dist}/boolean/assert.js +3 -8
  71. package/dist/boolean/index.d.ts +13 -0
  72. package/dist/boolean/index.d.ts.map +1 -0
  73. package/dist/boolean/index.js +12 -0
  74. package/{build → dist}/enum/enum-entries.d.ts +1 -1
  75. package/dist/enum/enum-entries.d.ts.map +1 -0
  76. package/{build → dist}/enum/enum-entries.js +0 -1
  77. package/{build → dist}/enum/enum-key-by-value.d.ts +1 -1
  78. package/dist/enum/enum-key-by-value.d.ts.map +1 -0
  79. package/{build → dist}/enum/enum-key-by-value.js +0 -1
  80. package/{build → dist}/enum/enum-keys.js +0 -1
  81. package/{build → dist}/enum/enum-safe-value.d.ts +1 -1
  82. package/dist/enum/enum-safe-value.d.ts.map +1 -0
  83. package/{build → dist}/enum/enum-safe-value.js +0 -1
  84. package/{build → dist}/enum/enum-values.js +0 -1
  85. package/{build → dist}/enum/index.d.ts +1 -1
  86. package/dist/enum/index.d.ts.map +1 -0
  87. package/{build → dist}/enum/index.js +1 -2
  88. package/dist/enum/types.js +1 -0
  89. package/{build → dist}/enum/validate-enum-value.d.ts +1 -1
  90. package/dist/enum/validate-enum-value.d.ts.map +1 -0
  91. package/{build → dist}/enum/validate-enum-value.js +0 -1
  92. package/{build → dist}/function/compose.d.ts +9 -2
  93. package/dist/function/compose.d.ts.map +1 -0
  94. package/{build → dist}/function/compose.js +0 -1
  95. package/{build → dist}/function/debounce.d.ts +8 -1
  96. package/dist/function/debounce.d.ts.map +1 -0
  97. package/{build → dist}/function/debounce.js +6 -1
  98. package/{build → dist}/function/index.js +0 -1
  99. package/dist/function/memoize.d.ts +43 -0
  100. package/dist/function/memoize.d.ts.map +1 -0
  101. package/dist/function/memoize.js +59 -0
  102. package/{build → dist}/function/once.d.ts +1 -0
  103. package/{build → dist}/function/once.d.ts.map +1 -1
  104. package/{build → dist}/function/once.js +2 -1
  105. package/{build → dist}/function/sleep.js +0 -1
  106. package/dist/function/throttle.d.ts +25 -0
  107. package/dist/function/throttle.d.ts.map +1 -0
  108. package/{build → dist}/function/throttle.js +7 -1
  109. package/dist/function/types.d.ts +18 -0
  110. package/dist/function/types.d.ts.map +1 -0
  111. package/dist/function/types.js +1 -0
  112. package/dist/index.d.ts +11 -0
  113. package/dist/index.d.ts.map +1 -0
  114. package/dist/index.js +10 -0
  115. package/{build → dist}/lru-cache.d.ts +19 -0
  116. package/dist/lru-cache.d.ts.map +1 -0
  117. package/{build → dist}/lru-cache.js +24 -2
  118. package/{build → dist}/number/assert.d.ts.map +1 -1
  119. package/{build → dist}/number/assert.js +38 -43
  120. package/dist/number/index.d.ts +13 -0
  121. package/dist/number/index.d.ts.map +1 -0
  122. package/dist/number/index.js +12 -0
  123. package/{build → dist}/object/assert-object.d.ts +5 -1
  124. package/{build → dist}/object/assert-object.d.ts.map +1 -1
  125. package/{build → dist}/object/assert-object.js +4 -1
  126. package/{build → dist}/object/assert.d.ts +1 -1
  127. package/dist/object/assert.d.ts.map +1 -0
  128. package/{build → dist}/object/assert.js +7 -29
  129. package/{build → dist}/object/clone.d.ts.map +1 -1
  130. package/{build → dist}/object/clone.js +11 -5
  131. package/{build → dist}/object/equals.d.ts +1 -1
  132. package/{build → dist}/object/equals.d.ts.map +1 -1
  133. package/{build → dist}/object/equals.js +12 -9
  134. package/dist/object/filter-cached.d.ts +44 -0
  135. package/{build → dist}/object/filter-cached.d.ts.map +1 -1
  136. package/{build → dist}/object/filter-cached.js +41 -2
  137. package/{build → dist}/object/filter.d.ts +1 -1
  138. package/{build → dist}/object/filter.d.ts.map +1 -1
  139. package/{build → dist}/object/filter.js +38 -70
  140. package/{build → dist}/object/has-circular-reference.d.ts.map +1 -1
  141. package/{build → dist}/object/has-circular-reference.js +4 -2
  142. package/{build → dist}/object/hash.d.ts +5 -1
  143. package/dist/object/hash.d.ts.map +1 -0
  144. package/{build → dist}/object/hash.js +20 -6
  145. package/{build → dist}/object/index.d.ts +2 -2
  146. package/{build → dist}/object/index.d.ts.map +1 -1
  147. package/{build → dist}/object/index.js +1 -2
  148. package/{build → dist}/object/json-circular-replacer.d.ts.map +1 -1
  149. package/{build → dist}/object/json-circular-replacer.js +0 -1
  150. package/{build → dist}/object/key-value-pairs.js +0 -1
  151. package/dist/object/map-cached.d.ts +31 -0
  152. package/dist/object/map-cached.d.ts.map +1 -0
  153. package/{build → dist}/object/map-cached.js +34 -6
  154. package/{build → dist}/object/map.js +0 -1
  155. package/{build → dist}/object/merge.d.ts.map +1 -1
  156. package/{build → dist}/object/merge.js +7 -7
  157. package/{build → dist}/object/object-diff.d.ts +2 -2
  158. package/{build → dist}/object/object-diff.d.ts.map +1 -1
  159. package/{build → dist}/object/object-diff.js +11 -5
  160. package/{build → dist}/object/object-flatten.d.ts +1 -1
  161. package/{build → dist}/object/object-flatten.d.ts.map +1 -1
  162. package/{build → dist}/object/object-flatten.js +6 -4
  163. package/{build → dist}/object/object-invert.js +0 -1
  164. package/{build → dist}/object/omit.js +0 -1
  165. package/{build → dist}/object/pick.js +0 -1
  166. package/{build → dist}/object/property-paths.d.ts +2 -2
  167. package/{build → dist}/object/property-paths.d.ts.map +1 -1
  168. package/{build → dist}/object/property-paths.js +13 -9
  169. package/dist/object/security-utils.d.ts +193 -0
  170. package/dist/object/security-utils.d.ts.map +1 -0
  171. package/dist/object/security-utils.js +297 -0
  172. package/{build → dist}/object/sort-keys.d.ts +1 -1
  173. package/{build → dist}/object/sort-keys.d.ts.map +1 -1
  174. package/{build → dist}/object/sort-keys.js +18 -11
  175. package/{build → dist}/object/types.d.ts +61 -20
  176. package/dist/object/types.d.ts.map +1 -0
  177. package/dist/object/types.js +1 -0
  178. package/{build → dist}/string/assert.d.ts +5 -0
  179. package/dist/string/assert.d.ts.map +1 -0
  180. package/{build → dist}/string/assert.js +14 -10
  181. package/dist/string/case-conversion.d.ts +79 -0
  182. package/dist/string/case-conversion.d.ts.map +1 -0
  183. package/{build → dist}/string/case-conversion.js +59 -30
  184. package/dist/string/comparison.d.ts +20 -0
  185. package/dist/string/comparison.d.ts.map +1 -0
  186. package/dist/string/comparison.js +27 -0
  187. package/{build → dist}/string/formatting.d.ts +35 -22
  188. package/dist/string/formatting.d.ts.map +1 -0
  189. package/{build → dist}/string/formatting.js +40 -25
  190. package/{build → dist}/string/index.d.ts +1 -0
  191. package/{build → dist}/string/index.d.ts.map +1 -1
  192. package/{build → dist}/string/index.js +1 -1
  193. package/dist/string/transformation.d.ts +28 -0
  194. package/dist/string/transformation.d.ts.map +1 -0
  195. package/dist/string/transformation.js +42 -0
  196. package/dist/string/types.d.ts +118 -0
  197. package/dist/string/types.d.ts.map +1 -0
  198. package/dist/string/types.js +1 -0
  199. package/dist/string/validation.d.ts +30 -0
  200. package/dist/string/validation.d.ts.map +1 -0
  201. package/dist/string/validation.js +38 -0
  202. package/dist/time/elapsed-time/constants.d.ts +36 -0
  203. package/{build → dist}/time/elapsed-time/constants.d.ts.map +1 -1
  204. package/{build → dist}/time/elapsed-time/constants.js +32 -3
  205. package/{build → dist}/time/elapsed-time/elapsed-time.d.ts +67 -15
  206. package/dist/time/elapsed-time/elapsed-time.d.ts.map +1 -0
  207. package/{build → dist}/time/elapsed-time/elapsed-time.js +172 -78
  208. package/dist/time/elapsed-time/types.d.ts +336 -0
  209. package/dist/time/elapsed-time/types.d.ts.map +1 -0
  210. package/dist/time/elapsed-time/types.js +1 -0
  211. package/{build → dist}/time/elapsed-time/utils.d.ts +1 -1
  212. package/dist/time/elapsed-time/utils.d.ts.map +1 -0
  213. package/{build → dist}/time/elapsed-time/utils.js +0 -1
  214. package/{build → dist}/time/index.d.ts +0 -2
  215. package/{build → dist}/time/index.d.ts.map +1 -1
  216. package/{build → dist}/time/index.js +0 -2
  217. package/{build → dist}/time/stopwatch/entry.d.ts +1 -1
  218. package/dist/time/stopwatch/entry.d.ts.map +1 -0
  219. package/{build → dist}/time/stopwatch/entry.js +0 -1
  220. package/{build → dist}/time/stopwatch/stopwatch.d.ts +9 -3
  221. package/dist/time/stopwatch/stopwatch.d.ts.map +1 -0
  222. package/{build → dist}/time/stopwatch/stopwatch.js +9 -4
  223. package/package.json +58 -81
  224. package/LICENSE +0 -21
  225. package/build/array/array-chunk.js.map +0 -1
  226. package/build/array/array-compact.js.map +0 -1
  227. package/build/array/array-contains.js.map +0 -1
  228. package/build/array/array-count-by.d.ts.map +0 -1
  229. package/build/array/array-count-by.js.map +0 -1
  230. package/build/array/array-difference.d.ts +0 -25
  231. package/build/array/array-difference.d.ts.map +0 -1
  232. package/build/array/array-difference.js +0 -34
  233. package/build/array/array-difference.js.map +0 -1
  234. package/build/array/array-element.js +0 -2
  235. package/build/array/array-element.js.map +0 -1
  236. package/build/array/array-filter.js.map +0 -1
  237. package/build/array/array-flatten.js.map +0 -1
  238. package/build/array/array-group-by.d.ts.map +0 -1
  239. package/build/array/array-group-by.js.map +0 -1
  240. package/build/array/array-intersection.d.ts +0 -25
  241. package/build/array/array-intersection.d.ts.map +0 -1
  242. package/build/array/array-intersection.js +0 -39
  243. package/build/array/array-intersection.js.map +0 -1
  244. package/build/array/array-partition.js.map +0 -1
  245. package/build/array/array-range.js.map +0 -1
  246. package/build/array/array-sample.d.ts.map +0 -1
  247. package/build/array/array-sample.js.map +0 -1
  248. package/build/array/array-shuffle.js.map +0 -1
  249. package/build/array/array-sort-by.js.map +0 -1
  250. package/build/array/array-zip.js.map +0 -1
  251. package/build/array/assert.d.ts.map +0 -1
  252. package/build/array/assert.js.map +0 -1
  253. package/build/array/index.js.map +0 -1
  254. package/build/array/types.d.ts.map +0 -1
  255. package/build/array/types.js +0 -2
  256. package/build/array/types.js.map +0 -1
  257. package/build/array/unique.js.map +0 -1
  258. package/build/asserts/errors.d.ts.map +0 -1
  259. package/build/asserts/errors.js.map +0 -1
  260. package/build/asserts/generic.d.ts.map +0 -1
  261. package/build/asserts/generic.js.map +0 -1
  262. package/build/asserts/index.d.ts +0 -41
  263. package/build/asserts/index.d.ts.map +0 -1
  264. package/build/asserts/index.js +0 -41
  265. package/build/asserts/index.js.map +0 -1
  266. package/build/asserts/internal-utils.js.map +0 -1
  267. package/build/asserts/types.d.ts.map +0 -1
  268. package/build/asserts/types.js +0 -2
  269. package/build/asserts/types.js.map +0 -1
  270. package/build/asserts/utils.d.ts.map +0 -1
  271. package/build/asserts/utils.js.map +0 -1
  272. package/build/boolean/assert.js.map +0 -1
  273. package/build/boolean/index.d.ts +0 -9
  274. package/build/boolean/index.d.ts.map +0 -1
  275. package/build/boolean/index.js +0 -9
  276. package/build/boolean/index.js.map +0 -1
  277. package/build/enum/enum-entries.d.ts.map +0 -1
  278. package/build/enum/enum-entries.js.map +0 -1
  279. package/build/enum/enum-key-by-value.d.ts.map +0 -1
  280. package/build/enum/enum-key-by-value.js.map +0 -1
  281. package/build/enum/enum-keys.js.map +0 -1
  282. package/build/enum/enum-safe-value.d.ts.map +0 -1
  283. package/build/enum/enum-safe-value.js.map +0 -1
  284. package/build/enum/enum-values.js.map +0 -1
  285. package/build/enum/index.d.ts.map +0 -1
  286. package/build/enum/index.js.map +0 -1
  287. package/build/enum/types.js +0 -2
  288. package/build/enum/types.js.map +0 -1
  289. package/build/enum/validate-enum-value.d.ts.map +0 -1
  290. package/build/enum/validate-enum-value.js.map +0 -1
  291. package/build/function/compose.d.ts.map +0 -1
  292. package/build/function/compose.js.map +0 -1
  293. package/build/function/debounce.d.ts.map +0 -1
  294. package/build/function/debounce.js.map +0 -1
  295. package/build/function/index.js.map +0 -1
  296. package/build/function/memoize.d.ts +0 -30
  297. package/build/function/memoize.d.ts.map +0 -1
  298. package/build/function/memoize.js +0 -44
  299. package/build/function/memoize.js.map +0 -1
  300. package/build/function/once.js.map +0 -1
  301. package/build/function/sleep.js.map +0 -1
  302. package/build/function/throttle.d.ts +0 -17
  303. package/build/function/throttle.d.ts.map +0 -1
  304. package/build/function/throttle.js.map +0 -1
  305. package/build/function/types.d.ts +0 -5
  306. package/build/function/types.d.ts.map +0 -1
  307. package/build/function/types.js +0 -2
  308. package/build/function/types.js.map +0 -1
  309. package/build/index.d.ts +0 -38
  310. package/build/index.d.ts.map +0 -1
  311. package/build/index.js +0 -64
  312. package/build/index.js.map +0 -1
  313. package/build/lru-cache.d.ts.map +0 -1
  314. package/build/lru-cache.js.map +0 -1
  315. package/build/number/assert.js.map +0 -1
  316. package/build/number/index.d.ts +0 -9
  317. package/build/number/index.d.ts.map +0 -1
  318. package/build/number/index.js +0 -9
  319. package/build/number/index.js.map +0 -1
  320. package/build/object/assert-object.js.map +0 -1
  321. package/build/object/assert.d.ts.map +0 -1
  322. package/build/object/assert.js.map +0 -1
  323. package/build/object/clone.js.map +0 -1
  324. package/build/object/equals.js.map +0 -1
  325. package/build/object/filter-cached.d.ts +0 -21
  326. package/build/object/filter-cached.js.map +0 -1
  327. package/build/object/filter.js.map +0 -1
  328. package/build/object/has-circular-reference.js.map +0 -1
  329. package/build/object/hash.d.ts.map +0 -1
  330. package/build/object/hash.js.map +0 -1
  331. package/build/object/index.js.map +0 -1
  332. package/build/object/json-circular-replacer.js.map +0 -1
  333. package/build/object/key-value-pairs.js.map +0 -1
  334. package/build/object/map-cached.d.ts +0 -20
  335. package/build/object/map-cached.d.ts.map +0 -1
  336. package/build/object/map-cached.js.map +0 -1
  337. package/build/object/map.js.map +0 -1
  338. package/build/object/merge.js.map +0 -1
  339. package/build/object/object-diff.js.map +0 -1
  340. package/build/object/object-flatten.js.map +0 -1
  341. package/build/object/object-invert.js.map +0 -1
  342. package/build/object/omit.js.map +0 -1
  343. package/build/object/pick.js.map +0 -1
  344. package/build/object/property-paths.js.map +0 -1
  345. package/build/object/security-utils.d.ts +0 -59
  346. package/build/object/security-utils.d.ts.map +0 -1
  347. package/build/object/security-utils.js +0 -161
  348. package/build/object/security-utils.js.map +0 -1
  349. package/build/object/sort-keys.js.map +0 -1
  350. package/build/object/types.d.ts.map +0 -1
  351. package/build/object/types.js +0 -6
  352. package/build/object/types.js.map +0 -1
  353. package/build/string/assert.d.ts.map +0 -1
  354. package/build/string/assert.js.map +0 -1
  355. package/build/string/case-conversion.d.ts +0 -50
  356. package/build/string/case-conversion.d.ts.map +0 -1
  357. package/build/string/case-conversion.js.map +0 -1
  358. package/build/string/formatting.d.ts.map +0 -1
  359. package/build/string/formatting.js.map +0 -1
  360. package/build/string/index.js.map +0 -1
  361. package/build/string/transformation.d.ts +0 -18
  362. package/build/string/transformation.d.ts.map +0 -1
  363. package/build/string/transformation.js +0 -32
  364. package/build/string/transformation.js.map +0 -1
  365. package/build/string/types.d.ts +0 -44
  366. package/build/string/types.d.ts.map +0 -1
  367. package/build/string/types.js +0 -2
  368. package/build/string/types.js.map +0 -1
  369. package/build/string/validation.d.ts +0 -18
  370. package/build/string/validation.d.ts.map +0 -1
  371. package/build/string/validation.js +0 -26
  372. package/build/string/validation.js.map +0 -1
  373. package/build/time/elapsed-time/constants.d.ts +0 -10
  374. package/build/time/elapsed-time/constants.js.map +0 -1
  375. package/build/time/elapsed-time/elapsed-time.d.ts.map +0 -1
  376. package/build/time/elapsed-time/elapsed-time.js.map +0 -1
  377. package/build/time/elapsed-time/types.d.ts +0 -150
  378. package/build/time/elapsed-time/types.d.ts.map +0 -1
  379. package/build/time/elapsed-time/types.js +0 -2
  380. package/build/time/elapsed-time/types.js.map +0 -1
  381. package/build/time/elapsed-time/utils.d.ts.map +0 -1
  382. package/build/time/elapsed-time/utils.js.map +0 -1
  383. package/build/time/index.js.map +0 -1
  384. package/build/time/stopwatch/entry-types.d.ts +0 -13
  385. package/build/time/stopwatch/entry-types.d.ts.map +0 -1
  386. package/build/time/stopwatch/entry-types.js +0 -2
  387. package/build/time/stopwatch/entry-types.js.map +0 -1
  388. package/build/time/stopwatch/entry.d.ts.map +0 -1
  389. package/build/time/stopwatch/entry.js.map +0 -1
  390. package/build/time/stopwatch/stopwatch.d.ts.map +0 -1
  391. package/build/time/stopwatch/stopwatch.js.map +0 -1
  392. /package/{build → dist}/array/array-chunk.d.ts.map +0 -0
  393. /package/{build → dist}/array/array-compact.d.ts.map +0 -0
  394. /package/{build → dist}/array/array-element.d.ts +0 -0
  395. /package/{build → dist}/array/array-element.d.ts.map +0 -0
  396. /package/{build → dist}/array/array-range.d.ts.map +0 -0
  397. /package/{build → dist}/array/array-shuffle.d.ts.map +0 -0
  398. /package/{build → dist}/array/array-sort-by.d.ts.map +0 -0
  399. /package/{build → dist}/array/array-zip.d.ts.map +0 -0
  400. /package/{build → dist}/array/index.d.ts +0 -0
  401. /package/{build → dist}/array/index.d.ts.map +0 -0
  402. /package/{build → dist}/asserts/errors.d.ts +0 -0
  403. /package/{build → dist}/asserts/internal-utils.d.ts +0 -0
  404. /package/{build → dist}/enum/enum-keys.d.ts +0 -0
  405. /package/{build → dist}/enum/enum-keys.d.ts.map +0 -0
  406. /package/{build → dist}/enum/enum-values.d.ts +0 -0
  407. /package/{build → dist}/enum/enum-values.d.ts.map +0 -0
  408. /package/{build → dist}/enum/types.d.ts +0 -0
  409. /package/{build → dist}/enum/types.d.ts.map +0 -0
  410. /package/{build → dist}/function/index.d.ts +0 -0
  411. /package/{build → dist}/function/index.d.ts.map +0 -0
  412. /package/{build → dist}/function/sleep.d.ts +0 -0
  413. /package/{build → dist}/function/sleep.d.ts.map +0 -0
  414. /package/{build → dist}/number/assert.d.ts +0 -0
  415. /package/{build → dist}/object/clone.d.ts +0 -0
  416. /package/{build → dist}/object/has-circular-reference.d.ts +0 -0
  417. /package/{build → dist}/object/json-circular-replacer.d.ts +0 -0
  418. /package/{build → dist}/object/key-value-pairs.d.ts +0 -0
  419. /package/{build → dist}/object/key-value-pairs.d.ts.map +0 -0
  420. /package/{build → dist}/object/map.d.ts +0 -0
  421. /package/{build → dist}/object/map.d.ts.map +0 -0
  422. /package/{build → dist}/object/merge.d.ts +0 -0
  423. /package/{build → dist}/object/object-invert.d.ts +0 -0
  424. /package/{build → dist}/object/object-invert.d.ts.map +0 -0
  425. /package/{build → dist}/object/omit.d.ts +0 -0
  426. /package/{build → dist}/object/omit.d.ts.map +0 -0
  427. /package/{build → dist}/object/pick.d.ts +0 -0
  428. /package/{build → dist}/object/pick.d.ts.map +0 -0
@@ -1,23 +1,14 @@
1
1
  export function ArraySample(array, n, random) {
2
- // Handle overload where second argument is RNG function
3
- let sampleCount;
4
- let rng = random ?? Math.random;
5
- if (typeof n === 'function') {
6
- rng = n;
7
- sampleCount = undefined;
8
- }
9
- else {
10
- sampleCount = n;
11
- }
2
+ const rng = random ?? Math.random;
12
3
  if (!array || array.length === 0) {
13
- return sampleCount !== undefined ? [] : undefined;
4
+ return n !== undefined ? [] : undefined;
14
5
  }
15
- if (sampleCount === undefined) {
6
+ if (n === undefined) {
16
7
  return array[Math.floor(rng() * array.length)];
17
8
  }
18
9
  // Fisher-Yates partial shuffle for O(n) sampling
19
10
  const copy = [...array];
20
- const count = Math.min(sampleCount, copy.length);
11
+ const count = Math.min(n, copy.length);
21
12
  for (let i = 0; i < count; i++) {
22
13
  const j = i + Math.floor(rng() * (copy.length - i));
23
14
  const tmp = copy[j];
@@ -26,4 +17,3 @@ export function ArraySample(array, n, random) {
26
17
  }
27
18
  return copy.slice(0, count);
28
19
  }
29
- //# sourceMappingURL=array-sample.js.map
@@ -4,7 +4,7 @@
4
4
  * @template T - The type of array elements
5
5
  * @param array - The array to shuffle
6
6
  * @param random - Optional custom RNG function (returns number between 0 and 1). Defaults to `Math.random`.
7
- * @returns A new shuffled array (original is not mutated)
7
+ * @returns A new shuffled array (original is not mutated). Returns `[]` if `array` is `null` or `undefined`.
8
8
  *
9
9
  * @remarks Uses `Math.random()` by default — not cryptographically secure. Do not use for
10
10
  * security-sensitive operations.
@@ -4,7 +4,7 @@
4
4
  * @template T - The type of array elements
5
5
  * @param array - The array to shuffle
6
6
  * @param random - Optional custom RNG function (returns number between 0 and 1). Defaults to `Math.random`.
7
- * @returns A new shuffled array (original is not mutated)
7
+ * @returns A new shuffled array (original is not mutated). Returns `[]` if `array` is `null` or `undefined`.
8
8
  *
9
9
  * @remarks Uses `Math.random()` by default — not cryptographically secure. Do not use for
10
10
  * security-sensitive operations.
@@ -28,4 +28,3 @@ export function ArrayShuffle(array, random) {
28
28
  }
29
29
  return result;
30
30
  }
31
- //# sourceMappingURL=array-shuffle.js.map
@@ -6,7 +6,7 @@ import type { TTransform } from './types.js';
6
6
  * @param array - The array to sort
7
7
  * @param keyFn - Function that extracts the sort key from each element
8
8
  * @param direction - Sort direction: `'asc'` (default) or `'desc'`
9
- * @returns A sorted copy of the array
9
+ * @returns A sorted copy of the array. Returns `[]` if `array` is `null` or `undefined`.
10
10
  *
11
11
  * @example
12
12
  * ```typescript
@@ -5,7 +5,7 @@
5
5
  * @param array - The array to sort
6
6
  * @param keyFn - Function that extracts the sort key from each element
7
7
  * @param direction - Sort direction: `'asc'` (default) or `'desc'`
8
- * @returns A sorted copy of the array
8
+ * @returns A sorted copy of the array. Returns `[]` if `array` is `null` or `undefined`.
9
9
  *
10
10
  * @example
11
11
  * ```typescript
@@ -28,4 +28,3 @@ export function ArraySortBy(array, keyFn, direction = 'asc') {
28
28
  return 0;
29
29
  });
30
30
  }
31
- //# sourceMappingURL=array-sort-by.js.map
@@ -3,7 +3,7 @@
3
3
  * The result length is capped at the shortest input array.
4
4
  *
5
5
  * @param arrays - Two or more arrays to zip
6
- * @returns Array of tuples — one tuple per index position
6
+ * @returns Array of tuples — one tuple per index position. Returns `[]` if `arrays` is empty or if any input array is `null` or `undefined`.
7
7
  *
8
8
  * @example
9
9
  * ```typescript
@@ -3,7 +3,7 @@
3
3
  * The result length is capped at the shortest input array.
4
4
  *
5
5
  * @param arrays - Two or more arrays to zip
6
- * @returns Array of tuples — one tuple per index position
6
+ * @returns Array of tuples — one tuple per index position. Returns `[]` if `arrays` is empty or if any input array is `null` or `undefined`.
7
7
  *
8
8
  * @example
9
9
  * ```typescript
@@ -22,4 +22,3 @@ export function ArrayZip(...arrays) {
22
22
  const minLen = Math.min(...arrays.map((a) => a.length));
23
23
  return Array.from({ length: minLen }, (_, i) => arrays.map((a) => a[i]));
24
24
  }
25
- //# sourceMappingURL=array-zip.js.map
@@ -15,10 +15,6 @@ export interface IAssertArrayArgs {
15
15
  /** Maximum number of elements the array must contain (inclusive) */
16
16
  maxSize?: number;
17
17
  }
18
- /**
19
- * Alias for {@link IAssertArrayArgs}. Kept for backwards compatibility.
20
- */
21
- export type TSizeConstraint = IAssertArrayArgs;
22
18
  /**
23
19
  * Type alias for 2D dimension constraint properties.
24
20
  * Represents constraints that can be applied to matrix dimensions.
@@ -63,45 +59,53 @@ export interface IAssertArray2DArgs {
63
59
  }
64
60
  /**
65
61
  * Asserts that a value is an array, optionally validating its size.
66
- * @template T The type of array elements.
67
- * @param value The value to validate.
68
- * @param args Optional size constraints.
69
- * @param exception Optional custom exception to throw.
62
+ * @template T - The type of array elements.
63
+ * @param value - The value to validate.
64
+ * @param args - Optional size constraints.
65
+ * @param exception - Optional custom exception to throw.
70
66
  * @throws {ArrayError} If the value is not an array or fails size validation.
71
67
  */
72
68
  export declare function AssertArray<T = unknown>(value: unknown, args?: IAssertArrayArgs, exception?: IAssertException): asserts value is T[];
73
69
  /**
74
70
  * Asserts that a value is a 2D array, optionally validating its dimensions.
75
- * @template T The type of array elements.
76
- * @param value The value to validate.
77
- * @param args Optional dimension constraints.
78
- * @param exception Optional custom exception to throw.
71
+ * @template T - The type of array elements.
72
+ * @param value - The value to validate.
73
+ * @param args - Optional dimension constraints.
74
+ * @param exception - Optional custom exception to throw.
79
75
  * @throws {ArrayError} If the value is not a 2D array or fails dimension validation.
80
76
  */
81
77
  export declare function AssertArray2D<T = unknown>(value: unknown, args?: IAssertArray2DArgs, exception?: IAssertException): asserts value is T[][];
82
78
  /**
83
79
  * Asserts that an array is not empty.
84
- * @template T The type of array elements.
85
- * @param value The array to validate.
86
- * @param exception Optional custom exception to throw.
80
+ * @template T - The type of array elements.
81
+ * @param value - The array to validate.
82
+ * @param exception - Optional custom exception to throw.
87
83
  * @throws {ArrayError} If the array is empty.
88
84
  */
89
85
  export declare function AssertArrayNotEmpty<T>(value: T[] | unknown, exception?: IAssertException): asserts value is T[];
90
86
  /**
91
87
  * Asserts that all elements in an array satisfy a predicate.
92
- * @template T The type of array elements.
93
- * @param array The array to validate.
94
- * @param predicate A function to test each element.
95
- * @param exception Optional custom exception to throw.
88
+ *
89
+ * Uses `array.every()` to check if all elements satisfy the predicate condition.
90
+ * Throws an error if any element fails the test.
91
+ *
92
+ * @template T - The type of array elements.
93
+ * @param array - The array to validate.
94
+ * @param predicate - A function to test each element.
95
+ * @param exception - Optional custom exception to throw.
96
96
  * @throws {ArrayError} If any element fails the predicate test.
97
97
  */
98
98
  export declare function AssertArrayAll<T>(array: T[], predicate: (el: T, idx: number, arr: T[]) => boolean, exception?: IAssertException): void;
99
99
  /**
100
100
  * Asserts that at least one element in an array satisfies a predicate.
101
- * @template T The type of array elements.
102
- * @param array The array to validate.
103
- * @param predicate A function to test each element.
104
- * @param exception Optional custom exception to throw.
101
+ *
102
+ * Uses `array.some()` to check if any element satisfies the predicate condition.
103
+ * Throws an error if no elements pass the test.
104
+ *
105
+ * @template T - The type of array elements.
106
+ * @param array - The array to validate.
107
+ * @param predicate - A function to test each element.
108
+ * @param exception - Optional custom exception to throw.
105
109
  * @throws {ArrayError} If no elements pass the predicate test.
106
110
  */
107
111
  export declare function AssertArrayAny<T>(array: T[], predicate: (el: T, idx: number, arr: T[]) => boolean, exception?: IAssertException): void;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/array/assert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAChC,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAClC,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gDAAgD;IACh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AO,EAAE,SAAS,GAAE,gBAAqB,GAAG,IAAI,CAO1I;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,OAAO,EAAE,SAAS,GAAE,gBAAqB,GAAG,IAAI,CAO1I"}
@@ -1,4 +1,4 @@
1
- import { SetExceptionClass, SetExceptionMessage, ThrowException } from '../asserts/utils.js';
1
+ import { SetExceptionClass, SetExceptionMessage, ThrowException, AssertValueType } from '../asserts/utils.js';
2
2
  import { SimpleError } from '../asserts/errors.js';
3
3
  /**
4
4
  * Error thrown when a value is not a valid array or fails an array assertion.
@@ -13,20 +13,17 @@ export class ArrayError extends SimpleError {
13
13
  }
14
14
  /**
15
15
  * Asserts that a value is an array, optionally validating its size.
16
- * @template T The type of array elements.
17
- * @param value The value to validate.
18
- * @param args Optional size constraints.
19
- * @param exception Optional custom exception to throw.
16
+ * @template T - The type of array elements.
17
+ * @param value - The value to validate.
18
+ * @param args - Optional size constraints.
19
+ * @param exception - Optional custom exception to throw.
20
20
  * @throws {ArrayError} If the value is not an array or fails size validation.
21
21
  */
22
22
  export function AssertArray(value, args, exception = {}) {
23
23
  // Initialize exception configuration with defaults
24
24
  SetExceptionClass(exception, ArrayError);
25
25
  // Validate that the value is an array
26
- if (!Array.isArray(value)) {
27
- SetExceptionMessage(exception, `Expected array but received ${typeof value}: ${String(value)}`);
28
- ThrowException(exception);
29
- }
26
+ AssertValueType(value, 'array', exception);
30
27
  // Type cast is safe after array validation
31
28
  const array = value;
32
29
  // Validate exact size constraint if specified
@@ -47,30 +44,27 @@ export function AssertArray(value, args, exception = {}) {
47
44
  }
48
45
  /**
49
46
  * Asserts that a value is a 2D array, optionally validating its dimensions.
50
- * @template T The type of array elements.
51
- * @param value The value to validate.
52
- * @param args Optional dimension constraints.
53
- * @param exception Optional custom exception to throw.
47
+ * @template T - The type of array elements.
48
+ * @param value - The value to validate.
49
+ * @param args - Optional dimension constraints.
50
+ * @param exception - Optional custom exception to throw.
54
51
  * @throws {ArrayError} If the value is not a 2D array or fails dimension validation.
55
52
  */
56
53
  export function AssertArray2D(value, args = {}, exception = {}) {
57
54
  // Initialize exception configuration with defaults
58
55
  SetExceptionClass(exception, ArrayError);
59
56
  // Validate that the value is an array
60
- if (!Array.isArray(value)) {
61
- SetExceptionMessage(exception, `Expected array but received ${typeof value}: ${String(value)}`);
62
- ThrowException(exception);
63
- }
57
+ AssertValueType(value, 'array', exception);
64
58
  // Type cast is safe after array validation
65
59
  const array = value;
66
- // Validate that all elements are arrays (making it 2D)
67
- if (!array.every((row) => Array.isArray(row))) {
68
- let invalidPositions = array.map((row, idx) => {
69
- if (!Array.isArray(row))
70
- return idx;
71
- return null;
72
- });
73
- invalidPositions = invalidPositions.filter((idx) => idx !== null);
60
+ // Validate that all elements are arrays (making it 2D) with single-pass collection of invalid positions
61
+ const invalidPositions = [];
62
+ for (let i = 0; i < array.length; i++) {
63
+ if (!Array.isArray(array[i])) {
64
+ invalidPositions.push(i);
65
+ }
66
+ }
67
+ if (invalidPositions.length > 0) {
74
68
  SetExceptionMessage(exception, `Expected 2D array but found non-array elements at positions: ${invalidPositions.join(', ')}`);
75
69
  ThrowException(exception);
76
70
  }
@@ -117,9 +111,9 @@ export function AssertArray2D(value, args = {}, exception = {}) {
117
111
  }
118
112
  /**
119
113
  * Asserts that an array is not empty.
120
- * @template T The type of array elements.
121
- * @param value The array to validate.
122
- * @param exception Optional custom exception to throw.
114
+ * @template T - The type of array elements.
115
+ * @param value - The array to validate.
116
+ * @param exception - Optional custom exception to throw.
123
117
  * @throws {ArrayError} If the array is empty.
124
118
  */
125
119
  export function AssertArrayNotEmpty(value, exception = {}) {
@@ -143,13 +137,18 @@ function assertIsArray(array, exception) {
143
137
  }
144
138
  /**
145
139
  * Asserts that all elements in an array satisfy a predicate.
146
- * @template T The type of array elements.
147
- * @param array The array to validate.
148
- * @param predicate A function to test each element.
149
- * @param exception Optional custom exception to throw.
140
+ *
141
+ * Uses `array.every()` to check if all elements satisfy the predicate condition.
142
+ * Throws an error if any element fails the test.
143
+ *
144
+ * @template T - The type of array elements.
145
+ * @param array - The array to validate.
146
+ * @param predicate - A function to test each element.
147
+ * @param exception - Optional custom exception to throw.
150
148
  * @throws {ArrayError} If any element fails the predicate test.
151
149
  */
152
150
  export function AssertArrayAll(array, predicate, exception = {}) {
151
+ // Predicate functions use array.some() / array.every() for consistency
153
152
  assertIsArray(array, exception);
154
153
  if (!array.every(predicate)) {
155
154
  SetExceptionMessage(exception, 'Not all elements satisfy the predicate condition');
@@ -158,17 +157,21 @@ export function AssertArrayAll(array, predicate, exception = {}) {
158
157
  }
159
158
  /**
160
159
  * Asserts that at least one element in an array satisfies a predicate.
161
- * @template T The type of array elements.
162
- * @param array The array to validate.
163
- * @param predicate A function to test each element.
164
- * @param exception Optional custom exception to throw.
160
+ *
161
+ * Uses `array.some()` to check if any element satisfies the predicate condition.
162
+ * Throws an error if no elements pass the test.
163
+ *
164
+ * @template T - The type of array elements.
165
+ * @param array - The array to validate.
166
+ * @param predicate - A function to test each element.
167
+ * @param exception - Optional custom exception to throw.
165
168
  * @throws {ArrayError} If no elements pass the predicate test.
166
169
  */
167
170
  export function AssertArrayAny(array, predicate, exception = {}) {
171
+ // Predicate functions use array.some() / array.every() for consistency
168
172
  assertIsArray(array, exception);
169
173
  if (!array.some(predicate)) {
170
174
  SetExceptionMessage(exception, 'No elements satisfy the predicate condition');
171
175
  ThrowException(exception);
172
176
  }
173
177
  }
174
- //# sourceMappingURL=assert.js.map
@@ -23,4 +23,3 @@ export * from './array-sort-by.js';
23
23
  export * from './array-count-by.js';
24
24
  export * from './array-sample.js';
25
25
  export * from './assert.js';
26
- //# sourceMappingURL=index.js.map
@@ -29,4 +29,33 @@ export type TComparator<T> = (a: T, b: T) => number;
29
29
  * @returns true if values are equal, false otherwise
30
30
  */
31
31
  export type TEqualityComparator<T> = (a: T, b: T) => boolean;
32
+ /**
33
+ * Options for comparing array elements.
34
+ * Supports both custom comparator functions and deep equality checking.
35
+ *
36
+ * @template T - The type of array elements
37
+ */
38
+ /**
39
+ * Comparison options for array operations.
40
+ *
41
+ * Provides a discriminated union where callers must choose exactly one strategy:
42
+ * - `comparator`: Custom equality function for specialized comparison logic
43
+ * - `useDeepEqual`: Deep structural equality checking
44
+ * - `keyFn`: Function to extract a primitive key for O(n+m) Set-based lookup
45
+ *
46
+ * Mutually exclusive at compile time via `never` literals.
47
+ */
48
+ export type TArrayComparisonOptions<T> = {
49
+ comparator: TEqualityComparator<T>;
50
+ useDeepEqual?: never;
51
+ keyFn?: never;
52
+ } | {
53
+ useDeepEqual: true;
54
+ comparator?: never;
55
+ keyFn?: never;
56
+ } | {
57
+ keyFn: (item: T) => unknown;
58
+ comparator?: never;
59
+ useDeepEqual?: never;
60
+ };
32
61
  //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/array/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC;AAE7D;;;;;GAKG;AACH;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAClC;IAAE,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAAC,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAC3E;IAAE,YAAY,EAAE,IAAI,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GACzD;IAAE,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAC;IAAC,YAAY,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * Returns a new array with duplicate values removed.
3
3
  *
4
+ * Returns empty array if input is null, undefined, or empty.
5
+ *
4
6
  * @template T - The type of array elements
5
7
  * @param array - The input array
6
- * @returns A new array containing only unique values (preserves first occurrence order)
8
+ * @returns A new array containing only unique values (preserves first occurrence order). Returns `[]` if `array` is `null`, `undefined`, or empty.
7
9
  *
8
10
  * @remarks Uses reference equality for objects. Two distinct objects with
9
11
  * identical property values are **not** considered equal and will both be kept.
@@ -1 +1 @@
1
- {"version":3,"file":"unique.d.ts","sourceRoot":"","sources":["../../src/array/unique.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAMlD"}
1
+ {"version":3,"file":"unique.d.ts","sourceRoot":"","sources":["../../src/array/unique.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAOlD"}
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * Returns a new array with duplicate values removed.
3
3
  *
4
+ * Returns empty array if input is null, undefined, or empty.
5
+ *
4
6
  * @template T - The type of array elements
5
7
  * @param array - The input array
6
- * @returns A new array containing only unique values (preserves first occurrence order)
8
+ * @returns A new array containing only unique values (preserves first occurrence order). Returns `[]` if `array` is `null`, `undefined`, or empty.
7
9
  *
8
10
  * @remarks Uses reference equality for objects. Two distinct objects with
9
11
  * identical property values are **not** considered equal and will both be kept.
@@ -15,9 +17,9 @@
15
17
  * ```
16
18
  */
17
19
  export function Unique(array) {
18
- if (array === null || array === undefined) {
20
+ // Consistent null-check: early return for null/undefined/empty arrays
21
+ if (!array || array.length === 0) {
19
22
  return [];
20
23
  }
21
24
  return [...new Set(array)];
22
25
  }
23
- //# sourceMappingURL=unique.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/asserts/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,qBAAa,WAAY,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAM3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,SAAU,SAAQ,KAAK;IACnC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B,SAAgB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAE7D;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAkB5E;AAED;;;;;;;GAOG;AACH,qBAAa,eAAgB,SAAQ,SAAS;IAC7C;;;OAGG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAG9D;AAED;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,SAAS;IAC5C;;;OAGG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAG9D;AAED;;;;;;;;;;GAUG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD;;;;OAIG;gBACS,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAGnF;AAED;;;;;;;;;GASG;AACH,qBAAa,iBAAkB,SAAQ,SAAS;IAC/C;;;OAGG;gBACS,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAGhE;AAED;;;;;;;;;GASG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC3C;;;OAGG;gBACS,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAG3D;AAED;;;;;;;;;;GAUG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;IACjD;;;OAGG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAG9D"}
@@ -55,9 +55,12 @@ export class BaseError extends Error {
55
55
  this.name = this.constructor.name;
56
56
  this.Code = code;
57
57
  this.Context = context;
58
- if (typeof Error.captureStackTrace === 'function') {
59
- Error.captureStackTrace(this, this.constructor);
58
+ /* eslint-disable @typescript-eslint/no-explicit-any */
59
+ const ErrorWithCapture = Error;
60
+ if (typeof ErrorWithCapture.captureStackTrace === 'function') {
61
+ ErrorWithCapture.captureStackTrace(this, this.constructor);
60
62
  }
63
+ /* eslint-enable @typescript-eslint/no-explicit-any */
61
64
  }
62
65
  }
63
66
  /**
@@ -173,4 +176,3 @@ export class BufferOverflowError extends BaseError {
173
176
  super(`Buffer overflow: maximum size ${maxSize} exceeded`, 'BUFFER_OVERFLOW', context);
174
177
  }
175
178
  }
176
- //# sourceMappingURL=errors.js.map
@@ -1,10 +1,39 @@
1
1
  import type { IAssertException, TGuard, TValidationPredicate } from './types.js';
2
2
  import { SimpleError } from './errors.js';
3
+ /**
4
+ * Serializes a value to a human-readable string, safe for any value type.
5
+ *
6
+ * Prevents sensitive data exposure in error messages by:
7
+ * - Masking object contents (shows type name only, not property values)
8
+ * - Truncating long strings with a clear indication
9
+ * - Handling non-serializable values gracefully
10
+ *
11
+ * @param value - The value to serialize for display
12
+ * @param maxLength - Maximum characters to display for primitives (default: 50, capped at 10,000)
13
+ * @returns A safe string representation (at most maxLength chars plus "[truncated]" suffix)
14
+ *
15
+ * @example
16
+ * safeDisplay({ apiKey: 'secret123', username: 'john' }); // '[Object]'
17
+ * safeDisplay('x'.repeat(100)); // 'xxx....[truncated]'
18
+ * safeDisplay(circularRef); // '[non-serializable]'
19
+ *
20
+ * @internal Used internally by assertion functions to safely display values in error messages
21
+ */
22
+ export declare function safeDisplay(value: unknown, maxLength?: number): string;
23
+ /**
24
+ * Gets the display type of a value including null and undefined.
25
+ * Used for error messages in null/undefined assertions and type checking.
26
+ *
27
+ * @param value - The value to get the type of
28
+ * @returns A string representation of the value's type ('null', 'undefined', 'array', 'object', or typeof)
29
+ * @internal Used internally by assertion functions for consistent type messages
30
+ */
31
+ export declare function GetValueType(value: unknown): string;
3
32
  /**
4
33
  * Type alias for constructor functions.
5
34
  * Represents any class constructor that can be instantiated.
6
35
  */
7
- export type TConstructorFunction<T = any> = new (...args: any[]) => T;
36
+ export type TConstructorFunction<T = unknown> = new (...args: any[]) => T;
8
37
  /**
9
38
  * Error thrown when a nullish assertion fails — the value is not null or undefined
10
39
  * but was expected to be. Used by {@link AssertNull} when the provided value is a
@@ -394,7 +423,7 @@ export declare function AssertInstanceOf<T>(value: unknown, constructor: TConstr
394
423
  * AssertFunction(123); // ✗ Throws FunctionError
395
424
  * AssertFunction(null); // ✗ Throws FunctionError
396
425
  */
397
- export declare function AssertFunction(value: unknown, exception?: IAssertException): asserts value is (...args: any[]) => any;
426
+ export declare function AssertFunction(value: unknown, exception?: IAssertException): asserts value is (...args: unknown[]) => unknown;
398
427
  /**
399
428
  * Asserts that a value is a symbol.
400
429
  *
@@ -431,5 +460,5 @@ export declare function AssertSymbol(value: unknown, exception?: IAssertExceptio
431
460
  * AssertExtends(Derived, Base); // ✓ Valid
432
461
  * AssertExtends(Base, Derived); // ✗ Throws ExtendsError
433
462
  */
434
- export declare function AssertExtends(derived: abstract new (...args: any[]) => any, base: abstract new (...args: any[]) => any, exception?: IAssertException): void;
463
+ export declare function AssertExtends(derived: abstract new (...args: any[]) => unknown, base: abstract new (...args: any[]) => unknown, exception?: IAssertException): void;
435
464
  //# sourceMappingURL=generic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../src/asserts/generic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEjF,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,SAAK,GAAG,MAAM,CAiBlE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAOnD;AAED;;;GAGG;AAEH,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,OAAO,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAE1E;;;;;;;GAOG;AACH,qBAAa,SAAU,SAAQ,WAAW;gBAC7B,OAAO,CAAC,EAAE,MAAM;CAG5B;AAED;;;;;;;GAOG;AACH,qBAAa,YAAa,SAAQ,WAAW;gBAChC,OAAO,CAAC,EAAE,MAAM;CAG5B;AAED;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,WAAW;gBAClC,OAAO,CAAC,EAAE,MAAM;CAG5B;AAED;;;;;GAKG;AACH,qBAAa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