abolish-browser
v0.0.17
Published
Browser version of abolish javascript validator
Downloads
11
Maintainers
Readme
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