We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d9d8f1 commit 543e776Copy full SHA for 543e776
src/typed-arrays.ts
@@ -48,11 +48,8 @@ export class TypedArrayViewGenerator {
48
}
49
50
51
-
52
export function subarray<T extends TypedArray>(arr: TypedArray, offset: number, length: number): T {
53
return arr.subarray(offset, offset + length) as T;
54
55
56
-// TODO: fix better?
57
-export const isTypedArray = (arr: any) =>
58
- arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';
+export const isTypedArray = (arr: any) => ArrayBuffer.isView(arr) && !(arr instanceof DataView);
0 commit comments