From 9e087493ed98524cf040c0e56a017d90e47dcae8 Mon Sep 17 00:00:00 2001 From: eleith Date: Tue, 9 Oct 2012 03:55:53 -0700 Subject: [PATCH] browserify it --- dist/schema-browser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/schema-browser.js b/dist/schema-browser.js index 9d12f9c..9e6c3fb 100644 --- a/dist/schema-browser.js +++ b/dist/schema-browser.js @@ -353,12 +353,14 @@ window.schema = (function (modules) { { 'toInt': function(value) { - return parseInt(value, 10); + var num = parseInt(value, 10); + return _.isNaN(num) ? null : num; }, 'toFloat': function(value) { - return parseFloat(value, 10); + var num = parseFloat(value, 10); + return _.isNaN(num) ? null : num; }, 'toString': function(value)