We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1da90de commit a276d0bCopy full SHA for a276d0b
Sources/Common/Core/URLExtract/index.js
@@ -39,13 +39,8 @@ function extractURLParameters(
39
) {
40
const summary = {};
41
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));
+ const params = new URLSearchParams(query);
+ params.forEach((value, key) => {
49
if (key) {
50
summary[key] = value ? convert(value) : true;
51
}
0 commit comments