chore(typings): restrict Angular to es5+collections+promise
This commit is contained in:
@ -214,14 +214,15 @@ function findPosParam(
|
||||
}
|
||||
|
||||
function findOrCreatePath(part: string, paths: UrlPathWithParams[]): UrlPathWithParams {
|
||||
const matchingIndex = paths.findIndex(s => s.path === part);
|
||||
if (matchingIndex > -1) {
|
||||
const r = paths[matchingIndex];
|
||||
paths.splice(matchingIndex);
|
||||
return r;
|
||||
} else {
|
||||
return new UrlPathWithParams(part, {});
|
||||
let idx = 0;
|
||||
for (const s of paths) {
|
||||
if (s.path === part) {
|
||||
paths.splice(idx);
|
||||
return s;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
return new UrlPathWithParams(part, {});
|
||||
}
|
||||
|
||||
|
||||
|
@ -37,13 +37,12 @@ function createNode(curr: TreeNode<ActivatedRouteSnapshot>, prevState?: TreeNode
|
||||
function createOrReuseChildren(
|
||||
curr: TreeNode<ActivatedRouteSnapshot>, prevState: TreeNode<ActivatedRoute>) {
|
||||
return curr.children.map(child => {
|
||||
const index =
|
||||
prevState.children.findIndex(p => equalRouteSnapshots(p.value.snapshot, child.value));
|
||||
if (index >= 0) {
|
||||
return createNode(child, prevState.children[index]);
|
||||
} else {
|
||||
return createNode(child);
|
||||
for (const p of prevState.children) {
|
||||
if (equalRouteSnapshots(p.value.snapshot, child.value)) {
|
||||
return createNode(child, p);
|
||||
}
|
||||
}
|
||||
return createNode(child);
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user