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.
18 lines
431 B
18 lines
431 B
'use strict';
|
|
const ow = require('./dist');
|
|
|
|
const fn = (input, options) => {
|
|
ow(input, ow.string.minLength(10));
|
|
|
|
// For objects, just an idea for now:
|
|
// ow.many(options, {
|
|
// tasks: ow.number.range(0, 10),
|
|
// extras: ow.arrayOf(ow.number)
|
|
// });
|
|
};
|
|
|
|
//fn(10);
|
|
//=> ArgumentError: Expected argument to be of type `string` but received type `number`
|
|
|
|
fn('foo');
|
|
//=> ArgumentError: Expected string length to be minimum 10
|
|
|