@splendidlabz/utils 1.11.3 → 1.11.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 (408) hide show
  1. package/dist/cjs/dom/accessibility.cjs +53 -0
  2. package/dist/cjs/dom/actions/index.cjs +410 -0
  3. package/dist/cjs/dom/actions/masonry.cjs +152 -0
  4. package/dist/cjs/dom/actions/prefer-horizontal-scroll.cjs +157 -0
  5. package/dist/cjs/dom/actions/sticky.cjs +213 -0
  6. package/dist/cjs/dom/bounding-box.cjs +70 -0
  7. package/dist/cjs/dom/clipboard.cjs +37 -0
  8. package/dist/cjs/dom/cookie.cjs +57 -0
  9. package/dist/cjs/dom/css-vars.cjs +57 -0
  10. package/dist/cjs/dom/events.cjs +59 -0
  11. package/{src/dom/focusable.js → dist/cjs/dom/focusable.cjs} +51 -73
  12. package/dist/cjs/dom/font-size.cjs +80 -0
  13. package/dist/cjs/dom/get-element.cjs +98 -0
  14. package/dist/cjs/dom/hash.cjs +35 -0
  15. package/dist/cjs/dom/index.cjs +1267 -0
  16. package/dist/cjs/dom/keyboard.cjs +51 -0
  17. package/dist/cjs/dom/local-store.cjs +79 -0
  18. package/dist/cjs/dom/media.cjs +59 -0
  19. package/dist/cjs/dom/observers/index.cjs +253 -0
  20. package/dist/cjs/dom/observers/intersection-observer.cjs +91 -0
  21. package/dist/cjs/dom/observers/mutation-observer.cjs +95 -0
  22. package/dist/cjs/dom/observers/observer.cjs +48 -0
  23. package/dist/cjs/dom/observers/resize-observer.cjs +84 -0
  24. package/dist/cjs/dom/observers/scroll-observer.cjs +177 -0
  25. package/dist/cjs/dom/pkce.cjs +53 -0
  26. package/dist/cjs/dom/query-params.cjs +38 -0
  27. package/dist/cjs/dom/random-string.cjs +38 -0
  28. package/dist/cjs/dom/sanitize.cjs +65 -0
  29. package/dist/cjs/dom/session-store.cjs +49 -0
  30. package/dist/cjs/dom/spam-prevention.cjs +50 -0
  31. package/dist/cjs/dom/trap-focus.cjs +197 -0
  32. package/dist/cjs/dom/ui/aria-current.cjs +43 -0
  33. package/dist/cjs/dom/ui/inconsistent-button-fix.cjs +35 -0
  34. package/dist/cjs/dom/ui/index.cjs +105 -0
  35. package/dist/cjs/dom/ui/scroll-container.cjs +47 -0
  36. package/dist/cjs/dom/ui/traverse-and-scramble.cjs +50 -0
  37. package/dist/cjs/lib/arrays/index.cjs +139 -0
  38. package/dist/cjs/lib/arrays/item-position.cjs +42 -0
  39. package/dist/cjs/lib/arrays/join.cjs +43 -0
  40. package/dist/cjs/lib/arrays/shuffle.cjs +42 -0
  41. package/dist/cjs/lib/arrays/sort.cjs +67 -0
  42. package/dist/cjs/lib/arrays/split-array.cjs +41 -0
  43. package/dist/cjs/lib/arrays/unique.cjs +31 -0
  44. package/dist/cjs/lib/auth/index.cjs +53 -0
  45. package/dist/cjs/lib/auth/route-manager.cjs +51 -0
  46. package/dist/cjs/lib/checks.cjs +63 -0
  47. package/dist/cjs/lib/date/days.cjs +37 -0
  48. package/dist/cjs/lib/date/index.cjs +208 -0
  49. package/dist/cjs/lib/date/months.cjs +102 -0
  50. package/dist/cjs/lib/date/time.cjs +117 -0
  51. package/dist/cjs/lib/form/form-data.cjs +83 -0
  52. package/dist/cjs/lib/form/index.cjs +122 -0
  53. package/dist/cjs/lib/form/sanitize.cjs +61 -0
  54. package/dist/cjs/lib/functions/callback.cjs +31 -0
  55. package/dist/cjs/lib/functions/debounce.cjs +43 -0
  56. package/dist/cjs/lib/functions/env.cjs +32 -0
  57. package/dist/cjs/lib/functions/functional.cjs +82 -0
  58. package/dist/cjs/lib/functions/index.cjs +142 -0
  59. package/dist/cjs/lib/functions/throttle.cjs +38 -0
  60. package/dist/cjs/lib/functions/timeout.cjs +41 -0
  61. package/dist/cjs/lib/hash.cjs +43 -0
  62. package/dist/cjs/lib/index.cjs +1178 -0
  63. package/dist/cjs/lib/numbers/index.cjs +49 -0
  64. package/dist/cjs/lib/numbers/math.cjs +36 -0
  65. package/dist/cjs/lib/objects/camelcase-keys.cjs +80 -0
  66. package/dist/cjs/lib/objects/empty.cjs +39 -0
  67. package/dist/cjs/lib/objects/equal.cjs +47 -0
  68. package/dist/cjs/lib/objects/extend.cjs +147 -0
  69. package/dist/cjs/lib/objects/flatten.cjs +48 -0
  70. package/dist/cjs/lib/objects/index.cjs +378 -0
  71. package/dist/cjs/lib/objects/json.cjs +35 -0
  72. package/dist/cjs/lib/objects/loop.cjs +40 -0
  73. package/dist/cjs/lib/objects/mix/mix.cjs +115 -0
  74. package/dist/cjs/lib/objects/nested-property.cjs +45 -0
  75. package/dist/cjs/lib/objects/normalize-object.cjs +106 -0
  76. package/dist/cjs/lib/objects/omit-empty.cjs +40 -0
  77. package/dist/cjs/lib/objects/size.cjs +63 -0
  78. package/dist/cjs/lib/objects/split.cjs +39 -0
  79. package/dist/cjs/lib/promises/index.cjs +69 -0
  80. package/dist/cjs/lib/promises/reject.cjs +67 -0
  81. package/dist/cjs/lib/sse.cjs +99 -0
  82. package/dist/cjs/lib/strings/convert-case/convert-case.cjs +96 -0
  83. package/dist/cjs/lib/strings/index.cjs +197 -0
  84. package/dist/cjs/lib/strings/markdown.cjs +76 -0
  85. package/dist/cjs/lib/strings/name.cjs +46 -0
  86. package/dist/cjs/lib/strings/pluralize.cjs +40 -0
  87. package/dist/cjs/lib/strings/query-string.cjs +43 -0
  88. package/dist/cjs/lib/style/index.cjs +64 -0
  89. package/dist/cjs/lib/symbols/index.cjs +40 -0
  90. package/dist/cjs/lib/symbols/symbols.cjs +38 -0
  91. package/dist/cjs/node/dirname.cjs +49 -0
  92. package/dist/cjs/node/file-cache.cjs +200 -0
  93. package/dist/cjs/node/file.cjs +50 -0
  94. package/dist/cjs/node/hash.cjs +42 -0
  95. package/dist/cjs/node/index.cjs +296 -0
  96. package/dist/cjs/node/pkce.cjs +64 -0
  97. package/dist/cjs/node/random-string.cjs +43 -0
  98. package/dist/cjs/node/sanitize.cjs +65 -0
  99. package/dist/cjs/node/uuid.cjs +42 -0
  100. package/dist/esm/dom/accessibility.js +26 -0
  101. package/dist/esm/dom/actions/index.js +3 -0
  102. package/dist/esm/dom/actions/masonry.js +38 -0
  103. package/dist/esm/dom/actions/prefer-horizontal-scroll.js +90 -0
  104. package/dist/esm/dom/actions/sticky.js +70 -0
  105. package/dist/esm/dom/bounding-box.js +44 -0
  106. package/dist/esm/dom/clipboard.js +12 -0
  107. package/dist/esm/dom/cookie.js +31 -0
  108. package/dist/esm/dom/css-vars.js +21 -0
  109. package/dist/esm/dom/events.js +31 -0
  110. package/dist/esm/dom/focusable.js +117 -0
  111. package/dist/esm/dom/font-size.js +40 -0
  112. package/dist/esm/dom/get-element.js +66 -0
  113. package/dist/esm/dom/hash.js +10 -0
  114. package/dist/esm/dom/index.js +23 -0
  115. package/dist/esm/dom/keyboard.js +22 -0
  116. package/{src → dist/esm}/dom/local-store.js +16 -28
  117. package/dist/esm/dom/media.js +32 -0
  118. package/dist/esm/dom/observers/index.js +4 -0
  119. package/dist/esm/dom/observers/intersection-observer.js +36 -0
  120. package/dist/esm/dom/observers/mutation-observer.js +40 -0
  121. package/dist/esm/dom/observers/observer.js +15 -0
  122. package/dist/esm/dom/observers/resize-observer.js +29 -0
  123. package/dist/esm/dom/observers/scroll-observer.js +95 -0
  124. package/dist/esm/dom/pkce.js +20 -0
  125. package/dist/esm/dom/query-params.js +13 -0
  126. package/dist/esm/dom/random-string.js +12 -0
  127. package/dist/esm/dom/sanitize.js +8 -0
  128. package/dist/esm/dom/session-store.js +24 -0
  129. package/dist/esm/dom/spam-prevention.js +25 -0
  130. package/dist/esm/dom/trap-focus.js +51 -0
  131. package/dist/esm/dom/ui/aria-current.js +17 -0
  132. package/dist/esm/dom/ui/inconsistent-button-fix.js +10 -0
  133. package/dist/esm/dom/ui/index.js +4 -0
  134. package/dist/esm/dom/ui/scroll-container.js +22 -0
  135. package/dist/esm/dom/ui/traverse-and-scramble.js +25 -0
  136. package/dist/esm/lib/arrays/index.js +6 -0
  137. package/dist/esm/lib/arrays/item-position.js +15 -0
  138. package/dist/esm/lib/arrays/join.js +12 -0
  139. package/dist/esm/lib/arrays/shuffle.js +17 -0
  140. package/dist/esm/lib/arrays/sort.js +36 -0
  141. package/dist/esm/lib/arrays/split-array.js +16 -0
  142. package/dist/esm/lib/arrays/unique.js +6 -0
  143. package/dist/esm/lib/auth/index.js +1 -0
  144. package/dist/esm/lib/auth/route-manager.js +25 -0
  145. package/dist/esm/lib/checks.js +34 -0
  146. package/dist/esm/lib/date/days.js +12 -0
  147. package/dist/esm/lib/date/index.js +3 -0
  148. package/dist/esm/lib/date/months.js +77 -0
  149. package/dist/esm/lib/date/time.js +75 -0
  150. package/dist/esm/lib/form/form-data.js +57 -0
  151. package/dist/esm/lib/form/index.js +2 -0
  152. package/dist/esm/lib/form/sanitize.js +34 -0
  153. package/dist/esm/lib/functions/callback.js +6 -0
  154. package/dist/esm/lib/functions/debounce.js +18 -0
  155. package/dist/esm/lib/functions/env.js +7 -0
  156. package/dist/esm/lib/functions/functional.js +52 -0
  157. package/dist/esm/lib/functions/index.js +5 -0
  158. package/dist/esm/lib/functions/throttle.js +13 -0
  159. package/dist/esm/lib/functions/timeout.js +14 -0
  160. package/dist/esm/lib/hash.js +18 -0
  161. package/dist/esm/lib/index.js +14 -0
  162. package/dist/esm/lib/numbers/index.js +11 -0
  163. package/dist/esm/lib/numbers/math.js +10 -0
  164. package/dist/esm/lib/objects/camelcase-keys.js +16 -0
  165. package/dist/esm/lib/objects/empty.js +13 -0
  166. package/dist/esm/lib/objects/equal.js +11 -0
  167. package/dist/esm/lib/objects/extend.js +13 -0
  168. package/dist/esm/lib/objects/flatten.js +17 -0
  169. package/dist/esm/lib/objects/index.js +13 -0
  170. package/dist/esm/lib/objects/json.js +10 -0
  171. package/dist/esm/lib/objects/loop.js +14 -0
  172. package/dist/esm/lib/objects/mix/mix.js +88 -0
  173. package/dist/esm/lib/objects/nested-property.js +18 -0
  174. package/dist/esm/lib/objects/normalize-object.js +9 -0
  175. package/dist/esm/lib/objects/omit-empty.js +15 -0
  176. package/dist/esm/lib/objects/size.js +38 -0
  177. package/dist/esm/lib/objects/split.js +14 -0
  178. package/dist/esm/lib/promises/index.js +1 -0
  179. package/dist/esm/lib/promises/reject.js +17 -0
  180. package/dist/esm/lib/sse.js +50 -0
  181. package/dist/esm/lib/strings/convert-case/convert-case.js +64 -0
  182. package/dist/esm/lib/strings/index.js +5 -0
  183. package/dist/esm/lib/strings/markdown.js +40 -0
  184. package/dist/esm/lib/strings/name.js +21 -0
  185. package/dist/esm/lib/strings/pluralize.js +5 -0
  186. package/dist/esm/lib/strings/query-string.js +16 -0
  187. package/dist/esm/lib/style/index.js +12 -0
  188. package/dist/esm/lib/symbols/index.js +1 -0
  189. package/dist/esm/lib/symbols/symbols.js +12 -0
  190. package/dist/esm/node/context.js +0 -0
  191. package/dist/esm/node/dirname.js +13 -0
  192. package/dist/esm/node/file-cache.js +121 -0
  193. package/dist/esm/node/file.js +14 -0
  194. package/dist/esm/node/hash.js +7 -0
  195. package/dist/esm/node/index.js +7 -0
  196. package/dist/esm/node/pkce.js +20 -0
  197. package/dist/esm/node/random-string.js +8 -0
  198. package/dist/esm/node/sanitize.js +8 -0
  199. package/dist/esm/node/uuid.js +7 -0
  200. package/dist/types/dom/accessibility.d.cts +30 -0
  201. package/dist/types/dom/actions/index.d.cts +3 -0
  202. package/dist/types/dom/actions/masonry.d.cts +5 -0
  203. package/dist/types/dom/actions/prefer-horizontal-scroll.d.cts +5 -0
  204. package/dist/types/dom/actions/sticky.d.cts +5 -0
  205. package/{src/dom/bounding-box.js → dist/types/dom/bounding-box.d.cts} +8 -49
  206. package/dist/types/dom/clipboard.d.cts +7 -0
  207. package/dist/types/dom/cookie.d.cts +7 -0
  208. package/dist/types/dom/css-vars.d.cts +6 -0
  209. package/{src/dom/events.js → dist/types/dom/events.d.cts} +52 -31
  210. package/dist/types/dom/focusable.d.cts +78 -0
  211. package/dist/types/dom/font-size.d.cts +8 -0
  212. package/{src/dom/get-element.js → dist/types/dom/get-element.d.cts} +25 -99
  213. package/dist/types/dom/hash.d.cts +3 -0
  214. package/dist/types/dom/index.d.cts +31 -0
  215. package/{src/dom/keyboard.js → dist/types/dom/keyboard.d.cts} +7 -19
  216. package/dist/types/dom/local-store.d.cts +31 -0
  217. package/dist/types/dom/media.d.cts +5 -0
  218. package/dist/types/dom/observers/index.d.cts +4 -0
  219. package/dist/types/dom/observers/intersection-observer.d.cts +10 -0
  220. package/dist/types/dom/observers/mutation-observer.d.cts +9 -0
  221. package/dist/types/dom/observers/observer.d.cts +3 -0
  222. package/{src/dom/observers/resize-observer.js → dist/types/dom/observers/resize-observer.d.cts} +6 -32
  223. package/dist/types/dom/observers/scroll-observer.d.cts +40 -0
  224. package/dist/types/dom/pkce.d.cts +8 -0
  225. package/dist/types/dom/query-params.d.cts +6 -0
  226. package/dist/types/dom/random-string.d.cts +9 -0
  227. package/dist/types/dom/sanitize.d.cts +10 -0
  228. package/dist/types/dom/session-store.d.cts +7 -0
  229. package/dist/types/dom/spam-prevention.d.cts +14 -0
  230. package/dist/types/dom/trap-focus.d.cts +32 -0
  231. package/dist/types/dom/ui/aria-current.d.cts +7 -0
  232. package/{src/dom/ui/inconsistent-button-fix.js → dist/types/dom/ui/inconsistent-button-fix.d.cts} +5 -11
  233. package/dist/types/dom/ui/index.d.cts +4 -0
  234. package/dist/types/dom/ui/scroll-container.d.cts +3 -0
  235. package/dist/types/dom/ui/traverse-and-scramble.d.cts +21 -0
  236. package/dist/types/lib/arrays/index.d.cts +6 -0
  237. package/{src/lib/arrays/item-position.js → dist/types/lib/arrays/item-position.d.cts} +5 -12
  238. package/{src/lib/arrays/join.js → dist/types/lib/arrays/join.d.cts} +4 -9
  239. package/dist/types/lib/arrays/shuffle.d.cts +3 -0
  240. package/dist/types/lib/arrays/sort.d.cts +32 -0
  241. package/dist/types/lib/arrays/split-array.d.cts +6 -0
  242. package/dist/types/lib/arrays/unique.d.cts +3 -0
  243. package/dist/types/lib/auth/index.d.cts +1 -0
  244. package/dist/types/lib/auth/route-manager.d.cts +28 -0
  245. package/dist/types/lib/checks.d.cts +33 -0
  246. package/dist/types/lib/date/days.d.cts +7 -0
  247. package/dist/types/lib/date/index.d.cts +3 -0
  248. package/dist/types/lib/date/months.d.cts +11 -0
  249. package/dist/types/lib/date/time.d.cts +21 -0
  250. package/dist/types/lib/form/form-data.d.cts +9 -0
  251. package/dist/types/lib/form/index.d.cts +2 -0
  252. package/{src/lib/form/sanitize.js → dist/types/lib/form/sanitize.d.cts} +19 -39
  253. package/{src/lib/functions/callback.js → dist/types/lib/functions/callback.d.cts} +3 -3
  254. package/dist/types/lib/functions/debounce.d.cts +3 -0
  255. package/dist/types/lib/functions/env.d.cts +3 -0
  256. package/{src/lib/functions/functional.js → dist/types/lib/functions/functional.d.cts} +8 -49
  257. package/dist/types/lib/functions/index.d.cts +5 -0
  258. package/dist/types/lib/functions/throttle.d.cts +3 -0
  259. package/dist/types/lib/functions/timeout.d.cts +5 -0
  260. package/dist/types/lib/hash.d.cts +3 -0
  261. package/dist/types/lib/index.d.cts +43 -0
  262. package/dist/types/lib/numbers/index.d.cts +5 -0
  263. package/dist/types/lib/numbers/math.d.cts +4 -0
  264. package/dist/types/lib/objects/camelcase-keys.d.cts +3 -0
  265. package/dist/types/lib/objects/empty.d.cts +4 -0
  266. package/dist/types/lib/objects/equal.d.cts +4 -0
  267. package/dist/types/lib/objects/extend.d.cts +6 -0
  268. package/dist/types/lib/objects/flatten.d.cts +6 -0
  269. package/dist/types/lib/objects/index.d.cts +13 -0
  270. package/dist/types/lib/objects/json.d.cts +3 -0
  271. package/dist/types/lib/objects/loop.d.cts +4 -0
  272. package/dist/types/lib/objects/mix/mix.d.cts +44 -0
  273. package/{src/lib/objects/nested-property.js → dist/types/lib/objects/nested-property.d.cts} +4 -21
  274. package/dist/types/lib/objects/normalize-object.d.cts +3 -0
  275. package/dist/types/lib/objects/omit-empty.d.cts +3 -0
  276. package/dist/types/lib/objects/size.d.cts +3 -0
  277. package/dist/types/lib/objects/split.d.cts +14 -0
  278. package/dist/types/lib/promises/index.d.cts +1 -0
  279. package/dist/types/lib/promises/reject.d.cts +5 -0
  280. package/dist/types/lib/sse.d.cts +18 -0
  281. package/dist/types/lib/strings/convert-case/convert-case.d.cts +10 -0
  282. package/dist/types/lib/strings/index.d.cts +5 -0
  283. package/dist/types/lib/strings/markdown.d.cts +25 -0
  284. package/dist/types/lib/strings/name.d.cts +7 -0
  285. package/dist/types/lib/strings/pluralize.d.cts +3 -0
  286. package/dist/types/lib/strings/query-string.d.cts +10 -0
  287. package/dist/types/lib/style/index.d.cts +3 -0
  288. package/dist/types/lib/symbols/index.d.cts +1 -0
  289. package/dist/types/lib/symbols/symbols.d.cts +4 -0
  290. package/dist/types/node/context.d.cts +2 -0
  291. package/dist/types/node/dirname.d.cts +9 -0
  292. package/dist/types/node/file-cache.d.cts +56 -0
  293. package/dist/types/node/file.d.cts +4 -0
  294. package/dist/types/node/hash.d.cts +3 -0
  295. package/dist/types/node/index.d.cts +7 -0
  296. package/dist/types/node/pkce.d.cts +14 -0
  297. package/dist/types/node/random-string.d.cts +3 -0
  298. package/{src/node/sanitize.js → dist/types/node/sanitize.d.cts} +3 -6
  299. package/dist/types/node/uuid.d.cts +3 -0
  300. package/package.json +18 -15
  301. package/CHANGELOG.md +0 -237
  302. package/eslint.config.js +0 -2
  303. package/src/dom/accessibility.js +0 -58
  304. package/src/dom/actions/index.js +0 -3
  305. package/src/dom/actions/masonry.js +0 -43
  306. package/src/dom/actions/prefer-horizontal-scroll.js +0 -121
  307. package/src/dom/actions/sticky.js +0 -85
  308. package/src/dom/clipboard.js +0 -14
  309. package/src/dom/cookie.js +0 -32
  310. package/src/dom/css-vars.js +0 -19
  311. package/src/dom/font-size.js +0 -40
  312. package/src/dom/hash.js +0 -9
  313. package/src/dom/index.js +0 -23
  314. package/src/dom/media.js +0 -30
  315. package/src/dom/observers/index.js +0 -4
  316. package/src/dom/observers/intersection-observer.js +0 -43
  317. package/src/dom/observers/mutation-observer.js +0 -51
  318. package/src/dom/observers/observer.js +0 -18
  319. package/src/dom/observers/scroll-observer.js +0 -146
  320. package/src/dom/pkce.js +0 -34
  321. package/src/dom/query-params.js +0 -14
  322. package/src/dom/random-string.js +0 -18
  323. package/src/dom/random-string.test.js +0 -13
  324. package/src/dom/sanitize.js +0 -16
  325. package/src/dom/session-store.js +0 -29
  326. package/src/dom/spam-prevention.js +0 -40
  327. package/src/dom/trap-focus.js +0 -70
  328. package/src/dom/ui/aria-current.js +0 -20
  329. package/src/dom/ui/index.js +0 -4
  330. package/src/dom/ui/scroll-container.js +0 -25
  331. package/src/dom/ui/traverse-and-scramble.js +0 -61
  332. package/src/lib/arrays/index.js +0 -6
  333. package/src/lib/arrays/shuffle.js +0 -21
  334. package/src/lib/arrays/sort.js +0 -88
  335. package/src/lib/arrays/sort.spec.js +0 -123
  336. package/src/lib/arrays/split-array.js +0 -15
  337. package/src/lib/arrays/unique.js +0 -3
  338. package/src/lib/auth/index.js +0 -1
  339. package/src/lib/auth/route-manager.js +0 -45
  340. package/src/lib/checks.js +0 -57
  341. package/src/lib/date/days.js +0 -9
  342. package/src/lib/date/index.js +0 -3
  343. package/src/lib/date/months.js +0 -74
  344. package/src/lib/date/time.js +0 -83
  345. package/src/lib/form/form-data.js +0 -73
  346. package/src/lib/form/index.js +0 -2
  347. package/src/lib/form/sanitize.spec.js +0 -126
  348. package/src/lib/functions/debounce.js +0 -18
  349. package/src/lib/functions/env.js +0 -5
  350. package/src/lib/functions/functional.test.js +0 -196
  351. package/src/lib/functions/index.js +0 -5
  352. package/src/lib/functions/throttle.js +0 -11
  353. package/src/lib/functions/timeout.js +0 -15
  354. package/src/lib/hash.js +0 -18
  355. package/src/lib/hash.spec.js +0 -163
  356. package/src/lib/index.js +0 -14
  357. package/src/lib/numbers/index.js +0 -12
  358. package/src/lib/numbers/math.js +0 -9
  359. package/src/lib/numbers/split-unit.test.js +0 -45
  360. package/src/lib/objects/camelcase-keys.js +0 -17
  361. package/src/lib/objects/camelcase-keys.test.js +0 -72
  362. package/src/lib/objects/empty.js +0 -10
  363. package/src/lib/objects/equal.js +0 -9
  364. package/src/lib/objects/extend.js +0 -16
  365. package/src/lib/objects/extend.test.js +0 -35
  366. package/src/lib/objects/flatten.js +0 -19
  367. package/src/lib/objects/index.js +0 -13
  368. package/src/lib/objects/json.js +0 -7
  369. package/src/lib/objects/loop.js +0 -11
  370. package/src/lib/objects/loop.test.js +0 -31
  371. package/src/lib/objects/mix/mix.js +0 -191
  372. package/src/lib/objects/mix/mix.md +0 -78
  373. package/src/lib/objects/mix/mix.test.js +0 -445
  374. package/src/lib/objects/normalize-object.js +0 -10
  375. package/src/lib/objects/omit-empty.js +0 -23
  376. package/src/lib/objects/omit-empty.test.js +0 -85
  377. package/src/lib/objects/size.js +0 -41
  378. package/src/lib/objects/split.js +0 -19
  379. package/src/lib/promises/index.js +0 -1
  380. package/src/lib/promises/reject.js +0 -17
  381. package/src/lib/sse.js +0 -61
  382. package/src/lib/strings/convert-case/convert-case.js +0 -86
  383. package/src/lib/strings/convert-case/convert-case.md +0 -44
  384. package/src/lib/strings/convert-case/convert-case.test.js +0 -50
  385. package/src/lib/strings/index.js +0 -5
  386. package/src/lib/strings/markdown.js +0 -71
  387. package/src/lib/strings/markdown.spec.js +0 -73
  388. package/src/lib/strings/name.js +0 -24
  389. package/src/lib/strings/name.test.js +0 -67
  390. package/src/lib/strings/pluralize.js +0 -2
  391. package/src/lib/strings/query-string.js +0 -18
  392. package/src/lib/style/index.js +0 -13
  393. package/src/lib/symbols/index.js +0 -1
  394. package/src/lib/symbols/symbols.js +0 -9
  395. package/src/node/dirname.js +0 -17
  396. package/src/node/file-cache.js +0 -184
  397. package/src/node/file.js +0 -13
  398. package/src/node/hash.js +0 -5
  399. package/src/node/index.js +0 -7
  400. package/src/node/pkce.js +0 -33
  401. package/src/node/random-string.js +0 -10
  402. package/src/node/random-string.test.js +0 -15
  403. package/src/node/sanitize.spec.js +0 -142
  404. package/src/node/uuid.js +0 -5
  405. package/tsconfig.json +0 -23
  406. package/tsup.config.js +0 -38
  407. package/tsup.config.mjs +0 -63
  408. /package/{src/node/context.js → dist/cjs/node/context.cjs} +0 -0
@@ -0,0 +1,22 @@
1
+ function findScrollContainer(element, direction = "both") {
2
+ if (!element) return;
3
+ let parent = element.parentElement;
4
+ while (parent) {
5
+ const { overflow, overflowX, overflowY } = getComputedStyle(parent);
6
+ if (direction === "both") {
7
+ if (overflow.includes("auto") || overflow.includes("scroll"))
8
+ return parent;
9
+ }
10
+ if (direction === "horizontal") {
11
+ if (overflowX === "auto" || overflowX === "scroll") return parent;
12
+ }
13
+ if (direction === "vertical") {
14
+ if (overflowY === "auto" || overflowY === "scroll") return parent;
15
+ }
16
+ parent = parent.parentElement;
17
+ }
18
+ return document.documentElement;
19
+ }
20
+ export {
21
+ findScrollContainer
22
+ };
@@ -0,0 +1,25 @@
1
+ function traverseAndScramble(node, { excludes = [] } = {}) {
2
+ if (node instanceof Element && excludes.some((selector) => node.matches(selector))) {
3
+ return;
4
+ }
5
+ node.childNodes.forEach((child) => {
6
+ if (child.nodeType === 3) {
7
+ child.nodeValue = scrambleText(child.nodeValue);
8
+ } else if (child.nodeType === 1 && child instanceof Element) {
9
+ traverseAndScramble(child, { excludes });
10
+ }
11
+ });
12
+ }
13
+ function scrambleText(text) {
14
+ return text.split("").map((char) => {
15
+ if (/^[A-Za-z0-9]$/.test(char)) {
16
+ const randomCharCode = Math.random() < 26 / 36 ? Math.floor(Math.random() * 26) + (char === char.toUpperCase() ? 65 : 97) : Math.floor(Math.random() * 10) + 48;
17
+ return String.fromCharCode(randomCharCode);
18
+ } else {
19
+ return char;
20
+ }
21
+ }).join("");
22
+ }
23
+ export {
24
+ traverseAndScramble
25
+ };
@@ -0,0 +1,6 @@
1
+ export * from "./item-position.js";
2
+ export * from "./join.js";
3
+ export * from "./shuffle.js";
4
+ export * from "./sort.js";
5
+ export * from "./split-array.js";
6
+ export * from "./unique.js";
@@ -0,0 +1,15 @@
1
+ function last(array, index) {
2
+ console.warn("last is deprecated. Use isLastItem instead.");
3
+ return index === array.length - 1;
4
+ }
5
+ function isLastItem(array, index) {
6
+ return index === array.length - 1;
7
+ }
8
+ function lastArrayItem(array) {
9
+ return array[array.length - 1];
10
+ }
11
+ export {
12
+ isLastItem,
13
+ last,
14
+ lastArrayItem
15
+ };
@@ -0,0 +1,12 @@
1
+ import { lastArrayItem } from "./item-position.js";
2
+ function joinWithConjunction(array, { conjunction = "and" } = {}) {
3
+ if (!array?.length) return "";
4
+ if (array.length === 1) return array[0];
5
+ if (array.length === 2) return `${array[0]} ${conjunction} ${array[1]}`;
6
+ const lastItem = lastArrayItem(array);
7
+ const rest = array.slice(0, -1);
8
+ return `${rest.join(", ")} ${conjunction} ${lastItem}`;
9
+ }
10
+ export {
11
+ joinWithConjunction
12
+ };
@@ -0,0 +1,17 @@
1
+ function shuffle(array) {
2
+ const clone = array.slice();
3
+ let currentIndex = array.length;
4
+ let temporaryValue;
5
+ let randomIndex;
6
+ while (currentIndex !== 0) {
7
+ randomIndex = Math.floor(Math.random() * currentIndex);
8
+ currentIndex -= 1;
9
+ temporaryValue = clone[currentIndex];
10
+ clone[currentIndex] = clone[randomIndex];
11
+ clone[randomIndex] = temporaryValue;
12
+ }
13
+ return clone;
14
+ }
15
+ export {
16
+ shuffle
17
+ };
@@ -0,0 +1,36 @@
1
+ import { getNestedValue } from "../objects/nested-property.js";
2
+ function sort(array, { props = null, reverse = false } = {}) {
3
+ const clone = array.slice();
4
+ if (props === null) {
5
+ return clone.sort((a, b) => {
6
+ const comparison = compareValues(a, b);
7
+ return reverse ? -comparison : comparison;
8
+ });
9
+ }
10
+ const properties = Array.isArray(props) ? props : [props];
11
+ return clone.sort((a, b) => {
12
+ for (const property of properties) {
13
+ const aValue = getNestedValue(a, property);
14
+ const bValue = getNestedValue(b, property);
15
+ if (aValue === bValue) continue;
16
+ if (aValue == null) return 1;
17
+ if (bValue == null) return -1;
18
+ const comparison = compareValues(aValue, bValue);
19
+ return reverse ? -comparison : comparison;
20
+ }
21
+ return 0;
22
+ });
23
+ }
24
+ function compareValues(a, b) {
25
+ if (typeof a === "number" && typeof b === "number") return a - b;
26
+ if (typeof a === "string" && typeof b === "string") return a.localeCompare(b);
27
+ const aDate = new Date(a);
28
+ const bDate = new Date(b);
29
+ const aTime = aDate.getTime();
30
+ const bTime = bDate.getTime();
31
+ if (!isNaN(aTime) && !isNaN(bTime)) return aTime - bTime;
32
+ return String(a).localeCompare(String(b));
33
+ }
34
+ export {
35
+ sort
36
+ };
@@ -0,0 +1,16 @@
1
+ function splitArray(array, predicate) {
2
+ const ret = {
3
+ picked: [],
4
+ omitted: []
5
+ };
6
+ array.forEach((item, index, arr) => {
7
+ if (predicate(item, index, arr)) ret.picked.push(item);
8
+ else ret.omitted.push(item);
9
+ });
10
+ ret.p = ret.picked;
11
+ ret.o = ret.omitted;
12
+ return ret;
13
+ }
14
+ export {
15
+ splitArray
16
+ };
@@ -0,0 +1,6 @@
1
+ function uniqueArray(array) {
2
+ return Array.from(new Set(array));
3
+ }
4
+ export {
5
+ uniqueArray
6
+ };
@@ -0,0 +1 @@
1
+ export * from "./route-manager.js";
@@ -0,0 +1,25 @@
1
+ function RouteManager(config) {
2
+ const { protectedRoutes, bypassRoutes } = config;
3
+ return {
4
+ isProtectedRoute(pathname) {
5
+ return isMatch(protectedRoutes, pathname);
6
+ },
7
+ isBypassRoute(pathname) {
8
+ return isMatch(bypassRoutes, pathname);
9
+ }
10
+ };
11
+ }
12
+ function AuthManager(config) {
13
+ return RouteManager(config);
14
+ }
15
+ function isMatch(routeConfig, pathname) {
16
+ const { is, startsWith, includes } = routeConfig;
17
+ const isExactMatch = is && is.some((u) => pathname === u);
18
+ const startsWithMatch = startsWith && startsWith.some((u) => pathname.startsWith(u));
19
+ const includesMatch = includes && includes.some((u) => pathname.includes(u));
20
+ return isExactMatch || startsWithMatch || includesMatch;
21
+ }
22
+ export {
23
+ AuthManager,
24
+ RouteManager
25
+ };
@@ -0,0 +1,34 @@
1
+ function isObject(x) {
2
+ return typeof x === "object" && !Array.isArray(x) && x !== null;
3
+ }
4
+ function isArray(x) {
5
+ return Array.isArray(x);
6
+ }
7
+ function notObject(x) {
8
+ return !isObject(x);
9
+ }
10
+ function getType(x) {
11
+ if (typeof x === "string") return "string";
12
+ if (typeof x === "number") {
13
+ if (Number.isInteger(x)) return "integer";
14
+ return "float";
15
+ }
16
+ if (typeof x === "boolean") return "boolean";
17
+ if (typeof x === "function") return "function";
18
+ if (typeof x === "undefined") return "undefined";
19
+ if (typeof x === "symbol") return "symbol";
20
+ if (typeof x === "bigint") return "bigint";
21
+ if (Array.isArray(x)) return "array";
22
+ if (typeof x === "object") return "object";
23
+ return "unknown";
24
+ }
25
+ function isFunction(x) {
26
+ return typeof x === "function";
27
+ }
28
+ export {
29
+ getType,
30
+ isArray,
31
+ isFunction,
32
+ isObject,
33
+ notObject
34
+ };
@@ -0,0 +1,12 @@
1
+ const DAYS = [
2
+ { short: "Sun", long: "Sunday", numeric: 1 },
3
+ { short: "Mon", long: "Monday", numeric: 2 },
4
+ { short: "Tue", long: "Tuesday", numeric: 3 },
5
+ { short: "Wed", long: "Wednesday", numeric: 4 },
6
+ { short: "Thu", long: "Thursday", numeric: 5 },
7
+ { short: "Fri", long: "Friday", numeric: 6 },
8
+ { short: "Sat", long: "Saturday", numeric: 7 }
9
+ ];
10
+ export {
11
+ DAYS
12
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./days.js";
2
+ export * from "./months.js";
3
+ export * from "./time.js";
@@ -0,0 +1,77 @@
1
+ const MONTHS = [
2
+ {
3
+ long: "January",
4
+ short: "jan",
5
+ numeric: 1,
6
+ lastDay: { default: 31, leapYear: 31 }
7
+ },
8
+ {
9
+ long: "February",
10
+ short: "feb",
11
+ numeric: 2,
12
+ lastDay: { default: 28, leapYear: 29 }
13
+ },
14
+ {
15
+ long: "March",
16
+ short: "mar",
17
+ numeric: 3,
18
+ lastDay: { default: 31, leapYear: 31 }
19
+ },
20
+ {
21
+ long: "April",
22
+ short: "apr",
23
+ numeric: 4,
24
+ lastDay: { default: 30, leapYear: 30 }
25
+ },
26
+ {
27
+ long: "May",
28
+ short: "may",
29
+ numeric: 5,
30
+ lastDay: { default: 31, leapYear: 31 }
31
+ },
32
+ {
33
+ long: "June",
34
+ short: "jun",
35
+ numeric: 6,
36
+ lastDay: { default: 30, leapYear: 30 }
37
+ },
38
+ {
39
+ long: "July",
40
+ short: "jul",
41
+ numeric: 7,
42
+ lastDay: { default: 31, leapYear: 31 }
43
+ },
44
+ {
45
+ long: "August",
46
+ short: "aug",
47
+ numeric: 8,
48
+ lastDay: { default: 31, leapYear: 31 }
49
+ },
50
+ {
51
+ long: "September",
52
+ short: "sep",
53
+ numeric: 9,
54
+ lastDay: { default: 30, leapYear: 30 }
55
+ },
56
+ {
57
+ long: "October",
58
+ short: "oct",
59
+ numeric: 10,
60
+ lastDay: { default: 31, leapYear: 31 }
61
+ },
62
+ {
63
+ long: "November",
64
+ short: "nov",
65
+ numeric: 11,
66
+ lastDay: { default: 30, leapYear: 30 }
67
+ },
68
+ {
69
+ long: "December",
70
+ short: "dec",
71
+ numeric: 12,
72
+ lastDay: { default: 31, leapYear: 31 }
73
+ }
74
+ ];
75
+ export {
76
+ MONTHS
77
+ };
@@ -0,0 +1,75 @@
1
+ import { splitUnit } from "../numbers/index.js";
2
+ function ms(arg) {
3
+ const [value, unit] = splitUnit(arg);
4
+ if (unit === "d") return getTimeInMs(value, "days");
5
+ if (unit === "day") return getTimeInMs(value, "days");
6
+ if (unit === "days") return getTimeInMs(value, "days");
7
+ if (unit === "h") return getTimeInMs(value, "hours");
8
+ if (unit === "hr") return getTimeInMs(value, "hours");
9
+ if (unit === "hour") return getTimeInMs(value, "hours");
10
+ if (unit === "hours") return getTimeInMs(value, "hours");
11
+ if (unit === "m") return getTimeInMs(value, "minutes");
12
+ if (unit === "min") return getTimeInMs(value, "minutes");
13
+ if (unit === "mins") return getTimeInMs(value, "minutes");
14
+ if (unit === "minute") return getTimeInMs(value, "minutes");
15
+ if (unit === "minutes") return getTimeInMs(value, "minutes");
16
+ if (unit === "s") return getTimeInMs(value, "seconds");
17
+ if (unit === "sec") return getTimeInMs(value, "seconds");
18
+ if (unit === "secs") return getTimeInMs(value, "seconds");
19
+ if (unit === "second") return getTimeInMs(value, "seconds");
20
+ if (unit === "seconds") return getTimeInMs(value, "seconds");
21
+ return value;
22
+ }
23
+ function getTimeInMs(value, unit = "ms") {
24
+ switch (unit) {
25
+ case "ms":
26
+ return value;
27
+ case "seconds":
28
+ return value * 1e3;
29
+ case "minutes":
30
+ return value * 1e3 * 60;
31
+ case "hours":
32
+ return value * 1e3 * 60 * 60;
33
+ case "days":
34
+ return value * 1e3 * 60 * 60 * 24;
35
+ case "weeks":
36
+ return value * 1e3 * 60 * 60 * 24 * 7;
37
+ }
38
+ }
39
+ function toWeeks(ms2) {
40
+ return ms2 / 1e3 / 60 / 60 / 24 / 7;
41
+ }
42
+ function toDays(ms2) {
43
+ return ms2 / 1e3 / 60 / 60 / 24;
44
+ }
45
+ function toHours(ms2) {
46
+ return ms2 / 1e3 / 60 / 60;
47
+ }
48
+ function toMinutes(ms2) {
49
+ return ms2 / 1e3 / 60;
50
+ }
51
+ function toSeconds(ms2) {
52
+ return ms2 / 1e3;
53
+ }
54
+ function toReadableTime(ms2) {
55
+ const weekMs = 1e3 * 60 * 60 * 24 * 7;
56
+ const dayMs = 1e3 * 60 * 60 * 24;
57
+ const hourMs = 1e3 * 60 * 60;
58
+ const minuteMs = 1e3 * 60;
59
+ const weeks = Math.floor(ms2 / weekMs);
60
+ const days = Math.floor(ms2 % weekMs / dayMs);
61
+ const hours = Math.floor(ms2 % dayMs / hourMs);
62
+ const minutes = Math.floor(ms2 % hourMs / minuteMs);
63
+ const seconds = Math.floor(ms2 % minuteMs / 1e3);
64
+ return { weeks, days, hours, minutes, seconds };
65
+ }
66
+ export {
67
+ getTimeInMs,
68
+ ms,
69
+ toDays,
70
+ toHours,
71
+ toMinutes,
72
+ toReadableTime,
73
+ toSeconds,
74
+ toWeeks
75
+ };
@@ -0,0 +1,57 @@
1
+ function formDataToObject(formData) {
2
+ const obj = {};
3
+ for (let [key, value] of formData) {
4
+ if (typeof value === "string") value = value.trim();
5
+ if (key.includes("[]")) {
6
+ const arrayKey = key.replace("[]", "");
7
+ if (!obj[arrayKey]) obj[arrayKey] = [];
8
+ obj[arrayKey].push(value);
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ }
13
+ return obj;
14
+ }
15
+ function flattenArrayFields(inputObject) {
16
+ const result = {};
17
+ for (const [key, value] of Object.entries(inputObject)) {
18
+ const match = key.match(/^(\w+)(?:\[(\d+)\])?(?:\[(\w+)\])?$/);
19
+ if (match) {
20
+ const [, baseKey, index, property] = match;
21
+ if (index !== void 0) {
22
+ if (!result[baseKey]) result[baseKey] = [];
23
+ const arrayIndex = parseInt(index);
24
+ if (!result[baseKey][arrayIndex]) result[baseKey][arrayIndex] = {};
25
+ if (property) {
26
+ result[baseKey][arrayIndex][property] = value;
27
+ } else {
28
+ result[baseKey][arrayIndex] = value;
29
+ }
30
+ } else if (property) {
31
+ if (!result[baseKey]) result[baseKey] = {};
32
+ result[baseKey][property] = value;
33
+ } else {
34
+ result[key] = value;
35
+ }
36
+ } else {
37
+ result[key] = value;
38
+ }
39
+ }
40
+ for (const key in result) {
41
+ if (typeof result[key] === "object" && result[key] !== null) {
42
+ if (Object.keys(result[key]).every((k) => !isNaN(parseInt(k)))) {
43
+ result[key] = Object.values(result[key]).filter((item) => {
44
+ if (typeof item === "object") {
45
+ return Object.values(item).some((v) => v !== "");
46
+ }
47
+ return item !== "";
48
+ });
49
+ }
50
+ }
51
+ }
52
+ return result;
53
+ }
54
+ export {
55
+ flattenArrayFields,
56
+ formDataToObject
57
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./form-data.js";
2
+ export * from "./sanitize.js";
@@ -0,0 +1,34 @@
1
+ function sanitize(value, options = {}) {
2
+ const { sanitizer, ...rest } = options;
3
+ if (!sanitizer) throw new Error("sanitizer function is required");
4
+ if (typeof value === "string") return sanitizer(value, rest);
5
+ if (Array.isArray(value)) return sanitizeArray(value, { sanitizer, ...rest });
6
+ if (value && typeof value === "object") {
7
+ return Object.fromEntries(
8
+ Object.entries(value).map(([key, val]) => [
9
+ key,
10
+ sanitize(val, { sanitizer, ...rest })
11
+ ])
12
+ );
13
+ }
14
+ return value;
15
+ }
16
+ function sanitizeArray(arr, { sanitizer, ...rest }) {
17
+ if (!sanitizer) throw new Error("sanitizer function is required");
18
+ return arr.map((item) => sanitize(item, { sanitizer, ...rest }));
19
+ }
20
+ function sanitizeObject(obj, { sanitizer, ...options } = {}) {
21
+ if (!sanitizer) throw new Error("sanitizer function is required");
22
+ if (Array.isArray(obj)) return sanitizeArray(obj, { sanitizer, ...options });
23
+ return Object.fromEntries(
24
+ Object.entries(obj).map(([key, value]) => [
25
+ key,
26
+ sanitize(value, { sanitizer, ...options })
27
+ ])
28
+ );
29
+ }
30
+ export {
31
+ sanitize,
32
+ sanitizeArray,
33
+ sanitizeObject
34
+ };
@@ -0,0 +1,6 @@
1
+ function runCallback(fn, ...data) {
2
+ if (typeof fn === "function") fn(data);
3
+ }
4
+ export {
5
+ runCallback
6
+ };
@@ -0,0 +1,18 @@
1
+ function debounce(callback, wait, immediate = false) {
2
+ let timeout;
3
+ return function() {
4
+ const context = this;
5
+ const args = arguments;
6
+ const callNow = immediate && !timeout;
7
+ clearTimeout(timeout);
8
+ timeout = setTimeout(later, wait);
9
+ if (callNow) callback.apply(context, args);
10
+ function later() {
11
+ timeout = null;
12
+ if (!immediate) callback.apply(context, args);
13
+ }
14
+ };
15
+ }
16
+ export {
17
+ debounce
18
+ };
@@ -0,0 +1,7 @@
1
+ function getEnv() {
2
+ if (typeof window === "object") return "browser";
3
+ if (typeof global === "object") return "node";
4
+ }
5
+ export {
6
+ getEnv
7
+ };
@@ -0,0 +1,52 @@
1
+ function curry(fn) {
2
+ return function curried(...args) {
3
+ if (args.length >= fn.length) {
4
+ return fn.apply(this, args);
5
+ } else {
6
+ return function(...moreArgs) {
7
+ return curried.apply(this, args.concat(moreArgs));
8
+ };
9
+ }
10
+ };
11
+ }
12
+ function compose(...fns) {
13
+ return function(value) {
14
+ return fns.reduceRight((acc, fn) => fn(acc), value);
15
+ };
16
+ }
17
+ function composeAsync(...fns) {
18
+ return async function(value) {
19
+ return fns.reduceRight(async (acc, fn) => {
20
+ const result = await acc;
21
+ return await fn(result);
22
+ }, value);
23
+ };
24
+ }
25
+ function pipe(...fns) {
26
+ return function(value) {
27
+ return fns.reduce((acc, fn) => fn(acc), value);
28
+ };
29
+ }
30
+ function pipeAsync(...fns) {
31
+ return async function(value) {
32
+ return fns.reduce(async (acc, fn) => {
33
+ const result = await acc;
34
+ return await fn(result);
35
+ }, value);
36
+ };
37
+ }
38
+ function times(fn, n) {
39
+ const result = [];
40
+ for (let i = 0; i < n; i++) {
41
+ result.push(fn(i));
42
+ }
43
+ return result;
44
+ }
45
+ export {
46
+ compose,
47
+ composeAsync,
48
+ curry,
49
+ pipe,
50
+ pipeAsync,
51
+ times
52
+ };
@@ -0,0 +1,5 @@
1
+ export * from "./debounce.js";
2
+ export * from "./env.js";
3
+ export * from "./functional.js";
4
+ export * from "./throttle.js";
5
+ export * from "./timeout.js";
@@ -0,0 +1,13 @@
1
+ function throttle(callback, wait) {
2
+ let lastCall = 0;
3
+ return function(...args) {
4
+ const now = (/* @__PURE__ */ new Date()).getTime();
5
+ if (now - lastCall >= wait) {
6
+ callback(...args);
7
+ lastCall = now;
8
+ }
9
+ };
10
+ }
11
+ export {
12
+ throttle
13
+ };
@@ -0,0 +1,14 @@
1
+ function timeout(wait2, callback) {
2
+ setTimeout(callback, wait2);
3
+ }
4
+ function delay(ms) {
5
+ return new Promise((resolve) => setTimeout(resolve, ms));
6
+ }
7
+ function wait(ms) {
8
+ return delay(ms);
9
+ }
10
+ export {
11
+ delay,
12
+ timeout,
13
+ wait
14
+ };
@@ -0,0 +1,18 @@
1
+ function isHashedValue(value, type = "sha256") {
2
+ if (typeof value !== "string") return null;
3
+ value = value.trim();
4
+ type = type.toLowerCase();
5
+ if (type === "sha256") {
6
+ return value.length === 64 && /^[a-fA-F0-9]{64}$/.test(value);
7
+ }
8
+ if (type === "sha1") {
9
+ return value.length === 40 && /^[a-fA-F0-9]{40}$/.test(value);
10
+ }
11
+ if (type === "md5") {
12
+ return value.length === 32 && /^[a-fA-F0-9]{32}$/.test(value);
13
+ }
14
+ return null;
15
+ }
16
+ export {
17
+ isHashedValue
18
+ };
@@ -0,0 +1,14 @@
1
+ export * from "./arrays/index.js";
2
+ export * from "./auth/index.js";
3
+ export * from "./checks.js";
4
+ export * from "./date/index.js";
5
+ export * from "./form/index.js";
6
+ export * from "./functions/index.js";
7
+ export * from "./hash.js";
8
+ export * from "./numbers/index.js";
9
+ export * from "./objects/index.js";
10
+ export * from "./promises/index.js";
11
+ export * from "./sse.js";
12
+ export * from "./strings/index.js";
13
+ export * from "./style/index.js";
14
+ export * from "./symbols/index.js";
@@ -0,0 +1,11 @@
1
+ export * from "./math.js";
2
+ function splitUnit(string) {
3
+ if (typeof string === "number") return [string, null];
4
+ const regex = /(-?\d*\.?\d+)\s*([a-z]+)/i;
5
+ const match = string.match(regex);
6
+ if (match) return [parseFloat(match[1]), match[2]];
7
+ return [parseFloat(string), null];
8
+ }
9
+ export {
10
+ splitUnit
11
+ };