@kikiutils/shared 12.0.0 → 13.0.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.
- package/README.md +1 -1
- package/dist/buffer.d.ts +7 -3
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +42 -0
- package/dist/buffer.js.map +1 -0
- package/dist/clipboard.d.ts +8 -6
- package/dist/clipboard.d.ts.map +1 -1
- package/dist/clipboard.js +86 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/consola.d.ts +8 -2
- package/dist/consola.d.ts.map +1 -1
- package/dist/consola.js +32 -0
- package/dist/consola.js.map +1 -0
- package/dist/crypto-hash.d.ts +16 -26
- package/dist/crypto-hash.d.ts.map +1 -1
- package/dist/crypto-hash.js +37 -0
- package/dist/crypto-hash.js.map +1 -0
- package/dist/datetime.d.ts +13 -9
- package/dist/datetime.d.ts.map +1 -1
- package/dist/datetime.js +131 -0
- package/dist/datetime.js.map +1 -0
- package/dist/element-plus.d.ts +8 -4
- package/dist/element-plus.d.ts.map +1 -1
- package/dist/element-plus.js +37 -0
- package/dist/element-plus.js.map +1 -0
- package/dist/enum.d.ts +6 -3
- package/dist/enum.d.ts.map +1 -1
- package/dist/enum.js +108 -0
- package/dist/enum.js.map +1 -0
- package/dist/env.d.ts +12 -9
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +51 -0
- package/dist/env.js.map +1 -0
- package/dist/general.d.ts +5 -2
- package/dist/general.d.ts.map +1 -1
- package/dist/general.js +8 -0
- package/dist/general.js.map +1 -0
- package/dist/hash.d.ts +7 -4
- package/dist/hash.d.ts.map +1 -1
- package/dist/hash.js +20 -0
- package/dist/hash.js.map +1 -0
- package/dist/math.d.ts +20 -17
- package/dist/math.d.ts.map +1 -1
- package/dist/math.js +36 -0
- package/dist/math.js.map +1 -0
- package/dist/number.d.ts +7 -2
- package/dist/number.d.ts.map +1 -1
- package/dist/number.js +32 -0
- package/dist/number.js.map +1 -0
- package/dist/object.d.ts +4 -1
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +42 -0
- package/dist/object.js.map +1 -0
- package/dist/pino.d.ts +8 -2
- package/dist/pino.d.ts.map +1 -1
- package/dist/pino.js +40 -0
- package/dist/pino.js.map +1 -0
- package/dist/random.d.ts +4 -1
- package/dist/random.d.ts.map +1 -1
- package/dist/random.js +31 -0
- package/dist/random.js.map +1 -0
- package/dist/storage/enhanced/local/core.d.ts +45 -42
- package/dist/storage/enhanced/local/core.d.ts.map +1 -1
- package/dist/storage/enhanced/local/core.js +63 -0
- package/dist/storage/enhanced/local/core.js.map +1 -0
- package/dist/storage/enhanced/local/index.d.ts +3 -3
- package/dist/storage/enhanced/local/index.js +4 -0
- package/dist/storage/enhanced/local/keyed-store.d.ts +14 -11
- package/dist/storage/enhanced/local/keyed-store.d.ts.map +1 -1
- package/dist/storage/enhanced/local/keyed-store.js +36 -0
- package/dist/storage/enhanced/local/keyed-store.js.map +1 -0
- package/dist/storage/enhanced/redis/core.d.ts +64 -59
- package/dist/storage/enhanced/redis/core.d.ts.map +1 -1
- package/dist/storage/enhanced/redis/core.js +85 -0
- package/dist/storage/enhanced/redis/core.js.map +1 -0
- package/dist/storage/enhanced/redis/index.d.ts +3 -3
- package/dist/storage/enhanced/redis/index.js +4 -0
- package/dist/storage/enhanced/redis/keyed-store.d.ts +19 -14
- package/dist/storage/enhanced/redis/keyed-store.d.ts.map +1 -1
- package/dist/storage/enhanced/redis/keyed-store.js +41 -0
- package/dist/storage/enhanced/redis/keyed-store.js.map +1 -0
- package/dist/storage/lru/keyed-store.d.ts +21 -16
- package/dist/storage/lru/keyed-store.d.ts.map +1 -1
- package/dist/storage/lru/keyed-store.js +40 -0
- package/dist/storage/lru/keyed-store.js.map +1 -0
- package/dist/string.d.ts +5 -2
- package/dist/string.d.ts.map +1 -1
- package/dist/string.js +42 -0
- package/dist/string.js.map +1 -0
- package/dist/url.d.ts +4 -1
- package/dist/url.d.ts.map +1 -1
- package/dist/url.js +21 -0
- package/dist/url.js.map +1 -0
- package/dist/vue.d.ts +10 -5
- package/dist/vue.d.ts.map +1 -1
- package/dist/vue.js +58 -0
- package/dist/vue.js.map +1 -0
- package/dist/web.d.ts +5 -2
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +32 -0
- package/dist/web.js.map +1 -0
- package/package.json +43 -27
- package/src/env.ts +1 -1
- package/src/vue.ts +1 -1
- package/src/web.ts +1 -1
- package/dist/buffer.cjs +0 -43
- package/dist/buffer.cjs.map +0 -1
- package/dist/buffer.mjs +0 -41
- package/dist/buffer.mjs.map +0 -1
- package/dist/clipboard.cjs +0 -91
- package/dist/clipboard.cjs.map +0 -1
- package/dist/clipboard.mjs +0 -88
- package/dist/clipboard.mjs.map +0 -1
- package/dist/consola.cjs +0 -35
- package/dist/consola.cjs.map +0 -1
- package/dist/consola.mjs +0 -32
- package/dist/consola.mjs.map +0 -1
- package/dist/crypto-hash.cjs +0 -61
- package/dist/crypto-hash.cjs.map +0 -1
- package/dist/crypto-hash.mjs +0 -50
- package/dist/crypto-hash.mjs.map +0 -1
- package/dist/datetime.cjs +0 -134
- package/dist/datetime.cjs.map +0 -1
- package/dist/datetime.mjs +0 -130
- package/dist/datetime.mjs.map +0 -1
- package/dist/element-plus.cjs +0 -37
- package/dist/element-plus.cjs.map +0 -1
- package/dist/element-plus.mjs +0 -35
- package/dist/element-plus.mjs.map +0 -1
- package/dist/enum.cjs +0 -112
- package/dist/enum.cjs.map +0 -1
- package/dist/enum.mjs +0 -108
- package/dist/enum.mjs.map +0 -1
- package/dist/env.cjs +0 -53
- package/dist/env.cjs.map +0 -1
- package/dist/env.mjs +0 -50
- package/dist/env.mjs.map +0 -1
- package/dist/general.cjs +0 -10
- package/dist/general.cjs.map +0 -1
- package/dist/general.mjs +0 -8
- package/dist/general.mjs.map +0 -1
- package/dist/hash.cjs +0 -36
- package/dist/hash.cjs.map +0 -1
- package/dist/hash.mjs +0 -31
- package/dist/hash.mjs.map +0 -1
- package/dist/math.cjs +0 -38
- package/dist/math.cjs.map +0 -1
- package/dist/math.mjs +0 -36
- package/dist/math.mjs.map +0 -1
- package/dist/number.cjs +0 -32
- package/dist/number.cjs.map +0 -1
- package/dist/number.mjs +0 -30
- package/dist/number.mjs.map +0 -1
- package/dist/object.cjs +0 -55
- package/dist/object.cjs.map +0 -1
- package/dist/object.mjs +0 -53
- package/dist/object.mjs.map +0 -1
- package/dist/pino.cjs +0 -42
- package/dist/pino.cjs.map +0 -1
- package/dist/pino.mjs +0 -39
- package/dist/pino.mjs.map +0 -1
- package/dist/random.cjs +0 -31
- package/dist/random.cjs.map +0 -1
- package/dist/random.mjs +0 -29
- package/dist/random.mjs.map +0 -1
- package/dist/storage/enhanced/local/core.cjs +0 -105
- package/dist/storage/enhanced/local/core.cjs.map +0 -1
- package/dist/storage/enhanced/local/core.mjs +0 -103
- package/dist/storage/enhanced/local/core.mjs.map +0 -1
- package/dist/storage/enhanced/local/index.cjs +0 -10
- package/dist/storage/enhanced/local/index.cjs.map +0 -1
- package/dist/storage/enhanced/local/index.d.ts.map +0 -1
- package/dist/storage/enhanced/local/index.mjs +0 -3
- package/dist/storage/enhanced/local/index.mjs.map +0 -1
- package/dist/storage/enhanced/local/keyed-store.cjs +0 -41
- package/dist/storage/enhanced/local/keyed-store.cjs.map +0 -1
- package/dist/storage/enhanced/local/keyed-store.mjs +0 -39
- package/dist/storage/enhanced/local/keyed-store.mjs.map +0 -1
- package/dist/storage/enhanced/redis/core.cjs +0 -144
- package/dist/storage/enhanced/redis/core.cjs.map +0 -1
- package/dist/storage/enhanced/redis/core.mjs +0 -142
- package/dist/storage/enhanced/redis/core.mjs.map +0 -1
- package/dist/storage/enhanced/redis/index.cjs +0 -10
- package/dist/storage/enhanced/redis/index.cjs.map +0 -1
- package/dist/storage/enhanced/redis/index.d.ts.map +0 -1
- package/dist/storage/enhanced/redis/index.mjs +0 -3
- package/dist/storage/enhanced/redis/index.mjs.map +0 -1
- package/dist/storage/enhanced/redis/keyed-store.cjs +0 -46
- package/dist/storage/enhanced/redis/keyed-store.cjs.map +0 -1
- package/dist/storage/enhanced/redis/keyed-store.mjs +0 -44
- package/dist/storage/enhanced/redis/keyed-store.mjs.map +0 -1
- package/dist/storage/lru/keyed-store.cjs +0 -49
- package/dist/storage/lru/keyed-store.cjs.map +0 -1
- package/dist/storage/lru/keyed-store.mjs +0 -47
- package/dist/storage/lru/keyed-store.mjs.map +0 -1
- package/dist/string.cjs +0 -45
- package/dist/string.cjs.map +0 -1
- package/dist/string.mjs +0 -43
- package/dist/string.mjs.map +0 -1
- package/dist/url.cjs +0 -21
- package/dist/url.cjs.map +0 -1
- package/dist/url.mjs +0 -19
- package/dist/url.mjs.map +0 -1
- package/dist/vue.cjs +0 -64
- package/dist/vue.cjs.map +0 -1
- package/dist/vue.mjs +0 -59
- package/dist/vue.mjs.map +0 -1
- package/dist/web.cjs +0 -35
- package/dist/web.cjs.map +0 -1
- package/dist/web.mjs +0 -32
- package/dist/web.mjs.map +0 -1
package/dist/vue.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vue.cjs","sources":["../src/vue.ts"],"sourcesContent":["import { onActivated } from 'vue';\nimport type { Ref } from 'vue';\nimport {\n onBeforeRouteLeave,\n useRoute,\n} from 'vue-router';\n\nimport { appendRedirectParamToUrl } from './url';\n\n/**\n * Appends the current Vue Router route's fullPath as the `redirect` query parameter to the given URL.\n *\n * @param {string} url - The base URL to modify\n *\n * @returns {string} A new URL with the current route fullPath as the `redirect` parameter\n */\nexport function appendRedirectParamFromCurrentRouteToUrl(url: string) {\n return appendRedirectParamToUrl(url, useRoute().fullPath);\n}\n\n/**\n * Clears an interval referenced by a Vue ref and sets it to null.\n *\n * @param {Ref<null | ReturnType<typeof setInterval>>} intervalRef - A Vue ref holding a NodeJS.Timeout or null\n */\nexport function clearIntervalRef(intervalRef: Ref<null | ReturnType<typeof setInterval>>) {\n if (intervalRef.value) clearInterval(intervalRef.value);\n intervalRef.value = null;\n}\n\n/**\n * Clears a timeout referenced by a Vue ref and sets it to null.\n *\n * @param {Ref<null | ReturnType<typeof setTimeout>>} timeoutRef - A Vue ref holding a NodeJS.Timeout or null\n */\nexport function clearTimeoutRef(timeoutRef: Ref<null | ReturnType<typeof setTimeout>>) {\n if (timeoutRef.value) clearTimeout(timeoutRef.value);\n timeoutRef.value = null;\n}\n\n/**\n * A Vue composition function that remembers and restores scroll position\n * of a scrollable container across route changes and keep-alive activation.\n *\n * @template T - The type of the scrollable element (defaults to HTMLElement)\n *\n * @param {Ref<null | T>} containerRef - A ref to the scrollable HTML element\n */\nexport function usePreserveScroll<T extends Element = HTMLElement>(containerRef: Ref<null | T>) {\n let scrollLeft = 0;\n let scrollTop = 0;\n onActivated(() => {\n if (!containerRef.value) return;\n containerRef.value.scrollLeft = scrollLeft;\n containerRef.value.scrollTop = scrollTop;\n });\n\n onBeforeRouteLeave(() => {\n scrollLeft = containerRef.value?.scrollLeft || 0;\n scrollTop = containerRef.value?.scrollTop || 0;\n });\n}\n"],"names":["url","appendRedirectParamToUrl","useRoute","onActivated","onBeforeRouteLeave"],"mappings":";;;;;;AASA;;;;;;AAMG;AACG,SAAU,wCAAwC,CAACA,KAAW,EAAA;IAChE,OAAOC,4BAAwB,CAACD,KAAG,EAAEE,kBAAQ,EAAE,CAAC,QAAQ,CAAC;AAC7D;AAEA;;;;AAIG;AACG,SAAU,gBAAgB,CAAC,WAAuD,EAAA;IACpF,IAAI,WAAW,CAAC,KAAK;AAAE,QAAA,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC;AACvD,IAAA,WAAW,CAAC,KAAK,GAAG,IAAI;AAC5B;AAEA;;;;AAIG;AACG,SAAU,eAAe,CAAC,UAAqD,EAAA;IACjF,IAAI,UAAU,CAAC,KAAK;AAAE,QAAA,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC;AACpD,IAAA,UAAU,CAAC,KAAK,GAAG,IAAI;AAC3B;AAEA;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAkC,YAA2B,EAAA;IAC1F,IAAI,UAAU,GAAG,CAAC;IAClB,IAAI,SAAS,GAAG,CAAC;IACjBC,eAAW,CAAC,MAAK;QACb,IAAI,CAAC,YAAY,CAAC,KAAK;YAAE;AACzB,QAAA,YAAY,CAAC,KAAK,CAAC,UAAU,GAAG,UAAU;AAC1C,QAAA,YAAY,CAAC,KAAK,CAAC,SAAS,GAAG,SAAS;AAC5C,IAAA,CAAC,CAAC;IAEFC,4BAAkB,CAAC,MAAK;QACpB,UAAU,GAAG,YAAY,CAAC,KAAK,EAAE,UAAU,IAAI,CAAC;QAChD,SAAS,GAAG,YAAY,CAAC,KAAK,EAAE,SAAS,IAAI,CAAC;AAClD,IAAA,CAAC,CAAC;AACN;;;;;;;"}
|
package/dist/vue.mjs
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { onActivated } from 'vue';
|
|
2
|
-
import { useRoute, onBeforeRouteLeave } from 'vue-router';
|
|
3
|
-
import { appendRedirectParamToUrl } from './url.mjs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Appends the current Vue Router route's fullPath as the `redirect` query parameter to the given URL.
|
|
7
|
-
*
|
|
8
|
-
* @param {string} url - The base URL to modify
|
|
9
|
-
*
|
|
10
|
-
* @returns {string} A new URL with the current route fullPath as the `redirect` parameter
|
|
11
|
-
*/
|
|
12
|
-
function appendRedirectParamFromCurrentRouteToUrl(url) {
|
|
13
|
-
return appendRedirectParamToUrl(url, useRoute().fullPath);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Clears an interval referenced by a Vue ref and sets it to null.
|
|
17
|
-
*
|
|
18
|
-
* @param {Ref<null | ReturnType<typeof setInterval>>} intervalRef - A Vue ref holding a NodeJS.Timeout or null
|
|
19
|
-
*/
|
|
20
|
-
function clearIntervalRef(intervalRef) {
|
|
21
|
-
if (intervalRef.value)
|
|
22
|
-
clearInterval(intervalRef.value);
|
|
23
|
-
intervalRef.value = null;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Clears a timeout referenced by a Vue ref and sets it to null.
|
|
27
|
-
*
|
|
28
|
-
* @param {Ref<null | ReturnType<typeof setTimeout>>} timeoutRef - A Vue ref holding a NodeJS.Timeout or null
|
|
29
|
-
*/
|
|
30
|
-
function clearTimeoutRef(timeoutRef) {
|
|
31
|
-
if (timeoutRef.value)
|
|
32
|
-
clearTimeout(timeoutRef.value);
|
|
33
|
-
timeoutRef.value = null;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* A Vue composition function that remembers and restores scroll position
|
|
37
|
-
* of a scrollable container across route changes and keep-alive activation.
|
|
38
|
-
*
|
|
39
|
-
* @template T - The type of the scrollable element (defaults to HTMLElement)
|
|
40
|
-
*
|
|
41
|
-
* @param {Ref<null | T>} containerRef - A ref to the scrollable HTML element
|
|
42
|
-
*/
|
|
43
|
-
function usePreserveScroll(containerRef) {
|
|
44
|
-
let scrollLeft = 0;
|
|
45
|
-
let scrollTop = 0;
|
|
46
|
-
onActivated(() => {
|
|
47
|
-
if (!containerRef.value)
|
|
48
|
-
return;
|
|
49
|
-
containerRef.value.scrollLeft = scrollLeft;
|
|
50
|
-
containerRef.value.scrollTop = scrollTop;
|
|
51
|
-
});
|
|
52
|
-
onBeforeRouteLeave(() => {
|
|
53
|
-
scrollLeft = containerRef.value?.scrollLeft || 0;
|
|
54
|
-
scrollTop = containerRef.value?.scrollTop || 0;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { appendRedirectParamFromCurrentRouteToUrl, clearIntervalRef, clearTimeoutRef, usePreserveScroll };
|
|
59
|
-
//# sourceMappingURL=vue.mjs.map
|
package/dist/vue.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vue.mjs","sources":["../src/vue.ts"],"sourcesContent":["import { onActivated } from 'vue';\nimport type { Ref } from 'vue';\nimport {\n onBeforeRouteLeave,\n useRoute,\n} from 'vue-router';\n\nimport { appendRedirectParamToUrl } from './url';\n\n/**\n * Appends the current Vue Router route's fullPath as the `redirect` query parameter to the given URL.\n *\n * @param {string} url - The base URL to modify\n *\n * @returns {string} A new URL with the current route fullPath as the `redirect` parameter\n */\nexport function appendRedirectParamFromCurrentRouteToUrl(url: string) {\n return appendRedirectParamToUrl(url, useRoute().fullPath);\n}\n\n/**\n * Clears an interval referenced by a Vue ref and sets it to null.\n *\n * @param {Ref<null | ReturnType<typeof setInterval>>} intervalRef - A Vue ref holding a NodeJS.Timeout or null\n */\nexport function clearIntervalRef(intervalRef: Ref<null | ReturnType<typeof setInterval>>) {\n if (intervalRef.value) clearInterval(intervalRef.value);\n intervalRef.value = null;\n}\n\n/**\n * Clears a timeout referenced by a Vue ref and sets it to null.\n *\n * @param {Ref<null | ReturnType<typeof setTimeout>>} timeoutRef - A Vue ref holding a NodeJS.Timeout or null\n */\nexport function clearTimeoutRef(timeoutRef: Ref<null | ReturnType<typeof setTimeout>>) {\n if (timeoutRef.value) clearTimeout(timeoutRef.value);\n timeoutRef.value = null;\n}\n\n/**\n * A Vue composition function that remembers and restores scroll position\n * of a scrollable container across route changes and keep-alive activation.\n *\n * @template T - The type of the scrollable element (defaults to HTMLElement)\n *\n * @param {Ref<null | T>} containerRef - A ref to the scrollable HTML element\n */\nexport function usePreserveScroll<T extends Element = HTMLElement>(containerRef: Ref<null | T>) {\n let scrollLeft = 0;\n let scrollTop = 0;\n onActivated(() => {\n if (!containerRef.value) return;\n containerRef.value.scrollLeft = scrollLeft;\n containerRef.value.scrollTop = scrollTop;\n });\n\n onBeforeRouteLeave(() => {\n scrollLeft = containerRef.value?.scrollLeft || 0;\n scrollTop = containerRef.value?.scrollTop || 0;\n });\n}\n"],"names":[],"mappings":";;;;AASA;;;;;;AAMG;AACG,SAAU,wCAAwC,CAAC,GAAW,EAAA;IAChE,OAAO,wBAAwB,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC;AAC7D;AAEA;;;;AAIG;AACG,SAAU,gBAAgB,CAAC,WAAuD,EAAA;IACpF,IAAI,WAAW,CAAC,KAAK;AAAE,QAAA,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC;AACvD,IAAA,WAAW,CAAC,KAAK,GAAG,IAAI;AAC5B;AAEA;;;;AAIG;AACG,SAAU,eAAe,CAAC,UAAqD,EAAA;IACjF,IAAI,UAAU,CAAC,KAAK;AAAE,QAAA,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC;AACpD,IAAA,UAAU,CAAC,KAAK,GAAG,IAAI;AAC3B;AAEA;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAkC,YAA2B,EAAA;IAC1F,IAAI,UAAU,GAAG,CAAC;IAClB,IAAI,SAAS,GAAG,CAAC;IACjB,WAAW,CAAC,MAAK;QACb,IAAI,CAAC,YAAY,CAAC,KAAK;YAAE;AACzB,QAAA,YAAY,CAAC,KAAK,CAAC,UAAU,GAAG,UAAU;AAC1C,QAAA,YAAY,CAAC,KAAK,CAAC,SAAS,GAAG,SAAS;AAC5C,IAAA,CAAC,CAAC;IAEF,kBAAkB,CAAC,MAAK;QACpB,UAAU,GAAG,YAAY,CAAC,KAAK,EAAE,UAAU,IAAI,CAAC;QAChD,SAAS,GAAG,YAAY,CAAC,KAAK,EAAE,SAAS,IAAI,CAAC;AAClD,IAAA,CAAC,CAAC;AACN;;;;"}
|
package/dist/web.cjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const url = require('./url.cjs');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Appends the current browser URL (including path, query, and hash) as the `redirect` query parameter to the given URL.
|
|
7
|
-
*
|
|
8
|
-
* @param {string} url - The base URL to modify
|
|
9
|
-
*
|
|
10
|
-
* @returns {string} A new URL with the current location as the `redirect` parameter
|
|
11
|
-
*/
|
|
12
|
-
function appendRedirectParamFromCurrentLocationToUrl(url$1) {
|
|
13
|
-
const currentPath = `${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
14
|
-
return url.appendRedirectParamToUrl(url$1, currentPath);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Navigates to the given URL, appending the current browser location
|
|
18
|
-
* (path, query, and hash) as the `redirect` query parameter.
|
|
19
|
-
*
|
|
20
|
-
* Useful for redirecting to login or other gateways while preserving
|
|
21
|
-
* the current location for post-auth navigation.
|
|
22
|
-
*
|
|
23
|
-
* @param {string} url - The destination URL to navigate to
|
|
24
|
-
* @param {number} [delayMs] - Optional delay in milliseconds before navigation
|
|
25
|
-
*/
|
|
26
|
-
function assignUrlWithRedirectParamFromCurrentLocation(url, delayMs) {
|
|
27
|
-
if (delayMs === undefined)
|
|
28
|
-
window.location.assign(appendRedirectParamFromCurrentLocationToUrl(url));
|
|
29
|
-
else
|
|
30
|
-
return setTimeout(() => window.location.assign(appendRedirectParamFromCurrentLocationToUrl(url)), delayMs);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
exports.appendRedirectParamFromCurrentLocationToUrl = appendRedirectParamFromCurrentLocationToUrl;
|
|
34
|
-
exports.assignUrlWithRedirectParamFromCurrentLocation = assignUrlWithRedirectParamFromCurrentLocation;
|
|
35
|
-
//# sourceMappingURL=web.cjs.map
|
package/dist/web.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"web.cjs","sources":["../src/web.ts"],"sourcesContent":["import { appendRedirectParamToUrl } from './url';\n\n/**\n * Appends the current browser URL (including path, query, and hash) as the `redirect` query parameter to the given URL.\n *\n * @param {string} url - The base URL to modify\n *\n * @returns {string} A new URL with the current location as the `redirect` parameter\n */\nexport function appendRedirectParamFromCurrentLocationToUrl(url: string) {\n const currentPath = `${window.location.pathname}${window.location.search}${window.location.hash}`;\n return appendRedirectParamToUrl(url, currentPath);\n}\n\n/**\n * Navigates to the given URL, appending the current browser location\n * (path, query, and hash) as the `redirect` query parameter.\n *\n * Useful for redirecting to login or other gateways while preserving\n * the current location for post-auth navigation.\n *\n * @param {string} url - The destination URL to navigate to\n * @param {number} [delayMs] - Optional delay in milliseconds before navigation\n */\nexport function assignUrlWithRedirectParamFromCurrentLocation(url: string, delayMs?: number) {\n if (delayMs === undefined) window.location.assign(appendRedirectParamFromCurrentLocationToUrl(url));\n else return setTimeout(() => window.location.assign(appendRedirectParamFromCurrentLocationToUrl(url)), delayMs);\n}\n"],"names":["url","appendRedirectParamToUrl"],"mappings":";;;;AAEA;;;;;;AAMG;AACG,SAAU,2CAA2C,CAACA,KAAW,EAAA;IACnE,MAAM,WAAW,GAAG,CAAA,EAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAA,EAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAA,EAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAA,CAAE;AACjG,IAAA,OAAOC,4BAAwB,CAACD,KAAG,EAAE,WAAW,CAAC;AACrD;AAEA;;;;;;;;;AASG;AACG,SAAU,6CAA6C,CAAC,GAAW,EAAE,OAAgB,EAAA;IACvF,IAAI,OAAO,KAAK,SAAS;QAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,2CAA2C,CAAC,GAAG,CAAC,CAAC;;AAC9F,QAAA,OAAO,UAAU,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,2CAA2C,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC;AACnH;;;;;"}
|
package/dist/web.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { appendRedirectParamToUrl } from './url.mjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Appends the current browser URL (including path, query, and hash) as the `redirect` query parameter to the given URL.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} url - The base URL to modify
|
|
7
|
-
*
|
|
8
|
-
* @returns {string} A new URL with the current location as the `redirect` parameter
|
|
9
|
-
*/
|
|
10
|
-
function appendRedirectParamFromCurrentLocationToUrl(url) {
|
|
11
|
-
const currentPath = `${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
12
|
-
return appendRedirectParamToUrl(url, currentPath);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Navigates to the given URL, appending the current browser location
|
|
16
|
-
* (path, query, and hash) as the `redirect` query parameter.
|
|
17
|
-
*
|
|
18
|
-
* Useful for redirecting to login or other gateways while preserving
|
|
19
|
-
* the current location for post-auth navigation.
|
|
20
|
-
*
|
|
21
|
-
* @param {string} url - The destination URL to navigate to
|
|
22
|
-
* @param {number} [delayMs] - Optional delay in milliseconds before navigation
|
|
23
|
-
*/
|
|
24
|
-
function assignUrlWithRedirectParamFromCurrentLocation(url, delayMs) {
|
|
25
|
-
if (delayMs === undefined)
|
|
26
|
-
window.location.assign(appendRedirectParamFromCurrentLocationToUrl(url));
|
|
27
|
-
else
|
|
28
|
-
return setTimeout(() => window.location.assign(appendRedirectParamFromCurrentLocationToUrl(url)), delayMs);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { appendRedirectParamFromCurrentLocationToUrl, assignUrlWithRedirectParamFromCurrentLocation };
|
|
32
|
-
//# sourceMappingURL=web.mjs.map
|
package/dist/web.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"web.mjs","sources":["../src/web.ts"],"sourcesContent":["import { appendRedirectParamToUrl } from './url';\n\n/**\n * Appends the current browser URL (including path, query, and hash) as the `redirect` query parameter to the given URL.\n *\n * @param {string} url - The base URL to modify\n *\n * @returns {string} A new URL with the current location as the `redirect` parameter\n */\nexport function appendRedirectParamFromCurrentLocationToUrl(url: string) {\n const currentPath = `${window.location.pathname}${window.location.search}${window.location.hash}`;\n return appendRedirectParamToUrl(url, currentPath);\n}\n\n/**\n * Navigates to the given URL, appending the current browser location\n * (path, query, and hash) as the `redirect` query parameter.\n *\n * Useful for redirecting to login or other gateways while preserving\n * the current location for post-auth navigation.\n *\n * @param {string} url - The destination URL to navigate to\n * @param {number} [delayMs] - Optional delay in milliseconds before navigation\n */\nexport function assignUrlWithRedirectParamFromCurrentLocation(url: string, delayMs?: number) {\n if (delayMs === undefined) window.location.assign(appendRedirectParamFromCurrentLocationToUrl(url));\n else return setTimeout(() => window.location.assign(appendRedirectParamFromCurrentLocationToUrl(url)), delayMs);\n}\n"],"names":[],"mappings":";;AAEA;;;;;;AAMG;AACG,SAAU,2CAA2C,CAAC,GAAW,EAAA;IACnE,MAAM,WAAW,GAAG,CAAA,EAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAA,EAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAA,EAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAA,CAAE;AACjG,IAAA,OAAO,wBAAwB,CAAC,GAAG,EAAE,WAAW,CAAC;AACrD;AAEA;;;;;;;;;AASG;AACG,SAAU,6CAA6C,CAAC,GAAW,EAAE,OAAgB,EAAA;IACvF,IAAI,OAAO,KAAK,SAAS;QAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,2CAA2C,CAAC,GAAG,CAAC,CAAC;;AAC9F,QAAA,OAAO,UAAU,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,2CAA2C,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC;AACnH;;;;"}
|