Const
The nan schema validates that the input is the JavaScript value NaN. It fails for anything that is not the value NaN, and does not check whether a value is something other than a number (for example, is will fail for any string value).
nan
NaN
import { nan } from "typerun/schema";import { is } from "typerun";const isNan = is(nan)(NaN);console.log(isNan); // trueconst isNotNan = is(nan)(3);console.log(isNotNan); // false Copy
import { nan } from "typerun/schema";import { is } from "typerun";const isNan = is(nan)(NaN);console.log(isNan); // trueconst isNotNan = is(nan)(3);console.log(isNotNan); // false
The
nan
schema validates that the input is the JavaScript valueNaN
. It fails for anything that is not the valueNaN
, and does not check whether a value is something other than a number (for example, is will fail for any string value).Example