effect-io-ai

Package: effect
Module: Predicate

Predicate.isSet

Checks whether a value is a Set.

When to use

Use when you need a Predicate runtime guard for Set values.

Details

Uses instanceof Set.

Example (Guarding a Set)

import { Predicate } from "effect"

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

if (Predicate.isSet(data)) {
  console.log(data.size)
}

See

Signature

declare const isSet: (input: unknown) => input is Set<unknown>

Source

Since v2.0.0