bson 1.0.9 → 1.1.0

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,13 @@
1
+ <a name="1.1.0"></a>
2
+ # [1.1.0](https://github.com/mongodb/js-bson/compare/v1.0.9...v1.1.0) (2018-08-13)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * **serializer:** do not use checkKeys for $clusterTime ([573e141](https://github.com/mongodb/js-bson/commit/573e141))
8
+
9
+
10
+
1
11
  <a name="1.0.9"></a>
2
12
  ## [1.0.9](https://github.com/mongodb/js-bson/compare/v1.0.8...v1.0.9) (2018-06-07)
3
13
 
@@ -15,6 +15,7 @@ var normalizedFunctionString = require('./utils').normalizedFunctionString;
15
15
  // }
16
16
 
17
17
  var regexp = /\x00/; // eslint-disable-line no-control-regex
18
+ var ignoreKeys = ['$db', '$ref', '$id', '$clusterTime'];
18
19
 
19
20
  // To ensure that 0.4 of node works correctly
20
21
  var isDate = function isDate(d) {
@@ -798,7 +799,7 @@ var serializeInto = function serializeInto(
798
799
  type = typeof value;
799
800
 
800
801
  // Check the key and throw error if it's illegal
801
- if (key !== '$db' && key !== '$ref' && key !== '$id') {
802
+ if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
802
803
  if (key.match(regexp) != null) {
803
804
  // The BSON spec doesn't allow keys with null bytes because keys are
804
805
  // null-terminated.
@@ -899,7 +900,7 @@ var serializeInto = function serializeInto(
899
900
  type = typeof value;
900
901
 
901
902
  // Check the key and throw error if it's illegal
902
- if (key !== '$db' && key !== '$ref' && key !== '$id') {
903
+ if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
903
904
  if (key.match(regexp) != null) {
904
905
  // The BSON spec doesn't allow keys with null bytes because keys are
905
906
  // null-terminated.
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "browser_build",
13
13
  "bower.json"
14
14
  ],
15
- "version": "1.0.9",
15
+ "version": "1.1.0",
16
16
  "author": "Christian Amor Kvalheim <christkv@gmail.com>",
17
17
  "contributors": [],
18
18
  "repository": "mongodb/js-bson",