Skip to content

isTypedArray

isTypedArray(value): value is TypedArray

Defined in: packages/core/src/guards/is-typed-array.ts:16

Check if a value is a typed array (Uint8Array, Float64Array, BigInt64Array, …).

A DataView does not pass: it is an ArrayBuffer view but not a typed array, and it has no element type.

Unlike the other buffer guards this one is realm-agnostic, because ArrayBuffer.isView inspects the internal slot rather than the prototype.

unknown

The value to check

value is TypedArray

True if the value is a typed array