Const
The date schema validates that the input is a JavaScript Date object. It is an alias for instance(Date).
date
instance(Date)
import { date } from "typerun/schema";import { is } from "typerun";const isDate = is(date)(new Date());console.log(isDate); // trueconst isNotDate = is(date)(3);console.log(isNotDate); // false Copy
import { date } from "typerun/schema";import { is } from "typerun";const isDate = is(date)(new Date());console.log(isDate); // trueconst isNotDate = is(date)(3);console.log(isNotDate); // false
The
date
schema validates that the input is a JavaScript Date object. It is an alias forinstance(Date)
.Example