https://github.com/richplastow/rufflib-verify
A ruffLIB library for succinctly validating JavaScript values
https://github.com/richplastow/rufflib-verify
Last synced: 4 months ago
JSON representation
A ruffLIB library for succinctly validating JavaScript values
- Host: GitHub
- URL: https://github.com/richplastow/rufflib-verify
- Owner: richplastow
- License: mit
- Created: 2022-11-27T02:52:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-27T03:05:52.000Z (over 2 years ago)
- Last Synced: 2025-01-06T01:10:46.964Z (5 months ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ruffLIB Verify
__A ruffLIB library for succinctly validating JavaScript values.__
▶ __Version:__ 0.0.1
▶ __Homepage:__
▶ __NPM:__
▶ __Repo:__
▶ __Tests:__### Typical usage:
```js
import { vNum } from 'rufflib-verify';function sayOk(n) {
if (vNum('sayOk()', 'n', n, 100)) return vNum.err;
return 'ok!';
}sayOk(123); // ok!
sayOk(null); // sayOk(): 'n' is null not type 'number'
sayOk(3); // sayOk(): 'n' 3 is < 100
```## Dev, Test and Build
Run the test suite in ‘src/docs/’, while working on this library:
`npm test --src`
`npm start --src --open --test`Build the minified and unminified bundles in ‘dist/’ and ‘docs/’:
`npm run build`Run the test suite in ‘docs/’, after a build:
`npm test`
`npm start --open --test`