Skip to content

isUint8Array ​

Checks if the provided value is a Uint8Array.

Syntax ​

typescript
isUint8Array(input: unknown): input is Uint8Array

Parameters ​

NameTypeDescription
inputunknownThe value to be checked

Returns ​

TypeDescription
booleanReturns true if the value is a Uint8Array, otherwise false

Example ​

typescript
isUint8Array(new Uint8Array([1,2,3])); // true
isUint8Array([]); // false
isUint8Array(null); // false

Notes ​

  • Uses object type checking and the internal signature [object Uint8Array].

References ​

Released under the MIT License.