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.
 
 
Sindre Sorhus d0bb4e84dc
Tiny readme tweak
7 years ago
source Add more string validators (#15) 7 years ago
.editorconfig Init 7 years ago
.gitattributes Init 7 years ago
.gitignore Rewrite in TypeScript (#1) 7 years ago
.npmrc Init 7 years ago
.travis.yml Rewrite in TypeScript (#1) 7 years ago
example.js Rewrite in TypeScript (#1) 7 years ago
header.gif Init 7 years ago
license Init 7 years ago
package.json Add more string validators (#15) 7 years ago
readme.md Tiny readme tweak 7 years ago
todo.md Init 7 years ago
tsconfig.json Fix support for Node.js 4 (#17) 7 years ago
tslint.json Add boolean validator (#13) 7 years ago

readme.md

ow Build Status

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