Skip to content

isArrayBuffer

The isArrayBuffer function determines whether a given value is an ArrayBuffer object.

Import

import { isArrayBuffer } from "@tai-kun/surrealdb/utils";

Usage

function isArrayBuffer(value: unknown): value is ArrayBuffer;

Arguments

value

The value expected to be an ArrayBuffer object.

Return Value

Returns true if value is an ArrayBuffer object, false otherwise.

Explanation

In some versions of Firefox, when the response body of fetch is an ArrayBuffer object, it may possess methods but fail instanceof checks. Therefore, this function performs a check based on the tag name, similar to the behavior of Lodash.