Skip to content

Commit

Permalink
Support the new 4.0 definition of isArray (#102413)
Browse files Browse the repository at this point in the history
  • Loading branch information
Orta Therox committed Jul 13, 2020
1 parent eedbcc4 commit d47ddb6
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 d47ddb6

Please sign in to comment.