Define Array.isArray using a type predicate

This commit is contained in:
Mohamed Hegazy
2015-06-12 09:32:15 -07:00
parent 2cd2a4acc6
commit 1a520386bb
7 changed files with 83 additions and 9 deletions

2
src/lib/core.d.ts vendored
View File

@@ -1150,7 +1150,7 @@ interface ArrayConstructor {
(arrayLength?: number): any[];
<T>(arrayLength: number): T[];
<T>(...items: T[]): T[];
isArray(arg: any): boolean;
isArray(arg: any): arg is Array<any>;
prototype: Array<any>;
}