bson 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ 1.0.4 2016-01-11
2
+ ----------------
3
+ - #204 remove Buffer.from as it's partially broken in early 4.x.x. series of node releases.
4
+
1
5
  1.0.3 2016-01-03
2
6
  ----------------
3
7
  - Fixed toString for ObjectId so it will work with inspect.
@@ -49,7 +49,7 @@ var ObjectID = function ObjectID(id) {
49
49
  if(!valid && id != null){
50
50
  throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");
51
51
  } else if(valid && typeof id == 'string' && id.length == 24 && hasBufferType) {
52
- return new ObjectID(Buffer.from(id, 'hex'));
52
+ return new ObjectID(new Buffer(id, 'hex'));
53
53
  } else if(valid && typeof id == 'string' && id.length == 24) {
54
54
  return ObjectID.createFromHexString(id);
55
55
  } else if(id != null && id.length === 12) {
@@ -290,7 +290,7 @@ ObjectID.createFromHexString = function createFromHexString (string) {
290
290
  }
291
291
 
292
292
  // Use Buffer.from method if available
293
- if(hasBufferType) return new ObjectID(Buffer.from(string, 'hex'));
293
+ if(hasBufferType) return new ObjectID(new Buffer(string, 'hex'));
294
294
 
295
295
  // Calculate lengths
296
296
  var array = new _Buffer(12);
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "browser_build",
13
13
  "bower.json"
14
14
  ],
15
- "version": "1.0.3",
15
+ "version": "1.0.4",
16
16
  "author": "Christian Amor Kvalheim <christkv@gmail.com>",
17
17
  "contributors": [],
18
18
  "repository": "mongodb/js-bson",