isNotNull

isNotNull

Check whether the given value is not nullable (undefined or null)

Import

import { isNotNull } from '@fullstacksjs/toolbox';

Signature

function isNotNull<T>(x: T): x is NonNullable<T> {}

Examples

isNotNull(undefined) // false
isNotNull(null)      // false
isNotNull('null')    // true
isNotNull(0)         // true
isNotNull([])        // true
isNotNull({})        // true
isNotNull(false)     // true