You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function parseQuery returns this object for query 'param=3¶m=':
{
param: [
"3",
""
]
}
But return value for query 'param=¶m=3' is different:
{
param: "3"
}
As i figured out, it happens because of using if (obj[key]) condition, instead of checking if (obj[key] !== undefined)
if (obj[key]) { <-- here is a problem
if (Array.isArray(obj[key])) {
obj[key].push(value);
} else {
obj[key] = [obj[key], value];
}
} else {
obj[key] = value;
}
The text was updated successfully, but these errors were encountered:
Function parseQuery returns this object for query 'param=3¶m=':
But return value for query 'param=¶m=3' is different:
As i figured out, it happens because of using
if (obj[key])
condition, instead of checkingif (obj[key] !== undefined)
The text was updated successfully, but these errors were encountered: