Skip to main content
Module

x/isx/top_types.ts>isNullable

TypeScript-first is function collections
Go to Latest
function isNullable
import { isNullable } from "https://deno.land/x/isx@1.0.0-beta.24/top_types.ts";

Whether the value is null or undefined or not.

Examples

Example 1

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

Parameters

value: unknown
  • Any value.

Returns

value is null | undefined