You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
335 B
JavaScript

5 years ago
"use strict";
const { validateValue } = require("@validatem/core");
const isDate = require("./");
console.log(validateValue(new Date(), [ isDate ])); // 2020-05-31T20:34:47.197Z
console.log(validateValue(42, [ isDate ])); /*
AggregrateValidationError: One or more validation errors occurred:
- At (root): Must be a Date object
*/