add `is.length`, `is.longerThan`, and `is.shorterThan`
mrDarcyMurphy opened this issue · comments
Darcy Murphy commented
Wrap javascript's stock length attribute for usage in the-thing-is
.
var foo = 'bar'
var fizz = ['buzz', 'fizzbuzz']
var empty = []
is.length(foo) // true - greater than 0 length
is.length(foo, 3) // true - length is 3
is.length(foo, 2) // false - length is not 2
is.length(fizz) // true
is.length(fizz, 2) // true
is.length(empty) // false
Darcy Murphy commented
var foo = 'bar'
is.lengthy(foo) // true - length greater than 0
A cute addition.
Darcy Murphy commented
Also add is.longerThan
and is.shorterThan
with the same pattern as greaterThan
and lessThan
, but specifically for length.
Darcy Murphy commented
add minlength
and maxlength
as aliases.