bson 4.6.3 → 4.7.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.
Files changed (74) hide show
  1. package/bower.json +1 -1
  2. package/bson.d.ts +9 -9
  3. package/dist/bson.browser.esm.js +352 -400
  4. package/dist/bson.browser.esm.js.map +1 -1
  5. package/dist/bson.browser.umd.js +355 -403
  6. package/dist/bson.browser.umd.js.map +1 -1
  7. package/dist/bson.bundle.js +355 -403
  8. package/dist/bson.bundle.js.map +1 -1
  9. package/dist/bson.esm.js +349 -400
  10. package/dist/bson.esm.js.map +1 -1
  11. package/lib/binary.js +196 -10
  12. package/lib/binary.js.map +1 -1
  13. package/lib/bson.js +8 -9
  14. package/lib/bson.js.map +1 -1
  15. package/lib/code.js +1 -1
  16. package/lib/code.js.map +1 -1
  17. package/lib/db_ref.js +2 -2
  18. package/lib/db_ref.js.map +1 -1
  19. package/lib/decimal128.js +13 -13
  20. package/lib/decimal128.js.map +1 -1
  21. package/lib/double.js +2 -2
  22. package/lib/double.js.map +1 -1
  23. package/lib/ensure_buffer.js +1 -1
  24. package/lib/ensure_buffer.js.map +1 -1
  25. package/lib/extended_json.js +24 -12
  26. package/lib/extended_json.js.map +1 -1
  27. package/lib/int_32.js +1 -1
  28. package/lib/int_32.js.map +1 -1
  29. package/lib/long.js +3 -3
  30. package/lib/long.js.map +1 -1
  31. package/lib/map.js +1 -1
  32. package/lib/map.js.map +1 -1
  33. package/lib/objectid.js +9 -8
  34. package/lib/objectid.js.map +1 -1
  35. package/lib/parser/calculate_size.js +10 -9
  36. package/lib/parser/calculate_size.js.map +1 -1
  37. package/lib/parser/deserializer.js +20 -11
  38. package/lib/parser/deserializer.js.map +1 -1
  39. package/lib/parser/serializer.js +25 -22
  40. package/lib/parser/serializer.js.map +1 -1
  41. package/lib/parser/utils.js +23 -19
  42. package/lib/parser/utils.js.map +1 -1
  43. package/lib/regexp.js +4 -4
  44. package/lib/regexp.js.map +1 -1
  45. package/lib/symbol.js +1 -1
  46. package/lib/symbol.js.map +1 -1
  47. package/lib/timestamp.js +3 -3
  48. package/lib/timestamp.js.map +1 -1
  49. package/lib/utils/global.js +1 -1
  50. package/lib/utils/global.js.map +1 -1
  51. package/lib/uuid_utils.js +1 -1
  52. package/lib/uuid_utils.js.map +1 -1
  53. package/package.json +17 -24
  54. package/src/binary.ts +197 -3
  55. package/src/bson.ts +18 -23
  56. package/src/code.ts +1 -1
  57. package/src/db_ref.ts +1 -1
  58. package/src/decimal128.ts +3 -3
  59. package/src/extended_json.ts +13 -2
  60. package/src/long.ts +32 -7
  61. package/src/objectid.ts +3 -2
  62. package/src/parser/calculate_size.ts +4 -3
  63. package/src/parser/deserializer.ts +12 -4
  64. package/src/parser/serializer.ts +14 -7
  65. package/src/parser/utils.ts +24 -20
  66. package/src/timestamp.ts +1 -1
  67. package/src/utils/global.ts +1 -1
  68. package/bson-ts34.d.ts +0 -1133
  69. package/lib/float_parser.js +0 -137
  70. package/lib/float_parser.js.map +0 -1
  71. package/lib/uuid.js +0 -179
  72. package/lib/uuid.js.map +0 -1
  73. package/src/float_parser.ts +0 -152
  74. package/src/uuid.ts +0 -209
package/bower.json CHANGED
@@ -22,5 +22,5 @@
22
22
  "test",
23
23
  "tools"
24
24
  ],
25
- "version": "4.6.3"
25
+ "version": "4.7.0"
26
26
  }
package/bson.d.ts CHANGED
@@ -32,6 +32,13 @@ export declare class Binary {
32
32
  sub_type: number;
33
33
  position: number;
34
34
  /**
35
+ * Create a new Binary instance.
36
+ *
37
+ * This constructor can accept a string as its first argument. In this case,
38
+ * this string will be encoded using ISO-8859-1, **not** using UTF-8.
39
+ * This is almost certainly not what you want. Use `new Binary(Buffer.from(string))`
40
+ * instead to convert the string to a Buffer using UTF-8 first.
41
+ *
35
42
  * @param buffer - a buffer object containing the binary data.
36
43
  * @param subType - the option binary type.
37
44
  */
@@ -590,8 +597,6 @@ export declare interface Int32Extended {
590
597
 
591
598
  declare const kId: unique symbol;
592
599
 
593
- declare const kId_2: unique symbol;
594
-
595
600
  /**
596
601
  * A class representing a 64-bit integer
597
602
  * @public
@@ -721,7 +726,7 @@ export declare class Long {
721
726
  /**
722
727
  * Tests if the specified object is a Long.
723
728
  */
724
- static isLong(value: any): value is Long;
729
+ static isLong(value: unknown): value is Long;
725
730
  /**
726
731
  * Converts the specified value to a Long.
727
732
  * @param unsigned - Whether unsigned or not, defaults to signed
@@ -1159,10 +1164,8 @@ export declare type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromE
1159
1164
  * A class representation of the BSON UUID type.
1160
1165
  * @public
1161
1166
  */
1162
- export declare class UUID {
1163
- _bsontype: 'UUID';
1167
+ export declare class UUID extends Binary {
1164
1168
  static cacheHexString: boolean;
1165
- /* Excluded from this release type: [kId] */
1166
1169
  /* Excluded from this release type: __id */
1167
1170
  /**
1168
1171
  * Create an UUID type
@@ -1176,9 +1179,6 @@ export declare class UUID {
1176
1179
  */
1177
1180
  get id(): Buffer;
1178
1181
  set id(value: Buffer);
1179
- /**
1180
- * Generate a 16 byte uuid v4 buffer used in UUIDs
1181
- */
1182
1182
  /**
1183
1183
  * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated)
1184
1184
  * @param includeDashes - should the string exclude dash-separators.