Skip to content

Commit

Permalink
Support the new 4.0 definition of isArray (microsoft#102413)
Browse files Browse the repository at this point in the history
  • Loading branch information
Orta Therox authored and Charles-Gagnon committed Jul 14, 2020
1 parent 5a37e42 commit 9ea4c5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vs/base/common/types.ts
Expand Up @@ -8,7 +8,7 @@ import { URI, UriComponents } from 'vs/base/common/uri';
/**
* @returns whether the provided parameter is a JavaScript Array or not.
*/
export function isArray(array: any): array is any[] {
export function isArray<T>(array: T | {}): array is T extends readonly any[] ? (unknown extends T ? never : readonly any[]) : any[] {
return Array.isArray(array);
}

Expand Down

0 comments on commit 9ea4c5f

Please sign in to comment.