Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/isx/is_nullable.ts>isNullable

Collection of validation functions for JavaScript data
Go to Latest
function isNullable
import { isNullable } from "https://deno.land/x/isx@1.1.1/is_nullable.ts";

Whether the input is null or undefined or not.

Examples

Example 1

import { isNullable } from "https://deno.land/x/isx@$VERSION/is_nullable.ts"
import { assertEquals } from "https://deno.land/std/testing/asserts.ts"
assertEquals(isNullable(null), true)
assertEquals(isNullable(undefined), true)
assertEquals(isNullable({}), false)

Parameters

input: unknown
  • Any input.

Returns

input is null | undefined