diff --git a/src/util/query.js b/src/util/query.js index c017f2b5d..c56cfcad5 100644 --- a/src/util/query.js +++ b/src/util/query.js @@ -38,7 +38,7 @@ export function resolveQuery ( return parsedQuery } -const castQueryParamValue = value => (value == null ? value : '' + value) +const castQueryParamValue = value => (value == null ? value : String(value)) function parseQuery (query: string): Dictionary { const res = {} diff --git a/src/util/route.js b/src/util/route.js index 54a91a738..6b049ccc2 100644 --- a/src/util/route.js +++ b/src/util/route.js @@ -104,6 +104,8 @@ function isObjectEqual (a = {}, b = {}): boolean { return aKeys.every(key => { const aVal = a[key] const bVal = b[key] + // query values can be null and undefined + if (aVal == null || bVal == null) return aVal === bVal // check nested equality if (typeof aVal === 'object' && typeof bVal === 'object') { return isObjectEqual(aVal, bVal)