@studiometa/js-toolkit 2.12.0 → 3.0.0-alpha.1

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 (341) hide show
  1. package/Base/Base.d.ts +2 -2
  2. package/Base/Base.js +8 -45
  3. package/Base/Base.js.map +2 -2
  4. package/Base/features.d.ts +10 -2
  5. package/Base/features.js +23 -1
  6. package/Base/features.js.map +2 -2
  7. package/Base/managers/AbstractManager.d.ts +3 -3
  8. package/Base/managers/ActionManager.d.ts +4 -0
  9. package/Base/managers/ActionManager.js +10 -0
  10. package/Base/managers/ActionManager.js.map +7 -0
  11. package/Base/managers/ChildrenManager.d.ts +1 -1
  12. package/Base/managers/ServicesManager.d.ts +2 -4
  13. package/Base/managers/ServicesManager.js +2 -3
  14. package/Base/managers/ServicesManager.js.map +2 -2
  15. package/Base/utils.js +1 -1
  16. package/Base/utils.js.map +2 -2
  17. package/decorators/index.d.ts +0 -1
  18. package/decorators/index.js +0 -1
  19. package/decorators/index.js.map +2 -2
  20. package/decorators/withBreakpointObserver.js +1 -1
  21. package/decorators/withBreakpointObserver.js.map +2 -2
  22. package/decorators/withIntersectionObserver.js +1 -1
  23. package/decorators/withIntersectionObserver.js.map +2 -2
  24. package/decorators/withMountOnMediaQuery.js +1 -1
  25. package/decorators/withMountOnMediaQuery.js.map +2 -2
  26. package/decorators/withMountWhenInView.js +1 -1
  27. package/decorators/withMountWhenInView.js.map +2 -2
  28. package/decorators/withScrolledInView/utils.d.ts +12 -1
  29. package/decorators/withScrolledInView/utils.js.map +2 -2
  30. package/decorators/withScrolledInView/withScrolledInView.js +7 -62
  31. package/decorators/withScrolledInView/withScrolledInView.js.map +2 -2
  32. package/helpers/createApp.d.ts +2 -1
  33. package/helpers/createApp.js.map +2 -2
  34. package/package.json +2 -10
  35. package/services/index.d.ts +1 -1
  36. package/services/index.js.map +2 -2
  37. package/services/pointer.d.ts +1 -1
  38. package/services/pointer.js +3 -3
  39. package/services/pointer.js.map +2 -2
  40. package/services/raf.js +2 -4
  41. package/services/raf.js.map +2 -2
  42. package/services/resize.d.ts +7 -6
  43. package/services/resize.js +19 -26
  44. package/services/resize.js.map +2 -2
  45. package/services/scroll.js +8 -8
  46. package/services/scroll.js.map +2 -2
  47. package/utils/SmartQueue.d.ts +1 -1
  48. package/utils/SmartQueue.js +1 -1
  49. package/utils/SmartQueue.js.map +2 -2
  50. package/utils/css/animate.d.ts +33 -15
  51. package/utils/css/animate.js +67 -26
  52. package/utils/css/animate.js.map +2 -2
  53. package/utils/css/getOffsetSizes.js +2 -2
  54. package/utils/css/getOffsetSizes.js.map +1 -1
  55. package/utils/css/index.d.ts +2 -1
  56. package/utils/css/index.js +4 -4
  57. package/utils/css/index.js.map +2 -2
  58. package/utils/css/matrix.d.ts +1 -1
  59. package/utils/css/matrix.js.map +2 -2
  60. package/utils/css/transform.d.ts +1 -1
  61. package/utils/css/transform.js +1 -1
  62. package/utils/css/transform.js.map +2 -2
  63. package/utils/css/utils.d.ts +1 -1
  64. package/utils/css/utils.js +1 -1
  65. package/utils/css/utils.js.map +2 -2
  66. package/utils/index.d.ts +5 -4
  67. package/utils/index.js +16 -16
  68. package/utils/index.js.map +2 -2
  69. package/utils/is.d.ts +12 -0
  70. package/utils/is.js +17 -0
  71. package/utils/is.js.map +2 -2
  72. package/utils/math/ease.d.ts +1 -0
  73. package/utils/math/ease.js +2 -0
  74. package/utils/math/ease.js.map +2 -2
  75. package/utils/math/index.d.ts +4 -3
  76. package/utils/math/index.js +5 -3
  77. package/utils/math/index.js.map +2 -2
  78. package/utils/math/mean.d.ts +1 -0
  79. package/utils/math/mean.js +17 -0
  80. package/utils/math/mean.js.map +7 -0
  81. package/utils/nextFrame.d.ts +4 -22
  82. package/utils/nextFrame.js +3 -10
  83. package/utils/nextFrame.js.map +2 -2
  84. package/utils/nextMicrotask.d.ts +4 -1
  85. package/utils/nextMicrotask.js +3 -3
  86. package/utils/nextMicrotask.js.map +2 -2
  87. package/utils/nextTick.d.ts +4 -1
  88. package/utils/nextTick.js +3 -3
  89. package/utils/nextTick.js.map +2 -2
  90. package/utils/random.d.ts +15 -0
  91. package/utils/random.js +15 -0
  92. package/utils/random.js.map +7 -0
  93. package/utils/scrollTo.d.ts +30 -6
  94. package/utils/scrollTo.js +97 -43
  95. package/utils/scrollTo.js.map +2 -2
  96. package/utils/{focusTrap.d.ts → trapFocus.d.ts} +2 -10
  97. package/utils/{focusTrap.js → trapFocus.js} +5 -9
  98. package/utils/trapFocus.js.map +7 -0
  99. package/utils/tween.d.ts +59 -10
  100. package/utils/tween.js +24 -18
  101. package/utils/tween.js.map +2 -2
  102. package/Base/Base.cjs +0 -420
  103. package/Base/Base.cjs.map +0 -7
  104. package/Base/features.cjs +0 -27
  105. package/Base/features.cjs.map +0 -7
  106. package/Base/index.cjs +0 -21
  107. package/Base/index.cjs.map +0 -7
  108. package/Base/managers/AbstractManager.cjs +0 -78
  109. package/Base/managers/AbstractManager.cjs.map +0 -7
  110. package/Base/managers/ChildrenManager.cjs +0 -156
  111. package/Base/managers/ChildrenManager.cjs.map +0 -7
  112. package/Base/managers/EventsManager.cjs +0 -305
  113. package/Base/managers/EventsManager.cjs.map +0 -7
  114. package/Base/managers/OptionsManager.cjs +0 -198
  115. package/Base/managers/OptionsManager.cjs.map +0 -7
  116. package/Base/managers/RefsManager.cjs +0 -118
  117. package/Base/managers/RefsManager.cjs.map +0 -7
  118. package/Base/managers/ResponsiveOptionsManager.cjs +0 -79
  119. package/Base/managers/ResponsiveOptionsManager.cjs.map +0 -7
  120. package/Base/managers/ServicesManager.cjs +0 -161
  121. package/Base/managers/ServicesManager.cjs.map +0 -7
  122. package/Base/managers/index.cjs +0 -39
  123. package/Base/managers/index.cjs.map +0 -7
  124. package/Base/types.cjs +0 -19
  125. package/Base/types.cjs.map +0 -7
  126. package/Base/utils.cjs +0 -95
  127. package/Base/utils.cjs.map +0 -7
  128. package/decorators/index.cjs +0 -33
  129. package/decorators/index.cjs.map +0 -7
  130. package/decorators/withBreakpointManager.cjs +0 -102
  131. package/decorators/withBreakpointManager.cjs.map +0 -7
  132. package/decorators/withBreakpointObserver.cjs +0 -128
  133. package/decorators/withBreakpointObserver.cjs.map +0 -7
  134. package/decorators/withDrag.cjs +0 -56
  135. package/decorators/withDrag.cjs.map +0 -7
  136. package/decorators/withExtraConfig.cjs +0 -50
  137. package/decorators/withExtraConfig.cjs.map +0 -7
  138. package/decorators/withFreezedOptions.cjs +0 -50
  139. package/decorators/withFreezedOptions.cjs.map +0 -7
  140. package/decorators/withIntersectionObserver.cjs +0 -71
  141. package/decorators/withIntersectionObserver.cjs.map +0 -7
  142. package/decorators/withMountOnMediaQuery.cjs +0 -86
  143. package/decorators/withMountOnMediaQuery.cjs.map +0 -7
  144. package/decorators/withMountWhenInView.cjs +0 -92
  145. package/decorators/withMountWhenInView.cjs.map +0 -7
  146. package/decorators/withMountWhenPrefersMotion.cjs +0 -30
  147. package/decorators/withMountWhenPrefersMotion.cjs.map +0 -7
  148. package/decorators/withRelativePointer.cjs +0 -56
  149. package/decorators/withRelativePointer.cjs.map +0 -7
  150. package/decorators/withResponsiveOptions.cjs +0 -41
  151. package/decorators/withResponsiveOptions.cjs.map +0 -7
  152. package/decorators/withScrolledInView/index.cjs +0 -22
  153. package/decorators/withScrolledInView/index.cjs.map +0 -7
  154. package/decorators/withScrolledInView/types.cjs +0 -19
  155. package/decorators/withScrolledInView/types.cjs.map +0 -7
  156. package/decorators/withScrolledInView/utils.cjs +0 -99
  157. package/decorators/withScrolledInView/utils.cjs.map +0 -7
  158. package/decorators/withScrolledInView/withScrolledInView.cjs +0 -249
  159. package/decorators/withScrolledInView/withScrolledInView.cjs.map +0 -7
  160. package/decorators/withVue2.cjs +0 -68
  161. package/decorators/withVue2.cjs.map +0 -7
  162. package/decorators/withVue2.d.ts +0 -16
  163. package/decorators/withVue2.js +0 -46
  164. package/decorators/withVue2.js.map +0 -7
  165. package/helpers/createApp.cjs +0 -58
  166. package/helpers/createApp.cjs.map +0 -7
  167. package/helpers/getClosestParent.cjs +0 -45
  168. package/helpers/getClosestParent.cjs.map +0 -7
  169. package/helpers/getDirectChildren.cjs +0 -47
  170. package/helpers/getDirectChildren.cjs.map +0 -7
  171. package/helpers/getInstanceFromElement.cjs +0 -32
  172. package/helpers/getInstanceFromElement.cjs.map +0 -7
  173. package/helpers/importOnInteraction.cjs +0 -48
  174. package/helpers/importOnInteraction.cjs.map +0 -7
  175. package/helpers/importOnMediaQuery.cjs +0 -44
  176. package/helpers/importOnMediaQuery.cjs.map +0 -7
  177. package/helpers/importWhenIdle.cjs +0 -46
  178. package/helpers/importWhenIdle.cjs.map +0 -7
  179. package/helpers/importWhenPrefersMotion.cjs +0 -40
  180. package/helpers/importWhenPrefersMotion.cjs.map +0 -7
  181. package/helpers/importWhenVisible.cjs +0 -44
  182. package/helpers/importWhenVisible.cjs.map +0 -7
  183. package/helpers/index.cjs +0 -53
  184. package/helpers/index.cjs.map +0 -7
  185. package/helpers/utils.cjs +0 -37
  186. package/helpers/utils.cjs.map +0 -7
  187. package/index.cjs +0 -31
  188. package/index.cjs.map +0 -7
  189. package/services/drag.cjs +0 -231
  190. package/services/drag.cjs.map +0 -7
  191. package/services/index.cjs +0 -51
  192. package/services/index.cjs.map +0 -7
  193. package/services/key.cjs +0 -97
  194. package/services/key.cjs.map +0 -7
  195. package/services/load.cjs +0 -60
  196. package/services/load.cjs.map +0 -7
  197. package/services/pointer.cjs +0 -145
  198. package/services/pointer.cjs.map +0 -7
  199. package/services/raf.cjs +0 -80
  200. package/services/raf.cjs.map +0 -7
  201. package/services/resize.cjs +0 -107
  202. package/services/resize.cjs.map +0 -7
  203. package/services/scroll.cjs +0 -119
  204. package/services/scroll.cjs.map +0 -7
  205. package/services/service.cjs +0 -69
  206. package/services/service.cjs.map +0 -7
  207. package/utils/Queue.cjs +0 -93
  208. package/utils/Queue.cjs.map +0 -7
  209. package/utils/SmartQueue.cjs +0 -73
  210. package/utils/SmartQueue.cjs.map +0 -7
  211. package/utils/collide/boundingRectToCircle.cjs +0 -36
  212. package/utils/collide/boundingRectToCircle.cjs.map +0 -7
  213. package/utils/collide/collideCircleCircle.cjs +0 -35
  214. package/utils/collide/collideCircleCircle.cjs.map +0 -7
  215. package/utils/collide/collideCircleRect.cjs +0 -47
  216. package/utils/collide/collideCircleRect.cjs.map +0 -7
  217. package/utils/collide/collidePointCircle.cjs +0 -32
  218. package/utils/collide/collidePointCircle.cjs.map +0 -7
  219. package/utils/collide/collidePointRect.cjs +0 -32
  220. package/utils/collide/collidePointRect.cjs.map +0 -7
  221. package/utils/collide/collideRectRect.cjs +0 -32
  222. package/utils/collide/collideRectRect.cjs.map +0 -7
  223. package/utils/collide/index.cjs +0 -47
  224. package/utils/collide/index.cjs.map +0 -7
  225. package/utils/css/animate.cjs +0 -202
  226. package/utils/css/animate.cjs.map +0 -7
  227. package/utils/css/classes.cjs +0 -51
  228. package/utils/css/classes.cjs.map +0 -7
  229. package/utils/css/getOffsetSizes.cjs +0 -48
  230. package/utils/css/getOffsetSizes.cjs.map +0 -7
  231. package/utils/css/index.cjs +0 -52
  232. package/utils/css/index.cjs.map +0 -7
  233. package/utils/css/matrix.cjs +0 -30
  234. package/utils/css/matrix.cjs.map +0 -7
  235. package/utils/css/styles.cjs +0 -45
  236. package/utils/css/styles.cjs.map +0 -7
  237. package/utils/css/transform.cjs +0 -91
  238. package/utils/css/transform.cjs.map +0 -7
  239. package/utils/css/transition.cjs +0 -145
  240. package/utils/css/transition.cjs.map +0 -7
  241. package/utils/css/utils.cjs +0 -32
  242. package/utils/css/utils.cjs.map +0 -7
  243. package/utils/debounce.cjs +0 -35
  244. package/utils/debounce.cjs.map +0 -7
  245. package/utils/dom/ancestors.cjs +0 -37
  246. package/utils/dom/ancestors.cjs.map +0 -7
  247. package/utils/dom/index.cjs +0 -21
  248. package/utils/dom/index.cjs.map +0 -7
  249. package/utils/focusTrap.cjs +0 -93
  250. package/utils/focusTrap.cjs.map +0 -7
  251. package/utils/focusTrap.js.map +0 -7
  252. package/utils/getComponentResolver.cjs +0 -38
  253. package/utils/getComponentResolver.cjs.map +0 -7
  254. package/utils/has.cjs +0 -29
  255. package/utils/has.cjs.map +0 -7
  256. package/utils/history.cjs +0 -92
  257. package/utils/history.cjs.map +0 -7
  258. package/utils/index.cjs +0 -76
  259. package/utils/index.cjs.map +0 -7
  260. package/utils/is.cjs +0 -41
  261. package/utils/is.cjs.map +0 -7
  262. package/utils/keyCodes.cjs +0 -36
  263. package/utils/keyCodes.cjs.map +0 -7
  264. package/utils/math/clamp.cjs +0 -29
  265. package/utils/math/clamp.cjs.map +0 -7
  266. package/utils/math/clamp01.cjs +0 -40
  267. package/utils/math/clamp01.cjs.map +0 -7
  268. package/utils/math/createEases.cjs +0 -33
  269. package/utils/math/createEases.cjs.map +0 -7
  270. package/utils/math/damp.cjs +0 -29
  271. package/utils/math/damp.cjs.map +0 -7
  272. package/utils/math/ease.cjs +0 -82
  273. package/utils/math/ease.cjs.map +0 -7
  274. package/utils/math/index.cjs +0 -54
  275. package/utils/math/index.cjs.map +0 -7
  276. package/utils/math/inertiaFinalValue.cjs +0 -47
  277. package/utils/math/inertiaFinalValue.cjs.map +0 -7
  278. package/utils/math/lerp.cjs +0 -29
  279. package/utils/math/lerp.cjs.map +0 -7
  280. package/utils/math/map.cjs +0 -29
  281. package/utils/math/map.cjs.map +0 -7
  282. package/utils/math/round.cjs +0 -29
  283. package/utils/math/round.cjs.map +0 -7
  284. package/utils/memoize.cjs +0 -48
  285. package/utils/memoize.cjs.map +0 -7
  286. package/utils/nextFrame.cjs +0 -41
  287. package/utils/nextFrame.cjs.map +0 -7
  288. package/utils/nextMicrotask.cjs +0 -30
  289. package/utils/nextMicrotask.cjs.map +0 -7
  290. package/utils/nextTick.cjs +0 -31
  291. package/utils/nextTick.cjs.map +0 -7
  292. package/utils/noop.cjs +0 -32
  293. package/utils/noop.cjs.map +0 -7
  294. package/utils/object/autoBind.cjs +0 -60
  295. package/utils/object/autoBind.cjs.map +0 -7
  296. package/utils/object/autoBind.d.ts +0 -14
  297. package/utils/object/autoBind.js +0 -28
  298. package/utils/object/autoBind.js.map +0 -7
  299. package/utils/object/getAllProperties.cjs +0 -39
  300. package/utils/object/getAllProperties.cjs.map +0 -7
  301. package/utils/object/index.cjs +0 -39
  302. package/utils/object/index.cjs.map +0 -7
  303. package/utils/object/index.d.ts +0 -2
  304. package/utils/object/index.js +0 -7
  305. package/utils/object/index.js.map +0 -7
  306. package/utils/scheduler.cjs +0 -75
  307. package/utils/scheduler.cjs.map +0 -7
  308. package/utils/scrollTo.cjs +0 -88
  309. package/utils/scrollTo.cjs.map +0 -7
  310. package/utils/string/endsWith.cjs +0 -35
  311. package/utils/string/endsWith.cjs.map +0 -7
  312. package/utils/string/index.cjs +0 -58
  313. package/utils/string/index.cjs.map +0 -7
  314. package/utils/string/startsWith.cjs +0 -35
  315. package/utils/string/startsWith.cjs.map +0 -7
  316. package/utils/string/withLeadingCharacters.cjs +0 -40
  317. package/utils/string/withLeadingCharacters.cjs.map +0 -7
  318. package/utils/string/withLeadingSlash.cjs +0 -40
  319. package/utils/string/withLeadingSlash.cjs.map +0 -7
  320. package/utils/string/withTrailingCharacters.cjs +0 -40
  321. package/utils/string/withTrailingCharacters.cjs.map +0 -7
  322. package/utils/string/withTrailingSlash.cjs +0 -40
  323. package/utils/string/withTrailingSlash.cjs.map +0 -7
  324. package/utils/string/withoutLeadingCharacters.cjs +0 -29
  325. package/utils/string/withoutLeadingCharacters.cjs.map +0 -7
  326. package/utils/string/withoutLeadingCharactersRecursive.cjs +0 -45
  327. package/utils/string/withoutLeadingCharactersRecursive.cjs.map +0 -7
  328. package/utils/string/withoutLeadingSlash.cjs +0 -40
  329. package/utils/string/withoutLeadingSlash.cjs.map +0 -7
  330. package/utils/string/withoutTrailingCharacters.cjs +0 -29
  331. package/utils/string/withoutTrailingCharacters.cjs.map +0 -7
  332. package/utils/string/withoutTrailingCharactersRecursive.cjs +0 -45
  333. package/utils/string/withoutTrailingCharactersRecursive.cjs.map +0 -7
  334. package/utils/string/withoutTrailingSlash.cjs +0 -40
  335. package/utils/string/withoutTrailingSlash.cjs.map +0 -7
  336. package/utils/throttle.cjs +0 -37
  337. package/utils/throttle.cjs.map +0 -7
  338. package/utils/tween.cjs +0 -122
  339. package/utils/tween.cjs.map +0 -7
  340. package/utils/wait.cjs +0 -31
  341. package/utils/wait.cjs.map +0 -7
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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;AAAA;AAAA;AAAA;AAAA;AAAA,sCAAqC;AAStB,SAAR,sBAAuC,QAAgB,YAA4B;AACxF,SAAO,GAAG,UAAU,OAAG,gCAAAA,SAAyB,QAAQ,UAAU,CAAC;AACrE;",
6
- "names": ["withoutLeadingCharacters"]
7
- }
@@ -1,40 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // packages/js-toolkit/utils/string/withLeadingSlash.ts
30
- var withLeadingSlash_exports = {};
31
- __export(withLeadingSlash_exports, {
32
- default: () => withLeadingSlash
33
- });
34
- module.exports = __toCommonJS(withLeadingSlash_exports);
35
- var import_withLeadingCharacters = __toESM(require("./withLeadingCharacters.cjs"), 1);
36
- function withLeadingSlash(string) {
37
- return (0, import_withLeadingCharacters.default)(string, "/");
38
- }
39
- if (module.exports.default) module.exports = module.exports.default;
40
- //# sourceMappingURL=withLeadingSlash.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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;AAAA;AAAA;AAAA;AAAA;AAAA,mCAAkC;AAQnB,SAAR,iBAAkC,QAAwB;AAC/D,aAAO,6BAAAA,SAAsB,QAAQ,GAAG;AAC1C;",
6
- "names": ["withLeadingCharacters"]
7
- }
@@ -1,40 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // packages/js-toolkit/utils/string/withTrailingCharacters.ts
30
- var withTrailingCharacters_exports = {};
31
- __export(withTrailingCharacters_exports, {
32
- default: () => withTrailingCharacters
33
- });
34
- module.exports = __toCommonJS(withTrailingCharacters_exports);
35
- var import_withoutTrailingCharacters = __toESM(require("./withoutTrailingCharacters.cjs"), 1);
36
- function withTrailingCharacters(string, characters) {
37
- return `${(0, import_withoutTrailingCharacters.default)(string, characters)}${characters}`;
38
- }
39
- if (module.exports.default) module.exports = module.exports.default;
40
- //# sourceMappingURL=withTrailingCharacters.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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;AAAA;AAAA;AAAA;AAAA;AAAA,uCAAsC;AASvB,SAAR,uBAAwC,QAAgB,YAA4B;AACzF,SAAO,OAAG,iCAAAA,SAA0B,QAAQ,UAAU,CAAC,GAAG,UAAU;AACtE;",
6
- "names": ["withoutTrailingCharacters"]
7
- }
@@ -1,40 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // packages/js-toolkit/utils/string/withTrailingSlash.ts
30
- var withTrailingSlash_exports = {};
31
- __export(withTrailingSlash_exports, {
32
- default: () => withTrailingSlash
33
- });
34
- module.exports = __toCommonJS(withTrailingSlash_exports);
35
- var import_withTrailingCharacters = __toESM(require("./withTrailingCharacters.cjs"), 1);
36
- function withTrailingSlash(string) {
37
- return (0, import_withTrailingCharacters.default)(string, "/");
38
- }
39
- if (module.exports.default) module.exports = module.exports.default;
40
- //# sourceMappingURL=withTrailingSlash.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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;AAAA;AAAA;AAAA;AAAA;AAAA,oCAAmC;AAQpB,SAAR,kBAAmC,QAAwB;AAChE,aAAO,8BAAAA,SAAuB,QAAQ,GAAG;AAC3C;",
6
- "names": ["withTrailingCharacters"]
7
- }
@@ -1,29 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/js-toolkit/utils/string/withoutLeadingCharacters.ts
20
- var withoutLeadingCharacters_exports = {};
21
- __export(withoutLeadingCharacters_exports, {
22
- default: () => withoutLeadingCharacters
23
- });
24
- module.exports = __toCommonJS(withoutLeadingCharacters_exports);
25
- function withoutLeadingCharacters(string, characters) {
26
- return string.replace(new RegExp(`^${characters}`), "");
27
- }
28
- if (module.exports.default) module.exports = module.exports.default;
29
- //# sourceMappingURL=withoutLeadingCharacters.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOe,SAAR,yBAA0C,QAAgB,YAA4B;AAC3F,SAAO,OAAO,QAAQ,IAAI,OAAO,IAAI,UAAU,EAAE,GAAG,EAAE;AACxD;",
6
- "names": []
7
- }
@@ -1,45 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // packages/js-toolkit/utils/string/withoutLeadingCharactersRecursive.ts
30
- var withoutLeadingCharactersRecursive_exports = {};
31
- __export(withoutLeadingCharactersRecursive_exports, {
32
- default: () => withoutLeadingCharactersRecursive
33
- });
34
- module.exports = __toCommonJS(withoutLeadingCharactersRecursive_exports);
35
- var import_withoutLeadingCharacters = __toESM(require("./withoutLeadingCharacters.cjs"), 1);
36
- function withoutLeadingCharactersRecursive(string, characters) {
37
- let str = (0, import_withoutLeadingCharacters.default)(string, characters);
38
- const regex = new RegExp(`^${characters}`);
39
- while (regex.test(str)) {
40
- str = (0, import_withoutLeadingCharacters.default)(str, characters);
41
- }
42
- return str;
43
- }
44
- if (module.exports.default) module.exports = module.exports.default;
45
- //# sourceMappingURL=withoutLeadingCharactersRecursive.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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;AAAA;AAAA;AAAA;AAAA;AAAA,sCAAqC;AAStB,SAAR,kCACL,QACA,YACQ;AACR,MAAI,UAAM,gCAAAA,SAAyB,QAAQ,UAAU;AACrD,QAAM,QAAQ,IAAI,OAAO,IAAI,UAAU,EAAE;AAEzC,SAAO,MAAM,KAAK,GAAG,GAAG;AACtB,cAAM,gCAAAA,SAAyB,KAAK,UAAU;AAAA,EAChD;AAEA,SAAO;AACT;",
6
- "names": ["withoutLeadingCharacters"]
7
- }
@@ -1,40 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // packages/js-toolkit/utils/string/withoutLeadingSlash.ts
30
- var withoutLeadingSlash_exports = {};
31
- __export(withoutLeadingSlash_exports, {
32
- default: () => withoutLeadingSlash
33
- });
34
- module.exports = __toCommonJS(withoutLeadingSlash_exports);
35
- var import_withoutLeadingCharacters = __toESM(require("./withoutLeadingCharacters.cjs"), 1);
36
- function withoutLeadingSlash(string) {
37
- return (0, import_withoutLeadingCharacters.default)(string, "/");
38
- }
39
- if (module.exports.default) module.exports = module.exports.default;
40
- //# sourceMappingURL=withoutLeadingSlash.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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;AAAA;AAAA;AAAA;AAAA;AAAA,sCAAqC;AAQtB,SAAR,oBAAqC,QAAwB;AAClE,aAAO,gCAAAA,SAAyB,QAAQ,GAAG;AAC7C;",
6
- "names": ["withoutLeadingCharacters"]
7
- }
@@ -1,29 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/js-toolkit/utils/string/withoutTrailingCharacters.ts
20
- var withoutTrailingCharacters_exports = {};
21
- __export(withoutTrailingCharacters_exports, {
22
- default: () => withoutTrailingCharacters
23
- });
24
- module.exports = __toCommonJS(withoutTrailingCharacters_exports);
25
- function withoutTrailingCharacters(string, characters) {
26
- return string.replace(new RegExp(`${characters}$`), "");
27
- }
28
- if (module.exports.default) module.exports = module.exports.default;
29
- //# sourceMappingURL=withoutTrailingCharacters.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOe,SAAR,0BAA2C,QAAgB,YAA4B;AAC5F,SAAO,OAAO,QAAQ,IAAI,OAAO,GAAG,UAAU,GAAG,GAAG,EAAE;AACxD;",
6
- "names": []
7
- }
@@ -1,45 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // packages/js-toolkit/utils/string/withoutTrailingCharactersRecursive.ts
30
- var withoutTrailingCharactersRecursive_exports = {};
31
- __export(withoutTrailingCharactersRecursive_exports, {
32
- default: () => withoutTrailingCharactersRecursive
33
- });
34
- module.exports = __toCommonJS(withoutTrailingCharactersRecursive_exports);
35
- var import_withoutTrailingCharacters = __toESM(require("./withoutTrailingCharacters.cjs"), 1);
36
- function withoutTrailingCharactersRecursive(string, characters) {
37
- let str = (0, import_withoutTrailingCharacters.default)(string, characters);
38
- const regex = new RegExp(`${characters}$`);
39
- while (regex.test(str)) {
40
- str = (0, import_withoutTrailingCharacters.default)(str, characters);
41
- }
42
- return str;
43
- }
44
- if (module.exports.default) module.exports = module.exports.default;
45
- //# sourceMappingURL=withoutTrailingCharactersRecursive.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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;AAAA;AAAA;AAAA;AAAA;AAAA,uCAAsC;AASvB,SAAR,mCACL,QACA,YACQ;AACR,MAAI,UAAM,iCAAAA,SAA0B,QAAQ,UAAU;AACtD,QAAM,QAAQ,IAAI,OAAO,GAAG,UAAU,GAAG;AAEzC,SAAO,MAAM,KAAK,GAAG,GAAG;AACtB,cAAM,iCAAAA,SAA0B,KAAK,UAAU;AAAA,EACjD;AAEA,SAAO;AACT;",
6
- "names": ["withoutTrailingCharacters"]
7
- }
@@ -1,40 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // packages/js-toolkit/utils/string/withoutTrailingSlash.ts
30
- var withoutTrailingSlash_exports = {};
31
- __export(withoutTrailingSlash_exports, {
32
- default: () => withoutTrailingSlash
33
- });
34
- module.exports = __toCommonJS(withoutTrailingSlash_exports);
35
- var import_withoutTrailingCharacters = __toESM(require("./withoutTrailingCharacters.cjs"), 1);
36
- function withoutTrailingSlash(string) {
37
- return (0, import_withoutTrailingCharacters.default)(string, "/");
38
- }
39
- if (module.exports.default) module.exports = module.exports.default;
40
- //# sourceMappingURL=withoutTrailingSlash.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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;AAAA;AAAA;AAAA;AAAA;AAAA,uCAAsC;AAQvB,SAAR,qBAAsC,QAAwB;AACnE,aAAO,iCAAAA,SAA0B,QAAQ,GAAG;AAC9C;",
6
- "names": ["withoutTrailingCharacters"]
7
- }
@@ -1,37 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/js-toolkit/utils/throttle.ts
20
- var throttle_exports = {};
21
- __export(throttle_exports, {
22
- default: () => throttle
23
- });
24
- module.exports = __toCommonJS(throttle_exports);
25
- function throttle(fn, delay = 16) {
26
- let lastCall = 0;
27
- return function throttled(...args) {
28
- const now = Date.now();
29
- if (now - lastCall < delay) {
30
- return;
31
- }
32
- lastCall = now;
33
- return fn(...args);
34
- };
35
- }
36
- if (module.exports.default) module.exports = module.exports.default;
37
- //# sourceMappingURL=throttle.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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;",
6
- "names": []
7
- }
package/utils/tween.cjs DELETED
@@ -1,122 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // packages/js-toolkit/utils/tween.ts
30
- var tween_exports = {};
31
- __export(tween_exports, {
32
- normalizeEase: () => normalizeEase,
33
- tween: () => tween
34
- });
35
- module.exports = __toCommonJS(tween_exports);
36
- var import_easing = require("@motionone/easing");
37
- var import_math = require("./math/index.cjs");
38
- var import_is = require("./is.cjs");
39
- var import_noop = require("./noop.cjs");
40
- var import_raf = __toESM(require("../services/raf.cjs"), 1);
41
- var id = 0;
42
- var DEFAULT_PROGRESS_PRECISION = 1e-4;
43
- function normalizeEase(ease) {
44
- if (!(0, import_is.isDefined)(ease)) {
45
- return import_noop.noopValue;
46
- }
47
- if ((0, import_is.isArray)(ease)) {
48
- return (0, import_easing.cubicBezier)(...ease);
49
- }
50
- return ease;
51
- }
52
- function tween(callback, options = {}) {
53
- const raf = (0, import_raf.default)();
54
- let progressValue = 0;
55
- let easedProgress = 0;
56
- const precision = options.precision ?? DEFAULT_PROGRESS_PRECISION;
57
- const ease = normalizeEase(options.easing);
58
- let duration = options.duration ?? 1;
59
- duration *= 1e3;
60
- let startTime = performance.now();
61
- let endTime = startTime + duration;
62
- const key = `tw-${id}`;
63
- id += 1;
64
- const { onStart = import_noop.noop, onProgress = import_noop.noop, onFinish = import_noop.noop } = options;
65
- let isRunning = false;
66
- function pause() {
67
- isRunning = false;
68
- raf.remove(key);
69
- }
70
- function progress(newProgress) {
71
- if (typeof newProgress === "undefined") {
72
- return easedProgress;
73
- }
74
- progressValue = newProgress;
75
- easedProgress = ease(progressValue);
76
- if (Math.abs(1 - easedProgress) < precision) {
77
- progressValue = 1;
78
- easedProgress = 1;
79
- }
80
- callback(easedProgress);
81
- onProgress(progressValue, easedProgress);
82
- if (easedProgress === 1) {
83
- pause();
84
- requestAnimationFrame(() => onFinish(progressValue, easedProgress));
85
- }
86
- return progressValue;
87
- }
88
- function tick(props) {
89
- if (!isRunning) {
90
- raf.remove(key);
91
- return;
92
- }
93
- progress((0, import_math.clamp01)((0, import_math.map)(props.time, startTime, endTime, 0, 1)));
94
- }
95
- function start() {
96
- onStart();
97
- startTime = performance.now();
98
- endTime = startTime + duration;
99
- progressValue = 0;
100
- easedProgress = 0;
101
- isRunning = true;
102
- raf.add(key, tick);
103
- }
104
- function play() {
105
- if (isRunning) {
106
- return;
107
- }
108
- startTime = performance.now() - (0, import_math.lerp)(0, duration, progressValue);
109
- endTime = startTime + duration;
110
- isRunning = true;
111
- raf.add(key, tick);
112
- }
113
- return {
114
- start,
115
- finish: () => progress(1),
116
- pause,
117
- play,
118
- progress
119
- };
120
- }
121
- if (module.exports.default) module.exports = module.exports.default;
122
- //# sourceMappingURL=tween.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../packages/js-toolkit/utils/tween.ts"],
4
- "sourcesContent": ["import { cubicBezier } from '@motionone/easing';\nimport { lerp, map, clamp01 } from './math/index.js';\nimport { isDefined, isArray } from './is.js';\nimport { noop, noopValue as linear } from './noop.js';\nimport useRaf from '../services/raf.js';\nimport type { EasingFunction } from './math/createEases.js';\n\nlet id = 0;\nconst DEFAULT_PROGRESS_PRECISION = 0.0001;\n\nexport type BezierCurve = [number, number, number, number];\n\nexport interface TweenOptions {\n duration?: number;\n easing?: EasingFunction | BezierCurve;\n precision?: number;\n onStart?: () => void;\n onProgress?: (progress: number, easedProgress: number) => void;\n onFinish?: (progress: number, easedProgress: number) => void;\n}\n\n/**\n * Normalize a easing function with default fallbacks.\n */\nexport function normalizeEase(ease: EasingFunction | BezierCurve): EasingFunction {\n if (!isDefined(ease)) {\n return linear;\n }\n\n if (isArray(ease)) {\n return cubicBezier(...ease);\n }\n\n return ease;\n}\n\n/**\n * Tween from 0 to 1.\n */\nexport function tween(callback: (progress: number) => unknown, options: TweenOptions = {}) {\n const raf = useRaf();\n\n let progressValue = 0;\n let easedProgress = 0;\n\n const precision = options.precision ?? DEFAULT_PROGRESS_PRECISION;\n const ease = normalizeEase(options.easing);\n let duration = options.duration ?? 1;\n duration *= 1000;\n\n let startTime = performance.now();\n let endTime = startTime + duration;\n\n const key = `tw-${id}`;\n id += 1;\n\n const { onStart = noop, onProgress = noop, onFinish = noop } = options;\n let isRunning = false;\n\n /**\n * Pause the animation.\n */\n function pause() {\n isRunning = false;\n raf.remove(key);\n }\n\n /**\n * Set the progress value.\n */\n function progress(newProgress: number) {\n if (typeof newProgress === 'undefined') {\n return easedProgress;\n }\n\n progressValue = newProgress;\n easedProgress = ease(progressValue);\n\n // Stop when reaching precision\n if (Math.abs(1 - easedProgress) < precision) {\n progressValue = 1;\n easedProgress = 1;\n }\n\n callback(easedProgress);\n onProgress(progressValue, easedProgress);\n\n if (easedProgress === 1) {\n pause();\n requestAnimationFrame(() => onFinish(progressValue, easedProgress));\n }\n\n return progressValue;\n }\n\n /**\n * Loop for rendering the animation.\n */\n function tick(props: { time: number }) {\n if (!isRunning) {\n raf.remove(key);\n return;\n }\n\n progress(clamp01(map(props.time, startTime, endTime, 0, 1)));\n }\n\n /**\n * Play the animation.\n */\n function start() {\n onStart();\n startTime = performance.now();\n endTime = startTime + duration;\n progressValue = 0;\n easedProgress = 0;\n isRunning = true;\n\n raf.add(key, tick);\n }\n\n /**\n * Play a paused animation.\n */\n function play() {\n if (isRunning) {\n return;\n }\n\n startTime = performance.now() - lerp(0, duration, progressValue);\n endTime = startTime + duration;\n isRunning = true;\n\n raf.add(key, tick);\n }\n\n return {\n start,\n finish: () => progress(1),\n pause,\n play,\n progress,\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA4B;AAC5B,kBAAmC;AACnC,gBAAmC;AACnC,kBAA0C;AAC1C,iBAAmB;AAGnB,IAAI,KAAK;AACT,IAAM,6BAA6B;AAgB5B,SAAS,cAAc,MAAoD;AAChF,MAAI,KAAC,qBAAU,IAAI,GAAG;AACpB,WAAO,YAAAA;AAAA,EACT;AAEA,UAAI,mBAAQ,IAAI,GAAG;AACjB,eAAO,2BAAY,GAAG,IAAI;AAAA,EAC5B;AAEA,SAAO;AACT;AAKO,SAAS,MAAM,UAAyC,UAAwB,CAAC,GAAG;AACzF,QAAM,UAAM,WAAAC,SAAO;AAEnB,MAAI,gBAAgB;AACpB,MAAI,gBAAgB;AAEpB,QAAM,YAAY,QAAQ,aAAa;AACvC,QAAM,OAAO,cAAc,QAAQ,MAAM;AACzC,MAAI,WAAW,QAAQ,YAAY;AACnC,cAAY;AAEZ,MAAI,YAAY,YAAY,IAAI;AAChC,MAAI,UAAU,YAAY;AAE1B,QAAM,MAAM,MAAM,EAAE;AACpB,QAAM;AAEN,QAAM,EAAE,UAAU,kBAAM,aAAa,kBAAM,WAAW,iBAAK,IAAI;AAC/D,MAAI,YAAY;AAKhB,WAAS,QAAQ;AACf,gBAAY;AACZ,QAAI,OAAO,GAAG;AAAA,EAChB;AAKA,WAAS,SAAS,aAAqB;AACrC,QAAI,OAAO,gBAAgB,aAAa;AACtC,aAAO;AAAA,IACT;AAEA,oBAAgB;AAChB,oBAAgB,KAAK,aAAa;AAGlC,QAAI,KAAK,IAAI,IAAI,aAAa,IAAI,WAAW;AAC3C,sBAAgB;AAChB,sBAAgB;AAAA,IAClB;AAEA,aAAS,aAAa;AACtB,eAAW,eAAe,aAAa;AAEvC,QAAI,kBAAkB,GAAG;AACvB,YAAM;AACN,4BAAsB,MAAM,SAAS,eAAe,aAAa,CAAC;AAAA,IACpE;AAEA,WAAO;AAAA,EACT;AAKA,WAAS,KAAK,OAAyB;AACrC,QAAI,CAAC,WAAW;AACd,UAAI,OAAO,GAAG;AACd;AAAA,IACF;AAEA,iBAAS,yBAAQ,iBAAI,MAAM,MAAM,WAAW,SAAS,GAAG,CAAC,CAAC,CAAC;AAAA,EAC7D;AAKA,WAAS,QAAQ;AACf,YAAQ;AACR,gBAAY,YAAY,IAAI;AAC5B,cAAU,YAAY;AACtB,oBAAgB;AAChB,oBAAgB;AAChB,gBAAY;AAEZ,QAAI,IAAI,KAAK,IAAI;AAAA,EACnB;AAKA,WAAS,OAAO;AACd,QAAI,WAAW;AACb;AAAA,IACF;AAEA,gBAAY,YAAY,IAAI,QAAI,kBAAK,GAAG,UAAU,aAAa;AAC/D,cAAU,YAAY;AACtB,gBAAY;AAEZ,QAAI,IAAI,KAAK,IAAI;AAAA,EACnB;AAEA,SAAO;AAAA,IACL;AAAA,IACA,QAAQ,MAAM,SAAS,CAAC;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
6
- "names": ["linear", "useRaf"]
7
- }