@pawells/typescript-common 2.0.0 → 2.1.6

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 (426) hide show
  1. package/README.md +370 -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 +1 -1
  7. package/{build → dist}/array/array-contains.js +2 -3
  8. package/{build → dist}/array/array-count-by.d.ts +1 -1
  9. package/{build → dist}/array/array-count-by.js +2 -3
  10. package/{build → dist}/array/array-difference.d.ts +12 -5
  11. package/dist/array/array-difference.d.ts.map +1 -0
  12. package/dist/array/array-difference.js +70 -0
  13. package/dist/array/array-element.js +1 -0
  14. package/{build → dist}/array/array-filter.d.ts +1 -1
  15. package/{build → dist}/array/array-filter.js +1 -2
  16. package/{build → dist}/array/array-flatten.d.ts +2 -2
  17. package/{build → dist}/array/array-flatten.d.ts.map +1 -1
  18. package/{build → dist}/array/array-flatten.js +1 -2
  19. package/{build → dist}/array/array-group-by.d.ts +1 -1
  20. package/{build → dist}/array/array-group-by.d.ts.map +1 -1
  21. package/{build → dist}/array/array-group-by.js +10 -9
  22. package/{build → dist}/array/array-intersection.d.ts +12 -5
  23. package/dist/array/array-intersection.d.ts.map +1 -0
  24. package/dist/array/array-intersection.js +79 -0
  25. package/{build → dist}/array/array-partition.d.ts +1 -1
  26. package/{build → dist}/array/array-partition.js +2 -3
  27. package/{build → dist}/array/array-range.d.ts +1 -1
  28. package/{build → dist}/array/array-range.js +1 -2
  29. package/{build → dist}/array/array-sample.d.ts +2 -2
  30. package/{build → dist}/array/array-sample.js +3 -5
  31. package/{build → dist}/array/array-shuffle.d.ts +1 -1
  32. package/{build → dist}/array/array-shuffle.js +1 -2
  33. package/{build → dist}/array/array-sort-by.d.ts +1 -1
  34. package/{build → dist}/array/array-sort-by.js +1 -2
  35. package/{build → dist}/array/array-zip.d.ts +1 -1
  36. package/{build → dist}/array/array-zip.js +1 -2
  37. package/{build → dist}/array/assert.d.ts +5 -5
  38. package/{build → dist}/array/assert.d.ts.map +1 -1
  39. package/{build → dist}/array/assert.js +13 -14
  40. package/{build → dist}/array/index.d.ts +1 -0
  41. package/{build → dist}/array/index.d.ts.map +1 -1
  42. package/{build → dist}/array/index.js +1 -1
  43. package/dist/array/iterators.d.ts +40 -0
  44. package/dist/array/iterators.d.ts.map +1 -0
  45. package/dist/array/iterators.js +54 -0
  46. package/{build → dist}/array/types.d.ts +20 -2
  47. package/{build → dist}/array/types.d.ts.map +1 -1
  48. package/dist/array/types.js +1 -0
  49. package/{build → dist}/array/unique.d.ts +1 -1
  50. package/{build → dist}/array/unique.js +1 -2
  51. package/dist/asserts/errors.d.ts.map +1 -0
  52. package/{build → dist}/asserts/errors.js +5 -3
  53. package/{build → dist}/asserts/generic.d.ts +23 -3
  54. package/dist/asserts/generic.d.ts.map +1 -0
  55. package/{build → dist}/asserts/generic.js +39 -7
  56. package/dist/asserts/index.d.ts +47 -0
  57. package/dist/asserts/index.d.ts.map +1 -0
  58. package/dist/asserts/index.js +46 -0
  59. package/{build → dist}/asserts/internal-utils.d.ts.map +1 -1
  60. package/{build → dist}/asserts/internal-utils.js +0 -1
  61. package/{build → dist}/asserts/types.d.ts +56 -17
  62. package/dist/asserts/types.d.ts.map +1 -0
  63. package/dist/asserts/types.js +1 -0
  64. package/{build → dist}/asserts/utils.d.ts +5 -21
  65. package/dist/asserts/utils.d.ts.map +1 -0
  66. package/{build → dist}/asserts/utils.js +14 -39
  67. package/{build → dist}/boolean/assert.d.ts +1 -2
  68. package/{build → dist}/boolean/assert.d.ts.map +1 -1
  69. package/{build → dist}/boolean/assert.js +1 -3
  70. package/dist/boolean/index.d.ts +13 -0
  71. package/dist/boolean/index.d.ts.map +1 -0
  72. package/dist/boolean/index.js +12 -0
  73. package/{build → dist}/enum/enum-entries.d.ts +1 -1
  74. package/dist/enum/enum-entries.d.ts.map +1 -0
  75. package/{build → dist}/enum/enum-entries.js +0 -1
  76. package/{build → dist}/enum/enum-key-by-value.d.ts +1 -1
  77. package/dist/enum/enum-key-by-value.d.ts.map +1 -0
  78. package/{build → dist}/enum/enum-key-by-value.js +0 -1
  79. package/{build → dist}/enum/enum-keys.js +0 -1
  80. package/{build → dist}/enum/enum-safe-value.d.ts +1 -1
  81. package/dist/enum/enum-safe-value.d.ts.map +1 -0
  82. package/{build → dist}/enum/enum-safe-value.js +0 -1
  83. package/{build → dist}/enum/enum-values.js +0 -1
  84. package/{build → dist}/enum/index.d.ts +1 -1
  85. package/dist/enum/index.d.ts.map +1 -0
  86. package/{build → dist}/enum/index.js +1 -2
  87. package/dist/enum/types.js +1 -0
  88. package/{build → dist}/enum/validate-enum-value.d.ts +1 -1
  89. package/dist/enum/validate-enum-value.d.ts.map +1 -0
  90. package/{build → dist}/enum/validate-enum-value.js +0 -1
  91. package/{build → dist}/function/compose.d.ts +6 -0
  92. package/dist/function/compose.d.ts.map +1 -0
  93. package/{build → dist}/function/compose.js +0 -1
  94. package/{build → dist}/function/debounce.d.ts +6 -0
  95. package/dist/function/debounce.d.ts.map +1 -0
  96. package/{build → dist}/function/debounce.js +6 -1
  97. package/{build → dist}/function/index.js +0 -1
  98. package/dist/function/memoize.d.ts +56 -0
  99. package/dist/function/memoize.d.ts.map +1 -0
  100. package/dist/function/memoize.js +72 -0
  101. package/{build → dist}/function/once.d.ts.map +1 -1
  102. package/{build → dist}/function/once.js +1 -1
  103. package/{build → dist}/function/sleep.js +0 -1
  104. package/{build → dist}/function/throttle.d.ts +7 -0
  105. package/dist/function/throttle.d.ts.map +1 -0
  106. package/{build → dist}/function/throttle.js +7 -1
  107. package/dist/function/types.d.ts +18 -0
  108. package/dist/function/types.d.ts.map +1 -0
  109. package/dist/function/types.js +1 -0
  110. package/dist/index.d.ts +14 -0
  111. package/dist/index.d.ts.map +1 -0
  112. package/dist/index.js +13 -0
  113. package/dist/json.sanitization.d.ts +14 -0
  114. package/dist/json.sanitization.d.ts.map +1 -0
  115. package/dist/json.sanitization.js +37 -0
  116. package/{build → dist}/lru-cache.d.ts +19 -0
  117. package/dist/lru-cache.d.ts.map +1 -0
  118. package/{build → dist}/lru-cache.js +24 -2
  119. package/{build → dist}/number/assert.js +0 -1
  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 +6 -0
  130. package/dist/object/clone.d.ts.map +1 -0
  131. package/{build → dist}/object/clone.js +14 -5
  132. package/{build → dist}/object/equals.d.ts.map +1 -1
  133. package/{build → dist}/object/equals.js +3 -7
  134. package/dist/object/filter-cached.d.ts +26 -0
  135. package/{build → dist}/object/filter-cached.d.ts.map +1 -1
  136. package/{build → dist}/object/filter-cached.js +27 -6
  137. package/{build → dist}/object/filter.d.ts.map +1 -1
  138. package/{build → dist}/object/filter.js +22 -6
  139. package/{build → dist}/object/has-circular-reference.d.ts.map +1 -1
  140. package/{build → dist}/object/has-circular-reference.js +4 -2
  141. package/{build → dist}/object/hash.d.ts +4 -0
  142. package/dist/object/hash.d.ts.map +1 -0
  143. package/{build → dist}/object/hash.js +20 -7
  144. package/{build → dist}/object/index.d.ts +2 -2
  145. package/{build → dist}/object/index.d.ts.map +1 -1
  146. package/{build → dist}/object/index.js +1 -2
  147. package/{build → dist}/object/json-circular-replacer.d.ts.map +1 -1
  148. package/{build → dist}/object/json-circular-replacer.js +0 -1
  149. package/{build → dist}/object/key-value-pairs.js +0 -1
  150. package/dist/object/map-cached.d.ts +31 -0
  151. package/dist/object/map-cached.d.ts.map +1 -0
  152. package/{build → dist}/object/map-cached.js +34 -6
  153. package/{build → dist}/object/map.js +0 -1
  154. package/{build → dist}/object/merge.d.ts.map +1 -1
  155. package/{build → dist}/object/merge.js +7 -7
  156. package/{build → dist}/object/object-diff.d.ts +2 -2
  157. package/{build → dist}/object/object-diff.d.ts.map +1 -1
  158. package/{build → dist}/object/object-diff.js +11 -5
  159. package/{build → dist}/object/object-flatten.d.ts +1 -1
  160. package/{build → dist}/object/object-flatten.d.ts.map +1 -1
  161. package/{build → dist}/object/object-flatten.js +10 -4
  162. package/{build → dist}/object/object-invert.js +0 -1
  163. package/{build → dist}/object/omit.js +0 -1
  164. package/{build → dist}/object/pick.js +0 -1
  165. package/{build → dist}/object/property-paths.d.ts +2 -0
  166. package/{build → dist}/object/property-paths.d.ts.map +1 -1
  167. package/{build → dist}/object/property-paths.js +8 -7
  168. package/dist/object/security-utils.d.ts +193 -0
  169. package/dist/object/security-utils.d.ts.map +1 -0
  170. package/dist/object/security-utils.js +304 -0
  171. package/{build → dist}/object/sort-keys.d.ts +15 -1
  172. package/dist/object/sort-keys.d.ts.map +1 -0
  173. package/dist/object/sort-keys.js +73 -0
  174. package/{build → dist}/object/types.d.ts +0 -61
  175. package/dist/object/types.d.ts.map +1 -0
  176. package/dist/object/types.js +1 -0
  177. package/{build → dist}/string/assert.d.ts +24 -0
  178. package/dist/string/assert.d.ts.map +1 -0
  179. package/{build → dist}/string/assert.js +30 -1
  180. package/{build → dist}/string/case-conversion.js +0 -1
  181. package/{build → dist}/string/comparison.d.ts.map +1 -1
  182. package/{build → dist}/string/comparison.js +3 -1
  183. package/{build → dist}/string/formatting.d.ts.map +1 -1
  184. package/{build → dist}/string/formatting.js +5 -3
  185. package/{build → dist}/string/index.js +0 -1
  186. package/{build → dist}/string/transformation.js +0 -1
  187. package/dist/string/types.d.ts +118 -0
  188. package/dist/string/types.d.ts.map +1 -0
  189. package/dist/string/types.js +1 -0
  190. package/{build → dist}/string/validation.js +0 -1
  191. package/dist/time/elapsed-time/constants.d.ts +36 -0
  192. package/{build → dist}/time/elapsed-time/constants.d.ts.map +1 -1
  193. package/{build → dist}/time/elapsed-time/constants.js +32 -3
  194. package/{build → dist}/time/elapsed-time/elapsed-time.d.ts +74 -22
  195. package/dist/time/elapsed-time/elapsed-time.d.ts.map +1 -0
  196. package/{build → dist}/time/elapsed-time/elapsed-time.js +183 -89
  197. package/dist/time/elapsed-time/types.d.ts +336 -0
  198. package/dist/time/elapsed-time/types.d.ts.map +1 -0
  199. package/dist/time/elapsed-time/types.js +1 -0
  200. package/{build → dist}/time/elapsed-time/utils.d.ts +1 -1
  201. package/dist/time/elapsed-time/utils.d.ts.map +1 -0
  202. package/{build → dist}/time/elapsed-time/utils.js +0 -1
  203. package/dist/time/index.d.ts +14 -0
  204. package/dist/time/index.d.ts.map +1 -0
  205. package/{build → dist}/time/index.js +0 -5
  206. package/{build → dist}/time/stopwatch/entry.d.ts +1 -1
  207. package/dist/time/stopwatch/entry.d.ts.map +1 -0
  208. package/{build → dist}/time/stopwatch/entry.js +0 -1
  209. package/{build → dist}/time/stopwatch/stopwatch.d.ts +27 -3
  210. package/dist/time/stopwatch/stopwatch.d.ts.map +1 -0
  211. package/{build → dist}/time/stopwatch/stopwatch.js +32 -4
  212. package/dist/zod-util.d.ts +145 -0
  213. package/dist/zod-util.d.ts.map +1 -0
  214. package/dist/zod-util.js +126 -0
  215. package/package.json +51 -67
  216. package/LICENSE +0 -21
  217. package/build/array/array-chunk.js.map +0 -1
  218. package/build/array/array-compact.js.map +0 -1
  219. package/build/array/array-contains.js.map +0 -1
  220. package/build/array/array-count-by.js.map +0 -1
  221. package/build/array/array-difference.d.ts.map +0 -1
  222. package/build/array/array-difference.js +0 -51
  223. package/build/array/array-difference.js.map +0 -1
  224. package/build/array/array-element.js +0 -2
  225. package/build/array/array-element.js.map +0 -1
  226. package/build/array/array-filter.js.map +0 -1
  227. package/build/array/array-flatten.js.map +0 -1
  228. package/build/array/array-group-by.js.map +0 -1
  229. package/build/array/array-intersection.d.ts.map +0 -1
  230. package/build/array/array-intersection.js +0 -57
  231. package/build/array/array-intersection.js.map +0 -1
  232. package/build/array/array-partition.js.map +0 -1
  233. package/build/array/array-range.js.map +0 -1
  234. package/build/array/array-sample.js.map +0 -1
  235. package/build/array/array-shuffle.js.map +0 -1
  236. package/build/array/array-sort-by.js.map +0 -1
  237. package/build/array/array-zip.js.map +0 -1
  238. package/build/array/assert.js.map +0 -1
  239. package/build/array/index.js.map +0 -1
  240. package/build/array/types.js +0 -2
  241. package/build/array/types.js.map +0 -1
  242. package/build/array/unique.js.map +0 -1
  243. package/build/asserts/errors.d.ts.map +0 -1
  244. package/build/asserts/errors.js.map +0 -1
  245. package/build/asserts/generic.d.ts.map +0 -1
  246. package/build/asserts/generic.js.map +0 -1
  247. package/build/asserts/index.d.ts +0 -41
  248. package/build/asserts/index.d.ts.map +0 -1
  249. package/build/asserts/index.js +0 -41
  250. package/build/asserts/index.js.map +0 -1
  251. package/build/asserts/internal-utils.js.map +0 -1
  252. package/build/asserts/types.d.ts.map +0 -1
  253. package/build/asserts/types.js +0 -2
  254. package/build/asserts/types.js.map +0 -1
  255. package/build/asserts/utils.d.ts.map +0 -1
  256. package/build/asserts/utils.js.map +0 -1
  257. package/build/boolean/assert.js.map +0 -1
  258. package/build/boolean/index.d.ts +0 -9
  259. package/build/boolean/index.d.ts.map +0 -1
  260. package/build/boolean/index.js +0 -9
  261. package/build/boolean/index.js.map +0 -1
  262. package/build/enum/enum-entries.d.ts.map +0 -1
  263. package/build/enum/enum-entries.js.map +0 -1
  264. package/build/enum/enum-key-by-value.d.ts.map +0 -1
  265. package/build/enum/enum-key-by-value.js.map +0 -1
  266. package/build/enum/enum-keys.js.map +0 -1
  267. package/build/enum/enum-safe-value.d.ts.map +0 -1
  268. package/build/enum/enum-safe-value.js.map +0 -1
  269. package/build/enum/enum-values.js.map +0 -1
  270. package/build/enum/index.d.ts.map +0 -1
  271. package/build/enum/index.js.map +0 -1
  272. package/build/enum/types.js +0 -2
  273. package/build/enum/types.js.map +0 -1
  274. package/build/enum/validate-enum-value.d.ts.map +0 -1
  275. package/build/enum/validate-enum-value.js.map +0 -1
  276. package/build/function/compose.d.ts.map +0 -1
  277. package/build/function/compose.js.map +0 -1
  278. package/build/function/debounce.d.ts.map +0 -1
  279. package/build/function/debounce.js.map +0 -1
  280. package/build/function/index.js.map +0 -1
  281. package/build/function/memoize.d.ts +0 -30
  282. package/build/function/memoize.d.ts.map +0 -1
  283. package/build/function/memoize.js +0 -44
  284. package/build/function/memoize.js.map +0 -1
  285. package/build/function/once.js.map +0 -1
  286. package/build/function/sleep.js.map +0 -1
  287. package/build/function/throttle.d.ts.map +0 -1
  288. package/build/function/throttle.js.map +0 -1
  289. package/build/function/types.d.ts +0 -5
  290. package/build/function/types.d.ts.map +0 -1
  291. package/build/function/types.js +0 -2
  292. package/build/function/types.js.map +0 -1
  293. package/build/index.d.ts +0 -38
  294. package/build/index.d.ts.map +0 -1
  295. package/build/index.js +0 -64
  296. package/build/index.js.map +0 -1
  297. package/build/lru-cache.d.ts.map +0 -1
  298. package/build/lru-cache.js.map +0 -1
  299. package/build/number/assert.js.map +0 -1
  300. package/build/number/index.d.ts +0 -9
  301. package/build/number/index.d.ts.map +0 -1
  302. package/build/number/index.js +0 -9
  303. package/build/number/index.js.map +0 -1
  304. package/build/object/assert-object.js.map +0 -1
  305. package/build/object/assert.d.ts.map +0 -1
  306. package/build/object/assert.js.map +0 -1
  307. package/build/object/clone.d.ts.map +0 -1
  308. package/build/object/clone.js.map +0 -1
  309. package/build/object/equals.js.map +0 -1
  310. package/build/object/filter-cached.d.ts +0 -21
  311. package/build/object/filter-cached.js.map +0 -1
  312. package/build/object/filter.js.map +0 -1
  313. package/build/object/has-circular-reference.js.map +0 -1
  314. package/build/object/hash.d.ts.map +0 -1
  315. package/build/object/hash.js.map +0 -1
  316. package/build/object/index.js.map +0 -1
  317. package/build/object/json-circular-replacer.js.map +0 -1
  318. package/build/object/key-value-pairs.js.map +0 -1
  319. package/build/object/map-cached.d.ts +0 -20
  320. package/build/object/map-cached.d.ts.map +0 -1
  321. package/build/object/map-cached.js.map +0 -1
  322. package/build/object/map.js.map +0 -1
  323. package/build/object/merge.js.map +0 -1
  324. package/build/object/object-diff.js.map +0 -1
  325. package/build/object/object-flatten.js.map +0 -1
  326. package/build/object/object-invert.js.map +0 -1
  327. package/build/object/omit.js.map +0 -1
  328. package/build/object/pick.js.map +0 -1
  329. package/build/object/property-paths.js.map +0 -1
  330. package/build/object/security-utils.d.ts +0 -59
  331. package/build/object/security-utils.d.ts.map +0 -1
  332. package/build/object/security-utils.js +0 -161
  333. package/build/object/security-utils.js.map +0 -1
  334. package/build/object/sort-keys.d.ts.map +0 -1
  335. package/build/object/sort-keys.js +0 -52
  336. package/build/object/sort-keys.js.map +0 -1
  337. package/build/object/types.d.ts.map +0 -1
  338. package/build/object/types.js +0 -6
  339. package/build/object/types.js.map +0 -1
  340. package/build/string/assert.d.ts.map +0 -1
  341. package/build/string/assert.js.map +0 -1
  342. package/build/string/case-conversion.js.map +0 -1
  343. package/build/string/comparison.js.map +0 -1
  344. package/build/string/formatting.js.map +0 -1
  345. package/build/string/index.js.map +0 -1
  346. package/build/string/transformation.js.map +0 -1
  347. package/build/string/types.d.ts +0 -44
  348. package/build/string/types.d.ts.map +0 -1
  349. package/build/string/types.js +0 -2
  350. package/build/string/types.js.map +0 -1
  351. package/build/string/validation.js.map +0 -1
  352. package/build/time/elapsed-time/constants.d.ts +0 -10
  353. package/build/time/elapsed-time/constants.js.map +0 -1
  354. package/build/time/elapsed-time/elapsed-time.d.ts.map +0 -1
  355. package/build/time/elapsed-time/elapsed-time.js.map +0 -1
  356. package/build/time/elapsed-time/types.d.ts +0 -150
  357. package/build/time/elapsed-time/types.d.ts.map +0 -1
  358. package/build/time/elapsed-time/types.js +0 -2
  359. package/build/time/elapsed-time/types.js.map +0 -1
  360. package/build/time/elapsed-time/utils.d.ts.map +0 -1
  361. package/build/time/elapsed-time/utils.js.map +0 -1
  362. package/build/time/index.d.ts +0 -18
  363. package/build/time/index.d.ts.map +0 -1
  364. package/build/time/index.js.map +0 -1
  365. package/build/time/stopwatch/entry-types.d.ts +0 -13
  366. package/build/time/stopwatch/entry-types.d.ts.map +0 -1
  367. package/build/time/stopwatch/entry-types.js +0 -2
  368. package/build/time/stopwatch/entry-types.js.map +0 -1
  369. package/build/time/stopwatch/entry.d.ts.map +0 -1
  370. package/build/time/stopwatch/entry.js.map +0 -1
  371. package/build/time/stopwatch/stopwatch.d.ts.map +0 -1
  372. package/build/time/stopwatch/stopwatch.js.map +0 -1
  373. /package/{build → dist}/array/array-chunk.d.ts.map +0 -0
  374. /package/{build → dist}/array/array-compact.d.ts.map +0 -0
  375. /package/{build → dist}/array/array-contains.d.ts.map +0 -0
  376. /package/{build → dist}/array/array-count-by.d.ts.map +0 -0
  377. /package/{build → dist}/array/array-element.d.ts +0 -0
  378. /package/{build → dist}/array/array-element.d.ts.map +0 -0
  379. /package/{build → dist}/array/array-filter.d.ts.map +0 -0
  380. /package/{build → dist}/array/array-partition.d.ts.map +0 -0
  381. /package/{build → dist}/array/array-range.d.ts.map +0 -0
  382. /package/{build → dist}/array/array-sample.d.ts.map +0 -0
  383. /package/{build → dist}/array/array-shuffle.d.ts.map +0 -0
  384. /package/{build → dist}/array/array-sort-by.d.ts.map +0 -0
  385. /package/{build → dist}/array/array-zip.d.ts.map +0 -0
  386. /package/{build → dist}/array/unique.d.ts.map +0 -0
  387. /package/{build → dist}/asserts/errors.d.ts +0 -0
  388. /package/{build → dist}/asserts/internal-utils.d.ts +0 -0
  389. /package/{build → dist}/enum/enum-keys.d.ts +0 -0
  390. /package/{build → dist}/enum/enum-keys.d.ts.map +0 -0
  391. /package/{build → dist}/enum/enum-values.d.ts +0 -0
  392. /package/{build → dist}/enum/enum-values.d.ts.map +0 -0
  393. /package/{build → dist}/enum/types.d.ts +0 -0
  394. /package/{build → dist}/enum/types.d.ts.map +0 -0
  395. /package/{build → dist}/function/index.d.ts +0 -0
  396. /package/{build → dist}/function/index.d.ts.map +0 -0
  397. /package/{build → dist}/function/once.d.ts +0 -0
  398. /package/{build → dist}/function/sleep.d.ts +0 -0
  399. /package/{build → dist}/function/sleep.d.ts.map +0 -0
  400. /package/{build → dist}/number/assert.d.ts +0 -0
  401. /package/{build → dist}/number/assert.d.ts.map +0 -0
  402. /package/{build → dist}/object/equals.d.ts +0 -0
  403. /package/{build → dist}/object/filter.d.ts +0 -0
  404. /package/{build → dist}/object/has-circular-reference.d.ts +0 -0
  405. /package/{build → dist}/object/json-circular-replacer.d.ts +0 -0
  406. /package/{build → dist}/object/key-value-pairs.d.ts +0 -0
  407. /package/{build → dist}/object/key-value-pairs.d.ts.map +0 -0
  408. /package/{build → dist}/object/map.d.ts +0 -0
  409. /package/{build → dist}/object/map.d.ts.map +0 -0
  410. /package/{build → dist}/object/merge.d.ts +0 -0
  411. /package/{build → dist}/object/object-invert.d.ts +0 -0
  412. /package/{build → dist}/object/object-invert.d.ts.map +0 -0
  413. /package/{build → dist}/object/omit.d.ts +0 -0
  414. /package/{build → dist}/object/omit.d.ts.map +0 -0
  415. /package/{build → dist}/object/pick.d.ts +0 -0
  416. /package/{build → dist}/object/pick.d.ts.map +0 -0
  417. /package/{build → dist}/string/case-conversion.d.ts +0 -0
  418. /package/{build → dist}/string/case-conversion.d.ts.map +0 -0
  419. /package/{build → dist}/string/comparison.d.ts +0 -0
  420. /package/{build → dist}/string/formatting.d.ts +0 -0
  421. /package/{build → dist}/string/index.d.ts +0 -0
  422. /package/{build → dist}/string/index.d.ts.map +0 -0
  423. /package/{build → dist}/string/transformation.d.ts +0 -0
  424. /package/{build → dist}/string/transformation.d.ts.map +0 -0
  425. /package/{build → dist}/string/validation.d.ts +0 -0
  426. /package/{build → dist}/string/validation.d.ts.map +0 -0
@@ -1,19 +1,4 @@
1
- import { TConstructableObject } from './internal-utils.js';
2
- /**
3
- * Type alias for constraint union patterns.
4
- * Represents common constraint combinations used across assertion modules.
5
- */
6
- export type TConstraintValue = string | number | boolean | null | undefined;
7
- /**
8
- * Type alias for comparison operators.
9
- * Represents the various comparison operations available in constraint validation.
10
- */
11
- export type TComparisonOperator = 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
12
- /**
13
- * Type alias for validation result patterns.
14
- * Represents the union of possible validation outcomes.
15
- */
16
- export type TValidationResult = true | Error;
1
+ import type { TConstructableObject } from './internal-utils.js';
17
2
  /**
18
3
  * Configuration interface for assertion exception handling.
19
4
  *
@@ -27,7 +12,6 @@ export type TValidationResult = true | Error;
27
12
  * defaults for unconfigured options.
28
13
  *
29
14
  * @interface IAssertException
30
- * @since 1.0.0
31
15
  *
32
16
  * @example
33
17
  * Basic usage with custom messages:
@@ -139,6 +123,14 @@ export interface IAssertException {
139
123
  * @template T - The type being guarded
140
124
  * @param value - The value to check
141
125
  * @returns true if value is of type T, false otherwise
126
+ *
127
+ * @example
128
+ * ```typescript
129
+ * const isString: TGuard<string> = (value): value is string => typeof value === 'string';
130
+ * if (isString(input)) {
131
+ * // input is now typed as string
132
+ * }
133
+ * ```
142
134
  */
143
135
  export type TGuard<T> = (value: unknown) => value is T;
144
136
  /**
@@ -146,6 +138,14 @@ export type TGuard<T> = (value: unknown) => value is T;
146
138
  * @template T - The type of value being validated
147
139
  * @param value - The value to validate
148
140
  * @returns true if valid, false otherwise
141
+ *
142
+ * @example
143
+ * ```typescript
144
+ * const isPositive: TValidationPredicate<number> = (value) => value > 0;
145
+ * if (isPositive(count)) {
146
+ * // count is valid
147
+ * }
148
+ * ```
149
149
  */
150
150
  export type TValidationPredicate<T = unknown> = (value: T) => boolean;
151
151
  /**
@@ -153,6 +153,15 @@ export type TValidationPredicate<T = unknown> = (value: T) => boolean;
153
153
  * @template T - The element type
154
154
  * @param value - The value to check
155
155
  * @returns true if value is an array of type T[], false otherwise
156
+ *
157
+ * @example
158
+ * ```typescript
159
+ * const isStringArray: TArrayTypeGuard<string> = (value): value is string[] =>
160
+ * Array.isArray(value) && value.every(item => typeof item === 'string');
161
+ * if (isStringArray(items)) {
162
+ * // items is now typed as string[]
163
+ * }
164
+ * ```
156
165
  */
157
166
  export type TArrayTypeGuard<T> = (value: unknown) => value is T[];
158
167
  /**
@@ -160,6 +169,16 @@ export type TArrayTypeGuard<T> = (value: unknown) => value is T[];
160
169
  * @template T - The object type
161
170
  * @param value - The value to check
162
171
  * @returns true if value is of object type T, false otherwise
172
+ *
173
+ * @example
174
+ * ```typescript
175
+ * interface User { id: number; name: string; }
176
+ * const isUser: TObjectTypeGuard<User> = (value): value is User =>
177
+ * typeof value === 'object' && value !== null && 'id' in value && 'name' in value;
178
+ * if (isUser(data)) {
179
+ * // data is now typed as User
180
+ * }
181
+ * ```
163
182
  */
164
183
  export type TObjectTypeGuard<T extends object> = (value: unknown) => value is T;
165
184
  /**
@@ -167,6 +186,15 @@ export type TObjectTypeGuard<T extends object> = (value: unknown) => value is T;
167
186
  * @template T - The non-null type
168
187
  * @param value - The value to check
169
188
  * @returns true if value is not null or undefined, false otherwise
189
+ *
190
+ * @example
191
+ * ```typescript
192
+ * const isDefined: TNonNullableGuard<string> = (value): value is string =>
193
+ * value !== null && value !== undefined;
194
+ * if (isDefined(maybeString)) {
195
+ * // maybeString is now typed as string
196
+ * }
197
+ * ```
170
198
  */
171
199
  export type TNonNullableGuard<T> = (value: T | null | undefined) => value is T;
172
200
  /**
@@ -175,6 +203,17 @@ export type TNonNullableGuard<T> = (value: T | null | undefined) => value is T;
175
203
  * @param value - The value to assert
176
204
  * @param message - Optional error message
177
205
  * @throws IAssertException if assertion fails
206
+ *
207
+ * @example
208
+ * ```typescript
209
+ * const AssertNumber: TAssertFunction<number> = (value, message) => {
210
+ * if (typeof value !== 'number') {
211
+ * throw new Error(message || 'Expected a number');
212
+ * }
213
+ * };
214
+ * AssertNumber(input);
215
+ * // input is now typed as number
216
+ * ```
178
217
  */
179
218
  export type TAssertFunction<T = unknown> = (value: unknown, message?: string) => asserts value is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EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,24 +1,5 @@
1
- import { TConstructableObject } from './internal-utils.js';
2
- import { IAssertException } from './types.js';
3
- /**
4
- * Gets the actual type of a value for error messages.
5
- * Handles primitives, objects, arrays, null, and undefined.
6
- *
7
- * @param value - The value to get the type of
8
- * @returns A string representation suitable for error messages
9
- * @internal Used by assertion functions for consistent type naming
10
- *
11
- * @example
12
- * ```typescript
13
- * GetActualType(null); // "null"
14
- * GetActualType(undefined); // "undefined"
15
- * GetActualType([1, 2, 3]); // "array"
16
- * GetActualType({a: 1}); // "object"
17
- * GetActualType("hello"); // "string"
18
- * GetActualType(42); // "number"
19
- * ```
20
- */
21
- export declare function GetActualType(value: unknown): string;
1
+ import type { TConstructableObject } from './internal-utils.js';
2
+ import type { IAssertException } from './types.js';
22
3
  /**
23
4
  * Throws an exception using the configured error class and message.
24
5
  *
@@ -29,6 +10,7 @@ export declare function GetActualType(value: unknown): string;
29
10
  *
30
11
  * @param exception - Exception configuration containing error class and/or message
31
12
  * @throws {Error} The configured error class with the specified message, or generic Error if no class specified
13
+ * @internal
32
14
  *
33
15
  * @example
34
16
  * ```typescript
@@ -59,6 +41,7 @@ export declare function ThrowException(exception: IAssertException): void;
59
41
  * @param exception - Exception configuration object to modify
60
42
  * @param errorClass - The error class constructor to set as default
61
43
  * @param force - Whether to override existing error class configuration (default: false)
44
+ * @internal
62
45
  *
63
46
  * @example
64
47
  * ```typescript
@@ -89,6 +72,7 @@ export declare function SetExceptionClass(exception: IAssertException, errorClas
89
72
  * @param exception - Exception configuration object to modify
90
73
  * @param message - The error message to set as default
91
74
  * @param force - Whether to override existing error message configuration (default: false)
75
+ * @internal
92
76
  *
93
77
  * @example
94
78
  * ```typescript
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/asserts/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAIhE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,oBAAoB,EAAE,KAAK,UAAQ,GAAG,IAAI,CAGpH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,IAAI,CAGrG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC9B,KAAK,EAAE,OAAO,EACd,YAAY,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,EAClE,SAAS,EAAE,gBAAgB,GACzB,OAAO,CAAC,KAAK,CAuCf"}
@@ -1,30 +1,4 @@
1
- /**
2
- * Gets the actual type of a value for error messages.
3
- * Handles primitives, objects, arrays, null, and undefined.
4
- *
5
- * @param value - The value to get the type of
6
- * @returns A string representation suitable for error messages
7
- * @internal Used by assertion functions for consistent type naming
8
- *
9
- * @example
10
- * ```typescript
11
- * GetActualType(null); // "null"
12
- * GetActualType(undefined); // "undefined"
13
- * GetActualType([1, 2, 3]); // "array"
14
- * GetActualType({a: 1}); // "object"
15
- * GetActualType("hello"); // "string"
16
- * GetActualType(42); // "number"
17
- * ```
18
- */
19
- export function GetActualType(value) {
20
- if (value === null)
21
- return 'null';
22
- if (value === undefined)
23
- return 'undefined';
24
- if (Array.isArray(value))
25
- return 'array';
26
- return typeof value;
27
- }
1
+ import { safeDisplay, GetValueType } from './generic.js';
28
2
  /**
29
3
  * Throws an exception using the configured error class and message.
30
4
  *
@@ -35,6 +9,7 @@ export function GetActualType(value) {
35
9
  *
36
10
  * @param exception - Exception configuration containing error class and/or message
37
11
  * @throws {Error} The configured error class with the specified message, or generic Error if no class specified
12
+ * @internal
38
13
  *
39
14
  * @example
40
15
  * ```typescript
@@ -54,9 +29,8 @@ export function GetActualType(value) {
54
29
  * ```
55
30
  */
56
31
  export function ThrowException(exception) {
57
- if (!exception.class) {
58
- throw new Error(exception.message ?? 'An assertion error occurred');
59
- }
32
+ // exception.class is always set by SetExceptionClass before this is called
33
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
60
34
  throw new exception.class(exception.message ?? 'An assertion error occurred');
61
35
  }
62
36
  /**
@@ -70,6 +44,7 @@ export function ThrowException(exception) {
70
44
  * @param exception - Exception configuration object to modify
71
45
  * @param errorClass - The error class constructor to set as default
72
46
  * @param force - Whether to override existing error class configuration (default: false)
47
+ * @internal
73
48
  *
74
49
  * @example
75
50
  * ```typescript
@@ -104,6 +79,7 @@ export function SetExceptionClass(exception, errorClass, force = false) {
104
79
  * @param exception - Exception configuration object to modify
105
80
  * @param message - The error message to set as default
106
81
  * @param force - Whether to override existing error message configuration (default: false)
82
+ * @internal
107
83
  *
108
84
  * @example
109
85
  * ```typescript
@@ -150,33 +126,32 @@ export function AssertValueType(value, expectedType, exception) {
150
126
  }
151
127
  if (expectedType === 'array') {
152
128
  if (!Array.isArray(value)) {
153
- const actualType = GetActualType(value);
154
- SetExceptionMessage(exception, `Expected array but received ${actualType}: ${String(value)}`);
129
+ const actualType = GetValueType(value);
130
+ SetExceptionMessage(exception, `Expected array but received ${actualType}: ${safeDisplay(value)}`);
155
131
  ThrowException(exception);
156
132
  }
157
133
  return;
158
134
  }
159
135
  if (expectedType === 'object') {
160
136
  if (typeof value !== 'object') {
161
- const actualType = GetActualType(value);
162
- SetExceptionMessage(exception, `Expected object but received ${actualType}: ${String(value)}`);
137
+ const actualType = GetValueType(value);
138
+ SetExceptionMessage(exception, `Expected object but received ${actualType}: ${safeDisplay(value)}`);
163
139
  ThrowException(exception);
164
140
  }
165
141
  return;
166
142
  }
167
143
  if (expectedType === 'number') {
168
144
  if (typeof value !== 'number' || Number.isNaN(value)) {
169
- const actualType = typeof value === 'number' ? 'NaN' : GetActualType(value);
170
- SetExceptionMessage(exception, `Expected number but received ${actualType}: ${JSON.stringify(value)}`);
145
+ const actualType = typeof value === 'number' ? 'NaN' : GetValueType(value);
146
+ SetExceptionMessage(exception, `Expected number but received ${actualType}: ${safeDisplay(value)}`);
171
147
  ThrowException(exception);
172
148
  }
173
149
  return;
174
150
  }
175
151
  // For string and boolean
176
- const actualType = GetActualType(value);
152
+ const actualType = GetValueType(value);
177
153
  if (actualType !== expectedType) {
178
- SetExceptionMessage(exception, `Expected ${expectedType} but received ${actualType}: ${String(value)}`);
154
+ SetExceptionMessage(exception, `Expected ${expectedType} but received ${actualType}: ${safeDisplay(value)}`);
179
155
  ThrowException(exception);
180
156
  }
181
157
  }
182
- //# sourceMappingURL=utils.js.map
@@ -24,8 +24,7 @@ export declare class BooleanError extends SimpleError {
24
24
  * @param value - The value to validate and assert as a boolean primitive
25
25
  * @param exception - Optional exception configuration for custom error handling.
26
26
  * Can include custom error message, error type, or other metadata.
27
- * @throws {Error} When value is not a boolean primitive. The specific error type
28
- * depends on the exception configuration provided.
27
+ * @throws {BooleanError} When value is not a boolean primitive
29
28
  *
30
29
  * @example
31
30
  * Basic usage with valid boolean values:
@@ -1 +1 @@
1
- {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/boolean/assert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,WAAW;gBAChC,OAAO,CAAC,EAAE,MAAM;CAG5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,GAAE,gBAAqB,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAGxG"}
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/boolean/assert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,WAAW;gBAChC,OAAO,CAAC,EAAE,MAAM;CAG5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,GAAE,gBAAqB,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAGxG"}
@@ -26,8 +26,7 @@ export class BooleanError extends SimpleError {
26
26
  * @param value - The value to validate and assert as a boolean primitive
27
27
  * @param exception - Optional exception configuration for custom error handling.
28
28
  * Can include custom error message, error type, or other metadata.
29
- * @throws {Error} When value is not a boolean primitive. The specific error type
30
- * depends on the exception configuration provided.
29
+ * @throws {BooleanError} When value is not a boolean primitive
31
30
  *
32
31
  * @example
33
32
  * Basic usage with valid boolean values:
@@ -69,4 +68,3 @@ export function AssertBoolean(value, exception = {}) {
69
68
  SetExceptionClass(exception, BooleanError);
70
69
  AssertValueType(value, 'boolean', exception);
71
70
  }
72
- //# sourceMappingURL=assert.js.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Boolean assertion functions and types.
3
+ *
4
+ * Provides assertion helpers for validating boolean values at runtime.
5
+ *
6
+ * Currently contains only assertion utilities. This module structure is designed
7
+ * to accommodate additional boolean utilities in the future (e.g., conversion,
8
+ * parsing functions).
9
+ *
10
+ * @module boolean
11
+ */
12
+ export * from './assert.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/boolean/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,aAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Boolean assertion functions and types.
3
+ *
4
+ * Provides assertion helpers for validating boolean values at runtime.
5
+ *
6
+ * Currently contains only assertion utilities. This module structure is designed
7
+ * to accommodate additional boolean utilities in the future (e.g., conversion,
8
+ * parsing functions).
9
+ *
10
+ * @module boolean
11
+ */
12
+ export * from './assert.js';
@@ -1,4 +1,4 @@
1
- import { TEnumType, TEnumValue } from './types.js';
1
+ import type { TEnumType, TEnumValue } from './types.js';
2
2
  /**
3
3
  * Returns non-numeric key-value pairs from an enum.
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum-entries.d.ts","sourceRoot":"","sources":["../../src/enum/enum-entries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAIzF"}
@@ -16,4 +16,3 @@ export function EnumEntries(e) {
16
16
  return [];
17
17
  return Object.entries(e).filter(([key]) => Number.isNaN(Number(key)));
18
18
  }
19
- //# sourceMappingURL=enum-entries.js.map
@@ -1,4 +1,4 @@
1
- import { TEnumType, TEnumValue } from './types.js';
1
+ import type { TEnumType, TEnumValue } from './types.js';
2
2
  /**
3
3
  * Gets the enum key for a given value.
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum-key-by-value.d.ts","sourceRoot":"","sources":["../../src/enum/enum-key-by-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAQ3G"}
@@ -23,4 +23,3 @@ export function EnumKeyByValue(e, value) {
23
23
  return found[0];
24
24
  return undefined;
25
25
  }
26
- //# sourceMappingURL=enum-key-by-value.js.map
@@ -20,4 +20,3 @@ export function EnumKeys(obj) {
20
20
  return [];
21
21
  return Object.keys(obj).filter((k) => Number.isNaN(Number(k)));
22
22
  }
23
- //# sourceMappingURL=enum-keys.js.map
@@ -1,4 +1,4 @@
1
- import { TEnumType, TEnumValue } from './types.js';
1
+ import type { TEnumType, TEnumValue } from './types.js';
2
2
  /**
3
3
  * Gets an enum value safely, returning a fallback if the value is not a valid enum member.
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum-safe-value.d.ts","sourceRoot":"","sources":["../../src/enum/enum-safe-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,GAAG,UAAU,CAExH"}
@@ -18,4 +18,3 @@ import { ValidateEnumValue } from './validate-enum-value.js';
18
18
  export function EnumSafeValue(e, value, fallback) {
19
19
  return ValidateEnumValue(e, value) ? value : fallback;
20
20
  }
21
- //# sourceMappingURL=enum-safe-value.js.map
@@ -22,4 +22,3 @@ export function EnumValues(enumObj) {
22
22
  .filter(key => Number.isNaN(Number(key))) // Filter out reverse mappings
23
23
  .map(key => enumObj[key]);
24
24
  }
25
- //# sourceMappingURL=enum-values.js.map
@@ -1,4 +1,3 @@
1
- export * from './types.js';
2
1
  /**
3
2
  * Enum utility functions.
4
3
  *
@@ -14,4 +13,5 @@ export * from './enum-entries.js';
14
13
  export * from './validate-enum-value.js';
15
14
  export * from './enum-key-by-value.js';
16
15
  export * from './enum-safe-value.js';
16
+ export * from './types.js';
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enum/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC"}
@@ -1,4 +1,3 @@
1
- export * from './types.js';
2
1
  /**
3
2
  * Enum utility functions.
4
3
  *
@@ -14,4 +13,4 @@ export * from './enum-entries.js';
14
13
  export * from './validate-enum-value.js';
15
14
  export * from './enum-key-by-value.js';
16
15
  export * from './enum-safe-value.js';
17
- //# sourceMappingURL=index.js.map
16
+ export * from './types.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { TEnumType, TEnumValue } from './types.js';
1
+ import type { TEnumType, TEnumValue } from './types.js';
2
2
  /**
3
3
  * Checks if a value is a valid member of the given enum.
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-enum-value.d.ts","sourceRoot":"","sources":["../../src/enum/validate-enum-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAKnG"}
@@ -20,4 +20,3 @@ export function ValidateEnumValue(e, value) {
20
20
  const possibleValues = EnumValues(e);
21
21
  return possibleValues.includes(value);
22
22
  }
23
- //# sourceMappingURL=validate-enum-value.js.map
@@ -5,6 +5,9 @@ import type { TAnyFunction } from './types.js';
5
5
  * Overloads are provided for up to five functions with distinct types.
6
6
  * For same-type pipelines of any length, use the variadic form.
7
7
  *
8
+ * @param fns - One or more functions to compose
9
+ * @returns A function that applies the input through the composed pipeline
10
+ *
8
11
  * @example
9
12
  * ```typescript
10
13
  * const process = Compose(trim, toLowerCase, removeSpaces);
@@ -23,6 +26,9 @@ export declare function Compose(...fns: TAnyFunction[]): TAnyFunction;
23
26
  * Overloads are provided for up to five functions with distinct types.
24
27
  * For same-type pipelines of any length, use the variadic form.
25
28
  *
29
+ * @param fns - One or more functions to pipe
30
+ * @returns A function that applies the input through the piped pipeline
31
+ *
26
32
  * @example
27
33
  * ```typescript
28
34
  * const process = Pipe(trim, toLowerCase, removeSpaces);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/function/compose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC5D,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAChF,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAA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G,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC"}
@@ -4,4 +4,3 @@ export function Compose(...fns) {
4
4
  export function Pipe(...fns) {
5
5
  return (arg) => fns.reduce((v, fn) => fn(v), arg);
6
6
  }
7
- //# sourceMappingURL=compose.js.map
@@ -6,6 +6,12 @@ import type { TAnyFunction } from './types.js';
6
6
  * The returned function also exposes a `.cancel()` method to discard any
7
7
  * pending invocation.
8
8
  *
9
+ * @remarks
10
+ * Debounce differs from throttle in that it **delays execution** until silence.
11
+ * Each call resets the timer; the function executes only after `ms` milliseconds
12
+ * of inactivity. Throttle, by contrast, limits calls to **at most once per `ms` milliseconds**
13
+ * regardless of how frequently calls are made.
14
+ *
9
15
  * @template T - The wrapped function type
10
16
  * @param fn - The function to debounce
11
17
  * @param ms - Delay in milliseconds
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../src/function/debounce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,YAAY,EAC9C,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,MAAM,GACR,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAiB7D"}
@@ -5,6 +5,12 @@
5
5
  * The returned function also exposes a `.cancel()` method to discard any
6
6
  * pending invocation.
7
7
  *
8
+ * @remarks
9
+ * Debounce differs from throttle in that it **delays execution** until silence.
10
+ * Each call resets the timer; the function executes only after `ms` milliseconds
11
+ * of inactivity. Throttle, by contrast, limits calls to **at most once per `ms` milliseconds**
12
+ * regardless of how frequently calls are made.
13
+ *
8
14
  * @template T - The wrapped function type
9
15
  * @param fn - The function to debounce
10
16
  * @param ms - Delay in milliseconds
@@ -34,4 +40,3 @@ export function Debounce(fn, ms) {
34
40
  };
35
41
  return debounced;
36
42
  }
37
- //# sourceMappingURL=debounce.js.map
@@ -13,4 +13,3 @@ export * from './memoize.js';
13
13
  export * from './once.js';
14
14
  export * from './compose.js';
15
15
  export * from './sleep.js';
16
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Returns a memoized version of `fn` that caches results by serialising its
3
+ * arguments with `JSON.stringify` (or a custom `keyFn`).
4
+ *
5
+ * Only suitable for **pure functions** with serialisable arguments.
6
+ *
7
+ * Uses an LRU (Least Recently Used) eviction policy: when the cache reaches
8
+ * `maxCacheSize`, the entry that was accessed least recently is evicted.
9
+ *
10
+ * @template T - The function type to memoize
11
+ * @param fn - The function to memoize
12
+ * @param keyFn - Optional custom cache key function. If not provided, arguments are serialized with JSON.stringify
13
+ * @param maxCacheSize - Maximum number of cached results before LRU eviction (default: 1000)
14
+ * @returns A memoized function with the same signature as `fn`
15
+ *
16
+ * @warning Do not memoize functions with sensitive parameters (passwords, tokens, API keys).
17
+ * The cache stores return values keyed by serialized arguments, which could expose sensitive
18
+ * data if the cache is inspected or if the keyFn inadvertently includes sensitive data
19
+ * in the cache key. For functions handling sensitive data, consider:
20
+ * - Not memoizing at all
21
+ * - Using a custom keyFn that excludes sensitive parameters
22
+ * - Implementing manual cache invalidation after processing sensitive data
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const expensiveCalc = Memoize((n: number) => n * n);
27
+ * expensiveCalc(4); // computed
28
+ * expensiveCalc(4); // cached → same value returned immediately
29
+ *
30
+ * // Custom key function:
31
+ * const getUser = Memoize(fetchUser, (id) => `user:${id}`);
32
+ *
33
+ * // With custom cache size:
34
+ * const cached = Memoize(fn, undefined, 500);
35
+ *
36
+ * const add = (a: number, b: number) => a + b;
37
+ * const cachedAdd = Memoize(add);
38
+ * console.log(cachedAdd(1, 2)); // Computes: 3
39
+ * console.log(cachedAdd(1, 2)); // Returns cached result: 3
40
+ * ```
41
+ */
42
+ /**
43
+ * Memoizes a function using an LRU cache.
44
+ *
45
+ * @remarks
46
+ * - Default key function uses JSON.stringify(args)
47
+ * - Non-serializable arguments (functions, symbols, circular refs) will produce incorrect cache behavior
48
+ * - Supply a custom `keyFn` for non-serializable arguments or for content-addressed keys
49
+ *
50
+ * @param fn - The function to memoize
51
+ * @param keyFn - Optional custom cache key function; defaults to JSON.stringify(args)
52
+ * @param maxCacheSize - Maximum number of entries in the cache; defaults to 1000
53
+ * @returns Memoized version of the function
54
+ */
55
+ export declare function Memoize<T extends (...args: any[]) => any>(fn: T, keyFn?: (...args: Parameters<T>) => string, maxCacheSize?: number): T;
56
+ //# sourceMappingURL=memoize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoize.d.ts","sourceRoot":"","sources":["../../src/function/memoize.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH;;;;;;;;;;;;GAYG;AAEH,wBAAgB,OAAO,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,EAAE,EAAE,CAAC,EACL,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,EAC1C,YAAY,SAAO,GACjB,CAAC,CAkBH"}