Skip to content
Snippets Groups Projects
Commit b8b387ef authored by David Sehnal's avatar David Sehnal
Browse files

use array.is instead of instanceof

parent cd246b25
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ export function ofSortedArray(xs: Nums) {
return xs;
}
export function ofUnsortedArray(xs: Nums) { sortArray(xs); return xs; }
export function is(xs: any): xs is Nums { return xs && (xs instanceof Array || !!xs.buffer); }
export function is(xs: any): xs is Nums { return xs && (Array.isArray(xs) || !!xs.buffer); }
export function start(xs: Nums) { return xs[0]; }
export function end(xs: Nums) { return xs[xs.length - 1] + 1; }
......
......@@ -176,7 +176,7 @@ export function values(set: AtomSetImpl): Iterator<Atom> {
}
function isArrayLike(x: any): x is ArrayLike<Atom> {
return x && (typeof x.length === 'number' && (x instanceof Array || !!x.buffer));
return x && (typeof x.length === 'number' && (Array.isArray(x) || !!x.buffer));
}
function ofObject(data: { [id: number]: OrderedSet }) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment