Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/froebel/nullish.ts>notNullish

A strictly typed utility library.
Go to Latest
variable notNullish
import { notNullish } from "https://deno.land/x/froebel@v0.21.3/nullish.ts";

Checks if value is not nullish. Literal types are narrowed accordingly.

Examples

Example 1

const nums = (...values: (number | undefined)[]): number[] => values.filter(notNullish)

type

<T>(value: T | null | undefined) => value is T