@angular/router 5.2.7 → 5.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/router-testing.umd.js +2 -2
- package/bundles/router-testing.umd.min.js +2 -2
- package/bundles/router-testing.umd.min.js.map +1 -1
- package/bundles/router-upgrade.umd.js +2 -2
- package/bundles/router-upgrade.umd.min.js +2 -2
- package/bundles/router-upgrade.umd.min.js.map +1 -1
- package/bundles/router.umd.js +51 -18
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +5 -5
- package/bundles/router.umd.min.js.map +1 -1
- package/esm2015/router.js +50 -17
- package/esm2015/router.js.map +1 -1
- package/esm2015/testing.js +1 -1
- package/esm2015/upgrade.js +1 -1
- package/esm5/router.js +50 -17
- package/esm5/router.js.map +1 -1
- package/esm5/testing.js +1 -1
- package/esm5/upgrade.js +1 -1
- package/package.json +4 -4
- package/router.metadata.json +1 -1
- package/src/url_tree.d.ts +14 -10
- package/testing.d.ts +1 -1
- package/upgrade.d.ts +1 -1
package/esm2015/testing.js
CHANGED
package/esm2015/upgrade.js
CHANGED
package/esm5/router.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v5.2.
|
|
2
|
+
* @license Angular v5.2.8
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -1225,7 +1225,7 @@ var DefaultUrlSerializer = /** @class */ (function () {
|
|
|
1225
1225
|
function (tree) {
|
|
1226
1226
|
var /** @type {?} */ segment = "/" + serializeSegment(tree.root, true);
|
|
1227
1227
|
var /** @type {?} */ query = serializeQueryParams(tree.queryParams);
|
|
1228
|
-
var /** @type {?} */ fragment = typeof tree.fragment === "string" ? "#" +
|
|
1228
|
+
var /** @type {?} */ fragment = typeof tree.fragment === "string" ? "#" + encodeUriQuery((/** @type {?} */ ((tree.fragment)))) : '';
|
|
1229
1229
|
return "" + segment + query + fragment;
|
|
1230
1230
|
};
|
|
1231
1231
|
return DefaultUrlSerializer;
|
|
@@ -1270,9 +1270,10 @@ function serializeSegment(segment, root) {
|
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
1272
|
/**
|
|
1273
|
-
*
|
|
1274
|
-
*
|
|
1275
|
-
*
|
|
1273
|
+
* Encodes a URI string with the default encoding. This function will only ever be called from
|
|
1274
|
+
* `encodeUriQuery` or `encodeUriSegment` as it's the base set of encodings to be used. We need
|
|
1275
|
+
* a custom encoding because encodeURIComponent is too aggressive and encodes stuff that doesn't
|
|
1276
|
+
* have to be encoded per http://tools.ietf.org/html/rfc3986:
|
|
1276
1277
|
* query = *( pchar / "/" / "?" )
|
|
1277
1278
|
* pchar = unreserved / pct-encoded / sub-delims / ":" / "\@"
|
|
1278
1279
|
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
@@ -1282,13 +1283,35 @@ function serializeSegment(segment, root) {
|
|
|
1282
1283
|
* @param {?} s
|
|
1283
1284
|
* @return {?}
|
|
1284
1285
|
*/
|
|
1285
|
-
function
|
|
1286
|
+
function encodeUriString(s) {
|
|
1286
1287
|
return encodeURIComponent(s)
|
|
1287
1288
|
.replace(/%40/g, '@')
|
|
1288
1289
|
.replace(/%3A/gi, ':')
|
|
1289
1290
|
.replace(/%24/g, '$')
|
|
1290
|
-
.replace(/%2C/gi, ',')
|
|
1291
|
-
|
|
1291
|
+
.replace(/%2C/gi, ',');
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* This function should be used to encode both keys and values in a query string key/value or the
|
|
1295
|
+
* URL fragment. In the following URL, you need to call encodeUriQuery on "k", "v" and "f":
|
|
1296
|
+
*
|
|
1297
|
+
* http://www.site.org/html;mk=mv?k=v#f
|
|
1298
|
+
* @param {?} s
|
|
1299
|
+
* @return {?}
|
|
1300
|
+
*/
|
|
1301
|
+
function encodeUriQuery(s) {
|
|
1302
|
+
return encodeUriString(s).replace(/%3B/gi, ';');
|
|
1303
|
+
}
|
|
1304
|
+
/**
|
|
1305
|
+
* This function should be run on any URI segment as well as the key and value in a key/value
|
|
1306
|
+
* pair for matrix params. In the following URL, you need to call encodeUriSegment on "html",
|
|
1307
|
+
* "mk", and "mv":
|
|
1308
|
+
*
|
|
1309
|
+
* http://www.site.org/html;mk=mv?k=v#f
|
|
1310
|
+
* @param {?} s
|
|
1311
|
+
* @return {?}
|
|
1312
|
+
*/
|
|
1313
|
+
function encodeUriSegment(s) {
|
|
1314
|
+
return encodeUriString(s).replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/%26/gi, '&');
|
|
1292
1315
|
}
|
|
1293
1316
|
/**
|
|
1294
1317
|
* @param {?} s
|
|
@@ -1297,19 +1320,28 @@ function encode(s) {
|
|
|
1297
1320
|
function decode(s) {
|
|
1298
1321
|
return decodeURIComponent(s);
|
|
1299
1322
|
}
|
|
1323
|
+
/**
|
|
1324
|
+
* @param {?} s
|
|
1325
|
+
* @return {?}
|
|
1326
|
+
*/
|
|
1327
|
+
function decodeQuery(s) {
|
|
1328
|
+
return decode(s.replace(/\+/g, '%20'));
|
|
1329
|
+
}
|
|
1300
1330
|
/**
|
|
1301
1331
|
* @param {?} path
|
|
1302
1332
|
* @return {?}
|
|
1303
1333
|
*/
|
|
1304
1334
|
function serializePath(path) {
|
|
1305
|
-
return "" +
|
|
1335
|
+
return "" + encodeUriSegment(path.path) + serializeMatrixParams(path.parameters);
|
|
1306
1336
|
}
|
|
1307
1337
|
/**
|
|
1308
1338
|
* @param {?} params
|
|
1309
1339
|
* @return {?}
|
|
1310
1340
|
*/
|
|
1311
|
-
function
|
|
1312
|
-
return Object.keys(params)
|
|
1341
|
+
function serializeMatrixParams(params) {
|
|
1342
|
+
return Object.keys(params)
|
|
1343
|
+
.map(function (key) { return ";" + encodeUriSegment(key) + "=" + encodeUriSegment(params[key]); })
|
|
1344
|
+
.join('');
|
|
1313
1345
|
}
|
|
1314
1346
|
/**
|
|
1315
1347
|
* @param {?} params
|
|
@@ -1318,8 +1350,9 @@ function serializeParams(params) {
|
|
|
1318
1350
|
function serializeQueryParams(params) {
|
|
1319
1351
|
var /** @type {?} */ strParams = Object.keys(params).map(function (name) {
|
|
1320
1352
|
var /** @type {?} */ value = params[name];
|
|
1321
|
-
return Array.isArray(value) ?
|
|
1322
|
-
|
|
1353
|
+
return Array.isArray(value) ?
|
|
1354
|
+
value.map(function (v) { return encodeUriQuery(name) + "=" + encodeUriQuery(v); }).join('&') :
|
|
1355
|
+
encodeUriQuery(name) + "=" + encodeUriQuery(value);
|
|
1323
1356
|
});
|
|
1324
1357
|
return strParams.length ? "?" + strParams.join("&") : '';
|
|
1325
1358
|
}
|
|
@@ -1391,7 +1424,7 @@ var UrlParser = /** @class */ (function () {
|
|
|
1391
1424
|
* @return {?}
|
|
1392
1425
|
*/
|
|
1393
1426
|
function () {
|
|
1394
|
-
return this.consumeOptional('#') ?
|
|
1427
|
+
return this.consumeOptional('#') ? decodeURIComponent(this.remaining) : null;
|
|
1395
1428
|
};
|
|
1396
1429
|
/**
|
|
1397
1430
|
* @return {?}
|
|
@@ -1499,8 +1532,8 @@ var UrlParser = /** @class */ (function () {
|
|
|
1499
1532
|
this.capture(value);
|
|
1500
1533
|
}
|
|
1501
1534
|
}
|
|
1502
|
-
var /** @type {?} */ decodedKey =
|
|
1503
|
-
var /** @type {?} */ decodedVal =
|
|
1535
|
+
var /** @type {?} */ decodedKey = decodeQuery(key);
|
|
1536
|
+
var /** @type {?} */ decodedVal = decodeQuery(value);
|
|
1504
1537
|
if (params.hasOwnProperty(decodedKey)) {
|
|
1505
1538
|
// Append to existing values
|
|
1506
1539
|
var /** @type {?} */ currentVal = params[decodedKey];
|
|
@@ -7445,7 +7478,7 @@ function provideRouterInitializer() {
|
|
|
7445
7478
|
/**
|
|
7446
7479
|
* \@stable
|
|
7447
7480
|
*/
|
|
7448
|
-
var VERSION = new Version('5.2.
|
|
7481
|
+
var VERSION = new Version('5.2.8');
|
|
7449
7482
|
|
|
7450
7483
|
/**
|
|
7451
7484
|
* @fileoverview added by tsickle
|