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.
 
 

22 lines
264 B

'use strict';
const ow = require('./dist');
const logError = fn => {
try {
fn();
} catch (err) {
console.log(err.message);
}
};
const fn = input => {
ow(input, ow.string.minLength(10));
};
logError(() => {
fn(10);
});
logError(() => {
fn('foo');
});