Skip to content

matteocrippa/fossil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fossil Logo fossil

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
  • Email
  • Alphanumeric

A good companion project for fossil is Microraptor a lightweight framework for easy routing.

Install

Import fossil in your project with just one line of code:

import { Validator } from "https://deno.land/x/fossil/fossil.ts";

How to use

Check type

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.

Check type and value

let testBoolean = new Validator(true, ValidatorType.boolean, [true]);
console.log(testBoolean.isValid()); // true

Extra

Credits Icon made by Freepik from www.flaticon.com

Releases

No releases published

Packages

No packages published