@studiometa/js-toolkit 2.0.0-beta.10 → 2.0.0-beta.14
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.
- package/Base/index.cjs +295 -0
- package/Base/index.js +88 -174
- package/Base/managers/ChildrenManager.cjs +125 -0
- package/Base/managers/ChildrenManager.js +29 -55
- package/Base/managers/EventsManager.cjs +185 -0
- package/Base/managers/EventsManager.js +84 -130
- package/Base/managers/OptionsManager.cjs +176 -0
- package/Base/managers/OptionsManager.js +46 -88
- package/Base/managers/RefsManager.cjs +99 -0
- package/Base/managers/RefsManager.js +22 -38
- package/Base/managers/ServicesManager.cjs +133 -0
- package/Base/managers/ServicesManager.js +31 -65
- package/Base/utils.cjs +46 -0
- package/Base/utils.js +12 -11
- package/decorators/index.cjs +50 -0
- package/decorators/index.js +18 -8
- package/decorators/withBreakpointManager.cjs +92 -0
- package/decorators/withBreakpointManager.js +18 -39
- package/decorators/withBreakpointObserver.cjs +117 -0
- package/decorators/withBreakpointObserver.js +40 -88
- package/decorators/withDrag.cjs +55 -0
- package/decorators/withDrag.js +18 -26
- package/decorators/withExtraConfig.cjs +45 -0
- package/decorators/withExtraConfig.js +11 -12
- package/decorators/withIntersectionObserver.cjs +62 -0
- package/decorators/withIntersectionObserver.js +23 -32
- package/decorators/withMountWhenInView.cjs +69 -0
- package/decorators/withMountWhenInView.js +26 -53
- package/decorators/withScrolledInView.cjs +113 -0
- package/decorators/withScrolledInView.js +50 -63
- package/decorators/withVue2.cjs +61 -0
- package/decorators/withVue2.js +21 -32
- package/helpers/createApp.cjs +57 -0
- package/helpers/createApp.js +12 -12
- package/helpers/importOnInteraction.cjs +57 -0
- package/helpers/importOnInteraction.js +17 -18
- package/helpers/importWhenIdle.cjs +53 -0
- package/helpers/importWhenIdle.js +13 -17
- package/helpers/importWhenVisible.cjs +55 -0
- package/helpers/importWhenVisible.js +16 -18
- package/helpers/index.cjs +42 -0
- package/helpers/index.js +10 -4
- package/helpers/utils.cjs +40 -0
- package/helpers/utils.js +7 -6
- package/index.cjs +39 -0
- package/index.js +7 -4
- package/package.json +14 -3
- package/services/Service.cjs +76 -0
- package/services/Service.js +13 -32
- package/services/drag.cjs +195 -0
- package/services/drag.js +60 -90
- package/services/index.cjs +48 -0
- package/services/index.js +16 -7
- package/services/key.cjs +102 -0
- package/services/key.js +34 -52
- package/services/load.cjs +71 -0
- package/services/load.js +13 -24
- package/services/pointer.cjs +160 -0
- package/services/pointer.js +60 -87
- package/services/raf.cjs +82 -0
- package/services/raf.js +16 -33
- package/services/resize.cjs +107 -0
- package/services/resize.js +31 -49
- package/services/scroll.cjs +130 -0
- package/services/scroll.js +44 -62
- package/utils/collide/boundingRectToCircle.cjs +39 -0
- package/utils/collide/boundingRectToCircle.d.ts +1 -1
- package/utils/collide/boundingRectToCircle.js +7 -10
- package/utils/collide/collideCircleCircle.cjs +39 -0
- package/utils/collide/collideCircleCircle.js +8 -7
- package/utils/collide/collideCircleRect.cjs +51 -0
- package/utils/collide/collideCircleRect.js +10 -12
- package/utils/collide/collidePointCircle.cjs +36 -0
- package/utils/collide/collidePointCircle.js +8 -5
- package/utils/collide/collidePointRect.cjs +33 -0
- package/utils/collide/collidePointRect.js +5 -2
- package/utils/collide/collideRectRect.cjs +33 -0
- package/utils/collide/collideRectRect.js +5 -2
- package/utils/collide/index.cjs +46 -0
- package/utils/collide/index.js +14 -6
- package/utils/css/classes.cjs +49 -0
- package/utils/css/classes.js +13 -12
- package/utils/css/index.cjs +42 -0
- package/utils/css/index.js +10 -6
- package/utils/css/matrix.cjs +34 -0
- package/utils/css/matrix.js +6 -5
- package/utils/css/styles.cjs +52 -0
- package/utils/css/styles.js +13 -12
- package/utils/css/transition.cjs +122 -0
- package/utils/css/transition.js +62 -117
- package/utils/debounce.cjs +39 -0
- package/utils/debounce.js +7 -9
- package/utils/focusTrap.cjs +89 -0
- package/utils/focusTrap.js +30 -21
- package/utils/history.cjs +96 -0
- package/utils/history.js +28 -57
- package/utils/index.cjs +58 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +30 -11
- package/utils/keyCodes.cjs +40 -0
- package/utils/keyCodes.js +5 -2
- package/utils/math/clamp.cjs +33 -0
- package/utils/math/clamp.js +5 -2
- package/utils/math/clamp01.cjs +39 -0
- package/utils/math/clamp01.js +6 -3
- package/utils/math/damp.cjs +33 -0
- package/utils/math/damp.js +5 -4
- package/utils/math/ease.cjs +93 -0
- package/utils/math/ease.js +50 -25
- package/utils/math/index.cjs +49 -0
- package/utils/math/index.js +17 -8
- package/utils/math/inertiaFinalValue.cjs +42 -0
- package/utils/math/inertiaFinalValue.js +8 -10
- package/utils/math/lerp.cjs +33 -0
- package/utils/math/lerp.js +5 -2
- package/utils/math/map.cjs +33 -0
- package/utils/math/map.js +5 -2
- package/utils/math/round.cjs +33 -0
- package/utils/math/round.js +5 -3
- package/utils/memoize.cjs +48 -0
- package/utils/memoize.js +10 -19
- package/utils/nextFrame.cjs +45 -0
- package/utils/nextFrame.js +14 -9
- package/utils/object/autoBind.cjs +56 -0
- package/utils/object/autoBind.js +12 -22
- package/utils/object/getAllProperties.cjs +42 -0
- package/utils/object/getAllProperties.js +10 -13
- package/utils/object/index.cjs +40 -0
- package/utils/object/index.js +8 -3
- package/utils/object/isObject.cjs +33 -0
- package/utils/object/isObject.js +6 -3
- package/utils/scrollTo.cjs +87 -0
- package/utils/scrollTo.js +20 -40
- package/utils/string/index.cjs +54 -0
- package/utils/string/index.js +22 -10
- package/utils/string/withLeadingCharacters.cjs +39 -0
- package/utils/string/withLeadingCharacters.js +7 -4
- package/utils/string/withLeadingSlash.cjs +39 -0
- package/utils/string/withLeadingSlash.js +7 -4
- package/utils/string/withTrailingCharacters.cjs +39 -0
- package/utils/string/withTrailingCharacters.js +7 -4
- package/utils/string/withTrailingSlash.cjs +39 -0
- package/utils/string/withTrailingSlash.js +7 -4
- package/utils/string/withoutLeadingCharacters.cjs +33 -0
- package/utils/string/withoutLeadingCharacters.js +6 -3
- package/utils/string/withoutLeadingCharactersRecursive.cjs +44 -0
- package/utils/string/withoutLeadingCharactersRecursive.js +8 -7
- package/utils/string/withoutLeadingSlash.cjs +39 -0
- package/utils/string/withoutLeadingSlash.js +7 -4
- package/utils/string/withoutTrailingCharacters.cjs +33 -0
- package/utils/string/withoutTrailingCharacters.js +6 -3
- package/utils/string/withoutTrailingCharactersRecursive.cjs +44 -0
- package/utils/string/withoutTrailingCharactersRecursive.js +8 -7
- package/utils/string/withoutTrailingSlash.cjs +39 -0
- package/utils/string/withoutTrailingSlash.js +7 -4
- package/utils/throttle.cjs +41 -0
- package/utils/throttle.js +9 -9
- package/index.modern.js +0 -1
- package/index.umd.js +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
|
|
24
|
+
// packages/js-toolkit/utils/object/getAllProperties.js
|
|
25
|
+
var getAllProperties_exports = {};
|
|
26
|
+
__export(getAllProperties_exports, {
|
|
27
|
+
default: () => getAllProperties
|
|
28
|
+
});
|
|
29
|
+
function getAllProperties(object, props = [], testFn = null) {
|
|
30
|
+
const proto = Object.getPrototypeOf(object);
|
|
31
|
+
if (proto === Object.prototype || proto === null) {
|
|
32
|
+
return props;
|
|
33
|
+
}
|
|
34
|
+
let foundProps = Object.getOwnPropertyNames(proto);
|
|
35
|
+
if (typeof testFn === "function") {
|
|
36
|
+
foundProps = foundProps.filter((name) => testFn(name, proto));
|
|
37
|
+
}
|
|
38
|
+
foundProps = foundProps.map((name) => [name, proto]).reduce((acc, val) => [...acc, val], props);
|
|
39
|
+
return getAllProperties(proto, foundProps, testFn);
|
|
40
|
+
}
|
|
41
|
+
module.exports = __toCommonJS(getAllProperties_exports);
|
|
42
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var testFn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
4
|
-
var proto = Object.getPrototypeOf(object);
|
|
5
|
-
|
|
1
|
+
function getAllProperties(object, props = [], testFn = null) {
|
|
2
|
+
const proto = Object.getPrototypeOf(object);
|
|
6
3
|
if (proto === Object.prototype || proto === null) {
|
|
7
4
|
return props;
|
|
8
5
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (typeof testFn === 'function') {
|
|
13
|
-
foundProps = foundProps.filter(name => testFn(name, proto));
|
|
6
|
+
let foundProps = Object.getOwnPropertyNames(proto);
|
|
7
|
+
if (typeof testFn === "function") {
|
|
8
|
+
foundProps = foundProps.filter((name) => testFn(name, proto));
|
|
14
9
|
}
|
|
15
|
-
|
|
16
|
-
foundProps = foundProps.map(name => [name, proto]).reduce((acc, val) => [...acc, val], props);
|
|
10
|
+
foundProps = foundProps.map((name) => [name, proto]).reduce((acc, val) => [...acc, val], props);
|
|
17
11
|
return getAllProperties(proto, foundProps, testFn);
|
|
18
|
-
}
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
getAllProperties as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
|
|
29
|
+
// packages/js-toolkit/utils/object/index.js
|
|
30
|
+
var object_exports = {};
|
|
31
|
+
__export(object_exports, {
|
|
32
|
+
autoBind: () => import_autoBind.default,
|
|
33
|
+
getAllProperties: () => import_getAllProperties.default,
|
|
34
|
+
isObject: () => import_isObject.default
|
|
35
|
+
});
|
|
36
|
+
var import_autoBind = __toESM(require("./autoBind.cjs"), 1);
|
|
37
|
+
var import_getAllProperties = __toESM(require("./getAllProperties.cjs"), 1);
|
|
38
|
+
var import_isObject = __toESM(require("./isObject.cjs"), 1);
|
|
39
|
+
module.exports = __toCommonJS(object_exports);
|
|
40
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/utils/object/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { default as default2 } from "./autoBind.js";
|
|
2
|
+
import { default as default3 } from "./getAllProperties.js";
|
|
3
|
+
import { default as default4 } from "./isObject.js";
|
|
4
|
+
export {
|
|
5
|
+
default2 as autoBind,
|
|
6
|
+
default3 as getAllProperties,
|
|
7
|
+
default4 as isObject
|
|
8
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
|
|
24
|
+
// packages/js-toolkit/utils/object/isObject.js
|
|
25
|
+
var isObject_exports = {};
|
|
26
|
+
__export(isObject_exports, {
|
|
27
|
+
default: () => isObject
|
|
28
|
+
});
|
|
29
|
+
function isObject(value) {
|
|
30
|
+
return typeof value === "object" && !!value && value.toString() === "[object Object]";
|
|
31
|
+
}
|
|
32
|
+
module.exports = __toCommonJS(isObject_exports);
|
|
33
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/utils/object/isObject.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
return typeof value ===
|
|
3
|
-
}
|
|
1
|
+
function isObject(value) {
|
|
2
|
+
return typeof value === "object" && !!value && value.toString() === "[object Object]";
|
|
3
|
+
}
|
|
4
|
+
export {
|
|
5
|
+
isObject as default
|
|
6
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
|
|
29
|
+
// packages/js-toolkit/utils/scrollTo.js
|
|
30
|
+
var scrollTo_exports = {};
|
|
31
|
+
__export(scrollTo_exports, {
|
|
32
|
+
default: () => scrollTo
|
|
33
|
+
});
|
|
34
|
+
var import_damp = __toESM(require("./math/damp.cjs"), 1);
|
|
35
|
+
function scrollTo(selectorElement, { offset = 0, dampFactor = 0.2 } = {}) {
|
|
36
|
+
let targetElement = null;
|
|
37
|
+
if (selectorElement instanceof HTMLElement) {
|
|
38
|
+
targetElement = selectorElement;
|
|
39
|
+
} else {
|
|
40
|
+
targetElement = document.querySelector(selectorElement);
|
|
41
|
+
}
|
|
42
|
+
if (!targetElement) {
|
|
43
|
+
return Promise.resolve(window.pageYOffset);
|
|
44
|
+
}
|
|
45
|
+
const sizes = targetElement.getBoundingClientRect();
|
|
46
|
+
const scrollMargin = getComputedStyle(targetElement).scrollMarginTop || "0";
|
|
47
|
+
const max = document.documentElement.scrollHeight - window.innerHeight;
|
|
48
|
+
let scrollTarget = sizes.top + window.pageYOffset - parseInt(scrollMargin, 10) - offset;
|
|
49
|
+
if (scrollTarget > max) {
|
|
50
|
+
scrollTarget = max;
|
|
51
|
+
}
|
|
52
|
+
return new Promise((resolve) => {
|
|
53
|
+
let isScrolling = false;
|
|
54
|
+
let scroll = window.pageYOffset;
|
|
55
|
+
let dampScroll = window.pageYOffset;
|
|
56
|
+
function eventHandler() {
|
|
57
|
+
isScrolling = false;
|
|
58
|
+
}
|
|
59
|
+
function end() {
|
|
60
|
+
window.removeEventListener("wheel", eventHandler);
|
|
61
|
+
window.removeEventListener("touchmove", eventHandler);
|
|
62
|
+
resolve(window.pageYOffset);
|
|
63
|
+
}
|
|
64
|
+
function loop() {
|
|
65
|
+
if (!isScrolling) {
|
|
66
|
+
return end();
|
|
67
|
+
}
|
|
68
|
+
dampScroll = (0, import_damp.default)(scroll, dampScroll, dampFactor);
|
|
69
|
+
window.scrollTo({ top: dampScroll });
|
|
70
|
+
if (dampScroll === scroll) {
|
|
71
|
+
isScrolling = false;
|
|
72
|
+
}
|
|
73
|
+
return requestAnimationFrame(loop);
|
|
74
|
+
}
|
|
75
|
+
function start(target) {
|
|
76
|
+
isScrolling = true;
|
|
77
|
+
dampScroll = window.pageYOffset;
|
|
78
|
+
scroll = target;
|
|
79
|
+
window.addEventListener("wheel", eventHandler, { passive: true });
|
|
80
|
+
window.addEventListener("touchmove", eventHandler, { passive: true });
|
|
81
|
+
loop();
|
|
82
|
+
}
|
|
83
|
+
start(scrollTarget);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
module.exports = __toCommonJS(scrollTo_exports);
|
|
87
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/utils/scrollTo.js
CHANGED
|
@@ -1,75 +1,55 @@
|
|
|
1
|
-
import damp from
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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(
|
|
39
|
-
window.removeEventListener(
|
|
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(
|
|
65
|
-
|
|
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,54 @@
|
|
|
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
|
+
|
|
29
|
+
// packages/js-toolkit/utils/string/index.js
|
|
30
|
+
var string_exports = {};
|
|
31
|
+
__export(string_exports, {
|
|
32
|
+
withLeadingCharacters: () => import_withLeadingCharacters.default,
|
|
33
|
+
withLeadingSlash: () => import_withLeadingSlash.default,
|
|
34
|
+
withTrailingCharacters: () => import_withTrailingCharacters.default,
|
|
35
|
+
withTrailingSlash: () => import_withTrailingSlash.default,
|
|
36
|
+
withoutLeadingCharacters: () => import_withoutLeadingCharacters.default,
|
|
37
|
+
withoutLeadingCharactersRecursive: () => import_withoutLeadingCharactersRecursive.default,
|
|
38
|
+
withoutLeadingSlash: () => import_withoutLeadingSlash.default,
|
|
39
|
+
withoutTrailingCharacters: () => import_withoutTrailingCharacters.default,
|
|
40
|
+
withoutTrailingCharactersRecursive: () => import_withoutTrailingCharactersRecursive.default,
|
|
41
|
+
withoutTrailingSlash: () => import_withoutTrailingSlash.default
|
|
42
|
+
});
|
|
43
|
+
var import_withLeadingCharacters = __toESM(require("./withLeadingCharacters.cjs"), 1);
|
|
44
|
+
var import_withLeadingSlash = __toESM(require("./withLeadingSlash.cjs"), 1);
|
|
45
|
+
var import_withoutLeadingCharacters = __toESM(require("./withoutLeadingCharacters.cjs"), 1);
|
|
46
|
+
var import_withoutLeadingCharactersRecursive = __toESM(require("./withoutLeadingCharactersRecursive.cjs"), 1);
|
|
47
|
+
var import_withoutLeadingSlash = __toESM(require("./withoutLeadingSlash.cjs"), 1);
|
|
48
|
+
var import_withoutTrailingCharacters = __toESM(require("./withoutTrailingCharacters.cjs"), 1);
|
|
49
|
+
var import_withoutTrailingCharactersRecursive = __toESM(require("./withoutTrailingCharactersRecursive.cjs"), 1);
|
|
50
|
+
var import_withoutTrailingSlash = __toESM(require("./withoutTrailingSlash.cjs"), 1);
|
|
51
|
+
var import_withTrailingCharacters = __toESM(require("./withTrailingCharacters.cjs"), 1);
|
|
52
|
+
var import_withTrailingSlash = __toESM(require("./withTrailingSlash.cjs"), 1);
|
|
53
|
+
module.exports = __toCommonJS(string_exports);
|
|
54
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/utils/string/index.js
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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,39 @@
|
|
|
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
|
+
|
|
29
|
+
// packages/js-toolkit/utils/string/withLeadingCharacters.js
|
|
30
|
+
var withLeadingCharacters_exports = {};
|
|
31
|
+
__export(withLeadingCharacters_exports, {
|
|
32
|
+
default: () => withLeadingCharacters
|
|
33
|
+
});
|
|
34
|
+
var import_withoutLeadingCharacters = __toESM(require("./withoutLeadingCharacters.cjs"), 1);
|
|
35
|
+
function withLeadingCharacters(string, characters) {
|
|
36
|
+
return `${characters}${(0, import_withoutLeadingCharacters.default)(string, characters)}`;
|
|
37
|
+
}
|
|
38
|
+
module.exports = __toCommonJS(withLeadingCharacters_exports);
|
|
39
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import withoutLeadingCharacters from
|
|
2
|
-
|
|
3
|
-
return
|
|
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,39 @@
|
|
|
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
|
+
|
|
29
|
+
// packages/js-toolkit/utils/string/withLeadingSlash.js
|
|
30
|
+
var withLeadingSlash_exports = {};
|
|
31
|
+
__export(withLeadingSlash_exports, {
|
|
32
|
+
default: () => withLeadingSlash
|
|
33
|
+
});
|
|
34
|
+
var import_withLeadingCharacters = __toESM(require("./withLeadingCharacters.cjs"), 1);
|
|
35
|
+
function withLeadingSlash(string) {
|
|
36
|
+
return (0, import_withLeadingCharacters.default)(string, "/");
|
|
37
|
+
}
|
|
38
|
+
module.exports = __toCommonJS(withLeadingSlash_exports);
|
|
39
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import withLeadingCharacters from
|
|
2
|
-
|
|
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,39 @@
|
|
|
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
|
+
|
|
29
|
+
// packages/js-toolkit/utils/string/withTrailingCharacters.js
|
|
30
|
+
var withTrailingCharacters_exports = {};
|
|
31
|
+
__export(withTrailingCharacters_exports, {
|
|
32
|
+
default: () => withTrailingCharacters
|
|
33
|
+
});
|
|
34
|
+
var import_withoutTrailingCharacters = __toESM(require("./withoutTrailingCharacters.cjs"), 1);
|
|
35
|
+
function withTrailingCharacters(string, characters) {
|
|
36
|
+
return `${(0, import_withoutTrailingCharacters.default)(string, characters)}${characters}`;
|
|
37
|
+
}
|
|
38
|
+
module.exports = __toCommonJS(withTrailingCharacters_exports);
|
|
39
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import withoutTrailingCharacters from
|
|
2
|
-
|
|
3
|
-
return
|
|
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,39 @@
|
|
|
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
|
+
|
|
29
|
+
// packages/js-toolkit/utils/string/withTrailingSlash.js
|
|
30
|
+
var withTrailingSlash_exports = {};
|
|
31
|
+
__export(withTrailingSlash_exports, {
|
|
32
|
+
default: () => withTrailingSlash
|
|
33
|
+
});
|
|
34
|
+
var import_withTrailingCharacters = __toESM(require("./withTrailingCharacters.cjs"), 1);
|
|
35
|
+
function withTrailingSlash(string) {
|
|
36
|
+
return (0, import_withTrailingCharacters.default)(string, "/");
|
|
37
|
+
}
|
|
38
|
+
module.exports = __toCommonJS(withTrailingSlash_exports);
|
|
39
|
+
if (module.exports.default) module.exports = module.exports.default;
|