effect-io-ai

Package: effect
Module: Predicate

Predicate.isSymbol

Checks whether a value is a symbol.

When to use

Use when you need a Predicate guard to narrow an unknown value to a symbol.

Details

Uses typeof input === "symbol".

Example (Guarding symbols)

import { Predicate } from "effect"

const data: unknown = Symbol.for("id")

if (Predicate.isSymbol(data)) {
  console.log(data.description)
}

See

Signature

declare const isSymbol: (input: unknown) => input is symbol

Source

Since v2.0.0