mirror of https://github.com/lukechilds/ow.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sam Verschueren
6d22d3d932
|
7 years ago | |
---|---|---|
source | 7 years ago | |
.editorconfig | 7 years ago | |
.gitattributes | 7 years ago | |
.gitignore | 7 years ago | |
.npmrc | 7 years ago | |
.travis.yml | 7 years ago | |
example.js | 7 years ago | |
header.gif | 7 years ago | |
license | 7 years ago | |
package.json | 7 years ago | |
readme.md | 7 years ago | |
todo.md | 7 years ago | |
tsconfig.json | 7 years ago | |
tslint.json | 7 years ago | |
webpack.config.js | 7 years ago |
readme.md
ow
Argument type validation
Install
$ npm install ow
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 10
Maintainers
License
MIT