@koine/browser 2.0.0-beta.13 → 2.0.0-beta.131
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/createStorage.cjs.d.ts +2 -0
- package/createStorage.cjs.default.js +1 -0
- package/createStorage.cjs.js +50 -0
- package/createStorage.cjs.mjs +2 -0
- package/createStorage.d.ts +7 -54
- package/createStorage.esm.d.ts +2 -0
- package/createStorage.esm.js +45 -0
- package/getZonedDate.cjs.d.ts +2 -0
- package/getZonedDate.cjs.default.js +1 -0
- package/{getZonedDate.mjs → getZonedDate.cjs.js} +13 -18
- package/getZonedDate.cjs.mjs +2 -0
- package/getZonedDate.d.ts +1 -15
- package/getZonedDate.esm.d.ts +2 -0
- package/getZonedDate.esm.js +21 -0
- package/gtag.cjs.d.ts +2 -0
- package/gtag.cjs.default.js +1 -0
- package/gtag.cjs.js +22 -0
- package/gtag.cjs.mjs +2 -0
- package/gtag.d.ts +2 -0
- package/gtag.esm.d.ts +2 -0
- package/gtag.esm.js +17 -0
- package/gtagPageview.cjs.d.ts +2 -0
- package/gtagPageview.cjs.default.js +1 -0
- package/gtagPageview.cjs.js +12 -0
- package/gtagPageview.cjs.mjs +2 -0
- package/gtagPageview.d.ts +1 -4
- package/gtagPageview.esm.d.ts +2 -0
- package/gtagPageview.esm.js +7 -0
- package/index.cjs.d.ts +1 -0
- package/index.cjs.default.js +1 -0
- package/index.cjs.js +41 -0
- package/index.cjs.mjs +2 -0
- package/index.d.ts +4 -1
- package/index.esm.d.ts +1 -0
- package/index.esm.js +18 -0
- package/isIE.cjs.d.ts +2 -0
- package/isIE.cjs.default.js +1 -0
- package/isIE.cjs.js +14 -0
- package/isIE.cjs.mjs +2 -0
- package/isIE.d.ts +1 -6
- package/isIE.esm.d.ts +2 -0
- package/isIE.esm.js +9 -0
- package/isMobile.cjs.d.ts +2 -0
- package/isMobile.cjs.default.js +1 -0
- package/isMobile.cjs.js +16 -0
- package/isMobile.cjs.mjs +2 -0
- package/isMobile.d.ts +1 -6
- package/isMobile.esm.d.ts +2 -0
- package/isMobile.esm.js +11 -0
- package/listenUrlSearch.cjs.d.ts +2 -0
- package/listenUrlSearch.cjs.default.js +1 -0
- package/listenUrlSearch.cjs.js +32 -0
- package/listenUrlSearch.cjs.mjs +2 -0
- package/listenUrlSearch.d.ts +3 -0
- package/listenUrlSearch.esm.d.ts +2 -0
- package/listenUrlSearch.esm.js +27 -0
- package/listenUrlSearchParams.cjs.d.ts +2 -0
- package/listenUrlSearchParams.cjs.default.js +1 -0
- package/listenUrlSearchParams.cjs.js +14 -0
- package/listenUrlSearchParams.cjs.mjs +2 -0
- package/listenUrlSearchParams.d.ts +2 -0
- package/listenUrlSearchParams.esm.d.ts +2 -0
- package/listenUrlSearchParams.esm.js +9 -0
- package/navigateToHash.cjs.d.ts +2 -0
- package/navigateToHash.cjs.default.js +1 -0
- package/navigateToHash.cjs.js +15 -0
- package/navigateToHash.cjs.mjs +2 -0
- package/navigateToHash.d.ts +1 -7
- package/navigateToHash.esm.d.ts +2 -0
- package/navigateToHash.esm.js +10 -0
- package/navigateToHashParams.cjs.d.ts +2 -0
- package/navigateToHashParams.cjs.default.js +1 -0
- package/navigateToHashParams.cjs.js +15 -0
- package/navigateToHashParams.cjs.mjs +2 -0
- package/navigateToHashParams.d.ts +2 -8
- package/navigateToHashParams.esm.d.ts +2 -0
- package/navigateToHashParams.esm.js +10 -0
- package/navigateToMergedHashParams.cjs.d.ts +2 -0
- package/navigateToMergedHashParams.cjs.default.js +1 -0
- package/navigateToMergedHashParams.cjs.js +15 -0
- package/navigateToMergedHashParams.cjs.mjs +2 -0
- package/navigateToMergedHashParams.d.ts +2 -7
- package/navigateToMergedHashParams.esm.d.ts +2 -0
- package/navigateToMergedHashParams.esm.js +10 -0
- package/navigateToMergedParams.cjs.d.ts +2 -0
- package/navigateToMergedParams.cjs.default.js +1 -0
- package/navigateToMergedParams.cjs.js +16 -0
- package/navigateToMergedParams.cjs.mjs +2 -0
- package/navigateToMergedParams.d.ts +2 -8
- package/navigateToMergedParams.esm.d.ts +2 -0
- package/navigateToMergedParams.esm.js +11 -0
- package/navigateToParams.cjs.d.ts +2 -0
- package/navigateToParams.cjs.default.js +1 -0
- package/navigateToParams.cjs.js +17 -0
- package/navigateToParams.cjs.mjs +2 -0
- package/navigateToParams.d.ts +2 -9
- package/navigateToParams.esm.d.ts +2 -0
- package/navigateToParams.esm.js +12 -0
- package/navigateToUrl.cjs.d.ts +2 -0
- package/navigateToUrl.cjs.default.js +1 -0
- package/navigateToUrl.cjs.js +12 -0
- package/navigateToUrl.cjs.mjs +2 -0
- package/navigateToUrl.d.ts +1 -6
- package/navigateToUrl.esm.d.ts +2 -0
- package/navigateToUrl.esm.js +7 -0
- package/navigateWithoutUrlParam.cjs.d.ts +2 -0
- package/navigateWithoutUrlParam.cjs.default.js +1 -0
- package/navigateWithoutUrlParam.cjs.js +16 -0
- package/navigateWithoutUrlParam.cjs.mjs +2 -0
- package/navigateWithoutUrlParam.d.ts +1 -7
- package/navigateWithoutUrlParam.esm.d.ts +2 -0
- package/navigateWithoutUrlParam.esm.js +11 -0
- package/package.json +129 -8
- package/redirectTo.cjs.d.ts +2 -0
- package/redirectTo.cjs.default.js +1 -0
- package/redirectTo.cjs.js +15 -0
- package/redirectTo.cjs.mjs +2 -0
- package/redirectTo.d.ts +2 -8
- package/redirectTo.esm.d.ts +2 -0
- package/redirectTo.esm.js +10 -0
- package/storage.cjs.d.ts +2 -0
- package/storage.cjs.default.js +1 -0
- package/storage.cjs.js +14 -0
- package/storage.cjs.mjs +2 -0
- package/storage.d.ts +7 -12
- package/storage.esm.d.ts +2 -0
- package/storage.esm.js +9 -0
- package/storageClient.cjs.d.ts +2 -0
- package/storageClient.cjs.default.js +1 -0
- package/storageClient.cjs.js +21 -0
- package/storageClient.cjs.mjs +2 -0
- package/storageClient.d.ts +5 -13
- package/storageClient.esm.d.ts +2 -0
- package/storageClient.esm.js +16 -0
- package/createStorage.mjs +0 -133
- package/gtagPageview.mjs +0 -23
- package/index.mjs +0 -15
- package/isIE.mjs +0 -16
- package/isMobile.mjs +0 -14
- package/navigateToHash.mjs +0 -11
- package/navigateToHashParams.mjs +0 -19
- package/navigateToMergedHashParams.mjs +0 -11
- package/navigateToMergedParams.mjs +0 -12
- package/navigateToParams.mjs +0 -17
- package/navigateToUrl.mjs +0 -10
- package/navigateWithoutUrlParam.mjs +0 -18
- package/redirectTo.mjs +0 -14
- package/storage.mjs +0 -10
- package/storageClient.mjs +0 -97
- package/typings.d.ts +0 -12
package/package.json
CHANGED
|
@@ -2,12 +2,133 @@
|
|
|
2
2
|
"name": "@koine/browser",
|
|
3
3
|
"sideEffects": false,
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@koine/dom": "2.0.0-beta.
|
|
6
|
-
"@koine/utils": "2.0.0-beta.
|
|
5
|
+
"@koine/dom": "2.0.0-beta.131",
|
|
6
|
+
"@koine/utils": "2.0.0-beta.131"
|
|
7
7
|
},
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
"peerDependenciesMeta": {
|
|
9
|
+
"date-fns-tz": {
|
|
10
|
+
"optional": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
"./package.json": "./package.json",
|
|
15
|
+
".": {
|
|
16
|
+
"module": "./index.esm.js",
|
|
17
|
+
"types": "./index.esm.d.ts",
|
|
18
|
+
"import": "./index.cjs.mjs",
|
|
19
|
+
"default": "./index.cjs.js"
|
|
20
|
+
},
|
|
21
|
+
"./createStorage": {
|
|
22
|
+
"module": "./createStorage.esm.js",
|
|
23
|
+
"types": "./createStorage.esm.d.ts",
|
|
24
|
+
"import": "./createStorage.cjs.mjs",
|
|
25
|
+
"default": "./createStorage.cjs.js"
|
|
26
|
+
},
|
|
27
|
+
"./getZonedDate": {
|
|
28
|
+
"module": "./getZonedDate.esm.js",
|
|
29
|
+
"types": "./getZonedDate.esm.d.ts",
|
|
30
|
+
"import": "./getZonedDate.cjs.mjs",
|
|
31
|
+
"default": "./getZonedDate.cjs.js"
|
|
32
|
+
},
|
|
33
|
+
"./gtag": {
|
|
34
|
+
"module": "./gtag.esm.js",
|
|
35
|
+
"types": "./gtag.esm.d.ts",
|
|
36
|
+
"import": "./gtag.cjs.mjs",
|
|
37
|
+
"default": "./gtag.cjs.js"
|
|
38
|
+
},
|
|
39
|
+
"./gtagPageview": {
|
|
40
|
+
"module": "./gtagPageview.esm.js",
|
|
41
|
+
"types": "./gtagPageview.esm.d.ts",
|
|
42
|
+
"import": "./gtagPageview.cjs.mjs",
|
|
43
|
+
"default": "./gtagPageview.cjs.js"
|
|
44
|
+
},
|
|
45
|
+
"./isIE": {
|
|
46
|
+
"module": "./isIE.esm.js",
|
|
47
|
+
"types": "./isIE.esm.d.ts",
|
|
48
|
+
"import": "./isIE.cjs.mjs",
|
|
49
|
+
"default": "./isIE.cjs.js"
|
|
50
|
+
},
|
|
51
|
+
"./isMobile": {
|
|
52
|
+
"module": "./isMobile.esm.js",
|
|
53
|
+
"types": "./isMobile.esm.d.ts",
|
|
54
|
+
"import": "./isMobile.cjs.mjs",
|
|
55
|
+
"default": "./isMobile.cjs.js"
|
|
56
|
+
},
|
|
57
|
+
"./listenUrlSearch": {
|
|
58
|
+
"module": "./listenUrlSearch.esm.js",
|
|
59
|
+
"types": "./listenUrlSearch.esm.d.ts",
|
|
60
|
+
"import": "./listenUrlSearch.cjs.mjs",
|
|
61
|
+
"default": "./listenUrlSearch.cjs.js"
|
|
62
|
+
},
|
|
63
|
+
"./listenUrlSearchParams": {
|
|
64
|
+
"module": "./listenUrlSearchParams.esm.js",
|
|
65
|
+
"types": "./listenUrlSearchParams.esm.d.ts",
|
|
66
|
+
"import": "./listenUrlSearchParams.cjs.mjs",
|
|
67
|
+
"default": "./listenUrlSearchParams.cjs.js"
|
|
68
|
+
},
|
|
69
|
+
"./navigateToHash": {
|
|
70
|
+
"module": "./navigateToHash.esm.js",
|
|
71
|
+
"types": "./navigateToHash.esm.d.ts",
|
|
72
|
+
"import": "./navigateToHash.cjs.mjs",
|
|
73
|
+
"default": "./navigateToHash.cjs.js"
|
|
74
|
+
},
|
|
75
|
+
"./navigateToHashParams": {
|
|
76
|
+
"module": "./navigateToHashParams.esm.js",
|
|
77
|
+
"types": "./navigateToHashParams.esm.d.ts",
|
|
78
|
+
"import": "./navigateToHashParams.cjs.mjs",
|
|
79
|
+
"default": "./navigateToHashParams.cjs.js"
|
|
80
|
+
},
|
|
81
|
+
"./navigateToMergedHashParams": {
|
|
82
|
+
"module": "./navigateToMergedHashParams.esm.js",
|
|
83
|
+
"types": "./navigateToMergedHashParams.esm.d.ts",
|
|
84
|
+
"import": "./navigateToMergedHashParams.cjs.mjs",
|
|
85
|
+
"default": "./navigateToMergedHashParams.cjs.js"
|
|
86
|
+
},
|
|
87
|
+
"./navigateToMergedParams": {
|
|
88
|
+
"module": "./navigateToMergedParams.esm.js",
|
|
89
|
+
"types": "./navigateToMergedParams.esm.d.ts",
|
|
90
|
+
"import": "./navigateToMergedParams.cjs.mjs",
|
|
91
|
+
"default": "./navigateToMergedParams.cjs.js"
|
|
92
|
+
},
|
|
93
|
+
"./navigateToParams": {
|
|
94
|
+
"module": "./navigateToParams.esm.js",
|
|
95
|
+
"types": "./navigateToParams.esm.d.ts",
|
|
96
|
+
"import": "./navigateToParams.cjs.mjs",
|
|
97
|
+
"default": "./navigateToParams.cjs.js"
|
|
98
|
+
},
|
|
99
|
+
"./navigateToUrl": {
|
|
100
|
+
"module": "./navigateToUrl.esm.js",
|
|
101
|
+
"types": "./navigateToUrl.esm.d.ts",
|
|
102
|
+
"import": "./navigateToUrl.cjs.mjs",
|
|
103
|
+
"default": "./navigateToUrl.cjs.js"
|
|
104
|
+
},
|
|
105
|
+
"./navigateWithoutUrlParam": {
|
|
106
|
+
"module": "./navigateWithoutUrlParam.esm.js",
|
|
107
|
+
"types": "./navigateWithoutUrlParam.esm.d.ts",
|
|
108
|
+
"import": "./navigateWithoutUrlParam.cjs.mjs",
|
|
109
|
+
"default": "./navigateWithoutUrlParam.cjs.js"
|
|
110
|
+
},
|
|
111
|
+
"./redirectTo": {
|
|
112
|
+
"module": "./redirectTo.esm.js",
|
|
113
|
+
"types": "./redirectTo.esm.d.ts",
|
|
114
|
+
"import": "./redirectTo.cjs.mjs",
|
|
115
|
+
"default": "./redirectTo.cjs.js"
|
|
116
|
+
},
|
|
117
|
+
"./storage": {
|
|
118
|
+
"module": "./storage.esm.js",
|
|
119
|
+
"types": "./storage.esm.d.ts",
|
|
120
|
+
"import": "./storage.cjs.mjs",
|
|
121
|
+
"default": "./storage.cjs.js"
|
|
122
|
+
},
|
|
123
|
+
"./storageClient": {
|
|
124
|
+
"module": "./storageClient.esm.js",
|
|
125
|
+
"types": "./storageClient.esm.d.ts",
|
|
126
|
+
"import": "./storageClient.cjs.mjs",
|
|
127
|
+
"default": "./storageClient.cjs.js"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"module": "./index.esm.js",
|
|
131
|
+
"main": "./index.cjs.js",
|
|
132
|
+
"types": "./index.esm.d.ts",
|
|
133
|
+
"version": "2.0.0-beta.131"
|
|
134
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports._default = require('./redirectTo.cjs.js').default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var utils = require('@koine/utils');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Redirect to url with params {optionally}, removes eventual trailing question
|
|
9
|
+
* marks from the given URL, it uses `location`
|
|
10
|
+
*
|
|
11
|
+
* @category location
|
|
12
|
+
*/let redirectTo=(t,o)=>{if(utils.isBrowser){let r=utils.buildUrlQueryString(o);location.href=t.replace(/\?+$/g,"")+r;}};
|
|
13
|
+
|
|
14
|
+
exports.default = redirectTo;
|
|
15
|
+
exports.redirectTo = redirectTo;
|
package/redirectTo.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
* Redirect to url with params {optionally}, removes eventual trailing question
|
|
4
|
-
* marks from the given URL, it uses `location`
|
|
5
|
-
*
|
|
6
|
-
* @category location
|
|
7
|
-
*/
|
|
8
|
-
export declare function redirectTo(url: string, params?: AnyQueryParams): void;
|
|
1
|
+
import { type AnyQueryParams } from "@koine/utils";
|
|
2
|
+
export declare let redirectTo: (url: string, params?: AnyQueryParams) => void;
|
|
9
3
|
export default redirectTo;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isBrowser, buildUrlQueryString } from '@koine/utils';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Redirect to url with params {optionally}, removes eventual trailing question
|
|
5
|
+
* marks from the given URL, it uses `location`
|
|
6
|
+
*
|
|
7
|
+
* @category location
|
|
8
|
+
*/let redirectTo=(t,o)=>{if(isBrowser){let r=buildUrlQueryString(o);location.href=t.replace(/\?+$/g,"")+r;}};
|
|
9
|
+
|
|
10
|
+
export { redirectTo as default, redirectTo };
|
package/storage.cjs.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports._default = require('./storage.cjs.js').default;
|
package/storage.cjs.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var storageClient = require('./storageClient.cjs.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Storage, for `localStorage` and `sessionStorage`
|
|
9
|
+
*
|
|
10
|
+
* @category storage
|
|
11
|
+
*/let storage={l:storageClient.storageClient(),s:storageClient.storageClient(!0)};
|
|
12
|
+
|
|
13
|
+
exports.default = storage;
|
|
14
|
+
exports.storage = storage;
|
package/storage.cjs.mjs
ADDED
package/storage.d.ts
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
* Storage, for `localStorage` and `sessionStorage`
|
|
3
|
-
*
|
|
4
|
-
* @category storage
|
|
5
|
-
*/
|
|
6
|
-
export declare const storage: {
|
|
1
|
+
export declare let storage: {
|
|
7
2
|
l: {
|
|
8
3
|
get: <TKey extends string, TValue = any>(key: TKey, transform?: ((value: string) => TValue) | undefined, defaultValue?: TValue | null | undefined) => NonNullable<TValue> | null;
|
|
9
|
-
set: <
|
|
10
|
-
remove: <
|
|
11
|
-
has: <
|
|
4
|
+
set: <TKey extends string, TValue = any>(key: TKey, value?: TValue | undefined, transform?: (value: any) => string) => void;
|
|
5
|
+
remove: <TKey extends string>(key: TKey) => void;
|
|
6
|
+
has: <TKey extends string, TValue = any>(key: TKey, defaultValue?: TValue | undefined) => boolean | NonNullable<TValue>;
|
|
12
7
|
};
|
|
13
8
|
s: {
|
|
14
9
|
get: <TKey extends string, TValue = any>(key: TKey, transform?: ((value: string) => TValue) | undefined, defaultValue?: TValue | null | undefined) => NonNullable<TValue> | null;
|
|
15
|
-
set: <
|
|
16
|
-
remove: <
|
|
17
|
-
has: <
|
|
10
|
+
set: <TKey extends string, TValue = any>(key: TKey, value?: TValue | undefined, transform?: (value: any) => string) => void;
|
|
11
|
+
remove: <TKey extends string>(key: TKey) => void;
|
|
12
|
+
has: <TKey extends string, TValue = any>(key: TKey, defaultValue?: TValue | undefined) => boolean | NonNullable<TValue>;
|
|
18
13
|
};
|
|
19
14
|
};
|
|
20
15
|
export default storage;
|
package/storage.esm.d.ts
ADDED
package/storage.esm.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports._default = require('./storageClient.cjs.js').default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var utils = require('@koine/utils');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @category storage
|
|
9
|
+
*/let t={g:"getItem",s:"setItem",r:"removeItem"};/**
|
|
10
|
+
* Super minifiable `local/session Storage` client creator with SSR safety
|
|
11
|
+
*
|
|
12
|
+
* @category storage
|
|
13
|
+
*/let storageClient=s=>{let r=(o,r,l)=>utils.isBrowser?window[s?"sessionStorage":"localStorage"][t[o]](r,l):()=>{"development"===process.env.NODE_ENV&&console.warn(`[@koine/utils:storageClient]: ${s?"sessionStorage":"localStorage"} does not exists outside of browser.`);};return {get:(o,t,s)=>{let l=s??null;if("development"!==process.env.NODE_ENV||utils.isBrowser||console.log(`[@koine/utils:storage] called 'get' outside of browser with default value '${JSON.stringify(s)}'.`),utils.isBrowser){let e=r("g",o);if(e){e=t?t(e):e;try{let o=JSON.parse(e);o&&(l=o);}catch(o){l=e;}}}// if (process.env["NODE_ENV"] === "development") {
|
|
14
|
+
// console.warn(
|
|
15
|
+
// `[@koine/utils:storage]: 'get' failed to parse stored value as JSON. Plain '${stored}' value is returned.`
|
|
16
|
+
// );
|
|
17
|
+
// }
|
|
18
|
+
return l},set:(t,s,l=e=>e)=>{if("development"!==process.env.NODE_ENV||utils.isBrowser||console.log("[@koine/utils:storage] called 'set' outside of browser does not work."),utils.isBrowser)try{let e=l(utils.isString(s)?s:JSON.stringify(s));r("s",t,e);}catch(e){"development"===process.env.NODE_ENV&&console.warn("[@koine/utils:createStorage]: 'set' error.",e);}},remove:o=>{if("development"!==process.env.NODE_ENV||utils.isBrowser||console.log("[@koine/utils:storage] called 'remove' outside of browser does not work."),utils.isBrowser)try{r("r",o);}catch(e){"development"===process.env.NODE_ENV&&console.warn("[@koine/utils:createStorage]: 'remove' error.",e);}},has:(o,t)=>{let s=t??!1;return "development"!==process.env.NODE_ENV||utils.isBrowser||console.log(`[@koine/utils:storage] called 'has' outside of browser with default value '${JSON.stringify(t)}'.`),utils.isBrowser&&(s=r("g",o)??!1),s}}};
|
|
19
|
+
|
|
20
|
+
exports.default = storageClient;
|
|
21
|
+
exports.storageClient = storageClient;
|
package/storageClient.d.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @category storage
|
|
3
|
-
*/
|
|
4
1
|
export type StorageClientConfig = Record<string, any>;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const storageClient: <TConfig extends StorageClientConfig = StorageClientConfig>(useSessionStorage?: boolean) => {
|
|
11
|
-
get: <TKey extends Extract<keyof TConfig, string>, TValue = TConfig[TKey]>(key: TKey, transform?: ((value: string) => TValue) | undefined, defaultValue?: TValue | null | undefined) => NonNullable<TValue> | null;
|
|
12
|
-
set: <TKey_1 extends Extract<keyof TConfig, string>, TValue_1 = TConfig[TKey_1]>(key: TKey_1, value?: TValue_1 | undefined, transform?: (value: any) => string) => void;
|
|
13
|
-
remove: <TKey_2 extends Extract<keyof TConfig, string>>(key: TKey_2) => void;
|
|
14
|
-
has: <TKey_3 extends Extract<keyof TConfig, string>, TValue_2 = TConfig[TKey_3]>(key: TKey_3, defaultValue?: TValue_2 | undefined) => boolean | NonNullable<TValue_2>;
|
|
2
|
+
export declare let storageClient: <TConfig extends StorageClientConfig = StorageClientConfig>(useSessionStorage?: boolean) => {
|
|
3
|
+
get: <TKey extends Extract<keyof TConfig, string>, TValue = TConfig[TKey]>(key: TKey, transform?: (value: string) => TValue, defaultValue?: null | TValue) => NonNullable<TValue> | null;
|
|
4
|
+
set: <TKey extends Extract<keyof TConfig, string>, TValue_1 = TConfig[TKey]>(key: TKey, value?: TValue_1, transform?: (value: any) => string) => void;
|
|
5
|
+
remove: <TKey extends Extract<keyof TConfig, string>>(key: TKey) => void;
|
|
6
|
+
has: <TKey extends Extract<keyof TConfig, string>, TValue_2 = TConfig[TKey]>(key: TKey, defaultValue?: TValue_2) => boolean | NonNullable<TValue_2>;
|
|
15
7
|
};
|
|
16
8
|
export default storageClient;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isBrowser, isString } from '@koine/utils';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @category storage
|
|
5
|
+
*/let t={g:"getItem",s:"setItem",r:"removeItem"};/**
|
|
6
|
+
* Super minifiable `local/session Storage` client creator with SSR safety
|
|
7
|
+
*
|
|
8
|
+
* @category storage
|
|
9
|
+
*/let storageClient=s=>{let r=(o,r,l)=>isBrowser?window[s?"sessionStorage":"localStorage"][t[o]](r,l):()=>{"development"===process.env.NODE_ENV&&console.warn(`[@koine/utils:storageClient]: ${s?"sessionStorage":"localStorage"} does not exists outside of browser.`);};return {get:(o,t,s)=>{let l=s??null;if("development"!==process.env.NODE_ENV||isBrowser||console.log(`[@koine/utils:storage] called 'get' outside of browser with default value '${JSON.stringify(s)}'.`),isBrowser){let e=r("g",o);if(e){e=t?t(e):e;try{let o=JSON.parse(e);o&&(l=o);}catch(o){l=e;}}}// if (process.env["NODE_ENV"] === "development") {
|
|
10
|
+
// console.warn(
|
|
11
|
+
// `[@koine/utils:storage]: 'get' failed to parse stored value as JSON. Plain '${stored}' value is returned.`
|
|
12
|
+
// );
|
|
13
|
+
// }
|
|
14
|
+
return l},set:(t,s,l=e=>e)=>{if("development"!==process.env.NODE_ENV||isBrowser||console.log("[@koine/utils:storage] called 'set' outside of browser does not work."),isBrowser)try{let e=l(isString(s)?s:JSON.stringify(s));r("s",t,e);}catch(e){"development"===process.env.NODE_ENV&&console.warn("[@koine/utils:createStorage]: 'set' error.",e);}},remove:o=>{if("development"!==process.env.NODE_ENV||isBrowser||console.log("[@koine/utils:storage] called 'remove' outside of browser does not work."),isBrowser)try{r("r",o);}catch(e){"development"===process.env.NODE_ENV&&console.warn("[@koine/utils:createStorage]: 'remove' error.",e);}},has:(o,t)=>{let s=t??!1;return "development"!==process.env.NODE_ENV||isBrowser||console.log(`[@koine/utils:storage] called 'has' outside of browser with default value '${JSON.stringify(t)}'.`),isBrowser&&(s=r("g",o)??!1),s}}};
|
|
15
|
+
|
|
16
|
+
export { storageClient as default, storageClient };
|
package/createStorage.mjs
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import decode from "@koine/utils/decode";
|
|
2
|
-
import encode from "@koine/utils/encode";
|
|
3
|
-
import isBrowser from "@koine/utils/isBrowser";
|
|
4
|
-
import isNullOrUndefined from "@koine/utils/isNullOrUndefined";
|
|
5
|
-
import noop from "@koine/utils/noop";
|
|
6
|
-
import on from "@koine/dom/on";
|
|
7
|
-
import storage from "./storage";
|
|
8
|
-
/**
|
|
9
|
-
* Utility to create a storage instance to interact with `localStorage` using
|
|
10
|
-
* encrypted (encoded) key/values.
|
|
11
|
-
*
|
|
12
|
-
* @category storage
|
|
13
|
-
*/ export const createStorage = (config, useSessionStorage)=>{
|
|
14
|
-
const client = useSessionStorage ? storage.s : storage.l;
|
|
15
|
-
const keys = Object.keys(config).reduce((map, key)=>({
|
|
16
|
-
...map,
|
|
17
|
-
[key]: encode(key)
|
|
18
|
-
}), {});
|
|
19
|
-
return {
|
|
20
|
-
/**
|
|
21
|
-
* Get all storage value (it uses `localStorage.get()`).
|
|
22
|
-
*
|
|
23
|
-
* Unparseable values with `JSON.parse()` return their value as it is.
|
|
24
|
-
* On ssr or if the given `key` argument is not found `defaultValue` is
|
|
25
|
-
* returned, otherwise `null`.
|
|
26
|
-
*/ get (key, defaultValue) {
|
|
27
|
-
return client.get(keys[key], decode, defaultValue);
|
|
28
|
-
},
|
|
29
|
-
/**
|
|
30
|
-
* Get all storage values (it uses `localStorage.get()`).
|
|
31
|
-
*
|
|
32
|
-
* `undefined` and `null` values are not returned.
|
|
33
|
-
*/ getAll (defaultValues) {
|
|
34
|
-
if (!isBrowser) {
|
|
35
|
-
if (process.env["NODE_ENV"] !== "production") {
|
|
36
|
-
console.log(`[@koine/utils:createStorage] attempt to use 'getAll' outside of browser.`);
|
|
37
|
-
}
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
|
-
const all = {};
|
|
41
|
-
for(const key in keys){
|
|
42
|
-
const value = this.get(key);
|
|
43
|
-
const defaultValue = defaultValues?.[key];
|
|
44
|
-
if (!isNullOrUndefined(value)) {
|
|
45
|
-
all[key] = value;
|
|
46
|
-
} else if (defaultValue) {
|
|
47
|
-
// NOTE: without the assertion typedoc does not compile
|
|
48
|
-
all[key] = defaultValue;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return all;
|
|
52
|
-
},
|
|
53
|
-
/**
|
|
54
|
-
* Set a storage value (it uses `localStorage.set()`).
|
|
55
|
-
*
|
|
56
|
-
* Non-string values are stringified with `JSON.stringify()`
|
|
57
|
-
*/ set (key, value) {
|
|
58
|
-
client.set(keys[key], value, encode);
|
|
59
|
-
},
|
|
60
|
-
/**
|
|
61
|
-
* Set all given storage values (it uses `localStorage.set()`).
|
|
62
|
-
*
|
|
63
|
-
* Non-string values are stringified with `JSON.stringify()`, `undefined`
|
|
64
|
-
* and `null` values are removed from the storage
|
|
65
|
-
*/ setMany (newValues) {
|
|
66
|
-
if (process.env["NODE_ENV"] !== "production") {
|
|
67
|
-
if (!isBrowser) {
|
|
68
|
-
console.log(`[@koine/utils:createStorage] attempt to use 'setMany' outside of browser.`);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (isBrowser) {
|
|
72
|
-
for(const key in newValues){
|
|
73
|
-
const value = newValues[key];
|
|
74
|
-
if (!isNullOrUndefined(value)) {
|
|
75
|
-
this.set(key, value);
|
|
76
|
-
} else {
|
|
77
|
-
this.remove(key);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
/**
|
|
83
|
-
* Check if a storage value is _truthy_ (it uses `localStorage.get()`).
|
|
84
|
-
*/ has (key) {
|
|
85
|
-
return client.has(keys[key]);
|
|
86
|
-
},
|
|
87
|
-
/**
|
|
88
|
-
* Remove a storage value (it uses `localStorage.remove()`).
|
|
89
|
-
*/ remove (key) {
|
|
90
|
-
client.remove(keys[key]);
|
|
91
|
-
},
|
|
92
|
-
/**
|
|
93
|
-
* Clear all storage values (it uses `localStorage.remove()`).
|
|
94
|
-
*/ clear () {
|
|
95
|
-
if (process.env["NODE_ENV"] !== "production") {
|
|
96
|
-
if (!isBrowser) {
|
|
97
|
-
console.log(`[@koine/utils:createStorage] attempt to use 'clear' outside of browser.`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (isBrowser) {
|
|
101
|
-
for(const key in keys){
|
|
102
|
-
client.remove(keys[key]);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
/**
|
|
107
|
-
* Watch a storage value changes, this needs to be executed only in browser
|
|
108
|
-
* context (it uses `window.addEventListener("storage")`).
|
|
109
|
-
*
|
|
110
|
-
* Inspiration from [Multi Tab Logout in React — Redux](https://medium.com/front-end-weekly/multi-tab-logout-in-react-redux-4715f071c7fa)
|
|
111
|
-
*/ watch: (keyToWatch, onRemoved, onAdded)=>{
|
|
112
|
-
if (!isBrowser) {
|
|
113
|
-
if (process.env["NODE_ENV"] !== "production") {
|
|
114
|
-
console.log(`[@koine/utils:createStorage] attempt to use 'watch' outside of browser.`);
|
|
115
|
-
}
|
|
116
|
-
return noop;
|
|
117
|
-
}
|
|
118
|
-
const handler = (event)=>{
|
|
119
|
-
const { key, oldValue, newValue } = event;
|
|
120
|
-
if (key === keys[keyToWatch]) {
|
|
121
|
-
if (oldValue && !newValue) {
|
|
122
|
-
onRemoved?.();
|
|
123
|
-
} else if (!oldValue && newValue) {
|
|
124
|
-
onAdded?.();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
const listener = on(window, "storage", handler);
|
|
129
|
-
return listener;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
export default createStorage;
|
package/gtagPageview.mjs
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import isUndefined from "@koine/utils/isUndefined";
|
|
2
|
-
/**
|
|
3
|
-
* @category analytics-google
|
|
4
|
-
*/ export const gtagPageview = (...args)=>{
|
|
5
|
-
if (!isUndefined(window) && !isUndefined(window.gtag)) {
|
|
6
|
-
window.gtag("event", "page_view", {
|
|
7
|
-
page_path: args[0] || location.pathname,
|
|
8
|
-
page_title: args[1] || document.title,
|
|
9
|
-
page_location: args[2] || location.href
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export default gtagPageview; // export type GtmEventArgs = [
|
|
14
|
-
// eventCategory?: string,
|
|
15
|
-
// eventAction?: string,
|
|
16
|
-
// eventLabel?: string,
|
|
17
|
-
// eventValue?: string
|
|
18
|
-
// ];
|
|
19
|
-
// export const event = (...args: GtmEventArgs) => {
|
|
20
|
-
// if (!isUndefined(window) && !isUndefined(window.gtag)) {
|
|
21
|
-
// window.gtag("send", "event", ...args);
|
|
22
|
-
// }
|
|
23
|
-
// };
|
package/index.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { createStorage } from "./createStorage";
|
|
2
|
-
export { getZonedDate } from "./getZonedDate";
|
|
3
|
-
export { gtagPageview } from "./gtagPageview";
|
|
4
|
-
export { isIE } from "./isIE";
|
|
5
|
-
export { isMobile } from "./isMobile";
|
|
6
|
-
export { navigateToHash } from "./navigateToHash";
|
|
7
|
-
export { navigateToHashParams } from "./navigateToHashParams";
|
|
8
|
-
export { navigateToMergedHashParams } from "./navigateToMergedHashParams";
|
|
9
|
-
export { navigateToMergedParams } from "./navigateToMergedParams";
|
|
10
|
-
export { navigateToParams } from "./navigateToParams";
|
|
11
|
-
export { navigateToUrl } from "./navigateToUrl";
|
|
12
|
-
export { navigateWithoutUrlParam } from "./navigateWithoutUrlParam";
|
|
13
|
-
export { redirectTo } from "./redirectTo";
|
|
14
|
-
export { storage } from "./storage";
|
|
15
|
-
export { storageClient } from "./storageClient";
|
package/isIE.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import isServer from "@koine/utils/isServer";
|
|
2
|
-
/**
|
|
3
|
-
* @category detect
|
|
4
|
-
* @category is
|
|
5
|
-
* @see https://stackoverflow.com/a/21712356/12285349
|
|
6
|
-
*/ export function isIE(ssrValue = true) {
|
|
7
|
-
if (isServer) {
|
|
8
|
-
return ssrValue;
|
|
9
|
-
}
|
|
10
|
-
const ua = window.navigator.userAgent;
|
|
11
|
-
if (ua.indexOf("MSIE ") > 0 || ua.indexOf("Trident/") > 0) {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
export default isIE;
|
package/isMobile.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import isServer from "@koine/utils/isServer";
|
|
2
|
-
/**
|
|
3
|
-
* @category detect
|
|
4
|
-
* @category is
|
|
5
|
-
* @see https://stackoverflow.com/a/3540295
|
|
6
|
-
*/ export function isMobile(ssrValue = true) {
|
|
7
|
-
if (isServer) {
|
|
8
|
-
return ssrValue;
|
|
9
|
-
}
|
|
10
|
-
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent);
|
|
11
|
-
// return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)
|
|
12
|
-
// || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)
|
|
13
|
-
}
|
|
14
|
-
export default isMobile;
|
package/navigateToHash.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import navigateToUrl from "./navigateToUrl";
|
|
2
|
-
/**
|
|
3
|
-
* It updates the browser's location hash by replacing the history state.
|
|
4
|
-
* The non-silent standard way would simply be `location.hash = "#new-hash"`
|
|
5
|
-
*
|
|
6
|
-
* @category location
|
|
7
|
-
*/ export function navigateToHash(hash = "") {
|
|
8
|
-
const { pathname, search } = location;
|
|
9
|
-
navigateToUrl(pathname + (search ? "?" + search : "") + (hash ? "#" + hash : ""), true);
|
|
10
|
-
}
|
|
11
|
-
export default navigateToHash;
|
package/navigateToHashParams.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import buildUrlQueryString from "@koine/utils/buildUrlQueryString";
|
|
2
|
-
import getUrlHashPathname from "@koine/utils/getUrlHashPathname";
|
|
3
|
-
/**
|
|
4
|
-
* It updates the `location.hash` with the given query params, it uses `location.hash`
|
|
5
|
-
* if a second argument `hash` is not provded
|
|
6
|
-
*
|
|
7
|
-
* @category location
|
|
8
|
-
*/ export function navigateToHashParams(params = {}, hash = "") {
|
|
9
|
-
const useLocation = !hash;
|
|
10
|
-
hash = hash || location.hash;
|
|
11
|
-
const hashQueryLess = getUrlHashPathname(hash);
|
|
12
|
-
const queryString = typeof params === "string" ? params : buildUrlQueryString(params);
|
|
13
|
-
const newHash = "#/" + hashQueryLess + queryString;
|
|
14
|
-
if (useLocation) {
|
|
15
|
-
location.hash = newHash;
|
|
16
|
-
}
|
|
17
|
-
return newHash;
|
|
18
|
-
}
|
|
19
|
-
export default navigateToHashParams;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import getUrlHashParams from "@koine/utils/getUrlHashParams";
|
|
2
|
-
import mergeUrlQueryParams from "@koine/utils/mergeUrlQueryParams";
|
|
3
|
-
import { navigateToHashParams } from "./navigateToHashParams";
|
|
4
|
-
/**
|
|
5
|
-
* It updates the "query params" within the `location.hash`, it uses `location`
|
|
6
|
-
*
|
|
7
|
-
* @category location
|
|
8
|
-
*/ export function navigateToMergedHashParams(params = {}, hash = "") {
|
|
9
|
-
return navigateToHashParams(mergeUrlQueryParams(getUrlHashParams(hash), params), hash);
|
|
10
|
-
}
|
|
11
|
-
export default navigateToMergedHashParams;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import getUrlQueryParams from "@koine/utils/getUrlQueryParams";
|
|
2
|
-
import mergeUrlQueryParams from "@koine/utils/mergeUrlQueryParams";
|
|
3
|
-
import { navigateToParams } from "./navigateToParams";
|
|
4
|
-
/**
|
|
5
|
-
* Merge current URL query parameters with the given ones, it uses `history`.
|
|
6
|
-
*
|
|
7
|
-
* @category location
|
|
8
|
-
* @param replace Replace URL instead of pushing it in the history stack. By default it pushes it.
|
|
9
|
-
*/ export function navigateToMergedParams(params = {}, replace) {
|
|
10
|
-
return navigateToParams(mergeUrlQueryParams(getUrlQueryParams(), params), replace);
|
|
11
|
-
}
|
|
12
|
-
export default navigateToMergedParams;
|
package/navigateToParams.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import buildUrlQueryString from "@koine/utils/buildUrlQueryString";
|
|
2
|
-
import isBrowser from "@koine/utils/isBrowser";
|
|
3
|
-
import navigateToUrl from "./navigateToUrl";
|
|
4
|
-
/**
|
|
5
|
-
* Change current URL query parameters, it uses `history`.
|
|
6
|
-
*
|
|
7
|
-
* @category location
|
|
8
|
-
* @param replace Replace URL instead of pushing it in the history stack. By default it pushes it.
|
|
9
|
-
* @returns The query string with initial `?`
|
|
10
|
-
*/ export function navigateToParams(params = {}, replace) {
|
|
11
|
-
const queryString = typeof params === "string" ? params : buildUrlQueryString(params);
|
|
12
|
-
if (isBrowser) {
|
|
13
|
-
navigateToUrl(location.pathname + queryString, replace);
|
|
14
|
-
}
|
|
15
|
-
return queryString;
|
|
16
|
-
}
|
|
17
|
-
export default navigateToParams;
|