@preaction/validation
v2.0.6
Published
This is a small validation library.
Downloads
36
Readme
Preaction Validation
This is a small validation library for JavaScript using a simple signature for its functions.
Validator Function Signature
A validator function takes a single value argument and return a string. Validity is determined by the returned string's length.
Install
yarn
yarn add @preaction/validation
npm
npm install --save @preaction/validation
jsdelivr CDN
<script src="https://cdn.jsdelivr.net/npm/@preaction/validation@latest/dist/preaction-validation.umd.min.js"></script>
Remember to replace latest
with the version number in production.
Importing Functions
ES Module
import { notEmptyValidator } from '@preaction/validation'
CommonJS Module
const { notEmptyValidator } = require('@preaction/validation')
IIFE
const { notEmptyValidator } = window['@preaction/validation']
API
See API.md.