Skip to content

Commit

Permalink
[fixed] boxed number allowed NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense authored Jun 13, 2016
1 parent c9df371 commit ab94510
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function NumberSchema(){
inherits(NumberSchema, SchemaObject, {

_typeCheck(v) {
if ( typeof v === 'number' && !(v !== +v) ) return true
if ( typeof v === 'object' && v instanceof Number ) return true
if (typeof v === 'number' && !(v !== +v)) return true
if (v instanceof Number && !isNaN(+v)) return true

return false
},
Expand Down

0 comments on commit ab94510

Please sign in to comment.