bson 4.3.0 → 4.5.1
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/bower.json +1 -1
- package/bson.d.ts +23 -7
- package/dist/bson.browser.esm.js +728 -2228
- package/dist/bson.browser.esm.js.map +1 -1
- package/dist/bson.browser.umd.js +779 -2281
- package/dist/bson.browser.umd.js.map +1 -1
- package/dist/bson.bundle.js +779 -2281
- package/dist/bson.bundle.js.map +1 -1
- package/dist/bson.esm.js +718 -2222
- package/dist/bson.esm.js.map +1 -1
- package/lib/bson.js +1 -1
- package/lib/bson.js.map +1 -1
- package/lib/db_ref.js +4 -1
- package/lib/db_ref.js.map +1 -1
- package/lib/decimal128.js +14 -51
- package/lib/decimal128.js.map +1 -1
- package/lib/ensure_buffer.js +2 -5
- package/lib/ensure_buffer.js.map +1 -1
- package/lib/extended_json.js +48 -9
- package/lib/extended_json.js.map +1 -1
- package/lib/long.js +18 -5
- package/lib/long.js.map +1 -1
- package/lib/map.js +3 -15
- package/lib/map.js.map +1 -1
- package/lib/objectid.js +9 -17
- package/lib/objectid.js.map +1 -1
- package/lib/parser/calculate_size.js +5 -6
- package/lib/parser/calculate_size.js.map +1 -1
- package/lib/parser/deserializer.js +61 -47
- package/lib/parser/deserializer.js.map +1 -1
- package/lib/parser/serializer.js +14 -13
- package/lib/parser/serializer.js.map +1 -1
- package/lib/parser/utils.js +21 -15
- package/lib/parser/utils.js.map +1 -1
- package/lib/regexp.js +1 -3
- package/lib/regexp.js.map +1 -1
- package/lib/timestamp.js +6 -2
- package/lib/timestamp.js.map +1 -1
- package/lib/utils/global.js +18 -0
- package/lib/utils/global.js.map +1 -0
- package/lib/uuid.js +2 -3
- package/lib/uuid.js.map +1 -1
- package/lib/uuid_utils.js.map +1 -1
- package/package.json +10 -8
- package/src/bson.ts +1 -1
- package/src/db_ref.ts +6 -1
- package/src/decimal128.ts +14 -52
- package/src/ensure_buffer.ts +7 -7
- package/src/extended_json.ts +64 -16
- package/src/long.ts +19 -7
- package/src/map.ts +5 -25
- package/src/objectid.ts +12 -19
- package/src/parser/calculate_size.ts +8 -11
- package/src/parser/deserializer.ts +68 -51
- package/src/parser/serializer.ts +13 -12
- package/src/parser/utils.ts +23 -16
- package/src/regexp.ts +2 -4
- package/src/timestamp.ts +15 -7
- package/src/utils/global.ts +22 -0
- package/src/uuid.ts +3 -6
- package/src/uuid_utils.ts +2 -1
- package/HISTORY.md +0 -488
package/bower.json
CHANGED
package/bson.d.ts
CHANGED
|
@@ -260,8 +260,11 @@ export declare interface DBRefLike {
|
|
|
260
260
|
export declare class Decimal128 {
|
|
261
261
|
_bsontype: 'Decimal128';
|
|
262
262
|
readonly bytes: Buffer;
|
|
263
|
-
/**
|
|
264
|
-
|
|
263
|
+
/**
|
|
264
|
+
* @param bytes - a buffer containing the raw Decimal128 bytes in little endian order,
|
|
265
|
+
* or a string representation as returned by .toString()
|
|
266
|
+
*/
|
|
267
|
+
constructor(bytes: Buffer | string);
|
|
265
268
|
/**
|
|
266
269
|
* Create a Decimal128 instance from a string representation
|
|
267
270
|
*
|
|
@@ -503,11 +506,17 @@ export declare class Long {
|
|
|
503
506
|
/**
|
|
504
507
|
* Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.
|
|
505
508
|
* See the from* functions below for more convenient ways of constructing Longs.
|
|
509
|
+
*
|
|
510
|
+
* Acceptable signatures are:
|
|
511
|
+
* - Long(low, high, unsigned?)
|
|
512
|
+
* - Long(bigint, unsigned?)
|
|
513
|
+
* - Long(string, unsigned?)
|
|
514
|
+
*
|
|
506
515
|
* @param low - The low (signed) 32 bits of the long
|
|
507
516
|
* @param high - The high (signed) 32 bits of the long
|
|
508
517
|
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
509
518
|
*/
|
|
510
|
-
constructor(low?: number, high?: number, unsigned?: boolean);
|
|
519
|
+
constructor(low?: number | bigint | string, high?: number | boolean, unsigned?: boolean);
|
|
511
520
|
static TWO_PWR_24: Long;
|
|
512
521
|
/** Maximum unsigned value. */
|
|
513
522
|
static MAX_UNSIGNED_VALUE: Long;
|
|
@@ -779,7 +788,7 @@ export declare interface LongExtended {
|
|
|
779
788
|
$numberLong: string;
|
|
780
789
|
}
|
|
781
790
|
/** @public */
|
|
782
|
-
export declare type LongWithoutOverrides = new (low:
|
|
791
|
+
export declare type LongWithoutOverrides = new (low: unknown, high?: number, unsigned?: boolean) => {
|
|
783
792
|
[P in Exclude<keyof Long, TimestampOverrides>]: Long[P];
|
|
784
793
|
};
|
|
785
794
|
/** @public */
|
|
@@ -880,7 +889,7 @@ declare class ObjectId {
|
|
|
880
889
|
*
|
|
881
890
|
* @param id - ObjectId instance to validate.
|
|
882
891
|
*/
|
|
883
|
-
static isValid(id: number | string | ObjectId |
|
|
892
|
+
static isValid(id: number | string | ObjectId | Uint8Array | ObjectIdLike): boolean;
|
|
884
893
|
/* Excluded from this release type: toExtendedJSON */
|
|
885
894
|
/* Excluded from this release type: fromExtendedJSON */
|
|
886
895
|
inspect(): string;
|
|
@@ -941,12 +950,19 @@ export declare class Timestamp extends LongWithoutOverridesClass {
|
|
|
941
950
|
/**
|
|
942
951
|
* @param low - A 64-bit Long representing the Timestamp.
|
|
943
952
|
*/
|
|
944
|
-
constructor(
|
|
953
|
+
constructor(long: Long);
|
|
954
|
+
/**
|
|
955
|
+
* @param value - A pair of two values indicating timestamp and increment.
|
|
956
|
+
*/
|
|
957
|
+
constructor(value: {
|
|
958
|
+
t: number;
|
|
959
|
+
i: number;
|
|
960
|
+
});
|
|
945
961
|
/**
|
|
946
962
|
* @param low - the low (signed) 32 bits of the Timestamp.
|
|
947
963
|
* @param high - the high (signed) 32 bits of the Timestamp.
|
|
964
|
+
* @deprecated Please use `Timestamp({ t: high, i: low })` or `Timestamp(Long(low, high))` instead.
|
|
948
965
|
*/
|
|
949
|
-
constructor(low: Long);
|
|
950
966
|
constructor(low: number, high: number);
|
|
951
967
|
toJSON(): {
|
|
952
968
|
$timestamp: string;
|