Comparing version 0.4.21 to 0.4.22
@@ -5,3 +5,6 @@ /** | ||
*/ | ||
if(typeof window === 'undefined') { | ||
// Test if we're in Node via presence of "global" not absence of "window" | ||
// to support hybrid environments like Electron | ||
if(typeof global !== 'undefined') { | ||
var Buffer = require('buffer').Buffer; // TODO just use global Buffer | ||
@@ -8,0 +11,0 @@ } |
@@ -254,2 +254,5 @@ /** | ||
} | ||
if(id instanceof ObjectID) { | ||
return true; | ||
} | ||
return false; | ||
@@ -256,0 +259,0 @@ }; |
@@ -21,3 +21,3 @@ "use strict" | ||
// Read the document size | ||
var size = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24; | ||
var size = buffer[index] | buffer[index+1] << 8 | buffer[index+2] << 16 | buffer[index+3] << 24; | ||
@@ -30,3 +30,3 @@ // Ensure buffer is valid size | ||
// Illegal end value | ||
if(buffer[size - 1] != 0) { | ||
if(buffer[index + size - 1] != 0) { | ||
throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); | ||
@@ -36,3 +36,3 @@ } | ||
// Start deserializtion | ||
return deserializeObject(buffer, index - 4, options, isArray); | ||
return deserializeObject(buffer, index, options, isArray); | ||
} | ||
@@ -398,2 +398,8 @@ | ||
/** | ||
* Binary BSON Type | ||
* | ||
* @classconstant BSON_DATA_UNDEFINED | ||
**/ | ||
BSON.BSON_DATA_UNDEFINED = 7; | ||
/** | ||
* ObjectID BSON Type | ||
@@ -400,0 +406,0 @@ * |
{ "name" : "bson" | ||
, "description" : "A bson parser for node.js and the browser" | ||
, "keywords" : ["mongodb", "bson", "parser"] | ||
, "version" : "0.4.21" | ||
, "version" : "0.4.22" | ||
, "author" : "Christian Amor Kvalheim <christkv@gmail.com>" | ||
@@ -6,0 +6,0 @@ , "contributors" : [] |
Sorry, the diff of this file is not supported yet
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
435196
11356