Fix float type checks

This commit is contained in:
Kane York
2015-07-15 12:23:56 -07:00
parent 45c2636ea0
commit 6a61f694ee
4 changed files with 29 additions and 3 deletions
@@ -75,7 +75,7 @@ export default Ember.Component.extend({
case 'boolean':
return /^Y|N|#null|true|false/.test(value);
case 'double':
return !isNaN(parseFloat(value));
return !isNaN(parseFloat(value)) || /^(-?)Inf(inity)?$/i.test(value) || /^(-?)NaN$/i.test(value);
case 'int_list':
return value.split(',').every(function(i) {
return /^(-?\d+|null)$/.test(i.trim());