effect-io-ai

Package: effect
Module: Predicate

Predicate.isNotUndefined

Checks whether a value is not undefined.

When to use

Use when you need a Predicate refinement that filters out undefined while preserving other falsy values.

Details

Returns a refinement that excludes undefined.

Example (Filtering undefined values)

import { Predicate } from "effect"

const values = [1, undefined, 2]
const defined = values.filter(Predicate.isNotUndefined)

console.log(defined)

See

Signature

declare const isNotUndefined: <A>(input: A) => input is Exclude<A, undefined>

Source

Since v2.0.0