Skip to content

Commit a276d0b

Browse files
committed
fix(URLExtract): use builtin parser
1 parent 1da90de commit a276d0b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Sources/Common/Core/URLExtract/index.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,8 @@ function extractURLParameters(
3939
) {
4040
const summary = {};
4141
const convert = castToNativeType ? toNativeType : identity;
42-
const queryTokens = (query || '')
43-
.replace(/#.*/, '') // remove hash query
44-
.replace('?', '') // Remove ? from the head
45-
.split('&'); // extract token pair
46-
47-
queryTokens.forEach((token) => {
48-
const [key, value] = token.split('=').map((s) => decodeURIComponent(s));
42+
const params = new URLSearchParams(query);
43+
params.forEach((value, key) => {
4944
if (key) {
5045
summary[key] = value ? convert(value) : true;
5146
}

0 commit comments

Comments
 (0)