refactor(TypeScript): Add noImplicitAny
We automatically insert explicit 'any's where needed. These need to be addressed as in #9100. Fixes #4924
This commit is contained in:
@ -39,7 +39,7 @@ function _normalizeCommands(commands: any[]): _NormalizedNavigationCommands {
|
||||
|
||||
let numberOfDoubleDots = 0;
|
||||
let isAbsolute = false;
|
||||
let res = [];
|
||||
let res: any[] /** TODO #9100 */ = [];
|
||||
|
||||
for (let i = 0; i < commands.length; ++i) {
|
||||
let c = commands[i];
|
||||
@ -167,7 +167,7 @@ function _update(node: TreeNode<UrlSegment>, commands: any[]): TreeNode<UrlSegme
|
||||
|
||||
function _stringify(params: {[key: string]: any}): {[key: string]: string} {
|
||||
let res = {};
|
||||
StringMapWrapper.forEach(params, (v, k) => res[k] = v.toString());
|
||||
StringMapWrapper.forEach(params, (v: any /** TODO #9100 */, k: any /** TODO #9100 */) => (res as any /** TODO #9100 */)[k] = v.toString());
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ function _recognize(componentResolver: ComponentResolver, parentComponent: Type,
|
||||
`Component '${stringify(parentComponent)}' does not have route configuration`);
|
||||
}
|
||||
|
||||
let match;
|
||||
let match: any /** TODO #9100 */;
|
||||
try {
|
||||
match = _match(metadata, url);
|
||||
} catch (e) {
|
||||
@ -146,7 +146,7 @@ function _matchWithParts(route: RouteMetadata, url: TreeNode<UrlSegment>): _Matc
|
||||
|
||||
let parts = path.split("/");
|
||||
let positionalParams = {};
|
||||
let consumedUrlSegments = [];
|
||||
let consumedUrlSegments: any[] /** TODO #9100 */ = [];
|
||||
|
||||
let lastParent: TreeNode<UrlSegment> = null;
|
||||
let lastSegment: TreeNode<UrlSegment> = null;
|
||||
@ -169,7 +169,7 @@ function _matchWithParts(route: RouteMetadata, url: TreeNode<UrlSegment>): _Matc
|
||||
}
|
||||
|
||||
if (isPosParam) {
|
||||
positionalParams[p.substring(1)] = current.value.segment;
|
||||
(positionalParams as any /** TODO #9100 */)[p.substring(1)] = current.value.segment;
|
||||
}
|
||||
|
||||
consumedUrlSegments.push(current.value);
|
||||
@ -188,13 +188,13 @@ function _matchWithParts(route: RouteMetadata, url: TreeNode<UrlSegment>): _Matc
|
||||
function _checkOutletNameUniqueness(nodes: TreeNode<RouteSegment>[]): TreeNode<RouteSegment>[] {
|
||||
let names = {};
|
||||
nodes.forEach(n => {
|
||||
let segmentWithSameOutletName = names[n.value.outlet];
|
||||
let segmentWithSameOutletName = (names as any /** TODO #9100 */)[n.value.outlet];
|
||||
if (isPresent(segmentWithSameOutletName)) {
|
||||
let p = segmentWithSameOutletName.stringifiedUrlSegments;
|
||||
let c = n.value.stringifiedUrlSegments;
|
||||
throw new BaseException(`Two segments cannot have the same outlet name: '${p}' and '${c}'.`);
|
||||
}
|
||||
names[n.value.outlet] = n.value;
|
||||
(names as any /** TODO #9100 */)[n.value.outlet] = n.value;
|
||||
});
|
||||
return nodes;
|
||||
}
|
||||
|
@ -219,19 +219,19 @@ class _ActivateSegments {
|
||||
let prevChildren = isPresent(prevNode) ?
|
||||
prevNode.children.reduce(
|
||||
(m, c) => {
|
||||
m[c.value.outlet] = c;
|
||||
(m as any /** TODO #9100 */)[c.value.outlet] = c;
|
||||
return m;
|
||||
},
|
||||
{}) :
|
||||
{};
|
||||
|
||||
currNode.children.forEach(c => {
|
||||
this.activateSegments(c, prevChildren[c.value.outlet], outletMap, components);
|
||||
this.activateSegments(c, (prevChildren as any /** TODO #9100 */)[c.value.outlet], outletMap, components);
|
||||
StringMapWrapper.delete(prevChildren, c.value.outlet);
|
||||
});
|
||||
|
||||
StringMapWrapper.forEach(prevChildren,
|
||||
(v, k) => this.deactivateOutlet(outletMap._outlets[k], components));
|
||||
(v: any /** TODO #9100 */, k: any /** TODO #9100 */) => this.deactivateOutlet(outletMap._outlets[k], components));
|
||||
}
|
||||
|
||||
activateSegments(currNode: TreeNode<RouteSegment>, prevNode: TreeNode<RouteSegment>,
|
||||
@ -279,7 +279,7 @@ class _ActivateSegments {
|
||||
private deactivateOutlet(outlet: RouterOutlet, components: Object[]): void {
|
||||
if (isPresent(outlet) && outlet.isActivated) {
|
||||
StringMapWrapper.forEach(outlet.outletMap._outlets,
|
||||
(v, k) => this.deactivateOutlet(v, components));
|
||||
(v: any /** TODO #9100 */, k: any /** TODO #9100 */) => this.deactivateOutlet(v, components));
|
||||
if (this.performMutation) {
|
||||
outlet.deactivate();
|
||||
} else {
|
||||
|
@ -108,7 +108,7 @@ class _UrlParser {
|
||||
matrixParams = this.parseMatrixParams();
|
||||
}
|
||||
|
||||
var aux = [];
|
||||
var aux: any[] /** TODO #9100 */ = [];
|
||||
if (this.peekStartsWith('(')) {
|
||||
aux = this.parseAuxiliaryRoutes();
|
||||
}
|
||||
@ -183,7 +183,7 @@ class _UrlParser {
|
||||
}
|
||||
|
||||
parseAuxiliaryRoutes(): TreeNode<UrlSegment>[] {
|
||||
var segments = [];
|
||||
var segments: any[] /** TODO #9100 */ = [];
|
||||
this.capture('(');
|
||||
|
||||
while (!this.peekStartsWith(')') && this._remaining.length > 0) {
|
||||
|
@ -92,7 +92,7 @@ export class UrlSegment {
|
||||
|
||||
function _serializeParams(params: {[key: string]: string}): string {
|
||||
let res = "";
|
||||
StringMapWrapper.forEach(params, (v, k) => res += `;${k}=${v}`);
|
||||
StringMapWrapper.forEach(params, (v: any /** TODO #9100 */, k: any /** TODO #9100 */) => res += `;${k}=${v}`);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user