forked from orbit-oss/is
Add finiteNumber, nonNegativeNumber, and positiveInteger predicates
This commit is contained in:
parent
ac46b5400d
commit
63be5c0c19
3 changed files with 150 additions and 0 deletions
12
readme.md
12
readme.md
|
|
@ -463,6 +463,10 @@ function foo() {
|
|||
foo();
|
||||
```
|
||||
|
||||
##### .finiteNumber(value)
|
||||
|
||||
Check if `value` is a number and is finite. Excludes `Infinity` and `-Infinity`.
|
||||
|
||||
##### .positiveNumber(value)
|
||||
|
||||
Check if `value` is a number and is more than 0.
|
||||
|
|
@ -471,6 +475,14 @@ Check if `value` is a number and is more than 0.
|
|||
|
||||
Check if `value` is a number and is less than 0.
|
||||
|
||||
##### .nonNegativeNumber(value)
|
||||
|
||||
Check if `value` is a number and is 0 or more.
|
||||
|
||||
##### .positiveInteger(value)
|
||||
|
||||
Check if `value` is an integer and is more than 0.
|
||||
|
||||
##### .inRange(value, range)
|
||||
|
||||
Check if `value` (number) is in the given `range`. The range is an array of two values, lower bound and upper bound, in no specific order.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue