Skip to content

Commit 76db873

Browse files
committed
build: bundle 3.4.1
1 parent d6546d9 commit 76db873

6 files changed

+166
-129
lines changed

Diff for: dist/vue-router.common.js

+40-31
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v3.4.0
2+
* vue-router v3.4.1
33
* (c) 2020 Evan You
44
* @license MIT
55
*/
@@ -188,8 +188,8 @@ var commaRE = /%2C/g;
188188
// - escapes [!'()*]
189189
// - preserve commas
190190
var encode = function (str) { return encodeURIComponent(str)
191-
.replace(encodeReserveRE, encodeReserveReplacer)
192-
.replace(commaRE, ','); };
191+
.replace(encodeReserveRE, encodeReserveReplacer)
192+
.replace(commaRE, ','); };
193193

194194
var decode = decodeURIComponent;
195195

@@ -210,11 +210,15 @@ function resolveQuery (
210210
}
211211
for (var key in extraQuery) {
212212
var value = extraQuery[key];
213-
parsedQuery[key] = Array.isArray(value) ? value.map(function (v) { return '' + v; }) : '' + value;
213+
parsedQuery[key] = Array.isArray(value)
214+
? value.map(castQueryParamValue)
215+
: castQueryParamValue(value);
214216
}
215217
return parsedQuery
216218
}
217219

220+
var castQueryParamValue = function (value) { return (value == null ? value : String(value)); };
221+
218222
function parseQuery (query) {
219223
var res = {};
220224

@@ -227,9 +231,7 @@ function parseQuery (query) {
227231
query.split('&').forEach(function (param) {
228232
var parts = param.replace(/\+/g, ' ').split('=');
229233
var key = decode(parts.shift());
230-
var val = parts.length > 0
231-
? decode(parts.join('='))
232-
: null;
234+
var val = parts.length > 0 ? decode(parts.join('=')) : null;
233235

234236
if (res[key] === undefined) {
235237
res[key] = val;
@@ -244,34 +246,39 @@ function parseQuery (query) {
244246
}
245247

246248
function stringifyQuery (obj) {
247-
var res = obj ? Object.keys(obj).map(function (key) {
248-
var val = obj[key];
249-
250-
if (val === undefined) {
251-
return ''
252-
}
249+
var res = obj
250+
? Object.keys(obj)
251+
.map(function (key) {
252+
var val = obj[key];
253253

254-
if (val === null) {
255-
return encode(key)
256-
}
254+
if (val === undefined) {
255+
return ''
256+
}
257257

258-
if (Array.isArray(val)) {
259-
var result = [];
260-
val.forEach(function (val2) {
261-
if (val2 === undefined) {
262-
return
258+
if (val === null) {
259+
return encode(key)
263260
}
264-
if (val2 === null) {
265-
result.push(encode(key));
266-
} else {
267-
result.push(encode(key) + '=' + encode(val2));
261+
262+
if (Array.isArray(val)) {
263+
var result = [];
264+
val.forEach(function (val2) {
265+
if (val2 === undefined) {
266+
return
267+
}
268+
if (val2 === null) {
269+
result.push(encode(key));
270+
} else {
271+
result.push(encode(key) + '=' + encode(val2));
272+
}
273+
});
274+
return result.join('&')
268275
}
269-
});
270-
return result.join('&')
271-
}
272276

273-
return encode(key) + '=' + encode(val)
274-
}).filter(function (x) { return x.length > 0; }).join('&') : null;
277+
return encode(key) + '=' + encode(val)
278+
})
279+
.filter(function (x) { return x.length > 0; })
280+
.join('&')
281+
: null;
275282
return res ? ("?" + res) : ''
276283
}
277284

@@ -385,6 +392,8 @@ function isObjectEqual (a, b) {
385392
return aKeys.every(function (key) {
386393
var aVal = a[key];
387394
var bVal = b[key];
395+
// query values can be null and undefined
396+
if (aVal == null || bVal == null) { return aVal === bVal }
388397
// check nested equality
389398
if (typeof aVal === 'object' && typeof bVal === 'object') {
390399
return isObjectEqual(aVal, bVal)
@@ -3035,7 +3044,7 @@ function createHref (base, fullPath, mode) {
30353044
}
30363045

30373046
VueRouter.install = install;
3038-
VueRouter.version = '3.4.0';
3047+
VueRouter.version = '3.4.1';
30393048
VueRouter.isNavigationFailure = isNavigationFailure;
30403049
VueRouter.NavigationFailureType = NavigationFailureType;
30413050

Diff for: dist/vue-router.esm.browser.js

+42-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v3.4.0
2+
* vue-router v3.4.1
33
* (c) 2020 Evan You
44
* @license MIT
55
*/
@@ -180,9 +180,10 @@ const commaRE = /%2C/g;
180180
// fixed encodeURIComponent which is more conformant to RFC3986:
181181
// - escapes [!'()*]
182182
// - preserve commas
183-
const encode = str => encodeURIComponent(str)
184-
.replace(encodeReserveRE, encodeReserveReplacer)
185-
.replace(commaRE, ',');
183+
const encode = str =>
184+
encodeURIComponent(str)
185+
.replace(encodeReserveRE, encodeReserveReplacer)
186+
.replace(commaRE, ',');
186187

187188
const decode = decodeURIComponent;
188189

@@ -201,11 +202,15 @@ function resolveQuery (
201202
}
202203
for (const key in extraQuery) {
203204
const value = extraQuery[key];
204-
parsedQuery[key] = Array.isArray(value) ? value.map(v => '' + v) : '' + value;
205+
parsedQuery[key] = Array.isArray(value)
206+
? value.map(castQueryParamValue)
207+
: castQueryParamValue(value);
205208
}
206209
return parsedQuery
207210
}
208211

212+
const castQueryParamValue = value => (value == null ? value : String(value));
213+
209214
function parseQuery (query) {
210215
const res = {};
211216

@@ -218,9 +223,7 @@ function parseQuery (query) {
218223
query.split('&').forEach(param => {
219224
const parts = param.replace(/\+/g, ' ').split('=');
220225
const key = decode(parts.shift());
221-
const val = parts.length > 0
222-
? decode(parts.join('='))
223-
: null;
226+
const val = parts.length > 0 ? decode(parts.join('=')) : null;
224227

225228
if (res[key] === undefined) {
226229
res[key] = val;
@@ -235,34 +238,39 @@ function parseQuery (query) {
235238
}
236239

237240
function stringifyQuery (obj) {
238-
const res = obj ? Object.keys(obj).map(key => {
239-
const val = obj[key];
240-
241-
if (val === undefined) {
242-
return ''
243-
}
241+
const res = obj
242+
? Object.keys(obj)
243+
.map(key => {
244+
const val = obj[key];
244245

245-
if (val === null) {
246-
return encode(key)
247-
}
246+
if (val === undefined) {
247+
return ''
248+
}
248249

249-
if (Array.isArray(val)) {
250-
const result = [];
251-
val.forEach(val2 => {
252-
if (val2 === undefined) {
253-
return
250+
if (val === null) {
251+
return encode(key)
254252
}
255-
if (val2 === null) {
256-
result.push(encode(key));
257-
} else {
258-
result.push(encode(key) + '=' + encode(val2));
253+
254+
if (Array.isArray(val)) {
255+
const result = [];
256+
val.forEach(val2 => {
257+
if (val2 === undefined) {
258+
return
259+
}
260+
if (val2 === null) {
261+
result.push(encode(key));
262+
} else {
263+
result.push(encode(key) + '=' + encode(val2));
264+
}
265+
});
266+
return result.join('&')
259267
}
260-
});
261-
return result.join('&')
262-
}
263268

264-
return encode(key) + '=' + encode(val)
265-
}).filter(x => x.length > 0).join('&') : null;
269+
return encode(key) + '=' + encode(val)
270+
})
271+
.filter(x => x.length > 0)
272+
.join('&')
273+
: null;
266274
return res ? `?${res}` : ''
267275
}
268276

@@ -369,6 +377,8 @@ function isObjectEqual (a = {}, b = {}) {
369377
return aKeys.every(key => {
370378
const aVal = a[key];
371379
const bVal = b[key];
380+
// query values can be null and undefined
381+
if (aVal == null || bVal == null) return aVal === bVal
372382
// check nested equality
373383
if (typeof aVal === 'object' && typeof bVal === 'object') {
374384
return isObjectEqual(aVal, bVal)
@@ -3000,7 +3010,7 @@ function createHref (base, fullPath, mode) {
30003010
}
30013011

30023012
VueRouter.install = install;
3003-
VueRouter.version = '3.4.0';
3013+
VueRouter.version = '3.4.1';
30043014
VueRouter.isNavigationFailure = isNavigationFailure;
30053015
VueRouter.NavigationFailureType = NavigationFailureType;
30063016

Diff for: dist/vue-router.esm.browser.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/vue-router.esm.js

+40-31
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v3.4.0
2+
* vue-router v3.4.1
33
* (c) 2020 Evan You
44
* @license MIT
55
*/
@@ -186,8 +186,8 @@ var commaRE = /%2C/g;
186186
// - escapes [!'()*]
187187
// - preserve commas
188188
var encode = function (str) { return encodeURIComponent(str)
189-
.replace(encodeReserveRE, encodeReserveReplacer)
190-
.replace(commaRE, ','); };
189+
.replace(encodeReserveRE, encodeReserveReplacer)
190+
.replace(commaRE, ','); };
191191

192192
var decode = decodeURIComponent;
193193

@@ -208,11 +208,15 @@ function resolveQuery (
208208
}
209209
for (var key in extraQuery) {
210210
var value = extraQuery[key];
211-
parsedQuery[key] = Array.isArray(value) ? value.map(function (v) { return '' + v; }) : '' + value;
211+
parsedQuery[key] = Array.isArray(value)
212+
? value.map(castQueryParamValue)
213+
: castQueryParamValue(value);
212214
}
213215
return parsedQuery
214216
}
215217

218+
var castQueryParamValue = function (value) { return (value == null ? value : String(value)); };
219+
216220
function parseQuery (query) {
217221
var res = {};
218222

@@ -225,9 +229,7 @@ function parseQuery (query) {
225229
query.split('&').forEach(function (param) {
226230
var parts = param.replace(/\+/g, ' ').split('=');
227231
var key = decode(parts.shift());
228-
var val = parts.length > 0
229-
? decode(parts.join('='))
230-
: null;
232+
var val = parts.length > 0 ? decode(parts.join('=')) : null;
231233

232234
if (res[key] === undefined) {
233235
res[key] = val;
@@ -242,34 +244,39 @@ function parseQuery (query) {
242244
}
243245

244246
function stringifyQuery (obj) {
245-
var res = obj ? Object.keys(obj).map(function (key) {
246-
var val = obj[key];
247-
248-
if (val === undefined) {
249-
return ''
250-
}
247+
var res = obj
248+
? Object.keys(obj)
249+
.map(function (key) {
250+
var val = obj[key];
251251

252-
if (val === null) {
253-
return encode(key)
254-
}
252+
if (val === undefined) {
253+
return ''
254+
}
255255

256-
if (Array.isArray(val)) {
257-
var result = [];
258-
val.forEach(function (val2) {
259-
if (val2 === undefined) {
260-
return
256+
if (val === null) {
257+
return encode(key)
261258
}
262-
if (val2 === null) {
263-
result.push(encode(key));
264-
} else {
265-
result.push(encode(key) + '=' + encode(val2));
259+
260+
if (Array.isArray(val)) {
261+
var result = [];
262+
val.forEach(function (val2) {
263+
if (val2 === undefined) {
264+
return
265+
}
266+
if (val2 === null) {
267+
result.push(encode(key));
268+
} else {
269+
result.push(encode(key) + '=' + encode(val2));
270+
}
271+
});
272+
return result.join('&')
266273
}
267-
});
268-
return result.join('&')
269-
}
270274

271-
return encode(key) + '=' + encode(val)
272-
}).filter(function (x) { return x.length > 0; }).join('&') : null;
275+
return encode(key) + '=' + encode(val)
276+
})
277+
.filter(function (x) { return x.length > 0; })
278+
.join('&')
279+
: null;
273280
return res ? ("?" + res) : ''
274281
}
275282

@@ -383,6 +390,8 @@ function isObjectEqual (a, b) {
383390
return aKeys.every(function (key) {
384391
var aVal = a[key];
385392
var bVal = b[key];
393+
// query values can be null and undefined
394+
if (aVal == null || bVal == null) { return aVal === bVal }
386395
// check nested equality
387396
if (typeof aVal === 'object' && typeof bVal === 'object') {
388397
return isObjectEqual(aVal, bVal)
@@ -3033,7 +3042,7 @@ function createHref (base, fullPath, mode) {
30333042
}
30343043

30353044
VueRouter.install = install;
3036-
VueRouter.version = '3.4.0';
3045+
VueRouter.version = '3.4.1';
30373046
VueRouter.isNavigationFailure = isNavigationFailure;
30383047
VueRouter.NavigationFailureType = NavigationFailureType;
30393048

0 commit comments

Comments
 (0)