bson 4.5.2 → 4.5.3

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.
Files changed (50) hide show
  1. package/bower.json +1 -1
  2. package/bson.d.ts +16 -0
  3. package/dist/bson.browser.esm.js +187 -127
  4. package/dist/bson.browser.esm.js.map +1 -1
  5. package/dist/bson.browser.umd.js +190 -126
  6. package/dist/bson.browser.umd.js.map +1 -1
  7. package/dist/bson.bundle.js +190 -126
  8. package/dist/bson.bundle.js.map +1 -1
  9. package/dist/bson.esm.js +187 -127
  10. package/dist/bson.esm.js.map +1 -1
  11. package/lib/binary.js +11 -6
  12. package/lib/binary.js.map +1 -1
  13. package/lib/bson.js +11 -3
  14. package/lib/bson.js.map +1 -1
  15. package/lib/constants.js +5 -1
  16. package/lib/constants.js.map +1 -1
  17. package/lib/decimal128.js +5 -4
  18. package/lib/decimal128.js.map +1 -1
  19. package/lib/ensure_buffer.js +2 -1
  20. package/lib/ensure_buffer.js.map +1 -1
  21. package/lib/error.js +51 -0
  22. package/lib/error.js.map +1 -0
  23. package/lib/extended_json.js +11 -5
  24. package/lib/extended_json.js.map +1 -1
  25. package/lib/objectid.js +3 -2
  26. package/lib/objectid.js.map +1 -1
  27. package/lib/parser/deserializer.js +60 -51
  28. package/lib/parser/deserializer.js.map +1 -1
  29. package/lib/parser/serializer.js +13 -12
  30. package/lib/parser/serializer.js.map +1 -1
  31. package/lib/regexp.js +9 -2
  32. package/lib/regexp.js.map +1 -1
  33. package/lib/uuid.js +2 -1
  34. package/lib/uuid.js.map +1 -1
  35. package/lib/uuid_utils.js +2 -1
  36. package/lib/uuid_utils.js.map +1 -1
  37. package/package.json +3 -1
  38. package/src/binary.ts +11 -6
  39. package/src/bson.ts +7 -1
  40. package/src/constants.ts +6 -0
  41. package/src/decimal128.ts +5 -4
  42. package/src/ensure_buffer.ts +2 -1
  43. package/src/error.ts +13 -0
  44. package/src/extended_json.ts +13 -5
  45. package/src/objectid.ts +3 -2
  46. package/src/parser/deserializer.ts +65 -53
  47. package/src/parser/serializer.ts +13 -12
  48. package/src/regexp.ts +14 -2
  49. package/src/uuid.ts +2 -1
  50. package/src/uuid_utils.ts +2 -1
package/bower.json CHANGED
@@ -22,5 +22,5 @@
22
22
  "test",
23
23
  "tools"
24
24
  ],
25
- "version": "4.5.2"
25
+ "version": "4.5.3"
26
26
  }
package/bson.d.ts CHANGED
@@ -20,6 +20,10 @@ export declare class Binary {
20
20
  static readonly SUBTYPE_UUID = 4;
21
21
  /** MD5 BSON type */
22
22
  static readonly SUBTYPE_MD5 = 5;
23
+ /** Encrypted BSON type */
24
+ static readonly SUBTYPE_ENCRYPTED = 6;
25
+ /** Column BSON type */
26
+ static readonly SUBTYPE_COLUMN = 7;
23
27
  /** User BSON type */
24
28
  static readonly SUBTYPE_USER_DEFINED = 128;
25
29
  buffer: Buffer;
@@ -112,10 +116,14 @@ declare const BSON: {
112
116
  deserialize: typeof deserialize;
113
117
  calculateObjectSize: typeof calculateObjectSize;
114
118
  deserializeStream: typeof deserializeStream;
119
+ BSONError: typeof BSONError;
120
+ BSONTypeError: typeof BSONTypeError;
115
121
  };
116
122
  export default BSON;
117
123
  /* Excluded from this release type: BSON_BINARY_SUBTYPE_BYTE_ARRAY */
124
+ /* Excluded from this release type: BSON_BINARY_SUBTYPE_COLUMN */
118
125
  /* Excluded from this release type: BSON_BINARY_SUBTYPE_DEFAULT */
126
+ /* Excluded from this release type: BSON_BINARY_SUBTYPE_ENCRYPTED */
119
127
  /* Excluded from this release type: BSON_BINARY_SUBTYPE_FUNCTION */
120
128
  /* Excluded from this release type: BSON_BINARY_SUBTYPE_MD5 */
121
129
  /* Excluded from this release type: BSON_BINARY_SUBTYPE_USER_DEFINED */
@@ -146,6 +154,10 @@ export default BSON;
146
154
  /* Excluded from this release type: BSON_INT32_MIN */
147
155
  /* Excluded from this release type: BSON_INT64_MAX */
148
156
  /* Excluded from this release type: BSON_INT64_MIN */
157
+ /** @public */
158
+ export declare class BSONError extends Error {
159
+ readonly name: string;
160
+ }
149
161
  /**
150
162
  * A class representation of the BSON RegExp type.
151
163
  * @public
@@ -194,6 +206,10 @@ export declare class BSONSymbol {
194
206
  export declare interface BSONSymbolExtended {
195
207
  $symbol: string;
196
208
  }
209
+ /** @public */
210
+ export declare class BSONTypeError extends TypeError {
211
+ readonly name: string;
212
+ }
197
213
  /**
198
214
  * Calculate the bson size for a passed in Javascript object.
199
215
  *