@studiometa/js-toolkit 2.0.0-beta.0 → 2.0.0-beta.12

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 (184) hide show
  1. package/Base/index.cjs +287 -0
  2. package/Base/index.d.ts +27 -1
  3. package/Base/index.js +149 -179
  4. package/Base/managers/ChildrenManager.cjs +122 -0
  5. package/Base/managers/ChildrenManager.js +29 -55
  6. package/Base/managers/EventsManager.cjs +182 -0
  7. package/Base/managers/EventsManager.d.ts +3 -1
  8. package/Base/managers/EventsManager.js +85 -127
  9. package/Base/managers/OptionsManager.cjs +167 -0
  10. package/Base/managers/OptionsManager.d.ts +2 -0
  11. package/Base/managers/OptionsManager.js +46 -88
  12. package/Base/managers/RefsManager.cjs +96 -0
  13. package/Base/managers/RefsManager.d.ts +2 -0
  14. package/Base/managers/RefsManager.js +24 -35
  15. package/Base/managers/ServicesManager.cjs +130 -0
  16. package/Base/managers/ServicesManager.d.ts +29 -4
  17. package/Base/managers/ServicesManager.js +33 -63
  18. package/Base/utils.cjs +43 -0
  19. package/Base/utils.js +12 -11
  20. package/README.md +13 -70
  21. package/decorators/index.cjs +47 -0
  22. package/decorators/index.d.ts +8 -9
  23. package/decorators/index.js +18 -9
  24. package/decorators/withBreakpointManager.cjs +89 -0
  25. package/decorators/withBreakpointManager.js +18 -39
  26. package/decorators/withBreakpointObserver.cjs +114 -0
  27. package/decorators/withBreakpointObserver.js +40 -88
  28. package/decorators/withDrag.cjs +52 -0
  29. package/decorators/withDrag.js +16 -18
  30. package/decorators/withExtraConfig.cjs +42 -0
  31. package/decorators/withExtraConfig.js +11 -12
  32. package/decorators/withIntersectionObserver.cjs +59 -0
  33. package/decorators/withIntersectionObserver.js +23 -31
  34. package/decorators/withMountWhenInView.cjs +66 -0
  35. package/decorators/withMountWhenInView.js +31 -55
  36. package/decorators/withScrolledInView.cjs +110 -0
  37. package/decorators/withScrolledInView.d.ts +4 -1
  38. package/decorators/withScrolledInView.js +77 -73
  39. package/decorators/withVue2.cjs +58 -0
  40. package/decorators/withVue2.js +21 -32
  41. package/helpers/createApp.cjs +54 -0
  42. package/helpers/createApp.js +12 -12
  43. package/helpers/importOnInteraction.cjs +54 -0
  44. package/helpers/importOnInteraction.js +17 -18
  45. package/helpers/importWhenIdle.cjs +50 -0
  46. package/helpers/importWhenIdle.js +13 -17
  47. package/helpers/importWhenVisible.cjs +52 -0
  48. package/helpers/importWhenVisible.js +16 -18
  49. package/helpers/index.cjs +39 -0
  50. package/helpers/index.d.ts +4 -5
  51. package/helpers/index.js +10 -5
  52. package/helpers/utils.cjs +37 -0
  53. package/helpers/utils.js +7 -6
  54. package/index.cjs +36 -0
  55. package/index.d.ts +4 -21
  56. package/index.js +7 -5
  57. package/package.json +14 -3
  58. package/services/Service.cjs +73 -0
  59. package/services/Service.d.ts +22 -17
  60. package/services/Service.js +14 -28
  61. package/services/drag.cjs +192 -0
  62. package/services/drag.d.ts +4 -18
  63. package/services/drag.js +103 -156
  64. package/services/index.cjs +45 -0
  65. package/services/index.d.ts +13 -10
  66. package/services/index.js +16 -8
  67. package/services/key.cjs +99 -0
  68. package/services/key.d.ts +4 -13
  69. package/services/key.js +58 -77
  70. package/services/load.cjs +68 -0
  71. package/services/load.d.ts +3 -13
  72. package/services/load.js +31 -36
  73. package/services/pointer.cjs +157 -0
  74. package/services/pointer.d.ts +4 -13
  75. package/services/pointer.js +91 -121
  76. package/services/raf.cjs +79 -0
  77. package/services/raf.d.ts +3 -13
  78. package/services/raf.js +32 -52
  79. package/services/resize.cjs +104 -0
  80. package/services/resize.d.ts +3 -13
  81. package/services/resize.js +52 -52
  82. package/services/scroll.cjs +127 -0
  83. package/services/scroll.d.ts +3 -13
  84. package/services/scroll.js +75 -89
  85. package/utils/collide/boundingRectToCircle.cjs +36 -0
  86. package/utils/collide/boundingRectToCircle.d.ts +1 -1
  87. package/utils/collide/boundingRectToCircle.js +7 -10
  88. package/utils/collide/collideCircleCircle.cjs +36 -0
  89. package/utils/collide/collideCircleCircle.js +8 -7
  90. package/utils/collide/collideCircleRect.cjs +48 -0
  91. package/utils/collide/collideCircleRect.js +10 -12
  92. package/utils/collide/collidePointCircle.cjs +33 -0
  93. package/utils/collide/collidePointCircle.js +8 -5
  94. package/utils/collide/collidePointRect.cjs +30 -0
  95. package/utils/collide/collidePointRect.js +5 -2
  96. package/utils/collide/collideRectRect.cjs +30 -0
  97. package/utils/collide/collideRectRect.js +5 -2
  98. package/utils/collide/index.cjs +43 -0
  99. package/utils/collide/index.d.ts +6 -7
  100. package/utils/collide/index.js +14 -7
  101. package/utils/css/classes.cjs +46 -0
  102. package/utils/css/classes.js +13 -12
  103. package/utils/css/index.cjs +39 -0
  104. package/utils/css/index.d.ts +4 -5
  105. package/utils/css/index.js +10 -5
  106. package/utils/css/matrix.cjs +31 -0
  107. package/utils/css/matrix.js +6 -5
  108. package/utils/css/styles.cjs +49 -0
  109. package/utils/css/styles.js +13 -12
  110. package/utils/css/transition.cjs +119 -0
  111. package/utils/css/transition.js +62 -117
  112. package/utils/debounce.cjs +36 -0
  113. package/utils/debounce.js +7 -9
  114. package/utils/focusTrap.cjs +86 -0
  115. package/utils/focusTrap.js +30 -21
  116. package/utils/history.cjs +93 -0
  117. package/utils/history.js +28 -57
  118. package/utils/index.cjs +55 -0
  119. package/utils/index.d.ts +12 -35
  120. package/utils/index.js +30 -17
  121. package/utils/keyCodes.cjs +37 -0
  122. package/utils/keyCodes.js +5 -2
  123. package/utils/math/clamp.cjs +30 -0
  124. package/utils/math/clamp.js +5 -2
  125. package/utils/math/clamp01.cjs +36 -0
  126. package/utils/math/clamp01.js +6 -3
  127. package/utils/math/damp.cjs +30 -0
  128. package/utils/math/damp.js +5 -4
  129. package/utils/math/ease.cjs +90 -0
  130. package/utils/math/ease.d.ts +78 -0
  131. package/utils/math/ease.js +66 -0
  132. package/utils/math/index.cjs +46 -0
  133. package/utils/math/index.d.ts +8 -8
  134. package/utils/math/index.js +17 -8
  135. package/utils/math/inertiaFinalValue.cjs +39 -0
  136. package/utils/math/inertiaFinalValue.js +8 -10
  137. package/utils/math/lerp.cjs +30 -0
  138. package/utils/math/lerp.js +5 -2
  139. package/utils/math/map.cjs +30 -0
  140. package/utils/math/map.js +5 -2
  141. package/utils/math/round.cjs +30 -0
  142. package/utils/math/round.js +5 -3
  143. package/utils/memoize.cjs +45 -0
  144. package/utils/memoize.js +10 -19
  145. package/utils/nextFrame.cjs +42 -0
  146. package/utils/nextFrame.js +14 -9
  147. package/utils/object/autoBind.cjs +53 -0
  148. package/utils/object/autoBind.js +12 -22
  149. package/utils/object/getAllProperties.cjs +39 -0
  150. package/utils/object/getAllProperties.js +11 -14
  151. package/utils/object/index.cjs +37 -0
  152. package/utils/object/index.d.ts +3 -4
  153. package/utils/object/index.js +8 -4
  154. package/utils/object/isObject.cjs +30 -0
  155. package/utils/object/isObject.js +6 -3
  156. package/utils/scrollTo.cjs +84 -0
  157. package/utils/scrollTo.js +20 -40
  158. package/utils/string/index.cjs +51 -0
  159. package/utils/string/index.d.ts +10 -11
  160. package/utils/string/index.js +22 -11
  161. package/utils/string/withLeadingCharacters.cjs +36 -0
  162. package/utils/string/withLeadingCharacters.js +7 -4
  163. package/utils/string/withLeadingSlash.cjs +36 -0
  164. package/utils/string/withLeadingSlash.js +7 -4
  165. package/utils/string/withTrailingCharacters.cjs +36 -0
  166. package/utils/string/withTrailingCharacters.js +7 -4
  167. package/utils/string/withTrailingSlash.cjs +36 -0
  168. package/utils/string/withTrailingSlash.js +7 -4
  169. package/utils/string/withoutLeadingCharacters.cjs +30 -0
  170. package/utils/string/withoutLeadingCharacters.js +6 -3
  171. package/utils/string/withoutLeadingCharactersRecursive.cjs +41 -0
  172. package/utils/string/withoutLeadingCharactersRecursive.js +8 -7
  173. package/utils/string/withoutLeadingSlash.cjs +36 -0
  174. package/utils/string/withoutLeadingSlash.js +7 -4
  175. package/utils/string/withoutTrailingCharacters.cjs +30 -0
  176. package/utils/string/withoutTrailingCharacters.js +6 -3
  177. package/utils/string/withoutTrailingCharactersRecursive.cjs +41 -0
  178. package/utils/string/withoutTrailingCharactersRecursive.js +8 -7
  179. package/utils/string/withoutTrailingSlash.cjs +36 -0
  180. package/utils/string/withoutTrailingSlash.js +7 -4
  181. package/utils/throttle.cjs +38 -0
  182. package/utils/throttle.js +9 -9
  183. package/index.modern.js +0 -1
  184. package/index.umd.js +0 -1
@@ -0,0 +1,84 @@
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 __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var scrollTo_exports = {};
29
+ __export(scrollTo_exports, {
30
+ default: () => scrollTo
31
+ });
32
+ var import_damp = __toESM(require("./math/damp.js"), 1);
33
+ function scrollTo(selectorElement, { offset = 0, dampFactor = 0.2 } = {}) {
34
+ let targetElement = null;
35
+ if (selectorElement instanceof HTMLElement) {
36
+ targetElement = selectorElement;
37
+ } else {
38
+ targetElement = document.querySelector(selectorElement);
39
+ }
40
+ if (!targetElement) {
41
+ return Promise.resolve(window.pageYOffset);
42
+ }
43
+ const sizes = targetElement.getBoundingClientRect();
44
+ const scrollMargin = getComputedStyle(targetElement).scrollMarginTop || "0";
45
+ const max = document.documentElement.scrollHeight - window.innerHeight;
46
+ let scrollTarget = sizes.top + window.pageYOffset - parseInt(scrollMargin, 10) - offset;
47
+ if (scrollTarget > max) {
48
+ scrollTarget = max;
49
+ }
50
+ return new Promise((resolve) => {
51
+ let isScrolling = false;
52
+ let scroll = window.pageYOffset;
53
+ let dampScroll = window.pageYOffset;
54
+ function eventHandler() {
55
+ isScrolling = false;
56
+ }
57
+ function end() {
58
+ window.removeEventListener("wheel", eventHandler);
59
+ window.removeEventListener("touchmove", eventHandler);
60
+ resolve(window.pageYOffset);
61
+ }
62
+ function loop() {
63
+ if (!isScrolling) {
64
+ return end();
65
+ }
66
+ dampScroll = (0, import_damp.default)(scroll, dampScroll, dampFactor);
67
+ window.scrollTo({ top: dampScroll });
68
+ if (dampScroll === scroll) {
69
+ isScrolling = false;
70
+ }
71
+ return requestAnimationFrame(loop);
72
+ }
73
+ function start(target) {
74
+ isScrolling = true;
75
+ dampScroll = window.pageYOffset;
76
+ scroll = target;
77
+ window.addEventListener("wheel", eventHandler, { passive: true });
78
+ window.addEventListener("touchmove", eventHandler, { passive: true });
79
+ loop();
80
+ }
81
+ start(scrollTarget);
82
+ });
83
+ }
84
+ module.exports = __toCommonJS(scrollTo_exports);
package/utils/scrollTo.js CHANGED
@@ -1,75 +1,55 @@
1
- import damp from './math/damp.js';
2
- export default function scrollTo(selectorElement) {
3
- var {
4
- offset = 0,
5
- dampFactor = 0.2
6
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7
- var targetElement = null;
8
-
1
+ import damp from "./math/damp.js";
2
+ function scrollTo(selectorElement, { offset = 0, dampFactor = 0.2 } = {}) {
3
+ let targetElement = null;
9
4
  if (selectorElement instanceof HTMLElement) {
10
5
  targetElement = selectorElement;
11
6
  } else {
12
7
  targetElement = document.querySelector(selectorElement);
13
8
  }
14
-
15
9
  if (!targetElement) {
16
10
  return Promise.resolve(window.pageYOffset);
17
11
  }
18
-
19
- var sizes = targetElement.getBoundingClientRect();
20
- var scrollMargin = getComputedStyle(targetElement).scrollMarginTop || '0';
21
- var max = document.body.offsetHeight - window.innerHeight;
22
- var scrollTarget = sizes.top + window.pageYOffset + parseInt(scrollMargin, 10) + offset;
23
-
12
+ const sizes = targetElement.getBoundingClientRect();
13
+ const scrollMargin = getComputedStyle(targetElement).scrollMarginTop || "0";
14
+ const max = document.documentElement.scrollHeight - window.innerHeight;
15
+ let scrollTarget = sizes.top + window.pageYOffset - parseInt(scrollMargin, 10) - offset;
24
16
  if (scrollTarget > max) {
25
17
  scrollTarget = max;
26
18
  }
27
-
28
- return new Promise(resolve => {
29
- var isScrolling = false;
30
- var scroll = window.pageYOffset;
31
- var dampScroll = window.pageYOffset;
32
-
19
+ return new Promise((resolve) => {
20
+ let isScrolling = false;
21
+ let scroll = window.pageYOffset;
22
+ let dampScroll = window.pageYOffset;
33
23
  function eventHandler() {
34
24
  isScrolling = false;
35
25
  }
36
-
37
26
  function end() {
38
- window.removeEventListener('wheel', eventHandler);
39
- window.removeEventListener('touchmove', eventHandler);
27
+ window.removeEventListener("wheel", eventHandler);
28
+ window.removeEventListener("touchmove", eventHandler);
40
29
  resolve(window.pageYOffset);
41
30
  }
42
-
43
31
  function loop() {
44
32
  if (!isScrolling) {
45
33
  return end();
46
34
  }
47
-
48
35
  dampScroll = damp(scroll, dampScroll, dampFactor);
49
- window.scrollTo({
50
- top: dampScroll
51
- });
52
-
36
+ window.scrollTo({ top: dampScroll });
53
37
  if (dampScroll === scroll) {
54
38
  isScrolling = false;
55
39
  }
56
-
57
40
  return requestAnimationFrame(loop);
58
41
  }
59
-
60
42
  function start(target) {
61
43
  isScrolling = true;
62
44
  dampScroll = window.pageYOffset;
63
45
  scroll = target;
64
- window.addEventListener('wheel', eventHandler, {
65
- passive: true
66
- });
67
- window.addEventListener('touchmove', eventHandler, {
68
- passive: true
69
- });
46
+ window.addEventListener("wheel", eventHandler, { passive: true });
47
+ window.addEventListener("touchmove", eventHandler, { passive: true });
70
48
  loop();
71
49
  }
72
-
73
50
  start(scrollTarget);
74
51
  });
75
- }
52
+ }
53
+ export {
54
+ scrollTo as default
55
+ };
@@ -0,0 +1,51 @@
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 __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var string_exports = {};
29
+ __export(string_exports, {
30
+ withLeadingCharacters: () => import_withLeadingCharacters.default,
31
+ withLeadingSlash: () => import_withLeadingSlash.default,
32
+ withTrailingCharacters: () => import_withTrailingCharacters.default,
33
+ withTrailingSlash: () => import_withTrailingSlash.default,
34
+ withoutLeadingCharacters: () => import_withoutLeadingCharacters.default,
35
+ withoutLeadingCharactersRecursive: () => import_withoutLeadingCharactersRecursive.default,
36
+ withoutLeadingSlash: () => import_withoutLeadingSlash.default,
37
+ withoutTrailingCharacters: () => import_withoutTrailingCharacters.default,
38
+ withoutTrailingCharactersRecursive: () => import_withoutTrailingCharactersRecursive.default,
39
+ withoutTrailingSlash: () => import_withoutTrailingSlash.default
40
+ });
41
+ var import_withLeadingCharacters = __toESM(require("./withLeadingCharacters.js"), 1);
42
+ var import_withLeadingSlash = __toESM(require("./withLeadingSlash.js"), 1);
43
+ var import_withoutLeadingCharacters = __toESM(require("./withoutLeadingCharacters.js"), 1);
44
+ var import_withoutLeadingCharactersRecursive = __toESM(require("./withoutLeadingCharactersRecursive.js"), 1);
45
+ var import_withoutLeadingSlash = __toESM(require("./withoutLeadingSlash.js"), 1);
46
+ var import_withoutTrailingCharacters = __toESM(require("./withoutTrailingCharacters.js"), 1);
47
+ var import_withoutTrailingCharactersRecursive = __toESM(require("./withoutTrailingCharactersRecursive.js"), 1);
48
+ var import_withoutTrailingSlash = __toESM(require("./withoutTrailingSlash.js"), 1);
49
+ var import_withTrailingCharacters = __toESM(require("./withTrailingCharacters.js"), 1);
50
+ var import_withTrailingSlash = __toESM(require("./withTrailingSlash.js"), 1);
51
+ module.exports = __toCommonJS(string_exports);
@@ -1,11 +1,10 @@
1
- import withLeadingCharacters from "./withLeadingCharacters.js";
2
- import withLeadingSlash from "./withLeadingSlash.js";
3
- import withoutLeadingCharacters from "./withoutLeadingCharacters.js";
4
- import withoutLeadingCharactersRecursive from "./withoutLeadingCharactersRecursive.js";
5
- import withoutLeadingSlash from "./withoutLeadingSlash.js";
6
- import withoutTrailingCharacters from "./withoutTrailingCharacters.js";
7
- import withoutTrailingCharactersRecursive from "./withoutTrailingCharactersRecursive.js";
8
- import withoutTrailingSlash from "./withoutTrailingSlash.js";
9
- import withTrailingCharacters from "./withTrailingCharacters.js";
10
- import withTrailingSlash from "./withTrailingSlash.js";
11
- export { withLeadingCharacters, withLeadingSlash, withoutLeadingCharacters, withoutLeadingCharactersRecursive, withoutLeadingSlash, withoutTrailingCharacters, withoutTrailingCharactersRecursive, withoutTrailingSlash, withTrailingCharacters, withTrailingSlash };
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,11 +1,22 @@
1
- import withLeadingCharacters from './withLeadingCharacters.js';
2
- import withLeadingSlash from './withLeadingSlash.js';
3
- import withoutLeadingCharacters from './withoutLeadingCharacters.js';
4
- import withoutLeadingCharactersRecursive from './withoutLeadingCharactersRecursive.js';
5
- import withoutLeadingSlash from './withoutLeadingSlash.js';
6
- import withoutTrailingCharacters from './withoutTrailingCharacters.js';
7
- import withoutTrailingCharactersRecursive from './withoutTrailingCharactersRecursive.js';
8
- import withoutTrailingSlash from './withoutTrailingSlash.js';
9
- import withTrailingCharacters from './withTrailingCharacters.js';
10
- import withTrailingSlash from './withTrailingSlash.js';
11
- export { withLeadingCharacters, withLeadingSlash, withoutLeadingCharacters, withoutLeadingCharactersRecursive, withoutLeadingSlash, withoutTrailingCharacters, withoutTrailingCharactersRecursive, withoutTrailingSlash, withTrailingCharacters, withTrailingSlash };
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";
11
+ export {
12
+ default2 as withLeadingCharacters,
13
+ default3 as withLeadingSlash,
14
+ default10 as withTrailingCharacters,
15
+ default11 as withTrailingSlash,
16
+ default4 as withoutLeadingCharacters,
17
+ default5 as withoutLeadingCharactersRecursive,
18
+ default6 as withoutLeadingSlash,
19
+ default7 as withoutTrailingCharacters,
20
+ default8 as withoutTrailingCharactersRecursive,
21
+ default9 as withoutTrailingSlash
22
+ };
@@ -0,0 +1,36 @@
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 __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var withLeadingCharacters_exports = {};
29
+ __export(withLeadingCharacters_exports, {
30
+ default: () => withLeadingCharacters
31
+ });
32
+ var import_withoutLeadingCharacters = __toESM(require("./withoutLeadingCharacters.js"), 1);
33
+ function withLeadingCharacters(string, characters) {
34
+ return `${characters}${(0, import_withoutLeadingCharacters.default)(string, characters)}`;
35
+ }
36
+ module.exports = __toCommonJS(withLeadingCharacters_exports);
@@ -1,4 +1,7 @@
1
- import withoutLeadingCharacters from './withoutLeadingCharacters.js';
2
- export default function withLeadingCharacters(string, characters) {
3
- return "".concat(characters).concat(withoutLeadingCharacters(string, characters));
4
- }
1
+ import withoutLeadingCharacters from "./withoutLeadingCharacters.js";
2
+ function withLeadingCharacters(string, characters) {
3
+ return `${characters}${withoutLeadingCharacters(string, characters)}`;
4
+ }
5
+ export {
6
+ withLeadingCharacters as default
7
+ };
@@ -0,0 +1,36 @@
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 __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var withLeadingSlash_exports = {};
29
+ __export(withLeadingSlash_exports, {
30
+ default: () => withLeadingSlash
31
+ });
32
+ var import_withLeadingCharacters = __toESM(require("./withLeadingCharacters.js"), 1);
33
+ function withLeadingSlash(string) {
34
+ return (0, import_withLeadingCharacters.default)(string, "/");
35
+ }
36
+ module.exports = __toCommonJS(withLeadingSlash_exports);
@@ -1,4 +1,7 @@
1
- import withLeadingCharacters from './withLeadingCharacters.js';
2
- export default function withLeadingSlash(string) {
3
- return withLeadingCharacters(string, '/');
4
- }
1
+ import withLeadingCharacters from "./withLeadingCharacters.js";
2
+ function withLeadingSlash(string) {
3
+ return withLeadingCharacters(string, "/");
4
+ }
5
+ export {
6
+ withLeadingSlash as default
7
+ };
@@ -0,0 +1,36 @@
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 __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var withTrailingCharacters_exports = {};
29
+ __export(withTrailingCharacters_exports, {
30
+ default: () => withTrailingCharacters
31
+ });
32
+ var import_withoutTrailingCharacters = __toESM(require("./withoutTrailingCharacters.js"), 1);
33
+ function withTrailingCharacters(string, characters) {
34
+ return `${(0, import_withoutTrailingCharacters.default)(string, characters)}${characters}`;
35
+ }
36
+ module.exports = __toCommonJS(withTrailingCharacters_exports);
@@ -1,4 +1,7 @@
1
- import withoutTrailingCharacters from './withoutTrailingCharacters.js';
2
- export default function withTrailingCharacters(string, characters) {
3
- return "".concat(withoutTrailingCharacters(string, characters)).concat(characters);
4
- }
1
+ import withoutTrailingCharacters from "./withoutTrailingCharacters.js";
2
+ function withTrailingCharacters(string, characters) {
3
+ return `${withoutTrailingCharacters(string, characters)}${characters}`;
4
+ }
5
+ export {
6
+ withTrailingCharacters as default
7
+ };
@@ -0,0 +1,36 @@
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 __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var withTrailingSlash_exports = {};
29
+ __export(withTrailingSlash_exports, {
30
+ default: () => withTrailingSlash
31
+ });
32
+ var import_withTrailingCharacters = __toESM(require("./withTrailingCharacters.js"), 1);
33
+ function withTrailingSlash(string) {
34
+ return (0, import_withTrailingCharacters.default)(string, "/");
35
+ }
36
+ module.exports = __toCommonJS(withTrailingSlash_exports);
@@ -1,4 +1,7 @@
1
- import withTrailingCharacters from './withTrailingCharacters.js';
2
- export default function withTrailingSlash(string) {
3
- return withTrailingCharacters(string, '/');
4
- }
1
+ import withTrailingCharacters from "./withTrailingCharacters.js";
2
+ function withTrailingSlash(string) {
3
+ return withTrailingCharacters(string, "/");
4
+ }
5
+ export {
6
+ withTrailingSlash as default
7
+ };
@@ -0,0 +1,30 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __reExport = (target, module2, copyDefault, desc) => {
11
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
12
+ for (let key of __getOwnPropNames(module2))
13
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
14
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
15
+ }
16
+ return target;
17
+ };
18
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
19
+ return (module2, temp) => {
20
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
21
+ };
22
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
23
+ var withoutLeadingCharacters_exports = {};
24
+ __export(withoutLeadingCharacters_exports, {
25
+ default: () => withoutLeadingCharacters
26
+ });
27
+ function withoutLeadingCharacters(string, characters) {
28
+ return string.replace(new RegExp(`^${characters}`), "");
29
+ }
30
+ module.exports = __toCommonJS(withoutLeadingCharacters_exports);
@@ -1,3 +1,6 @@
1
- export default function withoutLeadingCharacters(string, characters) {
2
- return string.replace(new RegExp("^".concat(characters)), '');
3
- }
1
+ function withoutLeadingCharacters(string, characters) {
2
+ return string.replace(new RegExp(`^${characters}`), "");
3
+ }
4
+ export {
5
+ withoutLeadingCharacters as default
6
+ };
@@ -0,0 +1,41 @@
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 __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var withoutLeadingCharactersRecursive_exports = {};
29
+ __export(withoutLeadingCharactersRecursive_exports, {
30
+ default: () => withoutLeadingCharactersRecursive
31
+ });
32
+ var import_withoutLeadingCharacters = __toESM(require("./withoutLeadingCharacters.js"), 1);
33
+ function withoutLeadingCharactersRecursive(string, characters) {
34
+ let str = (0, import_withoutLeadingCharacters.default)(string, characters);
35
+ const regex = new RegExp(`^${characters}`);
36
+ while (regex.test(str)) {
37
+ str = (0, import_withoutLeadingCharacters.default)(str, characters);
38
+ }
39
+ return str;
40
+ }
41
+ module.exports = __toCommonJS(withoutLeadingCharactersRecursive_exports);
@@ -1,11 +1,12 @@
1
- import withoutLeadingCharacters from './withoutLeadingCharacters.js';
2
- export default function withoutLeadingCharactersRecursive(string, characters) {
3
- var str = withoutLeadingCharacters(string, characters);
4
- var regex = new RegExp("^".concat(characters));
5
-
1
+ import withoutLeadingCharacters from "./withoutLeadingCharacters.js";
2
+ function withoutLeadingCharactersRecursive(string, characters) {
3
+ let str = withoutLeadingCharacters(string, characters);
4
+ const regex = new RegExp(`^${characters}`);
6
5
  while (regex.test(str)) {
7
6
  str = withoutLeadingCharacters(str, characters);
8
7
  }
9
-
10
8
  return str;
11
- }
9
+ }
10
+ export {
11
+ withoutLeadingCharactersRecursive as default
12
+ };
@@ -0,0 +1,36 @@
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 __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var withoutLeadingSlash_exports = {};
29
+ __export(withoutLeadingSlash_exports, {
30
+ default: () => withoutLeadingSlash
31
+ });
32
+ var import_withoutLeadingCharacters = __toESM(require("./withoutLeadingCharacters.js"), 1);
33
+ function withoutLeadingSlash(string) {
34
+ return (0, import_withoutLeadingCharacters.default)(string, "/");
35
+ }
36
+ module.exports = __toCommonJS(withoutLeadingSlash_exports);
@@ -1,4 +1,7 @@
1
- import withoutLeadingCharacters from './withoutLeadingCharacters.js';
2
- export default function withoutLeadingSlash(string) {
3
- return withoutLeadingCharacters(string, '/');
4
- }
1
+ import withoutLeadingCharacters from "./withoutLeadingCharacters.js";
2
+ function withoutLeadingSlash(string) {
3
+ return withoutLeadingCharacters(string, "/");
4
+ }
5
+ export {
6
+ withoutLeadingSlash as default
7
+ };