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.2 to 0.5.3

4

HISTORY.md

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

0.5.3 2016-07-11
-----------------
- Throw error if ObjectId is not a string or a buffer.
0.5.2 2016-07-11

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

@@ -46,2 +46,4 @@ /**

return id;
} else {
throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");
}

@@ -71,2 +73,5 @@

var hexString = '';
if(!this.id || !this.id.length) {
throw new Error('invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [' + JSON.stringify(this.id) + ']');
}

@@ -73,0 +78,0 @@ if(this.id instanceof _Buffer) {

4

lib/bson/parser/serializer.js

@@ -251,4 +251,6 @@ "use strict"

buffer.write(value.id, index, 'binary')
} else if(value.id && value.id.copy){
value.id.copy(buffer, index, 0, 12);
} else {
value.id.copy(buffer, index, 0, 12);
throw new Error('object [' + JSON.stringify(value) + "] is not a valid ObjectId");
}

@@ -255,0 +257,0 @@

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

],
"version": "0.5.2",
"version": "0.5.3",
"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