Remove assignability cases in getNarrowedType + an isArray improvement for readonly arrays (#39258)

* Explore using a different isArray declaration

* Add tests and the new isArray definition

* Baseline updates

* Upda the isArray type
This commit is contained in:
Orta Therox
2020-09-08 14:43:48 -04:00
committed by GitHub
parent 1d2278be05
commit fa89ce6158
23 changed files with 700 additions and 63 deletions
+1 -1
View File
@@ -1376,7 +1376,7 @@ interface ArrayConstructor {
(arrayLength?: number): any[];
<T>(arrayLength: number): T[];
<T>(...items: T[]): T[];
isArray(arg: any): arg is any[];
isArray<T>(arg: T | {}): arg is T extends readonly any[] ? (unknown extends T ? never : readonly any[]) : any[];
readonly prototype: any[];
}