A typescript validation suite for deno projects.
At this alpha stage fossil support validation for the following types:
- String
- Number
- Symbol
- Custom function
- Array
- Object
- Null
- Undefined
- Alphanumeric
A good companion project for fossil
is Microraptor a lightweight framework for easy routing.
Import fossil in your project with just one line of code:
import { Validator } from "https://deno.land/x/fossil/fossil.ts";
let testBoolean = new Validator(true, ValidatorType.boolean);
console.log(testBoolean.isValid()); // true
testBoolean = new Validator("home", ValidatorType.boolean);
console.log(testBoolean.isValid()); // Invalid type
For more use feel free to check test examples.
let testBoolean = new Validator(true, ValidatorType.boolean, [true]);
console.log(testBoolean.isValid()); // true
Credits Icon made by Freepik from www.flaticon.com