Skip to main content
isArrayBufferView - util/types - Node documentation
function isArrayBufferView

Usage in Deno

import { isArrayBufferView } from "node:util/types";
isArrayBufferView(object: unknown): object is ArrayBufferView

Returns true if the value is an instance of one of the ArrayBuffer views, such as typed array objects or DataView. Equivalent to ArrayBuffer.isView().

util.types.isArrayBufferView(new Int8Array());  // true
util.types.isArrayBufferView(Buffer.from('hello world')); // true
util.types.isArrayBufferView(new DataView(new ArrayBuffer(16)));  // true
util.types.isArrayBufferView(new ArrayBuffer());  // false

Parameters

object: unknown

Return Type

object is ArrayBufferView
Back to top