Files
deno-valideno/t.ts
Sebastian Seedorf ff891cd303 Added readme
2020-05-28 01:44:42 +02:00

11 lines
356 B
TypeScript

import {
ValidationError, validate,
isBoolean
} from "./mod.ts";
const converted: any = {};
const errors: ValidationError[] = await validate("foobar", isBoolean(), { doConversion: true, converted });
console.log(errors);
// [ { type: "isBoolean", args: {}, message: "This value has to be a boolean." } ]
console.log(converted);
// { output: "foobar" }