feat(router): make it work with TypeScript 1.8

This commit is contained in:
vsavkin
2016-06-15 09:14:41 -07:00
parent 3683fb6886
commit b3e801ed9e
13 changed files with 39 additions and 38 deletions

View File

@ -24,11 +24,11 @@ export function flatten<T>(a: T[][]): T[] {
return target;
}
export function first<T>(a: T[]): T|null {
export function first<T>(a: T[]): T {
return a.length > 0 ? a[0] : null;
}
export function last<T>(a: T[]): T|null {
export function last<T>(a: T[]): T {
return a.length > 0 ? a[a.length - 1] : null;
}