@studiometa/js-toolkit 3.0.0-beta.1 → 3.0.0-beta.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 (217) hide show
  1. package/Base/Base.d.ts +19 -10
  2. package/Base/Base.js +46 -36
  3. package/Base/Base.js.map +2 -2
  4. package/Base/managers/AbstractManager.d.ts +3 -8
  5. package/Base/managers/AbstractManager.js +4 -22
  6. package/Base/managers/AbstractManager.js.map +2 -2
  7. package/Base/managers/ChildrenManager.d.ts +25 -2
  8. package/Base/managers/ChildrenManager.js +79 -63
  9. package/Base/managers/ChildrenManager.js.map +2 -2
  10. package/Base/managers/EventsManager.js +4 -12
  11. package/Base/managers/EventsManager.js.map +2 -2
  12. package/Base/managers/OptionsManager.d.ts +16 -11
  13. package/Base/managers/OptionsManager.js +38 -40
  14. package/Base/managers/OptionsManager.js.map +2 -2
  15. package/Base/managers/RefsManager.d.ts +11 -1
  16. package/Base/managers/RefsManager.js +48 -36
  17. package/Base/managers/RefsManager.js.map +2 -2
  18. package/Base/managers/ResponsiveOptionsManager.d.ts +9 -1
  19. package/Base/managers/ResponsiveOptionsManager.js +30 -23
  20. package/Base/managers/ResponsiveOptionsManager.js.map +2 -2
  21. package/Base/managers/ServicesManager.d.ts +12 -13
  22. package/Base/managers/ServicesManager.js +16 -22
  23. package/Base/managers/ServicesManager.js.map +2 -2
  24. package/Base/utils.js.map +2 -2
  25. package/decorators/index.d.ts +1 -0
  26. package/decorators/index.js +1 -0
  27. package/decorators/index.js.map +2 -2
  28. package/decorators/withBreakpointObserver.js +0 -2
  29. package/decorators/withBreakpointObserver.js.map +2 -2
  30. package/decorators/withDrag.js +1 -1
  31. package/decorators/withDrag.js.map +2 -2
  32. package/decorators/withIntersectionObserver.js +0 -2
  33. package/decorators/withIntersectionObserver.js.map +2 -2
  34. package/decorators/withMountOnMediaQuery.js +0 -2
  35. package/decorators/withMountOnMediaQuery.js.map +2 -2
  36. package/decorators/withMountWhenInView.js +0 -2
  37. package/decorators/withMountWhenInView.js.map +2 -2
  38. package/decorators/withMutation.d.ts +13 -0
  39. package/decorators/withMutation.js +34 -0
  40. package/decorators/withMutation.js.map +7 -0
  41. package/decorators/withRelativePointer.js +1 -1
  42. package/decorators/withRelativePointer.js.map +2 -2
  43. package/decorators/withScrolledInView/withScrolledInView.js +1 -1
  44. package/decorators/withScrolledInView/withScrolledInView.js.map +2 -2
  45. package/helpers/createApp.d.ts +1 -1
  46. package/helpers/createApp.js +20 -1
  47. package/helpers/createApp.js.map +2 -2
  48. package/helpers/getClosestParent.d.ts +1 -1
  49. package/helpers/getClosestParent.js +2 -2
  50. package/helpers/getClosestParent.js.map +2 -2
  51. package/helpers/getInstanceFromElement.d.ts +1 -1
  52. package/helpers/getInstanceFromElement.js +1 -1
  53. package/helpers/getInstanceFromElement.js.map +2 -2
  54. package/helpers/importOnInteraction.d.ts +1 -1
  55. package/helpers/importOnInteraction.js +1 -1
  56. package/helpers/importOnInteraction.js.map +2 -2
  57. package/helpers/importOnMediaQuery.d.ts +1 -1
  58. package/helpers/importOnMediaQuery.js +1 -1
  59. package/helpers/importOnMediaQuery.js.map +2 -2
  60. package/helpers/importWhenIdle.d.ts +1 -1
  61. package/helpers/importWhenIdle.js +1 -1
  62. package/helpers/importWhenIdle.js.map +2 -2
  63. package/helpers/importWhenPrefersMotion.d.ts +1 -1
  64. package/helpers/importWhenPrefersMotion.js +2 -2
  65. package/helpers/importWhenPrefersMotion.js.map +2 -2
  66. package/helpers/importWhenVisible.d.ts +1 -1
  67. package/helpers/importWhenVisible.js +1 -1
  68. package/helpers/importWhenVisible.js.map +2 -2
  69. package/helpers/index.d.ts +8 -8
  70. package/helpers/index.js +8 -18
  71. package/helpers/index.js.map +3 -3
  72. package/package.json +1 -1
  73. package/services/AbstractService.d.ts +10 -10
  74. package/services/AbstractService.js +10 -10
  75. package/services/AbstractService.js.map +3 -3
  76. package/services/DragService.js +5 -1
  77. package/services/DragService.js.map +2 -2
  78. package/services/KeyService.js +1 -1
  79. package/services/KeyService.js.map +2 -2
  80. package/services/MutationService.d.ts +20 -0
  81. package/services/MutationService.js +34 -0
  82. package/services/MutationService.js.map +7 -0
  83. package/services/PointerService.js +1 -1
  84. package/services/PointerService.js.map +2 -2
  85. package/services/ResizeService.js +2 -2
  86. package/services/ResizeService.js.map +2 -2
  87. package/services/ScrollService.js +1 -1
  88. package/services/ScrollService.js.map +2 -2
  89. package/services/index.d.ts +1 -0
  90. package/services/index.js +1 -0
  91. package/services/index.js.map +2 -2
  92. package/tsconfig.build.tsbuildinfo +1 -1
  93. package/utils/cache.d.ts +4 -0
  94. package/utils/cache.js +18 -0
  95. package/utils/cache.js.map +7 -0
  96. package/utils/collide/boundingRectToCircle.d.ts +1 -1
  97. package/utils/collide/boundingRectToCircle.js +1 -1
  98. package/utils/collide/boundingRectToCircle.js.map +2 -2
  99. package/utils/collide/collideCircleCircle.d.ts +1 -1
  100. package/utils/collide/collideCircleCircle.js +1 -1
  101. package/utils/collide/collideCircleCircle.js.map +2 -2
  102. package/utils/collide/collideCircleRect.d.ts +1 -1
  103. package/utils/collide/collideCircleRect.js +1 -1
  104. package/utils/collide/collideCircleRect.js.map +2 -2
  105. package/utils/collide/collidePointCircle.d.ts +1 -1
  106. package/utils/collide/collidePointCircle.js +1 -1
  107. package/utils/collide/collidePointCircle.js.map +2 -2
  108. package/utils/collide/collidePointRect.d.ts +1 -1
  109. package/utils/collide/collidePointRect.js +1 -1
  110. package/utils/collide/collidePointRect.js.map +2 -2
  111. package/utils/collide/collideRectRect.d.ts +1 -1
  112. package/utils/collide/collideRectRect.js +1 -1
  113. package/utils/collide/collideRectRect.js.map +2 -2
  114. package/utils/collide/index.d.ts +6 -6
  115. package/utils/collide/index.js +12 -12
  116. package/utils/collide/index.js.map +3 -3
  117. package/utils/css/animate.js.map +2 -2
  118. package/utils/css/getOffsetSizes.d.ts +1 -1
  119. package/utils/css/getOffsetSizes.js +1 -1
  120. package/utils/css/getOffsetSizes.js.map +2 -2
  121. package/utils/css/index.d.ts +3 -3
  122. package/utils/css/index.js +6 -6
  123. package/utils/css/index.js.map +3 -3
  124. package/utils/css/matrix.d.ts +1 -1
  125. package/utils/css/matrix.js +1 -1
  126. package/utils/css/matrix.js.map +2 -2
  127. package/utils/css/transition.d.ts +1 -1
  128. package/utils/css/transition.js +2 -2
  129. package/utils/css/transition.js.map +2 -2
  130. package/utils/debounce.d.ts +1 -1
  131. package/utils/debounce.js +1 -1
  132. package/utils/debounce.js.map +2 -2
  133. package/utils/dom/createElement.d.ts +10 -0
  134. package/utils/dom/createElement.js +21 -0
  135. package/utils/dom/createElement.js.map +7 -0
  136. package/utils/dom/index.d.ts +1 -0
  137. package/utils/dom/index.js +1 -0
  138. package/utils/dom/index.js.map +2 -2
  139. package/utils/getComponentResolver.d.ts +1 -1
  140. package/utils/getComponentResolver.js +1 -1
  141. package/utils/getComponentResolver.js.map +2 -2
  142. package/utils/index.d.ts +6 -5
  143. package/utils/index.js +11 -10
  144. package/utils/index.js.map +3 -3
  145. package/utils/keyCodes.d.ts +1 -2
  146. package/utils/keyCodes.js +2 -2
  147. package/utils/keyCodes.js.map +2 -2
  148. package/utils/math/clamp.d.ts +1 -1
  149. package/utils/math/clamp.js +1 -1
  150. package/utils/math/clamp.js.map +2 -2
  151. package/utils/math/clamp01.d.ts +1 -1
  152. package/utils/math/clamp01.js +2 -2
  153. package/utils/math/clamp01.js.map +2 -2
  154. package/utils/math/createEases.js.map +2 -2
  155. package/utils/math/damp.d.ts +1 -1
  156. package/utils/math/damp.js +1 -1
  157. package/utils/math/damp.js.map +2 -2
  158. package/utils/math/index.d.ts +7 -7
  159. package/utils/math/index.js +14 -14
  160. package/utils/math/index.js.map +3 -3
  161. package/utils/math/inertiaFinalValue.d.ts +1 -1
  162. package/utils/math/inertiaFinalValue.js +2 -2
  163. package/utils/math/inertiaFinalValue.js.map +2 -2
  164. package/utils/math/lerp.d.ts +1 -1
  165. package/utils/math/lerp.js +1 -1
  166. package/utils/math/lerp.js.map +2 -2
  167. package/utils/math/map.d.ts +1 -1
  168. package/utils/math/map.js +1 -1
  169. package/utils/math/map.js.map +2 -2
  170. package/utils/math/round.d.ts +1 -1
  171. package/utils/math/round.js +1 -1
  172. package/utils/math/round.js.map +2 -2
  173. package/utils/memoize.d.ts +1 -1
  174. package/utils/memoize.js +1 -1
  175. package/utils/memoize.js.map +2 -2
  176. package/utils/nextFrame.js.map +2 -2
  177. package/utils/object/getAllProperties.d.ts +1 -1
  178. package/utils/object/getAllProperties.js +1 -1
  179. package/utils/object/getAllProperties.js.map +2 -2
  180. package/utils/string/index.d.ts +10 -10
  181. package/utils/string/index.js +10 -22
  182. package/utils/string/index.js.map +3 -3
  183. package/utils/string/withLeadingCharacters.d.ts +1 -1
  184. package/utils/string/withLeadingCharacters.js +2 -2
  185. package/utils/string/withLeadingCharacters.js.map +2 -2
  186. package/utils/string/withLeadingSlash.d.ts +1 -1
  187. package/utils/string/withLeadingSlash.js +2 -2
  188. package/utils/string/withLeadingSlash.js.map +2 -2
  189. package/utils/string/withTrailingCharacters.d.ts +1 -1
  190. package/utils/string/withTrailingCharacters.js +2 -2
  191. package/utils/string/withTrailingCharacters.js.map +2 -2
  192. package/utils/string/withTrailingSlash.d.ts +1 -1
  193. package/utils/string/withTrailingSlash.js +2 -2
  194. package/utils/string/withTrailingSlash.js.map +2 -2
  195. package/utils/string/withoutLeadingCharacters.d.ts +1 -1
  196. package/utils/string/withoutLeadingCharacters.js +1 -1
  197. package/utils/string/withoutLeadingCharacters.js.map +2 -2
  198. package/utils/string/withoutLeadingCharactersRecursive.d.ts +1 -1
  199. package/utils/string/withoutLeadingCharactersRecursive.js +2 -2
  200. package/utils/string/withoutLeadingCharactersRecursive.js.map +2 -2
  201. package/utils/string/withoutLeadingSlash.d.ts +1 -1
  202. package/utils/string/withoutLeadingSlash.js +2 -2
  203. package/utils/string/withoutLeadingSlash.js.map +2 -2
  204. package/utils/string/withoutTrailingCharacters.d.ts +1 -1
  205. package/utils/string/withoutTrailingCharacters.js +1 -1
  206. package/utils/string/withoutTrailingCharacters.js.map +2 -2
  207. package/utils/string/withoutTrailingCharactersRecursive.d.ts +1 -1
  208. package/utils/string/withoutTrailingCharactersRecursive.js +2 -2
  209. package/utils/string/withoutTrailingCharactersRecursive.js.map +2 -2
  210. package/utils/string/withoutTrailingSlash.d.ts +1 -1
  211. package/utils/string/withoutTrailingSlash.js +2 -2
  212. package/utils/string/withoutTrailingSlash.js.map +2 -2
  213. package/utils/throttle.d.ts +1 -1
  214. package/utils/throttle.js +1 -1
  215. package/utils/throttle.js.map +2 -2
  216. package/utils/trapFocus.js +1 -1
  217. package/utils/trapFocus.js.map +2 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/math/round.ts"],
4
- "sourcesContent": ["/**\n * Round a value with a given number of decimals.\n *\n * @param {number} value The number to round.\n * @param {number} [decimals=0] The number of decimals to keep.\n * @returns {number} A rounded number to the given decimals length.\n */\nexport default function round(value: number, decimals = 0) {\n return Number(value.toFixed(decimals));\n}\n"],
5
- "mappings": "AAOe,SAAR,MAAuB,OAAe,WAAW,GAAG;AACzD,SAAO,OAAO,MAAM,QAAQ,QAAQ,CAAC;AACvC;",
4
+ "sourcesContent": ["/**\n * Round a value with a given number of decimals.\n *\n * @param {number} value The number to round.\n * @param {number} [decimals=0] The number of decimals to keep.\n * @returns {number} A rounded number to the given decimals length.\n */\nexport function round(value: number, decimals = 0) {\n return Number(value.toFixed(decimals));\n}\n"],
5
+ "mappings": "AAOO,SAAS,MAAM,OAAe,WAAW,GAAG;AACjD,SAAO,OAAO,MAAM,QAAQ,QAAQ,CAAC;AACvC;",
6
6
  "names": []
7
7
  }
@@ -17,4 +17,4 @@ export interface MemoizeOptions<T> {
17
17
  /**
18
18
  * Memoize the output of a function.
19
19
  */
20
- export default function memoize<T extends (...args: unknown[]) => unknown>(fn: T, { maxAge, cacheKey, cache, }?: MemoizeOptions<ReturnType<T>>): (...args: Parameters<T>) => ReturnType<T>;
20
+ export declare function memoize<T extends (...args: unknown[]) => unknown>(fn: T, { maxAge, cacheKey, cache, }?: MemoizeOptions<ReturnType<T>>): (...args: Parameters<T>) => ReturnType<T>;
package/utils/memoize.js CHANGED
@@ -21,6 +21,6 @@ function memoize(fn, {
21
21
  };
22
22
  }
23
23
  export {
24
- memoize as default
24
+ memoize
25
25
  };
26
26
  //# sourceMappingURL=memoize.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/js-toolkit/utils/memoize.ts"],
4
- "sourcesContent": ["export interface MemoizeCache<T> {\n has: (key: unknown) => boolean;\n set: (key: unknown, value: { data: T; date: number }) => this;\n get: (key: unknown) => { data: T; date: number };\n}\n\nexport interface MemoizeOptions<T> {\n maxAge?: number;\n cacheKey?: (args: unknown[]) => string;\n cache?: MemoizeCache<T>;\n}\n\n/**\n * Memoize the output of a function.\n */\nexport default function memoize<T extends (...args: unknown[]) => unknown>(\n fn: T,\n {\n maxAge = Number.POSITIVE_INFINITY,\n cacheKey = JSON.stringify,\n cache = new Map(),\n }: MemoizeOptions<ReturnType<T>> = {},\n): (...args: Parameters<T>) => ReturnType<T> {\n return function memoized(...args): ReturnType<T> {\n const key = cacheKey(args);\n const date = Date.now();\n\n if (cache.has(key)) {\n const cached = cache.get(key);\n\n if (date - cached.date < maxAge) {\n return cached.data;\n }\n }\n\n // @ts-ignore\n const data: ReturnType<T> = fn(...args);\n\n cache.set(key, {\n data,\n date: Date.now(),\n });\n\n return data;\n };\n}\n"],
5
- "mappings": "AAee,SAAR,QACL,IACA;AAAA,EACE,SAAS,OAAO;AAAA,EAChB,WAAW,KAAK;AAAA,EAChB,QAAQ,oBAAI,IAAI;AAClB,IAAmC,CAAC,GACO;AAC3C,SAAO,SAAS,YAAY,MAAqB;AAC/C,UAAM,MAAM,SAAS,IAAI;AACzB,UAAM,OAAO,KAAK,IAAI;AAEtB,QAAI,MAAM,IAAI,GAAG,GAAG;AAClB,YAAM,SAAS,MAAM,IAAI,GAAG;AAE5B,UAAI,OAAO,OAAO,OAAO,QAAQ;AAC/B,eAAO,OAAO;AAAA,MAChB;AAAA,IACF;AAGA,UAAM,OAAsB,GAAG,GAAG,IAAI;AAEtC,UAAM,IAAI,KAAK;AAAA,MACb;AAAA,MACA,MAAM,KAAK,IAAI;AAAA,IACjB,CAAC;AAED,WAAO;AAAA,EACT;AACF;",
4
+ "sourcesContent": ["export interface MemoizeCache<T> {\n has: (key: unknown) => boolean;\n set: (key: unknown, value: { data: T; date: number }) => this;\n get: (key: unknown) => { data: T; date: number };\n}\n\nexport interface MemoizeOptions<T> {\n maxAge?: number;\n cacheKey?: (args: unknown[]) => string;\n cache?: MemoizeCache<T>;\n}\n\n/**\n * Memoize the output of a function.\n */\nexport function memoize<T extends (...args: unknown[]) => unknown>(\n fn: T,\n {\n maxAge = Number.POSITIVE_INFINITY,\n cacheKey = JSON.stringify,\n cache = new Map(),\n }: MemoizeOptions<ReturnType<T>> = {},\n): (...args: Parameters<T>) => ReturnType<T> {\n return function memoized(...args): ReturnType<T> {\n const key = cacheKey(args);\n const date = Date.now();\n\n if (cache.has(key)) {\n const cached = cache.get(key);\n\n if (date - cached.date < maxAge) {\n return cached.data;\n }\n }\n\n // @ts-ignore\n const data: ReturnType<T> = fn(...args);\n\n cache.set(key, {\n data,\n date: Date.now(),\n });\n\n return data;\n };\n}\n"],
5
+ "mappings": "AAeO,SAAS,QACd,IACA;AAAA,EACE,SAAS,OAAO;AAAA,EAChB,WAAW,KAAK;AAAA,EAChB,QAAQ,oBAAI,IAAI;AAClB,IAAmC,CAAC,GACO;AAC3C,SAAO,SAAS,YAAY,MAAqB;AAC/C,UAAM,MAAM,SAAS,IAAI;AACzB,UAAM,OAAO,KAAK,IAAI;AAEtB,QAAI,MAAM,IAAI,GAAG,GAAG;AAClB,YAAM,SAAS,MAAM,IAAI,GAAG;AAE5B,UAAI,OAAO,OAAO,OAAO,QAAQ;AAC/B,eAAO,OAAO;AAAA,MAChB;AAAA,IACF;AAGA,UAAM,OAAsB,GAAG,GAAG,IAAI;AAEtC,UAAM,IAAI,KAAK;AAAA,MACb;AAAA,MACA,MAAM,KAAK,IAAI;AAAA,IACjB,CAAC;AAED,WAAO;AAAA,EACT;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/js-toolkit/utils/nextFrame.ts"],
4
- "sourcesContent": ["import { isFunction } from './is.js';\nimport { hasWindow } from './has.js';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Callback = (time?: DOMHighResTimeStamp) => any;\n\n/**\n * Wait for the next frame to execute a function.\n */\nexport function nextFrame(): Promise<DOMHighResTimeStamp>;\nexport function nextFrame<T extends Callback>(callback?: T): Promise<ReturnType<T>>;\nexport function nextFrame<T extends Callback>(callback?: T): Promise<ReturnType<T>> {\n const fn = hasWindow() ? window?.requestAnimationFrame ?? setTimeout : setTimeout;\n return new Promise((resolve) => {\n fn((time) => resolve(isFunction(callback) ? callback(time) : time));\n });\n}\n"],
5
- "mappings": "AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAUnB,SAAS,UAA8B,UAAsC;AAClF,QAAM,KAAK,UAAU,IAAI,QAAQ,yBAAyB,aAAa;AACvE,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,OAAG,CAAC,SAAS,QAAQ,WAAW,QAAQ,IAAI,SAAS,IAAI,IAAI,IAAI,CAAC;AAAA,EACpE,CAAC;AACH;",
4
+ "sourcesContent": ["import { isFunction } from './is.js';\nimport { hasWindow } from './has.js';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Callback = (time?: DOMHighResTimeStamp) => any;\n\n/**\n * Wait for the next frame to execute a function.\n */\nexport function nextFrame(): Promise<DOMHighResTimeStamp>;\nexport function nextFrame<T extends Callback>(callback?: T): Promise<ReturnType<T>>;\nexport function nextFrame<T extends Callback>(callback?: T): Promise<ReturnType<T>> {\n const fn = hasWindow() ? (window?.requestAnimationFrame ?? setTimeout) : setTimeout;\n return new Promise((resolve) => {\n fn((time) => resolve(isFunction(callback) ? callback(time) : time));\n });\n}\n"],
5
+ "mappings": "AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAUnB,SAAS,UAA8B,UAAsC;AAClF,QAAM,KAAK,UAAU,IAAK,QAAQ,yBAAyB,aAAc;AACzE,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,OAAG,CAAC,SAAS,QAAQ,WAAW,QAAQ,IAAI,SAAS,IAAI,IAAI,IAAI,CAAC;AAAA,EACpE,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -8,4 +8,4 @@
8
8
  * @param {(name:string, proto:any) => boolean} testFn
9
9
  * @returns {Array<[string, Object]>} An array of properties and the prototype they belong to.
10
10
  */
11
- export default function getAllProperties(object: unknown, props?: Array<[string, unknown]>, testFn?: (name: string, proto: unknown) => boolean): Array<[string, unknown]>;
11
+ export declare function getAllProperties(object: unknown, props?: Array<[string, unknown]>, testFn?: (name: string, proto: unknown) => boolean): Array<[string, unknown]>;
@@ -12,6 +12,6 @@ function getAllProperties(object, props = [], testFn = null) {
12
12
  return getAllProperties(proto, formatedProps, testFn);
13
13
  }
14
14
  export {
15
- getAllProperties as default
15
+ getAllProperties
16
16
  };
17
17
  //# sourceMappingURL=getAllProperties.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/object/getAllProperties.ts"],
4
- "sourcesContent": ["import { isFunction } from '../is.js';\n\n/**\n * Gets all non-builtin properties up the prototype chain.\n *\n * @param {Object} object\n * The object to get the propeties from.\n * @param {Array} [props=[]]\n * The already existing properties.\n * @param {(name:string, proto:any) => boolean} testFn\n * @returns {Array<[string, Object]>} An array of properties and the prototype they belong to.\n */\nexport default function getAllProperties(\n object: unknown,\n props: Array<[string, unknown]> = [],\n testFn: (name: string, proto: unknown) => boolean = null,\n): Array<[string, unknown]> {\n const proto = Object.getPrototypeOf(object);\n\n if (proto === Object.prototype || proto === null) {\n return props;\n }\n\n let foundProps = Object.getOwnPropertyNames(proto);\n\n if (isFunction(testFn)) {\n foundProps = foundProps.filter((name) => testFn(name, proto));\n }\n\n const formatedProps = foundProps\n .map<[string, unknown]>((name) => [name, proto])\n .reduce<Array<[string, unknown]>>((acc, val) => [...acc, val], props);\n\n return getAllProperties(proto, formatedProps, testFn);\n}\n"],
5
- "mappings": "AAAA,SAAS,kBAAkB;AAYZ,SAAR,iBACL,QACA,QAAkC,CAAC,GACnC,SAAoD,MAC1B;AAC1B,QAAM,QAAQ,OAAO,eAAe,MAAM;AAE1C,MAAI,UAAU,OAAO,aAAa,UAAU,MAAM;AAChD,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,OAAO,oBAAoB,KAAK;AAEjD,MAAI,WAAW,MAAM,GAAG;AACtB,iBAAa,WAAW,OAAO,CAAC,SAAS,OAAO,MAAM,KAAK,CAAC;AAAA,EAC9D;AAEA,QAAM,gBAAgB,WACnB,IAAuB,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAC9C,OAAiC,CAAC,KAAK,QAAQ,CAAC,GAAG,KAAK,GAAG,GAAG,KAAK;AAEtE,SAAO,iBAAiB,OAAO,eAAe,MAAM;AACtD;",
4
+ "sourcesContent": ["import { isFunction } from '../is.js';\n\n/**\n * Gets all non-builtin properties up the prototype chain.\n *\n * @param {Object} object\n * The object to get the propeties from.\n * @param {Array} [props=[]]\n * The already existing properties.\n * @param {(name:string, proto:any) => boolean} testFn\n * @returns {Array<[string, Object]>} An array of properties and the prototype they belong to.\n */\nexport function getAllProperties(\n object: unknown,\n props: Array<[string, unknown]> = [],\n testFn: (name: string, proto: unknown) => boolean = null,\n): Array<[string, unknown]> {\n const proto = Object.getPrototypeOf(object);\n\n if (proto === Object.prototype || proto === null) {\n return props;\n }\n\n let foundProps = Object.getOwnPropertyNames(proto);\n\n if (isFunction(testFn)) {\n foundProps = foundProps.filter((name) => testFn(name, proto));\n }\n\n const formatedProps = foundProps\n .map<[string, unknown]>((name) => [name, proto])\n .reduce<Array<[string, unknown]>>((acc, val) => [...acc, val], props);\n\n return getAllProperties(proto, formatedProps, testFn);\n}\n"],
5
+ "mappings": "AAAA,SAAS,kBAAkB;AAYpB,SAAS,iBACd,QACA,QAAkC,CAAC,GACnC,SAAoD,MAC1B;AAC1B,QAAM,QAAQ,OAAO,eAAe,MAAM;AAE1C,MAAI,UAAU,OAAO,aAAa,UAAU,MAAM;AAChD,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,OAAO,oBAAoB,KAAK;AAEjD,MAAI,WAAW,MAAM,GAAG;AACtB,iBAAa,WAAW,OAAO,CAAC,SAAS,OAAO,MAAM,KAAK,CAAC;AAAA,EAC9D;AAEA,QAAM,gBAAgB,WACnB,IAAuB,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAC9C,OAAiC,CAAC,KAAK,QAAQ,CAAC,GAAG,KAAK,GAAG,GAAG,KAAK;AAEtE,SAAO,iBAAiB,OAAO,eAAe,MAAM;AACtD;",
6
6
  "names": []
7
7
  }
@@ -1,13 +1,13 @@
1
- export { default as withLeadingCharacters } from './withLeadingCharacters.js';
2
- export { default as withLeadingSlash } from './withLeadingSlash.js';
3
- export { default as withoutLeadingCharacters } from './withoutLeadingCharacters.js';
4
- export { default as withoutLeadingCharactersRecursive } from './withoutLeadingCharactersRecursive.js';
5
- export { default as withoutLeadingSlash } from './withoutLeadingSlash.js';
6
- export { default as withoutTrailingCharacters } from './withoutTrailingCharacters.js';
7
- export { default as withoutTrailingCharactersRecursive } from './withoutTrailingCharactersRecursive.js';
8
- export { default as withoutTrailingSlash } from './withoutTrailingSlash.js';
9
- export { default as withTrailingCharacters } from './withTrailingCharacters.js';
10
- export { default as withTrailingSlash } from './withTrailingSlash.js';
1
+ export * from './withLeadingCharacters.js';
2
+ export * from './withLeadingSlash.js';
3
+ export * from './withoutLeadingCharacters.js';
4
+ export * from './withoutLeadingCharactersRecursive.js';
5
+ export * from './withoutLeadingSlash.js';
6
+ export * from './withoutTrailingCharacters.js';
7
+ export * from './withoutTrailingCharactersRecursive.js';
8
+ export * from './withoutTrailingSlash.js';
9
+ export * from './withTrailingCharacters.js';
10
+ export * from './withTrailingSlash.js';
11
11
  export * from './startsWith.js';
12
12
  export * from './endsWith.js';
13
13
  export * from './changeCase.js';
@@ -1,26 +1,14 @@
1
- import { default as default2 } from "./withLeadingCharacters.js";
2
- import { default as default3 } from "./withLeadingSlash.js";
3
- import { default as default4 } from "./withoutLeadingCharacters.js";
4
- import { default as default5 } from "./withoutLeadingCharactersRecursive.js";
5
- import { default as default6 } from "./withoutLeadingSlash.js";
6
- import { default as default7 } from "./withoutTrailingCharacters.js";
7
- import { default as default8 } from "./withoutTrailingCharactersRecursive.js";
8
- import { default as default9 } from "./withoutTrailingSlash.js";
9
- import { default as default10 } from "./withTrailingCharacters.js";
10
- import { default as default11 } from "./withTrailingSlash.js";
1
+ export * from "./withLeadingCharacters.js";
2
+ export * from "./withLeadingSlash.js";
3
+ export * from "./withoutLeadingCharacters.js";
4
+ export * from "./withoutLeadingCharactersRecursive.js";
5
+ export * from "./withoutLeadingSlash.js";
6
+ export * from "./withoutTrailingCharacters.js";
7
+ export * from "./withoutTrailingCharactersRecursive.js";
8
+ export * from "./withoutTrailingSlash.js";
9
+ export * from "./withTrailingCharacters.js";
10
+ export * from "./withTrailingSlash.js";
11
11
  export * from "./startsWith.js";
12
12
  export * from "./endsWith.js";
13
13
  export * from "./changeCase.js";
14
- export {
15
- default2 as withLeadingCharacters,
16
- default3 as withLeadingSlash,
17
- default10 as withTrailingCharacters,
18
- default11 as withTrailingSlash,
19
- default4 as withoutLeadingCharacters,
20
- default5 as withoutLeadingCharactersRecursive,
21
- default6 as withoutLeadingSlash,
22
- default7 as withoutTrailingCharacters,
23
- default8 as withoutTrailingCharactersRecursive,
24
- default9 as withoutTrailingSlash
25
- };
26
14
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/string/index.ts"],
4
- "sourcesContent": ["export { default as withLeadingCharacters } from './withLeadingCharacters.js';\nexport { default as withLeadingSlash } from './withLeadingSlash.js';\nexport { default as withoutLeadingCharacters } from './withoutLeadingCharacters.js';\nexport { default as withoutLeadingCharactersRecursive } from './withoutLeadingCharactersRecursive.js';\nexport { default as withoutLeadingSlash } from './withoutLeadingSlash.js';\nexport { default as withoutTrailingCharacters } from './withoutTrailingCharacters.js';\nexport { default as withoutTrailingCharactersRecursive } from './withoutTrailingCharactersRecursive.js';\nexport { default as withoutTrailingSlash } from './withoutTrailingSlash.js';\nexport { default as withTrailingCharacters } from './withTrailingCharacters.js';\nexport { default as withTrailingSlash } from './withTrailingSlash.js';\nexport * from './startsWith.js';\nexport * from './endsWith.js';\nexport * from './changeCase.js';\n"],
5
- "mappings": "AAAA,SAAoB,WAAXA,gBAAwC;AACjD,SAAoB,WAAXA,gBAAmC;AAC5C,SAAoB,WAAXA,gBAA2C;AACpD,SAAoB,WAAXA,gBAAoD;AAC7D,SAAoB,WAAXA,gBAAsC;AAC/C,SAAoB,WAAXA,gBAA4C;AACrD,SAAoB,WAAXA,gBAAqD;AAC9D,SAAoB,WAAXA,gBAAuC;AAChD,SAAoB,WAAXA,iBAAyC;AAClD,SAAoB,WAAXA,iBAAoC;AAC7C,cAAc;AACd,cAAc;AACd,cAAc;",
6
- "names": ["default"]
4
+ "sourcesContent": ["export * from './withLeadingCharacters.js';\nexport * from './withLeadingSlash.js';\nexport * from './withoutLeadingCharacters.js';\nexport * from './withoutLeadingCharactersRecursive.js';\nexport * from './withoutLeadingSlash.js';\nexport * from './withoutTrailingCharacters.js';\nexport * from './withoutTrailingCharactersRecursive.js';\nexport * from './withoutTrailingSlash.js';\nexport * from './withTrailingCharacters.js';\nexport * from './withTrailingSlash.js';\nexport * from './startsWith.js';\nexport * from './endsWith.js';\nexport * from './changeCase.js';\n"],
5
+ "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
+ "names": []
7
7
  }
@@ -5,4 +5,4 @@
5
5
  * @param {string} characters The characters to add to the start.
6
6
  * @returns {string}
7
7
  */
8
- export default function withLeadingCharacters(string: string, characters: string): string;
8
+ export declare function withLeadingCharacters(string: string, characters: string): string;
@@ -1,8 +1,8 @@
1
- import withoutLeadingCharacters from "./withoutLeadingCharacters.js";
1
+ import { withoutLeadingCharacters } from "./withoutLeadingCharacters.js";
2
2
  function withLeadingCharacters(string, characters) {
3
3
  return `${characters}${withoutLeadingCharacters(string, characters)}`;
4
4
  }
5
5
  export {
6
- withLeadingCharacters as default
6
+ withLeadingCharacters
7
7
  };
8
8
  //# sourceMappingURL=withLeadingCharacters.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/string/withLeadingCharacters.ts"],
4
- "sourcesContent": ["import withoutLeadingCharacters from './withoutLeadingCharacters.js';\n\n/**\n * Add the given characters to the start of the given string.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to add to the start.\n * @returns {string}\n */\nexport default function withLeadingCharacters(string: string, characters: string): string {\n return `${characters}${withoutLeadingCharacters(string, characters)}`;\n}\n"],
5
- "mappings": "AAAA,OAAO,8BAA8B;AAStB,SAAR,sBAAuC,QAAgB,YAA4B;AACxF,SAAO,GAAG,UAAU,GAAG,yBAAyB,QAAQ,UAAU,CAAC;AACrE;",
4
+ "sourcesContent": ["import { withoutLeadingCharacters } from './withoutLeadingCharacters.js';\n\n/**\n * Add the given characters to the start of the given string.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to add to the start.\n * @returns {string}\n */\nexport function withLeadingCharacters(string: string, characters: string): string {\n return `${characters}${withoutLeadingCharacters(string, characters)}`;\n}\n"],
5
+ "mappings": "AAAA,SAAS,gCAAgC;AASlC,SAAS,sBAAsB,QAAgB,YAA4B;AAChF,SAAO,GAAG,UAAU,GAAG,yBAAyB,QAAQ,UAAU,CAAC;AACrE;",
6
6
  "names": []
7
7
  }
@@ -4,4 +4,4 @@
4
4
  * @param {string} string The string to modify.
5
5
  * @returns {string} The string with a leading slash.
6
6
  */
7
- export default function withLeadingSlash(string: string): string;
7
+ export declare function withLeadingSlash(string: string): string;
@@ -1,8 +1,8 @@
1
- import withLeadingCharacters from "./withLeadingCharacters.js";
1
+ import { withLeadingCharacters } from "./withLeadingCharacters.js";
2
2
  function withLeadingSlash(string) {
3
3
  return withLeadingCharacters(string, "/");
4
4
  }
5
5
  export {
6
- withLeadingSlash as default
6
+ withLeadingSlash
7
7
  };
8
8
  //# sourceMappingURL=withLeadingSlash.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/string/withLeadingSlash.ts"],
4
- "sourcesContent": ["import withLeadingCharacters from './withLeadingCharacters.js';\n\n/**\n * Add a leading slash to a string.\n *\n * @param {string} string The string to modify.\n * @returns {string} The string with a leading slash.\n */\nexport default function withLeadingSlash(string: string): string {\n return withLeadingCharacters(string, '/');\n}\n"],
5
- "mappings": "AAAA,OAAO,2BAA2B;AAQnB,SAAR,iBAAkC,QAAwB;AAC/D,SAAO,sBAAsB,QAAQ,GAAG;AAC1C;",
4
+ "sourcesContent": ["import { withLeadingCharacters } from './withLeadingCharacters.js';\n\n/**\n * Add a leading slash to a string.\n *\n * @param {string} string The string to modify.\n * @returns {string} The string with a leading slash.\n */\nexport function withLeadingSlash(string: string): string {\n return withLeadingCharacters(string, '/');\n}\n"],
5
+ "mappings": "AAAA,SAAS,6BAA6B;AAQ/B,SAAS,iBAAiB,QAAwB;AACvD,SAAO,sBAAsB,QAAQ,GAAG;AAC1C;",
6
6
  "names": []
7
7
  }
@@ -5,4 +5,4 @@
5
5
  * @param {string} characters The characters to add to the end.
6
6
  * @returns {string}
7
7
  */
8
- export default function withTrailingCharacters(string: string, characters: string): string;
8
+ export declare function withTrailingCharacters(string: string, characters: string): string;
@@ -1,8 +1,8 @@
1
- import withoutTrailingCharacters from "./withoutTrailingCharacters.js";
1
+ import { withoutTrailingCharacters } from "./withoutTrailingCharacters.js";
2
2
  function withTrailingCharacters(string, characters) {
3
3
  return `${withoutTrailingCharacters(string, characters)}${characters}`;
4
4
  }
5
5
  export {
6
- withTrailingCharacters as default
6
+ withTrailingCharacters
7
7
  };
8
8
  //# sourceMappingURL=withTrailingCharacters.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/string/withTrailingCharacters.ts"],
4
- "sourcesContent": ["import withoutTrailingCharacters from './withoutTrailingCharacters.js';\n\n/**\n * Add the given characters to the end of the given string.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to add to the end.\n * @returns {string}\n */\nexport default function withTrailingCharacters(string: string, characters: string): string {\n return `${withoutTrailingCharacters(string, characters)}${characters}`;\n}\n"],
5
- "mappings": "AAAA,OAAO,+BAA+B;AASvB,SAAR,uBAAwC,QAAgB,YAA4B;AACzF,SAAO,GAAG,0BAA0B,QAAQ,UAAU,CAAC,GAAG,UAAU;AACtE;",
4
+ "sourcesContent": ["import { withoutTrailingCharacters } from './withoutTrailingCharacters.js';\n\n/**\n * Add the given characters to the end of the given string.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to add to the end.\n * @returns {string}\n */\nexport function withTrailingCharacters(string: string, characters: string): string {\n return `${withoutTrailingCharacters(string, characters)}${characters}`;\n}\n"],
5
+ "mappings": "AAAA,SAAS,iCAAiC;AASnC,SAAS,uBAAuB,QAAgB,YAA4B;AACjF,SAAO,GAAG,0BAA0B,QAAQ,UAAU,CAAC,GAAG,UAAU;AACtE;",
6
6
  "names": []
7
7
  }
@@ -4,4 +4,4 @@
4
4
  * @param {string} string The string to modify.
5
5
  * @returns {string} The string with a trailing slash.
6
6
  */
7
- export default function withTrailingSlash(string: string): string;
7
+ export declare function withTrailingSlash(string: string): string;
@@ -1,8 +1,8 @@
1
- import withTrailingCharacters from "./withTrailingCharacters.js";
1
+ import { withTrailingCharacters } from "./withTrailingCharacters.js";
2
2
  function withTrailingSlash(string) {
3
3
  return withTrailingCharacters(string, "/");
4
4
  }
5
5
  export {
6
- withTrailingSlash as default
6
+ withTrailingSlash
7
7
  };
8
8
  //# sourceMappingURL=withTrailingSlash.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/string/withTrailingSlash.ts"],
4
- "sourcesContent": ["import withTrailingCharacters from './withTrailingCharacters.js';\n\n/**\n * Add a trailing slash to a string.\n *\n * @param {string} string The string to modify.\n * @returns {string} The string with a trailing slash.\n */\nexport default function withTrailingSlash(string: string): string {\n return withTrailingCharacters(string, '/');\n}\n"],
5
- "mappings": "AAAA,OAAO,4BAA4B;AAQpB,SAAR,kBAAmC,QAAwB;AAChE,SAAO,uBAAuB,QAAQ,GAAG;AAC3C;",
4
+ "sourcesContent": ["import { withTrailingCharacters } from './withTrailingCharacters.js';\n\n/**\n * Add a trailing slash to a string.\n *\n * @param {string} string The string to modify.\n * @returns {string} The string with a trailing slash.\n */\nexport function withTrailingSlash(string: string): string {\n return withTrailingCharacters(string, '/');\n}\n"],
5
+ "mappings": "AAAA,SAAS,8BAA8B;AAQhC,SAAS,kBAAkB,QAAwB;AACxD,SAAO,uBAAuB,QAAQ,GAAG;AAC3C;",
6
6
  "names": []
7
7
  }
@@ -5,4 +5,4 @@
5
5
  * @param {string} characters The characters to remove from the start.
6
6
  * @returns {string}
7
7
  */
8
- export default function withoutLeadingCharacters(string: string, characters: string): string;
8
+ export declare function withoutLeadingCharacters(string: string, characters: string): string;
@@ -2,6 +2,6 @@ function withoutLeadingCharacters(string, characters) {
2
2
  return string.replace(new RegExp(`^${characters}`), "");
3
3
  }
4
4
  export {
5
- withoutLeadingCharacters as default
5
+ withoutLeadingCharacters
6
6
  };
7
7
  //# sourceMappingURL=withoutLeadingCharacters.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/string/withoutLeadingCharacters.ts"],
4
- "sourcesContent": ["/**\n * Remove the given characters from the start of the given string.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to remove from the start.\n * @returns {string}\n */\nexport default function withoutLeadingCharacters(string: string, characters: string): string {\n return string.replace(new RegExp(`^${characters}`), '');\n}\n"],
5
- "mappings": "AAOe,SAAR,yBAA0C,QAAgB,YAA4B;AAC3F,SAAO,OAAO,QAAQ,IAAI,OAAO,IAAI,UAAU,EAAE,GAAG,EAAE;AACxD;",
4
+ "sourcesContent": ["/**\n * Remove the given characters from the start of the given string.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to remove from the start.\n * @returns {string}\n */\nexport function withoutLeadingCharacters(string: string, characters: string): string {\n return string.replace(new RegExp(`^${characters}`), '');\n}\n"],
5
+ "mappings": "AAOO,SAAS,yBAAyB,QAAgB,YAA4B;AACnF,SAAO,OAAO,QAAQ,IAAI,OAAO,IAAI,UAAU,EAAE,GAAG,EAAE;AACxD;",
6
6
  "names": []
7
7
  }
@@ -5,4 +5,4 @@
5
5
  * @param {string} characters The characters to add to the start.
6
6
  * @returns {string}
7
7
  */
8
- export default function withoutLeadingCharactersRecursive(string: string, characters: string): string;
8
+ export declare function withoutLeadingCharactersRecursive(string: string, characters: string): string;
@@ -1,4 +1,4 @@
1
- import withoutLeadingCharacters from "./withoutLeadingCharacters.js";
1
+ import { withoutLeadingCharacters } from "./withoutLeadingCharacters.js";
2
2
  function withoutLeadingCharactersRecursive(string, characters) {
3
3
  let str = withoutLeadingCharacters(string, characters);
4
4
  const regex = new RegExp(`^${characters}`);
@@ -8,6 +8,6 @@ function withoutLeadingCharactersRecursive(string, characters) {
8
8
  return str;
9
9
  }
10
10
  export {
11
- withoutLeadingCharactersRecursive as default
11
+ withoutLeadingCharactersRecursive
12
12
  };
13
13
  //# sourceMappingURL=withoutLeadingCharactersRecursive.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/string/withoutLeadingCharactersRecursive.ts"],
4
- "sourcesContent": ["import withoutLeadingCharacters from './withoutLeadingCharacters.js';\n\n/**\n * Remove the given characters to the start of the given string recursively.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to add to the start.\n * @returns {string}\n */\nexport default function withoutLeadingCharactersRecursive(\n string: string,\n characters: string,\n): string {\n let str = withoutLeadingCharacters(string, characters);\n const regex = new RegExp(`^${characters}`);\n\n while (regex.test(str)) {\n str = withoutLeadingCharacters(str, characters);\n }\n\n return str;\n}\n"],
5
- "mappings": "AAAA,OAAO,8BAA8B;AAStB,SAAR,kCACL,QACA,YACQ;AACR,MAAI,MAAM,yBAAyB,QAAQ,UAAU;AACrD,QAAM,QAAQ,IAAI,OAAO,IAAI,UAAU,EAAE;AAEzC,SAAO,MAAM,KAAK,GAAG,GAAG;AACtB,UAAM,yBAAyB,KAAK,UAAU;AAAA,EAChD;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import { withoutLeadingCharacters } from './withoutLeadingCharacters.js';\n\n/**\n * Remove the given characters to the start of the given string recursively.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to add to the start.\n * @returns {string}\n */\nexport function withoutLeadingCharactersRecursive(string: string, characters: string): string {\n let str = withoutLeadingCharacters(string, characters);\n const regex = new RegExp(`^${characters}`);\n\n while (regex.test(str)) {\n str = withoutLeadingCharacters(str, characters);\n }\n\n return str;\n}\n"],
5
+ "mappings": "AAAA,SAAS,gCAAgC;AASlC,SAAS,kCAAkC,QAAgB,YAA4B;AAC5F,MAAI,MAAM,yBAAyB,QAAQ,UAAU;AACrD,QAAM,QAAQ,IAAI,OAAO,IAAI,UAAU,EAAE;AAEzC,SAAO,MAAM,KAAK,GAAG,GAAG;AACtB,UAAM,yBAAyB,KAAK,UAAU;AAAA,EAChD;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -4,4 +4,4 @@
4
4
  * @param {string} string The string to modify.
5
5
  * @returns {string} The string without leading slash.
6
6
  */
7
- export default function withoutLeadingSlash(string: string): string;
7
+ export declare function withoutLeadingSlash(string: string): string;
@@ -1,8 +1,8 @@
1
- import withoutLeadingCharacters from "./withoutLeadingCharacters.js";
1
+ import { withoutLeadingCharacters } from "./withoutLeadingCharacters.js";
2
2
  function withoutLeadingSlash(string) {
3
3
  return withoutLeadingCharacters(string, "/");
4
4
  }
5
5
  export {
6
- withoutLeadingSlash as default
6
+ withoutLeadingSlash
7
7
  };
8
8
  //# sourceMappingURL=withoutLeadingSlash.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/string/withoutLeadingSlash.ts"],
4
- "sourcesContent": ["import withoutLeadingCharacters from './withoutLeadingCharacters.js';\n\n/**\n * Remove the leading slash from a string.\n *\n * @param {string} string The string to modify.\n * @returns {string} The string without leading slash.\n */\nexport default function withoutLeadingSlash(string: string): string {\n return withoutLeadingCharacters(string, '/');\n}\n"],
5
- "mappings": "AAAA,OAAO,8BAA8B;AAQtB,SAAR,oBAAqC,QAAwB;AAClE,SAAO,yBAAyB,QAAQ,GAAG;AAC7C;",
4
+ "sourcesContent": ["import { withoutLeadingCharacters } from './withoutLeadingCharacters.js';\n\n/**\n * Remove the leading slash from a string.\n *\n * @param {string} string The string to modify.\n * @returns {string} The string without leading slash.\n */\nexport function withoutLeadingSlash(string: string): string {\n return withoutLeadingCharacters(string, '/');\n}\n"],
5
+ "mappings": "AAAA,SAAS,gCAAgC;AAQlC,SAAS,oBAAoB,QAAwB;AAC1D,SAAO,yBAAyB,QAAQ,GAAG;AAC7C;",
6
6
  "names": []
7
7
  }
@@ -5,4 +5,4 @@
5
5
  * @param {string} characters The characters to remove from the end.
6
6
  * @returns {string}
7
7
  */
8
- export default function withoutTrailingCharacters(string: string, characters: string): string;
8
+ export declare function withoutTrailingCharacters(string: string, characters: string): string;
@@ -2,6 +2,6 @@ function withoutTrailingCharacters(string, characters) {
2
2
  return string.replace(new RegExp(`${characters}$`), "");
3
3
  }
4
4
  export {
5
- withoutTrailingCharacters as default
5
+ withoutTrailingCharacters
6
6
  };
7
7
  //# sourceMappingURL=withoutTrailingCharacters.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/string/withoutTrailingCharacters.ts"],
4
- "sourcesContent": ["/**\n * Remove the given characters from the end of the given string.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to remove from the end.\n * @returns {string}\n */\nexport default function withoutTrailingCharacters(string: string, characters: string): string {\n return string.replace(new RegExp(`${characters}$`), '');\n}\n"],
5
- "mappings": "AAOe,SAAR,0BAA2C,QAAgB,YAA4B;AAC5F,SAAO,OAAO,QAAQ,IAAI,OAAO,GAAG,UAAU,GAAG,GAAG,EAAE;AACxD;",
4
+ "sourcesContent": ["/**\n * Remove the given characters from the end of the given string.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to remove from the end.\n * @returns {string}\n */\nexport function withoutTrailingCharacters(string: string, characters: string): string {\n return string.replace(new RegExp(`${characters}$`), '');\n}\n"],
5
+ "mappings": "AAOO,SAAS,0BAA0B,QAAgB,YAA4B;AACpF,SAAO,OAAO,QAAQ,IAAI,OAAO,GAAG,UAAU,GAAG,GAAG,EAAE;AACxD;",
6
6
  "names": []
7
7
  }
@@ -5,4 +5,4 @@
5
5
  * @param {string} characters The characters to add to the start.
6
6
  * @returns {string}
7
7
  */
8
- export default function withoutTrailingCharactersRecursive(string: string, characters: string): string;
8
+ export declare function withoutTrailingCharactersRecursive(string: string, characters: string): string;
@@ -1,4 +1,4 @@
1
- import withoutTrailingCharacters from "./withoutTrailingCharacters.js";
1
+ import { withoutTrailingCharacters } from "./withoutTrailingCharacters.js";
2
2
  function withoutTrailingCharactersRecursive(string, characters) {
3
3
  let str = withoutTrailingCharacters(string, characters);
4
4
  const regex = new RegExp(`${characters}$`);
@@ -8,6 +8,6 @@ function withoutTrailingCharactersRecursive(string, characters) {
8
8
  return str;
9
9
  }
10
10
  export {
11
- withoutTrailingCharactersRecursive as default
11
+ withoutTrailingCharactersRecursive
12
12
  };
13
13
  //# sourceMappingURL=withoutTrailingCharactersRecursive.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/string/withoutTrailingCharactersRecursive.ts"],
4
- "sourcesContent": ["import withoutTrailingCharacters from './withoutTrailingCharacters.js';\n\n/**\n * Remove the given characters to the start of the given string recursively.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to add to the start.\n * @returns {string}\n */\nexport default function withoutTrailingCharactersRecursive(\n string: string,\n characters: string,\n): string {\n let str = withoutTrailingCharacters(string, characters);\n const regex = new RegExp(`${characters}$`);\n\n while (regex.test(str)) {\n str = withoutTrailingCharacters(str, characters);\n }\n\n return str;\n}\n"],
5
- "mappings": "AAAA,OAAO,+BAA+B;AASvB,SAAR,mCACL,QACA,YACQ;AACR,MAAI,MAAM,0BAA0B,QAAQ,UAAU;AACtD,QAAM,QAAQ,IAAI,OAAO,GAAG,UAAU,GAAG;AAEzC,SAAO,MAAM,KAAK,GAAG,GAAG;AACtB,UAAM,0BAA0B,KAAK,UAAU;AAAA,EACjD;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import { withoutTrailingCharacters } from './withoutTrailingCharacters.js';\n\n/**\n * Remove the given characters to the start of the given string recursively.\n *\n * @param {string} string The string to modify.\n * @param {string} characters The characters to add to the start.\n * @returns {string}\n */\nexport function withoutTrailingCharactersRecursive(string: string, characters: string): string {\n let str = withoutTrailingCharacters(string, characters);\n const regex = new RegExp(`${characters}$`);\n\n while (regex.test(str)) {\n str = withoutTrailingCharacters(str, characters);\n }\n\n return str;\n}\n"],
5
+ "mappings": "AAAA,SAAS,iCAAiC;AASnC,SAAS,mCAAmC,QAAgB,YAA4B;AAC7F,MAAI,MAAM,0BAA0B,QAAQ,UAAU;AACtD,QAAM,QAAQ,IAAI,OAAO,GAAG,UAAU,GAAG;AAEzC,SAAO,MAAM,KAAK,GAAG,GAAG;AACtB,UAAM,0BAA0B,KAAK,UAAU;AAAA,EACjD;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -4,4 +4,4 @@
4
4
  * @param {string} string The string to modify.
5
5
  * @returns {string} The string without trailing slash.
6
6
  */
7
- export default function withoutTrailingSlash(string: string): string;
7
+ export declare function withoutTrailingSlash(string: string): string;
@@ -1,8 +1,8 @@
1
- import withoutTrailingCharacters from "./withoutTrailingCharacters.js";
1
+ import { withoutTrailingCharacters } from "./withoutTrailingCharacters.js";
2
2
  function withoutTrailingSlash(string) {
3
3
  return withoutTrailingCharacters(string, "/");
4
4
  }
5
5
  export {
6
- withoutTrailingSlash as default
6
+ withoutTrailingSlash
7
7
  };
8
8
  //# sourceMappingURL=withoutTrailingSlash.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/js-toolkit/utils/string/withoutTrailingSlash.ts"],
4
- "sourcesContent": ["import withoutTrailingCharacters from './withoutTrailingCharacters.js';\n\n/**\n * Remove the trailing slash from a string.\n *\n * @param {string} string The string to modify.\n * @returns {string} The string without trailing slash.\n */\nexport default function withoutTrailingSlash(string: string): string {\n return withoutTrailingCharacters(string, '/');\n}\n"],
5
- "mappings": "AAAA,OAAO,+BAA+B;AAQvB,SAAR,qBAAsC,QAAwB;AACnE,SAAO,0BAA0B,QAAQ,GAAG;AAC9C;",
4
+ "sourcesContent": ["import { withoutTrailingCharacters } from './withoutTrailingCharacters.js';\n\n/**\n * Remove the trailing slash from a string.\n *\n * @param {string} string The string to modify.\n * @returns {string} The string without trailing slash.\n */\nexport function withoutTrailingSlash(string: string): string {\n return withoutTrailingCharacters(string, '/');\n}\n"],
5
+ "mappings": "AAAA,SAAS,iCAAiC;AAQnC,SAAS,qBAAqB,QAAwB;AAC3D,SAAO,0BAA0B,QAAQ,GAAG;AAC9C;",
6
6
  "names": []
7
7
  }
@@ -5,4 +5,4 @@
5
5
  * @param {number} [delay] The delay in ms
6
6
  * @returns {Function} The throttled function.
7
7
  */
8
- export default function throttle(fn: (...args: unknown[]) => void, delay?: number): (...args: unknown[]) => void;
8
+ export declare function throttle(fn: (...args: unknown[]) => void, delay?: number): (...args: unknown[]) => void;
package/utils/throttle.js CHANGED
@@ -10,6 +10,6 @@ function throttle(fn, delay = 16) {
10
10
  };
11
11
  }
12
12
  export {
13
- throttle as default
13
+ throttle
14
14
  };
15
15
  //# sourceMappingURL=throttle.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/js-toolkit/utils/throttle.ts"],
4
- "sourcesContent": ["/**\n * Simple throttling helper that limits a function to only run once every {delay}ms.\n *\n * @param {Function} fn The function to throttle\n * @param {number} [delay] The delay in ms\n * @returns {Function} The throttled function.\n */\nexport default function throttle(\n fn: (...args: unknown[]) => void,\n delay = 16,\n): (...args: unknown[]) => void {\n let lastCall = 0;\n return function throttled(...args) {\n const now = Date.now();\n if (now - lastCall < delay) {\n return;\n }\n lastCall = now;\n // eslint-disable-next-line consistent-return\n return fn(...args);\n };\n}\n"],
5
- "mappings": "AAOe,SAAR,SACL,IACA,QAAQ,IACsB;AAC9B,MAAI,WAAW;AACf,SAAO,SAAS,aAAa,MAAM;AACjC,UAAM,MAAM,KAAK,IAAI;AACrB,QAAI,MAAM,WAAW,OAAO;AAC1B;AAAA,IACF;AACA,eAAW;AAEX,WAAO,GAAG,GAAG,IAAI;AAAA,EACnB;AACF;",
4
+ "sourcesContent": ["/**\n * Simple throttling helper that limits a function to only run once every {delay}ms.\n *\n * @param {Function} fn The function to throttle\n * @param {number} [delay] The delay in ms\n * @returns {Function} The throttled function.\n */\nexport function throttle(\n fn: (...args: unknown[]) => void,\n delay = 16,\n): (...args: unknown[]) => void {\n let lastCall = 0;\n return function throttled(...args) {\n const now = Date.now();\n if (now - lastCall < delay) {\n return;\n }\n lastCall = now;\n // eslint-disable-next-line consistent-return\n return fn(...args);\n };\n}\n"],
5
+ "mappings": "AAOO,SAAS,SACd,IACA,QAAQ,IACsB;AAC9B,MAAI,WAAW;AACf,SAAO,SAAS,aAAa,MAAM;AACjC,UAAM,MAAM,KAAK,IAAI;AACrB,QAAI,MAAM,WAAW,OAAO;AAC1B;AAAA,IACF;AACA,eAAW;AAEX,WAAO,GAAG,GAAG,IAAI;AAAA,EACnB;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import keyCodes from "./keyCodes.js";
1
+ import { keyCodes } from "./keyCodes.js";
2
2
  import { isFunction } from "./is.js";
3
3
  const FOCUSABLE_ELEMENTS = [
4
4
  'a[href]:not([tabindex^="-"]):not([inert])',
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/js-toolkit/utils/trapFocus.ts"],
4
- "sourcesContent": ["import keyCodes from './keyCodes.js';\nimport { isFunction } from './is.js';\n\nconst FOCUSABLE_ELEMENTS = [\n 'a[href]:not([tabindex^=\"-\"]):not([inert])',\n 'area[href]:not([tabindex^=\"-\"]):not([inert])',\n 'input:not([disabled]):not([inert])',\n 'select:not([disabled]):not([inert])',\n 'textarea:not([disabled]):not([inert])',\n 'button:not([disabled]):not([inert])',\n 'iframe:not([tabindex^=\"-\"]):not([inert])',\n 'audio:not([tabindex^=\"-\"]):not([inert])',\n 'video:not([tabindex^=\"-\"]):not([inert])',\n '[contenteditable]:not([tabindex^=\"-\"]):not([inert])',\n '[tabindex]:not([tabindex^=\"-\"]):not([inert])',\n];\n\nlet focusedBefore;\n\n/**\n * Save the current active element.\n */\nexport function saveActiveElement() {\n focusedBefore = document.activeElement;\n}\n\n/**\n * Trap tab navigation inside the given element.\n *\n * @param {HTMLElement} element The element in which to trap the tabulations.\n * @param {KeyboardEvent} event The keydown or keyup event.\n */\nexport function trapFocus(element: HTMLElement, event: KeyboardEvent) {\n if (event.keyCode !== keyCodes.TAB) {\n return;\n }\n\n // Save the previous focused element\n if (!focusedBefore) {\n focusedBefore = document.activeElement;\n }\n\n const focusableChildren: HTMLElement[] = Array.from(\n element.querySelectorAll(FOCUSABLE_ELEMENTS.join(', ')),\n ) as HTMLElement[];\n const focusedItemIndex =\n document.activeElement instanceof HTMLElement\n ? focusableChildren.indexOf(document.activeElement)\n : -1;\n\n if (!focusableChildren.length) {\n return;\n }\n\n if (focusedItemIndex < 0) {\n focusableChildren[0].focus();\n event.preventDefault();\n }\n\n // If the SHIFT key is being pressed while tabbing (moving backwards) and\n // the currently focused item is the first one, move the focus to the last\n // focusable item from the dialog element\n if (event.shiftKey && focusedItemIndex === 0) {\n focusableChildren.at(-1).focus();\n event.preventDefault();\n }\n\n // If the SHIFT key is not being pressed (moving forwards) and the currently\n // focused item is the last one, move the focus to the first focusable item\n // from the dialog element\n else if (!event.shiftKey && focusedItemIndex === focusableChildren.length - 1) {\n focusableChildren[0].focus();\n event.preventDefault();\n }\n}\n\n/**\n * Untrap the tab navigation.\n */\nexport function untrapFocus() {\n if (focusedBefore && isFunction(focusedBefore.focus)) {\n focusedBefore.focus();\n focusedBefore = null;\n }\n}\n"],
5
- "mappings": "AAAA,OAAO,cAAc;AACrB,SAAS,kBAAkB;AAE3B,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAI;AAKG,SAAS,oBAAoB;AAClC,kBAAgB,SAAS;AAC3B;AAQO,SAAS,UAAU,SAAsB,OAAsB;AACpE,MAAI,MAAM,YAAY,SAAS,KAAK;AAClC;AAAA,EACF;AAGA,MAAI,CAAC,eAAe;AAClB,oBAAgB,SAAS;AAAA,EAC3B;AAEA,QAAM,oBAAmC,MAAM;AAAA,IAC7C,QAAQ,iBAAiB,mBAAmB,KAAK,IAAI,CAAC;AAAA,EACxD;AACA,QAAM,mBACJ,SAAS,yBAAyB,cAC9B,kBAAkB,QAAQ,SAAS,aAAa,IAChD;AAEN,MAAI,CAAC,kBAAkB,QAAQ;AAC7B;AAAA,EACF;AAEA,MAAI,mBAAmB,GAAG;AACxB,sBAAkB,CAAC,EAAE,MAAM;AAC3B,UAAM,eAAe;AAAA,EACvB;AAKA,MAAI,MAAM,YAAY,qBAAqB,GAAG;AAC5C,sBAAkB,GAAG,EAAE,EAAE,MAAM;AAC/B,UAAM,eAAe;AAAA,EACvB,WAKS,CAAC,MAAM,YAAY,qBAAqB,kBAAkB,SAAS,GAAG;AAC7E,sBAAkB,CAAC,EAAE,MAAM;AAC3B,UAAM,eAAe;AAAA,EACvB;AACF;AAKO,SAAS,cAAc;AAC5B,MAAI,iBAAiB,WAAW,cAAc,KAAK,GAAG;AACpD,kBAAc,MAAM;AACpB,oBAAgB;AAAA,EAClB;AACF;",
4
+ "sourcesContent": ["import { keyCodes } from './keyCodes.js';\nimport { isFunction } from './is.js';\n\nconst FOCUSABLE_ELEMENTS = [\n 'a[href]:not([tabindex^=\"-\"]):not([inert])',\n 'area[href]:not([tabindex^=\"-\"]):not([inert])',\n 'input:not([disabled]):not([inert])',\n 'select:not([disabled]):not([inert])',\n 'textarea:not([disabled]):not([inert])',\n 'button:not([disabled]):not([inert])',\n 'iframe:not([tabindex^=\"-\"]):not([inert])',\n 'audio:not([tabindex^=\"-\"]):not([inert])',\n 'video:not([tabindex^=\"-\"]):not([inert])',\n '[contenteditable]:not([tabindex^=\"-\"]):not([inert])',\n '[tabindex]:not([tabindex^=\"-\"]):not([inert])',\n];\n\nlet focusedBefore;\n\n/**\n * Save the current active element.\n */\nexport function saveActiveElement() {\n focusedBefore = document.activeElement;\n}\n\n/**\n * Trap tab navigation inside the given element.\n *\n * @param {HTMLElement} element The element in which to trap the tabulations.\n * @param {KeyboardEvent} event The keydown or keyup event.\n */\nexport function trapFocus(element: HTMLElement, event: KeyboardEvent) {\n if (event.keyCode !== keyCodes.TAB) {\n return;\n }\n\n // Save the previous focused element\n if (!focusedBefore) {\n focusedBefore = document.activeElement;\n }\n\n const focusableChildren: HTMLElement[] = Array.from(\n element.querySelectorAll(FOCUSABLE_ELEMENTS.join(', ')),\n ) as HTMLElement[];\n const focusedItemIndex =\n document.activeElement instanceof HTMLElement\n ? focusableChildren.indexOf(document.activeElement)\n : -1;\n\n if (!focusableChildren.length) {\n return;\n }\n\n if (focusedItemIndex < 0) {\n focusableChildren[0].focus();\n event.preventDefault();\n }\n\n // If the SHIFT key is being pressed while tabbing (moving backwards) and\n // the currently focused item is the first one, move the focus to the last\n // focusable item from the dialog element\n if (event.shiftKey && focusedItemIndex === 0) {\n focusableChildren.at(-1).focus();\n event.preventDefault();\n }\n\n // If the SHIFT key is not being pressed (moving forwards) and the currently\n // focused item is the last one, move the focus to the first focusable item\n // from the dialog element\n else if (!event.shiftKey && focusedItemIndex === focusableChildren.length - 1) {\n focusableChildren[0].focus();\n event.preventDefault();\n }\n}\n\n/**\n * Untrap the tab navigation.\n */\nexport function untrapFocus() {\n if (focusedBefore && isFunction(focusedBefore.focus)) {\n focusedBefore.focus();\n focusedBefore = null;\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAE3B,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAI;AAKG,SAAS,oBAAoB;AAClC,kBAAgB,SAAS;AAC3B;AAQO,SAAS,UAAU,SAAsB,OAAsB;AACpE,MAAI,MAAM,YAAY,SAAS,KAAK;AAClC;AAAA,EACF;AAGA,MAAI,CAAC,eAAe;AAClB,oBAAgB,SAAS;AAAA,EAC3B;AAEA,QAAM,oBAAmC,MAAM;AAAA,IAC7C,QAAQ,iBAAiB,mBAAmB,KAAK,IAAI,CAAC;AAAA,EACxD;AACA,QAAM,mBACJ,SAAS,yBAAyB,cAC9B,kBAAkB,QAAQ,SAAS,aAAa,IAChD;AAEN,MAAI,CAAC,kBAAkB,QAAQ;AAC7B;AAAA,EACF;AAEA,MAAI,mBAAmB,GAAG;AACxB,sBAAkB,CAAC,EAAE,MAAM;AAC3B,UAAM,eAAe;AAAA,EACvB;AAKA,MAAI,MAAM,YAAY,qBAAqB,GAAG;AAC5C,sBAAkB,GAAG,EAAE,EAAE,MAAM;AAC/B,UAAM,eAAe;AAAA,EACvB,WAKS,CAAC,MAAM,YAAY,qBAAqB,kBAAkB,SAAS,GAAG;AAC7E,sBAAkB,CAAC,EAAE,MAAM;AAC3B,UAAM,eAAe;AAAA,EACvB;AACF;AAKO,SAAS,cAAc;AAC5B,MAAI,iBAAiB,WAAW,cAAc,KAAK,GAAG;AACpD,kBAAc,MAAM;AACpB,oBAAgB;AAAA,EAClB;AACF;",
6
6
  "names": []
7
7
  }