From ab94510efa09a2772881f976c96a17232ede9941 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Mon, 13 Jun 2016 08:45:47 -0400 Subject: [PATCH] [fixed] boxed number allowed NaN --- src/number.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/number.js b/src/number.js index 5ea70890d..d6570b91c 100644 --- a/src/number.js +++ b/src/number.js @@ -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 },