effect-io-ai

Package: effect
Module: Predicate

Predicate.isUint8Array

Checks whether a value is a Uint8Array.

When to use

Use when you need a Predicate runtime guard for binary data.

Details

Uses instanceof Uint8Array.

Example (Guarding Uint8Array values)

import { Predicate } from "effect"

const data: unknown = new Uint8Array([1, 2])

console.log(Predicate.isUint8Array(data))

See

Signature

declare const isUint8Array: (input: unknown) => input is Uint8Array

Source

Since v2.0.0