The value to check.
true
if the check passes, false
otherwise.
isNull(null) // true
isNull(undefined) // false
isNull(0) // false
const value: string | null
if (isNull(value)) {
value // type: null
} else {
value // type: string
}
// or
if (!isNull(value)) {
value // type: string
} else {
value // type: null
}
import { assert, isNull } from 'uft'
const token: string | null
assert(!isNull(token), 'received null token')
token // type: string
Generated using TypeDoc
Checks if a value is
null
.