@splendidlabz/utils 1.11.2 → 1.11.3

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 (305) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +2 -2
  3. package/src/lib/objects/omit-empty.js +1 -1
  4. package/src/lib/strings/markdown.spec.js +73 -0
  5. package/src/node/context.js +0 -0
  6. package/src/node/file-cache.js +1 -1
  7. package/src/node/pkce.js +1 -1
  8. package/tsup.config.mjs +19 -1
  9. package/dist/cjs/dom/accessibility.cjs +0 -51
  10. package/dist/cjs/dom/actions/index.cjs +0 -25
  11. package/dist/cjs/dom/actions/masonry.cjs +0 -61
  12. package/dist/cjs/dom/actions/prefer-horizontal-scroll.cjs +0 -113
  13. package/dist/cjs/dom/actions/sticky.cjs +0 -93
  14. package/dist/cjs/dom/bounding-box.cjs +0 -68
  15. package/dist/cjs/dom/clipboard.cjs +0 -35
  16. package/dist/cjs/dom/cookie.cjs +0 -55
  17. package/dist/cjs/dom/css-vars.cjs +0 -47
  18. package/dist/cjs/dom/events.cjs +0 -57
  19. package/dist/cjs/dom/focusable.cjs +0 -141
  20. package/dist/cjs/dom/font-size.cjs +0 -68
  21. package/dist/cjs/dom/get-element.cjs +0 -96
  22. package/dist/cjs/dom/hash.cjs +0 -33
  23. package/dist/cjs/dom/index.cjs +0 -65
  24. package/dist/cjs/dom/keyboard.cjs +0 -49
  25. package/dist/cjs/dom/local-store.cjs +0 -77
  26. package/dist/cjs/dom/media.cjs +0 -57
  27. package/dist/cjs/dom/observers/index.cjs +0 -27
  28. package/dist/cjs/dom/observers/intersection-observer.cjs +0 -59
  29. package/dist/cjs/dom/observers/mutation-observer.cjs +0 -63
  30. package/dist/cjs/dom/observers/observer.cjs +0 -38
  31. package/dist/cjs/dom/observers/resize-observer.cjs +0 -52
  32. package/dist/cjs/dom/observers/scroll-observer.cjs +0 -118
  33. package/dist/cjs/dom/pkce.cjs +0 -43
  34. package/dist/cjs/dom/query-params.cjs +0 -36
  35. package/dist/cjs/dom/random-string.cjs +0 -36
  36. package/dist/cjs/dom/sanitize.cjs +0 -41
  37. package/dist/cjs/dom/session-store.cjs +0 -47
  38. package/dist/cjs/dom/spam-prevention.cjs +0 -48
  39. package/dist/cjs/dom/trap-focus.cjs +0 -75
  40. package/dist/cjs/dom/ui/aria-current.cjs +0 -41
  41. package/dist/cjs/dom/ui/inconsistent-button-fix.cjs +0 -33
  42. package/dist/cjs/dom/ui/index.cjs +0 -27
  43. package/dist/cjs/dom/ui/scroll-container.cjs +0 -45
  44. package/dist/cjs/dom/ui/traverse-and-scramble.cjs +0 -48
  45. package/dist/cjs/lib/arrays/index.cjs +0 -31
  46. package/dist/cjs/lib/arrays/item-position.cjs +0 -40
  47. package/dist/cjs/lib/arrays/join.cjs +0 -35
  48. package/dist/cjs/lib/arrays/shuffle.cjs +0 -40
  49. package/dist/cjs/lib/arrays/sort.cjs +0 -59
  50. package/dist/cjs/lib/arrays/split-array.cjs +0 -39
  51. package/dist/cjs/lib/arrays/unique.cjs +0 -29
  52. package/dist/cjs/lib/auth/index.cjs +0 -21
  53. package/dist/cjs/lib/auth/route-manager.cjs +0 -49
  54. package/dist/cjs/lib/checks.cjs +0 -61
  55. package/dist/cjs/lib/date/days.cjs +0 -35
  56. package/dist/cjs/lib/date/index.cjs +0 -25
  57. package/dist/cjs/lib/date/months.cjs +0 -100
  58. package/dist/cjs/lib/date/time.cjs +0 -105
  59. package/dist/cjs/lib/form/form-data.cjs +0 -81
  60. package/dist/cjs/lib/form/index.cjs +0 -23
  61. package/dist/cjs/lib/form/sanitize.cjs +0 -59
  62. package/dist/cjs/lib/functions/callback.cjs +0 -29
  63. package/dist/cjs/lib/functions/debounce.cjs +0 -41
  64. package/dist/cjs/lib/functions/env.cjs +0 -30
  65. package/dist/cjs/lib/functions/functional.cjs +0 -80
  66. package/dist/cjs/lib/functions/index.cjs +0 -29
  67. package/dist/cjs/lib/functions/throttle.cjs +0 -36
  68. package/dist/cjs/lib/functions/timeout.cjs +0 -39
  69. package/dist/cjs/lib/hash.cjs +0 -41
  70. package/dist/cjs/lib/index.cjs +0 -47
  71. package/dist/cjs/lib/numbers/index.cjs +0 -36
  72. package/dist/cjs/lib/numbers/math.cjs +0 -34
  73. package/dist/cjs/lib/objects/camelcase-keys.cjs +0 -39
  74. package/dist/cjs/lib/objects/empty.cjs +0 -37
  75. package/dist/cjs/lib/objects/equal.cjs +0 -45
  76. package/dist/cjs/lib/objects/extend.cjs +0 -36
  77. package/dist/cjs/lib/objects/flatten.cjs +0 -40
  78. package/dist/cjs/lib/objects/index.cjs +0 -45
  79. package/dist/cjs/lib/objects/json.cjs +0 -33
  80. package/dist/cjs/lib/objects/loop.cjs +0 -38
  81. package/dist/cjs/lib/objects/mix/mix.cjs +0 -113
  82. package/dist/cjs/lib/objects/nested-property.cjs +0 -43
  83. package/dist/cjs/lib/objects/normalize-object.cjs +0 -32
  84. package/dist/cjs/lib/objects/omit-empty.cjs +0 -38
  85. package/dist/cjs/lib/objects/size.cjs +0 -61
  86. package/dist/cjs/lib/objects/split.cjs +0 -37
  87. package/dist/cjs/lib/promises/index.cjs +0 -21
  88. package/dist/cjs/lib/promises/reject.cjs +0 -50
  89. package/dist/cjs/lib/sse.cjs +0 -74
  90. package/dist/cjs/lib/strings/convert-case/convert-case.cjs +0 -94
  91. package/dist/cjs/lib/strings/index.cjs +0 -29
  92. package/dist/cjs/lib/strings/markdown.cjs +0 -74
  93. package/dist/cjs/lib/strings/name.cjs +0 -44
  94. package/dist/cjs/lib/strings/pluralize.cjs +0 -38
  95. package/dist/cjs/lib/strings/query-string.cjs +0 -41
  96. package/dist/cjs/lib/style/index.cjs +0 -35
  97. package/dist/cjs/lib/symbols/index.cjs +0 -21
  98. package/dist/cjs/lib/symbols/symbols.cjs +0 -36
  99. package/dist/cjs/node/dirname.cjs +0 -47
  100. package/dist/cjs/node/file-cache.cjs +0 -158
  101. package/dist/cjs/node/file.cjs +0 -48
  102. package/dist/cjs/node/hash.cjs +0 -40
  103. package/dist/cjs/node/index.cjs +0 -33
  104. package/dist/cjs/node/pkce.cjs +0 -52
  105. package/dist/cjs/node/random-string.cjs +0 -41
  106. package/dist/cjs/node/sanitize.cjs +0 -41
  107. package/dist/cjs/node/uuid.cjs +0 -40
  108. package/dist/esm/dom/accessibility.js +0 -26
  109. package/dist/esm/dom/actions/index.js +0 -3
  110. package/dist/esm/dom/actions/masonry.js +0 -38
  111. package/dist/esm/dom/actions/prefer-horizontal-scroll.js +0 -90
  112. package/dist/esm/dom/actions/sticky.js +0 -70
  113. package/dist/esm/dom/bounding-box.js +0 -44
  114. package/dist/esm/dom/clipboard.js +0 -12
  115. package/dist/esm/dom/cookie.js +0 -31
  116. package/dist/esm/dom/css-vars.js +0 -21
  117. package/dist/esm/dom/events.js +0 -31
  118. package/dist/esm/dom/focusable.js +0 -117
  119. package/dist/esm/dom/font-size.js +0 -40
  120. package/dist/esm/dom/get-element.js +0 -66
  121. package/dist/esm/dom/hash.js +0 -10
  122. package/dist/esm/dom/index.js +0 -23
  123. package/dist/esm/dom/keyboard.js +0 -22
  124. package/dist/esm/dom/local-store.js +0 -54
  125. package/dist/esm/dom/media.js +0 -32
  126. package/dist/esm/dom/observers/index.js +0 -4
  127. package/dist/esm/dom/observers/intersection-observer.js +0 -36
  128. package/dist/esm/dom/observers/mutation-observer.js +0 -40
  129. package/dist/esm/dom/observers/observer.js +0 -15
  130. package/dist/esm/dom/observers/resize-observer.js +0 -29
  131. package/dist/esm/dom/observers/scroll-observer.js +0 -95
  132. package/dist/esm/dom/pkce.js +0 -20
  133. package/dist/esm/dom/query-params.js +0 -13
  134. package/dist/esm/dom/random-string.js +0 -12
  135. package/dist/esm/dom/sanitize.js +0 -8
  136. package/dist/esm/dom/session-store.js +0 -24
  137. package/dist/esm/dom/spam-prevention.js +0 -25
  138. package/dist/esm/dom/trap-focus.js +0 -51
  139. package/dist/esm/dom/ui/aria-current.js +0 -17
  140. package/dist/esm/dom/ui/inconsistent-button-fix.js +0 -10
  141. package/dist/esm/dom/ui/index.js +0 -4
  142. package/dist/esm/dom/ui/scroll-container.js +0 -22
  143. package/dist/esm/dom/ui/traverse-and-scramble.js +0 -25
  144. package/dist/esm/lib/arrays/index.js +0 -6
  145. package/dist/esm/lib/arrays/item-position.js +0 -15
  146. package/dist/esm/lib/arrays/join.js +0 -12
  147. package/dist/esm/lib/arrays/shuffle.js +0 -17
  148. package/dist/esm/lib/arrays/sort.js +0 -36
  149. package/dist/esm/lib/arrays/split-array.js +0 -16
  150. package/dist/esm/lib/arrays/unique.js +0 -6
  151. package/dist/esm/lib/auth/index.js +0 -1
  152. package/dist/esm/lib/auth/route-manager.js +0 -25
  153. package/dist/esm/lib/checks.js +0 -34
  154. package/dist/esm/lib/date/days.js +0 -12
  155. package/dist/esm/lib/date/index.js +0 -3
  156. package/dist/esm/lib/date/months.js +0 -77
  157. package/dist/esm/lib/date/time.js +0 -75
  158. package/dist/esm/lib/form/form-data.js +0 -57
  159. package/dist/esm/lib/form/index.js +0 -2
  160. package/dist/esm/lib/form/sanitize.js +0 -34
  161. package/dist/esm/lib/functions/callback.js +0 -6
  162. package/dist/esm/lib/functions/debounce.js +0 -18
  163. package/dist/esm/lib/functions/env.js +0 -7
  164. package/dist/esm/lib/functions/functional.js +0 -52
  165. package/dist/esm/lib/functions/index.js +0 -5
  166. package/dist/esm/lib/functions/throttle.js +0 -13
  167. package/dist/esm/lib/functions/timeout.js +0 -14
  168. package/dist/esm/lib/hash.js +0 -18
  169. package/dist/esm/lib/index.js +0 -14
  170. package/dist/esm/lib/numbers/index.js +0 -11
  171. package/dist/esm/lib/numbers/math.js +0 -10
  172. package/dist/esm/lib/objects/camelcase-keys.js +0 -16
  173. package/dist/esm/lib/objects/empty.js +0 -13
  174. package/dist/esm/lib/objects/equal.js +0 -11
  175. package/dist/esm/lib/objects/extend.js +0 -13
  176. package/dist/esm/lib/objects/flatten.js +0 -17
  177. package/dist/esm/lib/objects/index.js +0 -13
  178. package/dist/esm/lib/objects/json.js +0 -10
  179. package/dist/esm/lib/objects/loop.js +0 -14
  180. package/dist/esm/lib/objects/mix/mix.js +0 -88
  181. package/dist/esm/lib/objects/nested-property.js +0 -18
  182. package/dist/esm/lib/objects/normalize-object.js +0 -9
  183. package/dist/esm/lib/objects/omit-empty.js +0 -15
  184. package/dist/esm/lib/objects/size.js +0 -38
  185. package/dist/esm/lib/objects/split.js +0 -14
  186. package/dist/esm/lib/promises/index.js +0 -1
  187. package/dist/esm/lib/promises/reject.js +0 -17
  188. package/dist/esm/lib/sse.js +0 -50
  189. package/dist/esm/lib/strings/convert-case/convert-case.js +0 -64
  190. package/dist/esm/lib/strings/index.js +0 -5
  191. package/dist/esm/lib/strings/markdown.js +0 -40
  192. package/dist/esm/lib/strings/name.js +0 -21
  193. package/dist/esm/lib/strings/pluralize.js +0 -5
  194. package/dist/esm/lib/strings/query-string.js +0 -16
  195. package/dist/esm/lib/style/index.js +0 -12
  196. package/dist/esm/lib/symbols/index.js +0 -1
  197. package/dist/esm/lib/symbols/symbols.js +0 -12
  198. package/dist/esm/node/dirname.js +0 -13
  199. package/dist/esm/node/file-cache.js +0 -121
  200. package/dist/esm/node/file.js +0 -14
  201. package/dist/esm/node/hash.js +0 -7
  202. package/dist/esm/node/index.js +0 -7
  203. package/dist/esm/node/pkce.js +0 -19
  204. package/dist/esm/node/random-string.js +0 -8
  205. package/dist/esm/node/sanitize.js +0 -8
  206. package/dist/esm/node/uuid.js +0 -7
  207. package/dist/types/dom/accessibility.d.cts +0 -30
  208. package/dist/types/dom/actions/index.d.cts +0 -3
  209. package/dist/types/dom/actions/masonry.d.cts +0 -5
  210. package/dist/types/dom/actions/prefer-horizontal-scroll.d.cts +0 -5
  211. package/dist/types/dom/actions/sticky.d.cts +0 -5
  212. package/dist/types/dom/bounding-box.d.cts +0 -41
  213. package/dist/types/dom/clipboard.d.cts +0 -7
  214. package/dist/types/dom/cookie.d.cts +0 -7
  215. package/dist/types/dom/css-vars.d.cts +0 -6
  216. package/dist/types/dom/events.d.cts +0 -92
  217. package/dist/types/dom/focusable.d.cts +0 -78
  218. package/dist/types/dom/font-size.d.cts +0 -8
  219. package/dist/types/dom/get-element.d.cts +0 -102
  220. package/dist/types/dom/hash.d.cts +0 -3
  221. package/dist/types/dom/index.d.cts +0 -31
  222. package/dist/types/dom/keyboard.d.cts +0 -32
  223. package/dist/types/dom/local-store.d.cts +0 -31
  224. package/dist/types/dom/media.d.cts +0 -5
  225. package/dist/types/dom/observers/index.d.cts +0 -4
  226. package/dist/types/dom/observers/intersection-observer.d.cts +0 -10
  227. package/dist/types/dom/observers/mutation-observer.d.cts +0 -9
  228. package/dist/types/dom/observers/observer.d.cts +0 -3
  229. package/dist/types/dom/observers/resize-observer.d.cts +0 -40
  230. package/dist/types/dom/observers/scroll-observer.d.cts +0 -40
  231. package/dist/types/dom/pkce.d.cts +0 -8
  232. package/dist/types/dom/query-params.d.cts +0 -6
  233. package/dist/types/dom/random-string.d.cts +0 -9
  234. package/dist/types/dom/sanitize.d.cts +0 -10
  235. package/dist/types/dom/session-store.d.cts +0 -7
  236. package/dist/types/dom/spam-prevention.d.cts +0 -14
  237. package/dist/types/dom/trap-focus.d.cts +0 -32
  238. package/dist/types/dom/ui/aria-current.d.cts +0 -7
  239. package/dist/types/dom/ui/inconsistent-button-fix.d.cts +0 -14
  240. package/dist/types/dom/ui/index.d.cts +0 -4
  241. package/dist/types/dom/ui/scroll-container.d.cts +0 -3
  242. package/dist/types/dom/ui/traverse-and-scramble.d.cts +0 -21
  243. package/dist/types/lib/arrays/index.d.cts +0 -6
  244. package/dist/types/lib/arrays/item-position.d.cts +0 -16
  245. package/dist/types/lib/arrays/join.d.cts +0 -15
  246. package/dist/types/lib/arrays/shuffle.d.cts +0 -3
  247. package/dist/types/lib/arrays/sort.d.cts +0 -32
  248. package/dist/types/lib/arrays/split-array.d.cts +0 -6
  249. package/dist/types/lib/arrays/unique.d.cts +0 -3
  250. package/dist/types/lib/auth/index.d.cts +0 -1
  251. package/dist/types/lib/auth/route-manager.d.cts +0 -28
  252. package/dist/types/lib/checks.d.cts +0 -33
  253. package/dist/types/lib/date/days.d.cts +0 -7
  254. package/dist/types/lib/date/index.d.cts +0 -3
  255. package/dist/types/lib/date/months.d.cts +0 -11
  256. package/dist/types/lib/date/time.d.cts +0 -21
  257. package/dist/types/lib/form/form-data.d.cts +0 -9
  258. package/dist/types/lib/form/index.d.cts +0 -2
  259. package/dist/types/lib/form/sanitize.d.cts +0 -60
  260. package/dist/types/lib/functions/callback.d.cts +0 -8
  261. package/dist/types/lib/functions/debounce.d.cts +0 -3
  262. package/dist/types/lib/functions/env.d.cts +0 -3
  263. package/dist/types/lib/functions/functional.d.cts +0 -72
  264. package/dist/types/lib/functions/index.d.cts +0 -5
  265. package/dist/types/lib/functions/throttle.d.cts +0 -3
  266. package/dist/types/lib/functions/timeout.d.cts +0 -5
  267. package/dist/types/lib/hash.d.cts +0 -3
  268. package/dist/types/lib/index.d.cts +0 -43
  269. package/dist/types/lib/numbers/index.d.cts +0 -5
  270. package/dist/types/lib/numbers/math.d.cts +0 -4
  271. package/dist/types/lib/objects/camelcase-keys.d.cts +0 -3
  272. package/dist/types/lib/objects/empty.d.cts +0 -4
  273. package/dist/types/lib/objects/equal.d.cts +0 -4
  274. package/dist/types/lib/objects/extend.d.cts +0 -6
  275. package/dist/types/lib/objects/flatten.d.cts +0 -6
  276. package/dist/types/lib/objects/index.d.cts +0 -13
  277. package/dist/types/lib/objects/json.d.cts +0 -3
  278. package/dist/types/lib/objects/loop.d.cts +0 -4
  279. package/dist/types/lib/objects/mix/mix.d.cts +0 -44
  280. package/dist/types/lib/objects/nested-property.d.cts +0 -24
  281. package/dist/types/lib/objects/normalize-object.d.cts +0 -3
  282. package/dist/types/lib/objects/omit-empty.d.cts +0 -3
  283. package/dist/types/lib/objects/size.d.cts +0 -3
  284. package/dist/types/lib/objects/split.d.cts +0 -14
  285. package/dist/types/lib/promises/index.d.cts +0 -1
  286. package/dist/types/lib/promises/reject.d.cts +0 -5
  287. package/dist/types/lib/sse.d.cts +0 -18
  288. package/dist/types/lib/strings/convert-case/convert-case.d.cts +0 -10
  289. package/dist/types/lib/strings/index.d.cts +0 -5
  290. package/dist/types/lib/strings/markdown.d.cts +0 -25
  291. package/dist/types/lib/strings/name.d.cts +0 -7
  292. package/dist/types/lib/strings/pluralize.d.cts +0 -3
  293. package/dist/types/lib/strings/query-string.d.cts +0 -10
  294. package/dist/types/lib/style/index.d.cts +0 -3
  295. package/dist/types/lib/symbols/index.d.cts +0 -1
  296. package/dist/types/lib/symbols/symbols.d.cts +0 -4
  297. package/dist/types/node/dirname.d.cts +0 -9
  298. package/dist/types/node/file-cache.d.cts +0 -56
  299. package/dist/types/node/file.d.cts +0 -4
  300. package/dist/types/node/hash.d.cts +0 -3
  301. package/dist/types/node/index.d.cts +0 -7
  302. package/dist/types/node/pkce.d.cts +0 -8
  303. package/dist/types/node/random-string.d.cts +0 -3
  304. package/dist/types/node/sanitize.d.cts +0 -10
  305. package/dist/types/node/uuid.d.cts +0 -3
@@ -1,6 +0,0 @@
1
- declare namespace queryParams {
2
- function get(key: any): string;
3
- function stringify(params: any): string;
4
- }
5
-
6
- export { queryParams };
@@ -1,9 +0,0 @@
1
- /**
2
- * Generates a random string.
3
- * Ensures first character is a letter so it can be used in HTML ids and classes
4
- * This can actually be used everywhere, not just in the browser.
5
- */
6
- declare function randomString(length?: number): string;
7
- declare function uuid(): `${string}-${string}-${string}-${string}-${string}`;
8
-
9
- export { randomString, uuid };
@@ -1,10 +0,0 @@
1
- /**
2
- * Sanitizes values using DOMPurify
3
- * @param {*} value - Value to sanitize (string, array, or object)
4
- * @param {Object} [options={}] - DOMPurify options
5
- * @returns {*} Sanitized value
6
- * @throws {Error} If input is a string but DOMPurify fails
7
- */
8
- declare function sanitize(value: any, options?: any): any;
9
-
10
- export { sanitize };
@@ -1,7 +0,0 @@
1
- declare namespace sessionStore {
2
- function get(key: any): any;
3
- function set(key: any, value: any): void;
4
- function remove(key: any): void;
5
- }
6
-
7
- export { sessionStore };
@@ -1,14 +0,0 @@
1
- /**
2
- * Enhances a form element with spam detection capabilities
3
- * @param {HTMLFormElement} form - The form element to enhance
4
- * @param {Object} [options] - Configuration options
5
- * @param {string} [options.honeypotField] - Name of the honeypot field (default: 'hp')
6
- * @param {number} [options.honeypotDuration] - Minimum time in ms for legitimate form fill (default: 2000)
7
- * @returns {void}
8
- */
9
- declare function preventSpam(form: HTMLFormElement, { honeypotField, honeypotDuration }?: {
10
- honeypotField?: string;
11
- honeypotDuration?: number;
12
- }): void;
13
-
14
- export { preventSpam };
@@ -1,32 +0,0 @@
1
- import { Focusables } from './focusable.cjs';
2
-
3
- /**
4
- * Traps focus within a set of focusable elements, creating a circular tab order
5
- * @param {Object} params
6
- * @param {KeyboardEvent} params.event - The keyboard event to handle
7
- * @param {import('./focusable.js').Focusables} params.focusables - Object containing focusable elements
8
- */
9
- declare function trapFocus({ event, focusables }: {
10
- event: KeyboardEvent;
11
- focusables: Focusables;
12
- }): void;
13
- /**
14
- * Manages focus behavior when tabbing through content, with options to control focus on exit
15
- * @param {Object} params
16
- * @param {KeyboardEvent} params.event - The keyboard event to handle
17
- * @param {HTMLElement} params.triggerNode - Element that triggered the focus trap
18
- * @param {HTMLElement} params.contentNode - Container element that holds focusable content
19
- * @param {import('./focusable.js').Focusables} params.focusables - Object containing focusable elements
20
- * @param {'next'|'trigger'} [params.tabOutFocus='next'] - Where to focus when tabbing out: 'next' element or back to trigger
21
- * @param {Function} [params.onLeave=()=>{}] - Callback when focus leaves content, receives 'forward' or 'back' direction
22
- */
23
- declare function manageFocus({ event, triggerNode, contentNode, focusables, tabOutFocus, onLeave, }: {
24
- event: KeyboardEvent;
25
- triggerNode: HTMLElement;
26
- contentNode: HTMLElement;
27
- focusables: Focusables;
28
- tabOutFocus?: "next" | "trigger";
29
- onLeave?: Function;
30
- }): void;
31
-
32
- export { manageFocus, trapFocus };
@@ -1,7 +0,0 @@
1
- declare function markActiveAnchorIn(container: any, anchorType?: string): any;
2
- declare function scrollToElement(element: any, { scrollBehaviour, scrollMargin }?: {
3
- scrollBehaviour?: string;
4
- scrollMargin?: string;
5
- }): void;
6
-
7
- export { markActiveAnchorIn, scrollToElement };
@@ -1,14 +0,0 @@
1
- /**
2
- * Fixes inconsistent button focus behavior across browsers.
3
- *
4
- * In some browsers (like Firefox), clicking a button doesn't focus it.
5
- * This function ensures buttons are focused when clicked, making behavior consistent.
6
- *
7
- * @see {@link https://zellwk.com/blog/inconsistent-button-behavior/|Source}
8
- * @example
9
- * // Add the fix to your app
10
- * inconsistentButtonFix()
11
- */
12
- declare function inconsistentButtonFix(): void;
13
-
14
- export { inconsistentButtonFix };
@@ -1,4 +0,0 @@
1
- export { markActiveAnchorIn, scrollToElement } from './aria-current.cjs';
2
- export { inconsistentButtonFix } from './inconsistent-button-fix.cjs';
3
- export { findScrollContainer } from './scroll-container.cjs';
4
- export { traverseAndScramble } from './traverse-and-scramble.cjs';
@@ -1,3 +0,0 @@
1
- declare function findScrollContainer(element: any, direction?: string): any;
2
-
3
- export { findScrollContainer };
@@ -1,21 +0,0 @@
1
- /**
2
- * Traverses a DOM node and scrambles its text content, excluding specified elements.
3
- * Useful for creating placeholder/loading states or privacy features.
4
- *
5
- * @param {Element|ChildNode} node - The root element or node to start traversal from
6
- * @param {Object} [options] - Options for traversal
7
- * @param {string[]} [options.excludes=[]] - Array of CSS selectors to exclude from scrambling
8
- * @example
9
- * // Scramble all text in a container
10
- * traverseAndScramble(document.querySelector('.container'))
11
- *
12
- * // Scramble text but exclude certain elements
13
- * traverseAndScramble(document.body, {
14
- * excludes: ['.no-scramble', '[data-no-scramble]']
15
- * })
16
- */
17
- declare function traverseAndScramble(node: Element | ChildNode, { excludes }?: {
18
- excludes?: string[];
19
- }): void;
20
-
21
- export { traverseAndScramble };
@@ -1,6 +0,0 @@
1
- export { isLastItem, last, lastArrayItem } from './item-position.cjs';
2
- export { joinWithConjunction } from './join.cjs';
3
- export { shuffle } from './shuffle.cjs';
4
- export { sort } from './sort.cjs';
5
- export { splitArray } from './split-array.cjs';
6
- export { uniqueArray } from './unique.cjs';
@@ -1,16 +0,0 @@
1
- declare function last(array: any, index: any): boolean;
2
- /**
3
- * Checks if the given index is the last item in the array
4
- * @param {Array} array - The array to check
5
- * @param {number} index - The index to check
6
- * @returns {boolean} True if the index is the last item, false otherwise
7
- */
8
- declare function isLastItem(array: any[], index: number): boolean;
9
- /**
10
- * Returns the last item in the array
11
- * @param {Array} array - The array to get the last item from
12
- * @returns {*} The last item in the array
13
- */
14
- declare function lastArrayItem(array: any[]): any;
15
-
16
- export { isLastItem, last, lastArrayItem };
@@ -1,15 +0,0 @@
1
- /**
2
- * Joins an array with a conjunction (and/or)
3
- * @param {Array<string>} array - Array of strings to join
4
- * @param {Object} [options] - Options for joining
5
- * @param {string} [options.conjunction='and'] - Conjunction to use ('and' or 'or')
6
- * @returns {string} Joined string
7
- * @example
8
- * joinWithConjunction(['a', 'b', 'c']) // 'a, b, and c'
9
- * joinWithConjunction(['a', 'b'], { conjunction: 'or' }) // 'a or b'
10
- */
11
- declare function joinWithConjunction(array: Array<string>, { conjunction }?: {
12
- conjunction?: string;
13
- }): string;
14
-
15
- export { joinWithConjunction };
@@ -1,3 +0,0 @@
1
- declare function shuffle(array: any): any;
2
-
3
- export { shuffle };
@@ -1,32 +0,0 @@
1
- /**
2
- * Sorts an array of objects, numbers, or strings without mutating the original array.
3
- * Supports nested properties, multiple sort keys, and various data types.
4
- *
5
- * @template T
6
- * @param {T[]} array - Array to sort
7
- * @param {Object} [options] - Sort options
8
- * @param {string|string[]|null} [options.props=null] - Property or array of properties to sort by. If null, sorts simple arrays
9
- * @param {boolean} [options.reverse=false] - Whether to sort in reverse order
10
- * @returns {T[]} New sorted array
11
- * @example
12
- * // Sort simple array
13
- * sort([3, 1, 2]) // [1, 2, 3]
14
- *
15
- * // Sort objects by single property
16
- * sort(users, { props: 'name' })
17
- *
18
- * // Sort objects by multiple properties
19
- * sort(users, { props: ['age', 'name'] })
20
- *
21
- * // Sort in reverse order
22
- * sort(users, { props: 'age', reverse: true })
23
- *
24
- * // Sort by nested property
25
- * sort(users, { props: 'address.city' })
26
- */
27
- declare function sort<T>(array: T[], { props, reverse }?: {
28
- props?: string | string[] | null;
29
- reverse?: boolean;
30
- }): T[];
31
-
32
- export { sort };
@@ -1,6 +0,0 @@
1
- declare function splitArray(array: any, predicate: any): {
2
- picked: any[];
3
- omitted: any[];
4
- };
5
-
6
- export { splitArray };
@@ -1,3 +0,0 @@
1
- declare function uniqueArray(array: any): any[];
2
-
3
- export { uniqueArray };
@@ -1 +0,0 @@
1
- export { AuthManager, RouteManager } from './route-manager.cjs';
@@ -1,28 +0,0 @@
1
- /**
2
- // Usage ... Probably should use either protected or bypass, not both.
3
- // Maybe ... glob would be a better for this
4
- @example
5
- const config = {
6
- routeConfig: {
7
- startsWith: ['/dashboard']
8
- }
9
- bypassRoutes: {
10
- is: ['/'],
11
- startsWith: ['/fonts', '/auth', '/favicon', '/images'],
12
- includes: ['/meh'],
13
- }
14
- }
15
- const {isProtectedRoute, isBypassRoute} = AuthManager(config)
16
- if (!isProtectedRoute(context.url.pathname)) return next() // Handle only protected routes
17
- if (isBypassRoute(context.url.pathname)) return next() // Bypass all non protected routes
18
- */
19
- declare function RouteManager(config: any): {
20
- isProtectedRoute(pathname: any): any;
21
- isBypassRoute(pathname: any): any;
22
- };
23
- declare function AuthManager(config: any): {
24
- isProtectedRoute(pathname: any): any;
25
- isBypassRoute(pathname: any): any;
26
- };
27
-
28
- export { AuthManager, RouteManager };
@@ -1,33 +0,0 @@
1
- /**
2
- * Checks if a value is a plain object (not an array or null)
3
- * @param {unknown} x - The value to check
4
- * @returns {boolean} True if the value is a plain object
5
- * @example
6
- * isObject({}) // true
7
- * isObject([]) // false
8
- * isObject(null) // false
9
- */
10
- declare function isObject(x: unknown): boolean;
11
- /**
12
- * Checks if a value is an array
13
- * @param {unknown} x - The value to check
14
- * @returns {boolean} True if the value is an array
15
- * @example
16
- * isArray([]) // true
17
- * isArray({}) // false
18
- */
19
- declare function isArray(x: unknown): boolean;
20
- /**
21
- * Checks if a value is not a plain object
22
- * @param {unknown} x - The value to check
23
- * @returns {boolean} True if the value is not a plain object
24
- * @example
25
- * notObject([]) // true
26
- * notObject(null) // true
27
- * notObject({}) // false
28
- */
29
- declare function notObject(x: unknown): boolean;
30
- declare function getType(x: any): "string" | "integer" | "float" | "boolean" | "function" | "undefined" | "symbol" | "bigint" | "array" | "object" | "unknown";
31
- declare function isFunction(x: any): boolean;
32
-
33
- export { getType, isArray, isFunction, isObject, notObject };
@@ -1,7 +0,0 @@
1
- declare const DAYS: {
2
- short: string;
3
- long: string;
4
- numeric: number;
5
- }[];
6
-
7
- export { DAYS };
@@ -1,3 +0,0 @@
1
- export { DAYS } from './days.cjs';
2
- export { MONTHS } from './months.cjs';
3
- export { getTimeInMs, ms, toDays, toHours, toMinutes, toReadableTime, toSeconds, toWeeks } from './time.cjs';
@@ -1,11 +0,0 @@
1
- declare const MONTHS: {
2
- long: string;
3
- short: string;
4
- numeric: number;
5
- lastDay: {
6
- default: number;
7
- leapYear: number;
8
- };
9
- }[];
10
-
11
- export { MONTHS };
@@ -1,21 +0,0 @@
1
- /**
2
- * Convert a time string to milliseconds
3
- * @param {string} arg - The time string to convert
4
- * @returns {number}
5
- */
6
- declare function ms(arg: string): number;
7
- declare function getTimeInMs(value: any, unit?: string): any;
8
- declare function toWeeks(ms: any): number;
9
- declare function toDays(ms: any): number;
10
- declare function toHours(ms: any): number;
11
- declare function toMinutes(ms: any): number;
12
- declare function toSeconds(ms: any): number;
13
- declare function toReadableTime(ms: any): {
14
- weeks: number;
15
- days: number;
16
- hours: number;
17
- minutes: number;
18
- seconds: number;
19
- };
20
-
21
- export { getTimeInMs, ms, toDays, toHours, toMinutes, toReadableTime, toSeconds, toWeeks };
@@ -1,9 +0,0 @@
1
- /**
2
- * Converts Form Data into an object
3
- * @param {FormData} formData
4
- * @returns Object
5
- */
6
- declare function formDataToObject(formData: FormData): {};
7
- declare function flattenArrayFields(inputObject: any): {};
8
-
9
- export { flattenArrayFields, formDataToObject };
@@ -1,2 +0,0 @@
1
- export { flattenArrayFields, formDataToObject } from './form-data.cjs';
2
- export { SanitizeOptions, sanitize, sanitizeArray, sanitizeObject } from './sanitize.cjs';
@@ -1,60 +0,0 @@
1
- /**
2
- * @typedef {Object} SanitizeOptions
3
- * @property {Function} [sanitizer] - Function to sanitize strings
4
- * @property {*} [additional] - Any additional properties are passed through to the sanitizer function
5
- */
6
- /**
7
- * Core sanitization function that handles different value types.
8
- * Throws if no sanitizer function is provided.
9
- * Any additional properties in options are passed through to the sanitizer function.
10
- *
11
- * @param {*} value - The value to sanitize
12
- * @param {SanitizeOptions} [options={}] - Sanitization options
13
- * @throws {Error} If sanitizer function is not provided
14
- * @returns {*} Sanitized value
15
- * @example
16
- * // Basic sanitization
17
- * sanitize('hello', { sanitizer: str => str.trim() })
18
- *
19
- * // With additional options passed to sanitizer
20
- * sanitize('hello', {
21
- * sanitizer: (str, length, char) => str.padEnd(length, char),
22
- * length: 10,
23
- * char: '-'
24
- * })
25
- */
26
- declare function sanitize(value: any, options?: SanitizeOptions): any;
27
- type SanitizeOptions = {
28
- /**
29
- * - Function to sanitize strings
30
- */
31
- sanitizer?: Function;
32
- /**
33
- * - Any additional properties are passed through to the sanitizer function
34
- */
35
- additional?: any;
36
- };
37
- /**
38
- * Sanitizes an array by recursively sanitizing each element.
39
- * Throws if no sanitizer function is provided.
40
- * Any additional properties in options are passed through to the sanitizer function.
41
- *
42
- * @param {Array} arr - Array to sanitize
43
- * @param {SanitizeOptions} options - Sanitization options
44
- * @throws {Error} If sanitizer function is not provided
45
- * @returns {Array} New array with sanitized values
46
- */
47
- declare function sanitizeArray(arr: any[], { sanitizer, ...rest }: SanitizeOptions): any[];
48
- /**
49
- * Sanitizes all string values in an object recursively.
50
- * Throws if no sanitizer function is not provided.
51
- * Any additional properties in options are passed through to the sanitizer function.
52
- *
53
- * @param {Object} obj - Object to sanitize
54
- * @param {SanitizeOptions} [options={}] - Sanitization options
55
- * @throws {Error} If sanitizer function is not provided
56
- * @returns {Object} New object with sanitized values
57
- */
58
- declare function sanitizeObject(obj: any, { sanitizer, ...options }?: SanitizeOptions): any;
59
-
60
- export { type SanitizeOptions, sanitize, sanitizeArray, sanitizeObject };
@@ -1,8 +0,0 @@
1
- /**
2
- * Safely executes a callback function if it's a function
3
- * @param {Function|*} fn - The potential callback function
4
- * @param {...*} data - Data arguments to pass to the callback
5
- */
6
- declare function runCallback(fn: Function | any, ...data: any[]): void;
7
-
8
- export { runCallback };
@@ -1,3 +0,0 @@
1
- declare function debounce(callback: any, wait: any, immediate?: boolean): () => void;
2
-
3
- export { debounce };
@@ -1,3 +0,0 @@
1
- declare function getEnv(): "browser" | "node";
2
-
3
- export { getEnv };
@@ -1,72 +0,0 @@
1
- /**
2
- * Creates a curried version of a function that can be called with partial arguments
3
- * @param {Function} fn - The function to curry
4
- * @return {Function} The curried function
5
- * @property {any} return - The result of calling the original function when all arguments are provided
6
- * @example
7
- * const add = (a, b, c) => a + b + c
8
- * const curriedAdd = curry(add)
9
- * curriedAdd(1)(2)(3) // 6
10
- * curriedAdd(1, 2)(3) // 6
11
- * curriedAdd(1)(2, 3) // 6
12
- */
13
- declare function curry(fn: Function): Function;
14
- /**
15
- * Composes functions from right to left (synchronous)
16
- * @param {...Function} fns - Functions to compose
17
- * @return {Function} The composed function
18
- * @property {any} return - The result of applying all functions in sequence
19
- * @example
20
- * const add1 = x => x + 1
21
- * const multiply2 = x => x * 2
22
- * const composed = compose(add1, multiply2)
23
- * composed(3) // 7 (3 * 2 + 1)
24
- */
25
- declare function compose(...fns: Function[]): Function;
26
- /**
27
- * Composes functions from right to left (asynchronous)
28
- * @param {...Function} fns - Functions to compose (can be sync or async)
29
- * @return {Function} The composed async function
30
- * @property {Promise<any>} return - A Promise that resolves to the result of applying all functions
31
- * @example
32
- * const add1 = x => x + 1
33
- * const multiplyAsync = async x => x * 2
34
- * await composeAsync(add1, multiplyAsync)(3) // 7 (3 * 2 + 1)
35
- */
36
- declare function composeAsync(...fns: Function[]): Function;
37
- /**
38
- * Pipes functions from left to right (synchronous)
39
- * @param {...Function} fns - Functions to pipe
40
- * @return {Function} The piped function
41
- * @property {any} return - The result of applying all functions in sequence
42
- * @example
43
- * const add1 = x => x + 1
44
- * const multiply2 = x => x * 2
45
- * const piped = pipe(add1, multiply2)
46
- * piped(3) // 8 (3 + 1) * 2
47
- */
48
- declare function pipe(...fns: Function[]): Function;
49
- /**
50
- * Pipes functions from left to right (asynchronous)
51
- * @param {...Function} fns - Functions to pipe (can be sync or async)
52
- * @return {Function} The piped async function
53
- * @property {Promise<any>} return - A Promise that resolves to the result of applying all functions
54
- * @example
55
- * const add1 = x => x + 1
56
- * const multiplyAsync = async x => x * 2
57
- * await pipeAsync(add1, multiplyAsync)(3) // 8 ((3 + 1) * 2)
58
- */
59
- declare function pipeAsync(...fns: Function[]): Function;
60
- /**
61
- * Calls a function n times with the current index and returns an array of results
62
- * @param {Function} fn - Function to call (receives index as argument)
63
- * @param {number} n - Number of times to call the function
64
- * @return {any[]} Array of results from calling the function
65
- * @property {any[]} return - Array containing the results of each function call
66
- * @example
67
- * times(i => i * 2, 3) // [0, 2, 4]
68
- * times(() => Math.random(), 2) // [0.123, 0.456] (random values)
69
- */
70
- declare function times(fn: Function, n: number): any[];
71
-
72
- export { compose, composeAsync, curry, pipe, pipeAsync, times };
@@ -1,5 +0,0 @@
1
- export { debounce } from './debounce.cjs';
2
- export { getEnv } from './env.cjs';
3
- export { compose, composeAsync, curry, pipe, pipeAsync, times } from './functional.cjs';
4
- export { throttle } from './throttle.cjs';
5
- export { delay, timeout, wait } from './timeout.cjs';
@@ -1,3 +0,0 @@
1
- declare function throttle(callback: any, wait: any): (...args: any[]) => void;
2
-
3
- export { throttle };
@@ -1,5 +0,0 @@
1
- declare function timeout(wait: any, callback: any): void;
2
- declare function delay(ms: any): Promise<any>;
3
- declare function wait(ms: any): Promise<any>;
4
-
5
- export { delay, timeout, wait };
@@ -1,3 +0,0 @@
1
- declare function isHashedValue(value: any, type?: string): boolean;
2
-
3
- export { isHashedValue };
@@ -1,43 +0,0 @@
1
- export { isLastItem, last, lastArrayItem } from './arrays/item-position.cjs';
2
- export { joinWithConjunction } from './arrays/join.cjs';
3
- export { shuffle } from './arrays/shuffle.cjs';
4
- export { sort } from './arrays/sort.cjs';
5
- export { splitArray } from './arrays/split-array.cjs';
6
- export { uniqueArray } from './arrays/unique.cjs';
7
- export { AuthManager, RouteManager } from './auth/route-manager.cjs';
8
- export { getType, isArray, isFunction, isObject, notObject } from './checks.cjs';
9
- export { DAYS } from './date/days.cjs';
10
- export { MONTHS } from './date/months.cjs';
11
- export { getTimeInMs, ms, toDays, toHours, toMinutes, toReadableTime, toSeconds, toWeeks } from './date/time.cjs';
12
- export { flattenArrayFields, formDataToObject } from './form/form-data.cjs';
13
- export { SanitizeOptions, sanitize, sanitizeArray, sanitizeObject } from './form/sanitize.cjs';
14
- export { debounce } from './functions/debounce.cjs';
15
- export { getEnv } from './functions/env.cjs';
16
- export { compose, composeAsync, curry, pipe, pipeAsync, times } from './functions/functional.cjs';
17
- export { throttle } from './functions/throttle.cjs';
18
- export { delay, timeout, wait } from './functions/timeout.cjs';
19
- export { isHashedValue } from './hash.cjs';
20
- export { splitUnit } from './numbers/index.cjs';
21
- export { camelCaseKeys } from './objects/camelcase-keys.cjs';
22
- export { isEmpty, notEmpty } from './objects/empty.cjs';
23
- export { isEqual, notEqual } from './objects/equal.cjs';
24
- export { extendObject } from './objects/extend.cjs';
25
- export { flattenObject } from './objects/flatten.cjs';
26
- export { parseJSON } from './objects/json.cjs';
27
- export { objectForEach, objectMap } from './objects/loop.cjs';
28
- export { concatMix, createMix, mix } from './objects/mix/mix.cjs';
29
- export { getNestedProperty, getNestedProperty2, getNestedValue } from './objects/nested-property.cjs';
30
- export { normalizeObject } from './objects/normalize-object.cjs';
31
- export { omitEmpty } from './objects/omit-empty.cjs';
32
- export { sizeOf } from './objects/size.cjs';
33
- export { splitObject } from './objects/split.cjs';
34
- export { reject } from './promises/reject.cjs';
35
- export { createSSE, parseSSE } from './sse.cjs';
36
- export { toCamel, toKebab, toLower, toPascal, toSentence, toSlug, toTitle, toUpper } from './strings/convert-case/convert-case.cjs';
37
- export { markdown, treatMarkdownWhitespace } from './strings/markdown.cjs';
38
- export { parseFullName } from './strings/name.cjs';
39
- export { pluralize } from './strings/pluralize.cjs';
40
- export { plural, stripNumbers, toQueryString } from './strings/query-string.cjs';
41
- export { toStyleString } from './style/index.cjs';
42
- export { getSymbol, getSymbolValue } from './symbols/symbols.cjs';
43
- export { toDegrees, toRadians } from './numbers/math.cjs';
@@ -1,5 +0,0 @@
1
- export { toDegrees, toRadians } from './math.cjs';
2
-
3
- declare function splitUnit(string: any): any[];
4
-
5
- export { splitUnit };
@@ -1,4 +0,0 @@
1
- declare function toDegrees(angle: any): number;
2
- declare function toRadians(angle: any): number;
3
-
4
- export { toDegrees, toRadians };
@@ -1,3 +0,0 @@
1
- declare function camelCaseKeys(obj: any): any;
2
-
3
- export { camelCaseKeys };
@@ -1,4 +0,0 @@
1
- declare function isEmpty(obj: any): boolean;
2
- declare function notEmpty(obj: any): boolean;
3
-
4
- export { isEmpty, notEmpty };
@@ -1,4 +0,0 @@
1
- declare function isEqual(a: any, b: any): boolean;
2
- declare function notEqual(a: any, b: any): boolean;
3
-
4
- export { isEqual, notEqual };
@@ -1,6 +0,0 @@
1
- declare function extendObject(object: any): {
2
- orig: any;
3
- extended: any;
4
- };
5
-
6
- export { extendObject };
@@ -1,6 +0,0 @@
1
- declare function flattenObject(obj: any, { separator, prefix }: {
2
- separator: any;
3
- prefix?: string;
4
- }): {};
5
-
6
- export { flattenObject };