lyb-js 1.6.2 → 1.6.3
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/Browser/LibJsPathParams.js +2 -1
- package/Browser/libJsParseQueryString.js +1 -1
- package/lyb.js +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,8 @@ export const libJsPathParams = (path) => {
|
|
|
7
7
|
if (!url)
|
|
8
8
|
return {};
|
|
9
9
|
const params = url.split("&").reduce((pre, cur) => {
|
|
10
|
-
const [k, v] = cur.split(/=(.+)/);
|
|
10
|
+
const [k, v] = cur.split(/=(.+)/).map(decodeURIComponent);
|
|
11
|
+
;
|
|
11
12
|
return (pre[k] = v), pre;
|
|
12
13
|
}, {}) || {};
|
|
13
14
|
return params;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* @param query URL参数
|
|
3
3
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsParseQueryString-URL参数转对象
|
|
4
4
|
*/
|
|
5
|
-
export const libJsParseQueryString = (query) => Object.fromEntries(new URLSearchParams(query));
|
|
5
|
+
export const libJsParseQueryString = (query) => Object.fromEntries(new URLSearchParams(decodeURIComponent(query)));
|
package/lyb.js
CHANGED
|
@@ -92,7 +92,7 @@ ${log3.label}:`, log3.value];
|
|
|
92
92
|
if (!url)
|
|
93
93
|
return {};
|
|
94
94
|
const params = url.split("&").reduce((pre, cur) => {
|
|
95
|
-
const [k, v2] = cur.split(/=(.+)/);
|
|
95
|
+
const [k, v2] = cur.split(/=(.+)/).map(decodeURIComponent);
|
|
96
96
|
return pre[k] = v2, pre;
|
|
97
97
|
}, {}) || {};
|
|
98
98
|
return params;
|