Skip to main content
Module

x/pgsql_ast_parser/mod.ts>arrayNilMap

Yet another simple Postgres SQL parser
Go to Latest
function arrayNilMap
import { arrayNilMap } from "https://deno.land/x/pgsql_ast_parser@10.5.2/mod.ts";

An helper function that returns a map of an array, but:

  • It will return the original array if it is null-ish
  • It will remove all null-ish entries
  • It will return the original array if nothing has changed

Type Parameters

T extends Object

Parameters

this: void
collection: T[] | nil
mapper: (v: T) => T | nil