<A>(input: A): input is A & (null | undefined)Checks whether a value is null or undefined.
When to use
Use when you need a Predicate guard for nullish values.
Details
Uses input === null || input === undefined.
Example (Guarding nullish values)
import { Predicate } from "effect"
const values = [0, null, "", undefined]
const nullish = values.filter(Predicate.isNullish)
console.log(nullish)Source effect/Predicate.ts:8933 lines
export function function isNullish<A>(
input: A
): input is A & (null | undefined)
Checks whether a value is null or undefined.
When to use
Use when you need a Predicate guard for nullish values.
Details
Uses input === null || input === undefined.
Example (Guarding nullish values)
import { Predicate } from "effect"
const values = [0, null, "", undefined]
const nullish = values.filter(Predicate.isNullish)
console.log(nullish)
isNullish<function (type parameter) A in isNullish<A>(input: A): input is A & (null | undefined)A>(input: Ainput: function (type parameter) A in isNullish<A>(input: A): input is A & (null | undefined)A): input: Ainput is function (type parameter) A in isNullish<A>(input: A): input is A & (null | undefined)A & (null | undefined) {
return input: Ainput === null || input: A & ({} | undefined)input === var undefinedundefined
}