Socket
Socket
Sign inDemoInstall

bson

Package Overview
Dependencies
Maintainers
2
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bson - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

4

HISTORY.md

@@ -0,1 +1,5 @@

0.5.5 2016-09-15
-----------------
- Added DBPointer up conversion to DBRef
0.5.4 2016-08-23

@@ -2,0 +6,0 @@ -----------------

@@ -391,2 +391,26 @@ "use strict"

}
} else if(elementType == BSON_DATA_DBPOINTER) {
// Get the code string size
var stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
// Check if we have a valid string
if(stringSize <= 0 || stringSize > (buffer.length - index) || buffer[index + stringSize - 1] != 0) throw new Error("bad string length in bson");
// Namespace
var namespace = buffer.toString('utf8', index, index + stringSize - 1);
// Update parse index position
index = index + stringSize;
// Read the oid
var oidBuffer = new Buffer(12);
buffer.copy(oidBuffer, 0, index, index + 12);
var oid = new ObjectID(oidBuffer);
// Update the index
index = index + 12;
// Split the namespace
var parts = namespace.split('.');
var db = parts.shift();
var collection = parts.join('.');
// Upgrade to DBRef type
object[name] = new DBRef(collection, oid, db);
} else {

@@ -520,2 +544,8 @@ throw new Error("Detected unknown BSON type " + elementType.toString(16) + " for fieldname \"" + name + "\", are you using the latest BSON parser");

*
* @classconstant BSON_DATA_DBPOINTER
**/
BSON.BSON_DATA_DBPOINTER = 12;
/**
* Code BSON Type
*
* @classconstant BSON_DATA_CODE

@@ -522,0 +552,0 @@ **/

2

package.json

@@ -17,3 +17,3 @@ {

],
"version": "0.5.4",
"version": "0.5.5",
"author": "Christian Amor Kvalheim <christkv@gmail.com>",

@@ -20,0 +20,0 @@ "contributors": [],

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc