Skip to content

Commit

Permalink
build: bundle 3.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Aug 6, 2020
1 parent d6546d9 commit 76db873
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 129 deletions.
71 changes: 40 additions & 31 deletions dist/vue-router.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-router v3.4.0
* vue-router v3.4.1
* (c) 2020 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -188,8 +188,8 @@ var commaRE = /%2C/g;
// - escapes [!'()*]
// - preserve commas
var encode = function (str) { return encodeURIComponent(str)
.replace(encodeReserveRE, encodeReserveReplacer)
.replace(commaRE, ','); };
.replace(encodeReserveRE, encodeReserveReplacer)
.replace(commaRE, ','); };

var decode = decodeURIComponent;

Expand All @@ -210,11 +210,15 @@ function resolveQuery (
}
for (var key in extraQuery) {
var value = extraQuery[key];
parsedQuery[key] = Array.isArray(value) ? value.map(function (v) { return '' + v; }) : '' + value;
parsedQuery[key] = Array.isArray(value)
? value.map(castQueryParamValue)
: castQueryParamValue(value);
}
return parsedQuery
}

var castQueryParamValue = function (value) { return (value == null ? value : String(value)); };

function parseQuery (query) {
var res = {};

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

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

function stringifyQuery (obj) {
var res = obj ? Object.keys(obj).map(function (key) {
var val = obj[key];

if (val === undefined) {
return ''
}
var res = obj
? Object.keys(obj)
.map(function (key) {
var val = obj[key];

if (val === null) {
return encode(key)
}
if (val === undefined) {
return ''
}

if (Array.isArray(val)) {
var result = [];
val.forEach(function (val2) {
if (val2 === undefined) {
return
if (val === null) {
return encode(key)
}
if (val2 === null) {
result.push(encode(key));
} else {
result.push(encode(key) + '=' + encode(val2));

if (Array.isArray(val)) {
var result = [];
val.forEach(function (val2) {
if (val2 === undefined) {
return
}
if (val2 === null) {
result.push(encode(key));
} else {
result.push(encode(key) + '=' + encode(val2));
}
});
return result.join('&')
}
});
return result.join('&')
}

return encode(key) + '=' + encode(val)
}).filter(function (x) { return x.length > 0; }).join('&') : null;
return encode(key) + '=' + encode(val)
})
.filter(function (x) { return x.length > 0; })
.join('&')
: null;
return res ? ("?" + res) : ''
}

Expand Down Expand Up @@ -385,6 +392,8 @@ function isObjectEqual (a, b) {
return aKeys.every(function (key) {
var aVal = a[key];
var 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)
Expand Down Expand Up @@ -3035,7 +3044,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '3.4.0';
VueRouter.version = '3.4.1';
VueRouter.isNavigationFailure = isNavigationFailure;
VueRouter.NavigationFailureType = NavigationFailureType;

Expand Down
74 changes: 42 additions & 32 deletions dist/vue-router.esm.browser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-router v3.4.0
* vue-router v3.4.1
* (c) 2020 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -180,9 +180,10 @@ const commaRE = /%2C/g;
// fixed encodeURIComponent which is more conformant to RFC3986:
// - escapes [!'()*]
// - preserve commas
const encode = str => encodeURIComponent(str)
.replace(encodeReserveRE, encodeReserveReplacer)
.replace(commaRE, ',');
const encode = str =>
encodeURIComponent(str)
.replace(encodeReserveRE, encodeReserveReplacer)
.replace(commaRE, ',');

const decode = decodeURIComponent;

Expand All @@ -201,11 +202,15 @@ function resolveQuery (
}
for (const key in extraQuery) {
const value = extraQuery[key];
parsedQuery[key] = Array.isArray(value) ? value.map(v => '' + v) : '' + value;
parsedQuery[key] = Array.isArray(value)
? value.map(castQueryParamValue)
: castQueryParamValue(value);
}
return parsedQuery
}

const castQueryParamValue = value => (value == null ? value : String(value));

function parseQuery (query) {
const res = {};

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

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

function stringifyQuery (obj) {
const res = obj ? Object.keys(obj).map(key => {
const val = obj[key];

if (val === undefined) {
return ''
}
const res = obj
? Object.keys(obj)
.map(key => {
const val = obj[key];

if (val === null) {
return encode(key)
}
if (val === undefined) {
return ''
}

if (Array.isArray(val)) {
const result = [];
val.forEach(val2 => {
if (val2 === undefined) {
return
if (val === null) {
return encode(key)
}
if (val2 === null) {
result.push(encode(key));
} else {
result.push(encode(key) + '=' + encode(val2));

if (Array.isArray(val)) {
const result = [];
val.forEach(val2 => {
if (val2 === undefined) {
return
}
if (val2 === null) {
result.push(encode(key));
} else {
result.push(encode(key) + '=' + encode(val2));
}
});
return result.join('&')
}
});
return result.join('&')
}

return encode(key) + '=' + encode(val)
}).filter(x => x.length > 0).join('&') : null;
return encode(key) + '=' + encode(val)
})
.filter(x => x.length > 0)
.join('&')
: null;
return res ? `?${res}` : ''
}

Expand Down Expand Up @@ -369,6 +377,8 @@ function isObjectEqual (a = {}, b = {}) {
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)
Expand Down Expand Up @@ -3000,7 +3010,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '3.4.0';
VueRouter.version = '3.4.1';
VueRouter.isNavigationFailure = isNavigationFailure;
VueRouter.NavigationFailureType = NavigationFailureType;

Expand Down
4 changes: 2 additions & 2 deletions dist/vue-router.esm.browser.min.js

Large diffs are not rendered by default.

71 changes: 40 additions & 31 deletions dist/vue-router.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-router v3.4.0
* vue-router v3.4.1
* (c) 2020 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -186,8 +186,8 @@ var commaRE = /%2C/g;
// - escapes [!'()*]
// - preserve commas
var encode = function (str) { return encodeURIComponent(str)
.replace(encodeReserveRE, encodeReserveReplacer)
.replace(commaRE, ','); };
.replace(encodeReserveRE, encodeReserveReplacer)
.replace(commaRE, ','); };

var decode = decodeURIComponent;

Expand All @@ -208,11 +208,15 @@ function resolveQuery (
}
for (var key in extraQuery) {
var value = extraQuery[key];
parsedQuery[key] = Array.isArray(value) ? value.map(function (v) { return '' + v; }) : '' + value;
parsedQuery[key] = Array.isArray(value)
? value.map(castQueryParamValue)
: castQueryParamValue(value);
}
return parsedQuery
}

var castQueryParamValue = function (value) { return (value == null ? value : String(value)); };

function parseQuery (query) {
var res = {};

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

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

function stringifyQuery (obj) {
var res = obj ? Object.keys(obj).map(function (key) {
var val = obj[key];

if (val === undefined) {
return ''
}
var res = obj
? Object.keys(obj)
.map(function (key) {
var val = obj[key];

if (val === null) {
return encode(key)
}
if (val === undefined) {
return ''
}

if (Array.isArray(val)) {
var result = [];
val.forEach(function (val2) {
if (val2 === undefined) {
return
if (val === null) {
return encode(key)
}
if (val2 === null) {
result.push(encode(key));
} else {
result.push(encode(key) + '=' + encode(val2));

if (Array.isArray(val)) {
var result = [];
val.forEach(function (val2) {
if (val2 === undefined) {
return
}
if (val2 === null) {
result.push(encode(key));
} else {
result.push(encode(key) + '=' + encode(val2));
}
});
return result.join('&')
}
});
return result.join('&')
}

return encode(key) + '=' + encode(val)
}).filter(function (x) { return x.length > 0; }).join('&') : null;
return encode(key) + '=' + encode(val)
})
.filter(function (x) { return x.length > 0; })
.join('&')
: null;
return res ? ("?" + res) : ''
}

Expand Down Expand Up @@ -383,6 +390,8 @@ function isObjectEqual (a, b) {
return aKeys.every(function (key) {
var aVal = a[key];
var 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)
Expand Down Expand Up @@ -3033,7 +3042,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '3.4.0';
VueRouter.version = '3.4.1';
VueRouter.isNavigationFailure = isNavigationFailure;
VueRouter.NavigationFailureType = NavigationFailureType;

Expand Down
Loading

0 comments on commit 76db873

Please sign in to comment.