Skip to content

Commit

Permalink
fix(angular): avoid TS 2.8 features
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed May 23, 2018
1 parent c35684e commit c736bac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/src/components/router/router.tsx
Expand Up @@ -160,9 +160,9 @@ export class Router {
const redirect = routeRedirect(path, redirects);
let redirectFrom: string[]|null = null;
if (redirect) {
this.setPath(redirect.to, intent);
this.setPath(redirect.to!, intent);
redirectFrom = redirect.from;
path = redirect.to;
path = redirect.to!;
}

// lookup route chain
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/router/utils/matching.ts
@@ -1,7 +1,7 @@
import { RouteChain, RouteID, RouteRedirect } from './interface';


export function matchesRedirect(input: string[], route: RouteRedirect): route is Required<RouteRedirect> {
export function matchesRedirect(input: string[], route: RouteRedirect): route is RouteRedirect {
const {from, to} = route;
if (to === undefined) {
return false;
Expand All @@ -24,7 +24,7 @@ export function matchesRedirect(input: string[], route: RouteRedirect): route is
}

export function routeRedirect(path: string[], routes: RouteRedirect[]) {
return routes.find(route => matchesRedirect(path, route)) as Required<RouteRedirect> | undefined;
return routes.find(route => matchesRedirect(path, route)) as RouteRedirect | undefined;
}


Expand Down

0 comments on commit c736bac

Please sign in to comment.