function isSome
isSome<T>(thing: T | null | undefined): thing is T

Returns true if the given value is not null or undefined.

Examples

Example 1

isSome(null); // false
isSome(undefined); // false
isSome(0); // true
isSome({}); // true

Type Parameters

Parameters

thing: T | null | undefined

Return Type

thing is T

Usage

import { isSome } from ".";