Update tests, typescript declaration

This commit is contained in:
Nicolas Dextraze
2017-10-17 15:55:07 -07:00
parent e6af223f0d
commit 4584517ede
14 changed files with 68 additions and 61 deletions

View File

@ -12,10 +12,11 @@ module.exports.notNull = function(value, name) {
throw new TypeError(name + " should not be null.");
};
module.exports.isInteger = function isInteger(value, name) {
function isInteger(value, name) {
if (typeof value !== 'number' || value % 1 !== 0)
throw new TypeError(name + " should be an integer.");
};
}
module.exports.isInteger = isInteger;
module.exports.isLongOrInteger = function(value, name) {
if (typeof value === 'number') {