Hyperlinkv0.8.0-beta.28

Predicate

Predicate.isNotUndefinedfunctioneffect/Predicate.ts:799
<A>(input: A): input is Exclude<A, undefined>

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)
export function isNotUndefined<A>(input: A): input is Exclude<A, undefined> {
  return input !== undefined
}
Referenced by 6 symbols