Skip to content

Commit

Permalink
node 0.10.x does not have function of Number.isInteger, fixed it.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunnysunny committed Apr 22, 2016
1 parent 7a6dd5d commit 6c6d6b6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/util.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
var crypto = require('crypto');

Number.isInteger = Number.isInteger || function(value) {
return typeof value === "number" &&
isFinite(value) &&
Math.floor(value) === value;
};

function validateId( id ) {
if( Number.isInteger( id ) )
id = id.toString()
Expand Down

0 comments on commit 6c6d6b6

Please sign in to comment.