effect-io-ai

Package: effect
Module: Predicate

Predicate.isNotNullish

Checks whether a value is not null and not undefined.

When to use

Use when you need a Predicate refinement that filters out nullish values but keeps other falsy ones.

Details

Uses input != null.

Example (Filtering non-nullish values)

import { Predicate } from "effect"

const values = [0, null, "", undefined]
const present = values.filter(Predicate.isNotNullish)

console.log(present)

See

Signature

declare const isNotNullish: <A>(input: A) => input is NonNullable<A>

Source

Since v4.0.0