@angular/router 5.2.7 → 5.2.11
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 +68 -24
- 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 +67 -23
- package/esm2015/router.js.map +1 -1
- package/esm2015/testing.js +1 -1
- package/esm2015/upgrade.js +1 -1
- package/esm5/router.js +67 -23
- 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 +21 -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.11
|
|
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" ? "#" + encodeUriFragment((/** @type {?} */ ((tree.fragment)))) : '';
|
|
1229
1229
|
return "" + segment + query + fragment;
|
|
1230
1230
|
};
|
|
1231
1231
|
return DefaultUrlSerializer;
|
|
@@ -1270,25 +1270,53 @@ function serializeSegment(segment, root) {
|
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
1272
|
/**
|
|
1273
|
-
*
|
|
1274
|
-
*
|
|
1275
|
-
*
|
|
1276
|
-
*
|
|
1277
|
-
* pchar = unreserved / pct-encoded / sub-delims / ":" / "\@"
|
|
1278
|
-
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
1279
|
-
* pct-encoded = "%" HEXDIG HEXDIG
|
|
1280
|
-
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
|
|
1281
|
-
* / "*" / "+" / "," / ";" / "="
|
|
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 https://url.spec.whatwg.org.
|
|
1282
1277
|
* @param {?} s
|
|
1283
1278
|
* @return {?}
|
|
1284
1279
|
*/
|
|
1285
|
-
function
|
|
1280
|
+
function encodeUriString(s) {
|
|
1286
1281
|
return encodeURIComponent(s)
|
|
1287
1282
|
.replace(/%40/g, '@')
|
|
1288
1283
|
.replace(/%3A/gi, ':')
|
|
1289
1284
|
.replace(/%24/g, '$')
|
|
1290
|
-
.replace(/%2C/gi, ',')
|
|
1291
|
-
|
|
1285
|
+
.replace(/%2C/gi, ',');
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
* This function should be used to encode both keys and values in a query string key/value. In
|
|
1289
|
+
* the following URL, you need to call encodeUriQuery on "k" and "v":
|
|
1290
|
+
*
|
|
1291
|
+
* http://www.site.org/html;mk=mv?k=v#f
|
|
1292
|
+
* @param {?} s
|
|
1293
|
+
* @return {?}
|
|
1294
|
+
*/
|
|
1295
|
+
function encodeUriQuery(s) {
|
|
1296
|
+
return encodeUriString(s).replace(/%3B/gi, ';');
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* This function should be used to encode a URL fragment. In the following URL, you need to call
|
|
1300
|
+
* encodeUriFragment on "f":
|
|
1301
|
+
*
|
|
1302
|
+
* http://www.site.org/html;mk=mv?k=v#f
|
|
1303
|
+
* @param {?} s
|
|
1304
|
+
* @return {?}
|
|
1305
|
+
*/
|
|
1306
|
+
function encodeUriFragment(s) {
|
|
1307
|
+
return encodeURI(s);
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* This function should be run on any URI segment as well as the key and value in a key/value
|
|
1311
|
+
* pair for matrix params. In the following URL, you need to call encodeUriSegment on "html",
|
|
1312
|
+
* "mk", and "mv":
|
|
1313
|
+
*
|
|
1314
|
+
* http://www.site.org/html;mk=mv?k=v#f
|
|
1315
|
+
* @param {?} s
|
|
1316
|
+
* @return {?}
|
|
1317
|
+
*/
|
|
1318
|
+
function encodeUriSegment(s) {
|
|
1319
|
+
return encodeUriString(s).replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/%26/gi, '&');
|
|
1292
1320
|
}
|
|
1293
1321
|
/**
|
|
1294
1322
|
* @param {?} s
|
|
@@ -1297,19 +1325,28 @@ function encode(s) {
|
|
|
1297
1325
|
function decode(s) {
|
|
1298
1326
|
return decodeURIComponent(s);
|
|
1299
1327
|
}
|
|
1328
|
+
/**
|
|
1329
|
+
* @param {?} s
|
|
1330
|
+
* @return {?}
|
|
1331
|
+
*/
|
|
1332
|
+
function decodeQuery(s) {
|
|
1333
|
+
return decode(s.replace(/\+/g, '%20'));
|
|
1334
|
+
}
|
|
1300
1335
|
/**
|
|
1301
1336
|
* @param {?} path
|
|
1302
1337
|
* @return {?}
|
|
1303
1338
|
*/
|
|
1304
1339
|
function serializePath(path) {
|
|
1305
|
-
return "" +
|
|
1340
|
+
return "" + encodeUriSegment(path.path) + serializeMatrixParams(path.parameters);
|
|
1306
1341
|
}
|
|
1307
1342
|
/**
|
|
1308
1343
|
* @param {?} params
|
|
1309
1344
|
* @return {?}
|
|
1310
1345
|
*/
|
|
1311
|
-
function
|
|
1312
|
-
return Object.keys(params)
|
|
1346
|
+
function serializeMatrixParams(params) {
|
|
1347
|
+
return Object.keys(params)
|
|
1348
|
+
.map(function (key) { return ";" + encodeUriSegment(key) + "=" + encodeUriSegment(params[key]); })
|
|
1349
|
+
.join('');
|
|
1313
1350
|
}
|
|
1314
1351
|
/**
|
|
1315
1352
|
* @param {?} params
|
|
@@ -1318,8 +1355,9 @@ function serializeParams(params) {
|
|
|
1318
1355
|
function serializeQueryParams(params) {
|
|
1319
1356
|
var /** @type {?} */ strParams = Object.keys(params).map(function (name) {
|
|
1320
1357
|
var /** @type {?} */ value = params[name];
|
|
1321
|
-
return Array.isArray(value) ?
|
|
1322
|
-
|
|
1358
|
+
return Array.isArray(value) ?
|
|
1359
|
+
value.map(function (v) { return encodeUriQuery(name) + "=" + encodeUriQuery(v); }).join('&') :
|
|
1360
|
+
encodeUriQuery(name) + "=" + encodeUriQuery(value);
|
|
1323
1361
|
});
|
|
1324
1362
|
return strParams.length ? "?" + strParams.join("&") : '';
|
|
1325
1363
|
}
|
|
@@ -1391,7 +1429,7 @@ var UrlParser = /** @class */ (function () {
|
|
|
1391
1429
|
* @return {?}
|
|
1392
1430
|
*/
|
|
1393
1431
|
function () {
|
|
1394
|
-
return this.consumeOptional('#') ?
|
|
1432
|
+
return this.consumeOptional('#') ? decodeURIComponent(this.remaining) : null;
|
|
1395
1433
|
};
|
|
1396
1434
|
/**
|
|
1397
1435
|
* @return {?}
|
|
@@ -1499,8 +1537,8 @@ var UrlParser = /** @class */ (function () {
|
|
|
1499
1537
|
this.capture(value);
|
|
1500
1538
|
}
|
|
1501
1539
|
}
|
|
1502
|
-
var /** @type {?} */ decodedKey =
|
|
1503
|
-
var /** @type {?} */ decodedVal =
|
|
1540
|
+
var /** @type {?} */ decodedKey = decodeQuery(key);
|
|
1541
|
+
var /** @type {?} */ decodedVal = decodeQuery(value);
|
|
1504
1542
|
if (params.hasOwnProperty(decodedKey)) {
|
|
1505
1543
|
// Append to existing values
|
|
1506
1544
|
var /** @type {?} */ currentVal = params[decodedKey];
|
|
@@ -2355,6 +2393,9 @@ function getOutlet(route) {
|
|
|
2355
2393
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2356
2394
|
* found in the LICENSE file at https://angular.io/license
|
|
2357
2395
|
*/
|
|
2396
|
+
/**
|
|
2397
|
+
* @template T
|
|
2398
|
+
*/
|
|
2358
2399
|
var Tree = /** @class */ (function () {
|
|
2359
2400
|
function Tree(root) {
|
|
2360
2401
|
this._root = root;
|
|
@@ -2490,6 +2531,9 @@ function findPath(value, node) {
|
|
|
2490
2531
|
}
|
|
2491
2532
|
return [];
|
|
2492
2533
|
}
|
|
2534
|
+
/**
|
|
2535
|
+
* @template T
|
|
2536
|
+
*/
|
|
2493
2537
|
var TreeNode = /** @class */ (function () {
|
|
2494
2538
|
function TreeNode(value, children) {
|
|
2495
2539
|
this.value = value;
|
|
@@ -7445,7 +7489,7 @@ function provideRouterInitializer() {
|
|
|
7445
7489
|
/**
|
|
7446
7490
|
* \@stable
|
|
7447
7491
|
*/
|
|
7448
|
-
var VERSION = new Version('5.2.
|
|
7492
|
+
var VERSION = new Version('5.2.11');
|
|
7449
7493
|
|
|
7450
7494
|
/**
|
|
7451
7495
|
* @fileoverview added by tsickle
|