UNPKG
obey
Version:
latest (5.0.1)
5.0.1
5.0.0
4.1.2
4.1.1
4.1.0
4.0.2
4.0.1
4.0.0
3.0.5
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.0.2
2.0.1
2.0.0
1.8.2
1.7.4
1.7.3
1.7.1
1.7.0
1.6.1
1.6.0
1.5.0
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.1
1.3.0
1.2.0
1.1.0
1.0.0
0.12.1
0.12.0
0.11.5
0.11.3
0.11.2
0.11.1
0.11.0
0.10.1
0.10.0
0.9.1
0.9.0
0.8.0
0.7.0
0.6.0
0.5.1
0.5.0
0.0.1
0.0.0
Data modelling and validation library
github.com/psvet/obey
psvet/obey
obey
/
src
/
typeStrategies
/
number.js
10 lines
(8 loc)
•
199 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
const
number
= {
default
:
context
=>
{
if
(
typeof
context.
value
!==
'number'
||
Number
.
isNaN
(context.
value
)) { context.
fail
(
'Value must be a number'
) } } }
module
.
exports
=
number