function mapNotNullish
mapNotNullish<
T,
U,
>
(fn: (item: T) =>
U
| null
| undefined
): unknown

Curried map that drops null/undefined results in one pass. Curried adapter over @std/collections.mapNotNullish. Replaces the two-step pattern: compact(map(fn)(array))

Type Parameters

Parameters

fn: (item: T) =>
U
| null
| undefined

Return Type

unknown

Usage

import { mapNotNullish } from "docs/utilities.ts";