Skip to content
This repository was archived by the owner on Mar 22, 2022. It is now read-only.

trapcodeio/abolish-browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abolish for browser

To use abolish directly in your browser without package managers.

From CDN

<script src="https://cdn.jsdelivr.net/npm/abolish-browser/abolish.min.js"></script>

Abolish is exposed as window.Abolish while Rule is exposed as window.AbolishRule ParseRules is exposed as window.AbolishParseRules

<script>
    const form = {
        age: 10
    };

    const rules = {
        age: 'max:5'
    };

    console.log(Abolish.validate(form, rules))
</script>
{
  "error": {
    "key": "age",
    "type": "validator",
    "validator": "max",
    "message": "Age is too big. (Max. 5)",
    "data": null
  }
}

visit abolish documentation

About

Browser version for Abolish object validator

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published