Added readme
This commit is contained in:
11
t.ts
Normal file
11
t.ts
Normal 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" }
|
||||
Reference in New Issue
Block a user