Comparing version 1.0.2 to 1.0.3
16
index.js
@@ -123,2 +123,5 @@ /* Copyright 2015-present Facebook, Inc. | ||
var ival = this.peekInt(bytes); | ||
if (ival instanceof Int64 && isFinite(ival.valueOf())) { | ||
ival = ival.valueOf(); | ||
} | ||
this.readOffset += bytes; | ||
@@ -211,4 +214,4 @@ return ival; | ||
var MAX_INT8 = 127; | ||
var MAX_INT16 = 32768; | ||
var MAX_INT32 = 2147483648; | ||
var MAX_INT16 = 32767; | ||
var MAX_INT32 = 2147483647; | ||
@@ -495,4 +498,9 @@ function BunserBuf() { | ||
case 'number': | ||
buf.writeByte(BSER_REAL); | ||
buf.writeDouble(val); | ||
// check if it is an integer or a float | ||
if (isFinite(val) && Math.floor(val) === val) { | ||
dump_int(buf, val); | ||
} else { | ||
buf.writeByte(BSER_REAL); | ||
buf.writeDouble(val); | ||
} | ||
return; | ||
@@ -499,0 +507,0 @@ case 'string': |
{ | ||
"name": "bser", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "JavaScript implementation of the BSER Binary Serialization", | ||
@@ -12,2 +12,5 @@ "main": "index.js", | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"repository": { | ||
@@ -14,0 +17,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
17971
3
531