Added readme

This commit is contained in:
Sebastian Seedorf
2020-05-28 01:44:42 +02:00
parent 1ddb84234e
commit ff891cd303
4 changed files with 102 additions and 3 deletions

11
t.ts Normal file
View File

@@ -0,0 +1,11 @@
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" }