Skip to content

Commit

Permalink
Allow to check both float & double types
Browse files Browse the repository at this point in the history
Change-Id: Ia5752662110fb6ab2bdae1e2b7cd24fb78ae7fea
  • Loading branch information
piranna committed Jun 3, 2014
1 parent 04a1a48 commit db6e83a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/checkType.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ function checkBoolean(key, value)
throw SyntaxError(key+' param should be a Boolean, not '+typeof value);
};

function checkDouble(key, value)
function checkNumber(key, value)
{
if(typeof value != 'number')
throw SyntaxError(key+' param should be a Float, not '+typeof value);
throw SyntaxError(key+' param should be a Number, not '+typeof value);
};

function checkInteger(key, value)
Expand Down Expand Up @@ -164,7 +164,8 @@ checkType.checkParams = checkParams;
// Basic types

checkType.boolean = checkBoolean;
checkType.double = checkDouble;
checkType.double = checkNumber;
checkType.float = checkNumber;
checkType.int = checkInteger;
checkType.Object = checkObject;
checkType.String = checkString;
Expand Down

0 comments on commit db6e83a

Please sign in to comment.