mirror of https://github.com/lukechilds/ow.git
|
7 years ago | |
---|---|---|
docs | 7 years ago | |
media | 7 years ago | |
source | 7 years ago | |
.editorconfig | 8 years ago | |
.gitattributes | 8 years ago | |
.gitignore | 8 years ago | |
.npmrc | 8 years ago | |
.travis.yml | 7 years ago | |
example.js | 8 years ago | |
license | 8 years ago | |
package.json | 7 years ago | |
readme.md | 7 years ago | |
tsconfig.json | 7 years ago | |
tslint.json | 7 years ago | |
webpack.config.js | 7 years ago |
readme.md
Argument type validation
Install
$ npm install ow
Docs
Usage
const ow = require('ow');
const unicorn = input => {
ow(input, ow.string.minLength(5));
…
);
unicorn(3);
//=> ArgumentError: Expected argument to be of type `string` but received type `number`
unicorn('yo');
//=> ArgumentError: Expected string length to be minimum 5
Maintainers
Logo
Logo is based on Comic Book Elements by Carl Eriksson.
License
MIT