bson 4.4.0 → 4.5.2
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 +42 -14
- package/dist/bson.browser.esm.js +628 -2199
- package/dist/bson.browser.esm.js.map +1 -1
- package/dist/bson.browser.umd.js +681 -2254
- package/dist/bson.browser.umd.js.map +1 -1
- package/dist/bson.bundle.js +681 -2254
- package/dist/bson.bundle.js.map +1 -1
- package/dist/bson.esm.js +622 -2197
- package/dist/bson.esm.js.map +1 -1
- package/lib/binary.js +0 -3
- package/lib/binary.js.map +1 -1
- package/lib/bson.js +1 -1
- package/lib/bson.js.map +1 -1
- package/lib/code.js +0 -1
- package/lib/code.js.map +1 -1
- package/lib/db_ref.js +4 -2
- package/lib/db_ref.js.map +1 -1
- package/lib/decimal128.js +4 -49
- package/lib/decimal128.js.map +1 -1
- package/lib/double.js +3 -1
- package/lib/double.js.map +1 -1
- package/lib/extended_json.js +3 -3
- package/lib/extended_json.js.map +1 -1
- package/lib/int_32.js +3 -1
- package/lib/int_32.js.map +1 -1
- package/lib/long.js.map +1 -1
- package/lib/map.js +3 -15
- package/lib/map.js.map +1 -1
- package/lib/objectid.js +1 -5
- package/lib/objectid.js.map +1 -1
- package/lib/parser/deserializer.js +15 -12
- package/lib/parser/deserializer.js.map +1 -1
- package/lib/parser/serializer.js +7 -3
- package/lib/parser/serializer.js.map +1 -1
- package/lib/parser/utils.js +8 -8
- package/lib/parser/utils.js.map +1 -1
- package/lib/regexp.js +1 -3
- package/lib/regexp.js.map +1 -1
- package/lib/symbol.js +0 -2
- package/lib/symbol.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 +22 -9
- package/src/binary.ts +1 -4
- package/src/bson.ts +1 -1
- package/src/code.ts +0 -1
- package/src/db_ref.ts +6 -2
- package/src/decimal128.ts +4 -49
- package/src/double.ts +4 -1
- package/src/extended_json.ts +6 -6
- package/src/int_32.ts +4 -1
- package/src/long.ts +2 -2
- package/src/map.ts +5 -25
- package/src/objectid.ts +1 -5
- package/src/parser/deserializer.ts +23 -16
- package/src/parser/serializer.ts +7 -3
- package/src/parser/utils.ts +9 -11
- package/src/regexp.ts +2 -4
- package/src/symbol.ts +0 -2
- package/src/timestamp.ts +15 -7
- package/src/utils/global.ts +22 -0
- package/src/uuid.ts +2 -3
- package/src/uuid_utils.ts +2 -1
- package/HISTORY.md +0 -505
package/bower.json
CHANGED
package/bson.d.ts
CHANGED
|
@@ -59,10 +59,10 @@ export declare class Binary {
|
|
|
59
59
|
value(asRaw?: boolean): string | BinarySequence;
|
|
60
60
|
/** the length of the binary sequence */
|
|
61
61
|
length(): number;
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
toJSON(): string;
|
|
63
|
+
toString(format?: string): string;
|
|
64
64
|
/* Excluded from this release type: toExtendedJSON */
|
|
65
|
-
|
|
65
|
+
toUUID(): UUID;
|
|
66
66
|
/* Excluded from this release type: fromExtendedJSON */
|
|
67
67
|
inspect(): string;
|
|
68
68
|
}
|
|
@@ -186,6 +186,9 @@ export declare class BSONSymbol {
|
|
|
186
186
|
constructor(value: string);
|
|
187
187
|
/** Access the wrapped string value. */
|
|
188
188
|
valueOf(): string;
|
|
189
|
+
toString(): string;
|
|
190
|
+
/* Excluded from this release type: inspect */
|
|
191
|
+
toJSON(): string;
|
|
189
192
|
}
|
|
190
193
|
/** @public */
|
|
191
194
|
export declare interface BSONSymbolExtended {
|
|
@@ -214,7 +217,10 @@ export declare class Code {
|
|
|
214
217
|
* @param scope - an optional scope for the function.
|
|
215
218
|
*/
|
|
216
219
|
constructor(code: string | Function, scope?: Document);
|
|
217
|
-
|
|
220
|
+
toJSON(): {
|
|
221
|
+
code: string | Function;
|
|
222
|
+
scope?: Document;
|
|
223
|
+
};
|
|
218
224
|
/* Excluded from this release type: toExtendedJSON */
|
|
219
225
|
/* Excluded from this release type: fromExtendedJSON */
|
|
220
226
|
inspect(): string;
|
|
@@ -242,7 +248,7 @@ export declare class DBRef {
|
|
|
242
248
|
constructor(collection: string, oid: ObjectId, db?: string, fields?: Document);
|
|
243
249
|
/* Excluded from this release type: namespace */
|
|
244
250
|
/* Excluded from this release type: namespace */
|
|
245
|
-
|
|
251
|
+
toJSON(): DBRefLike & Document;
|
|
246
252
|
/* Excluded from this release type: toExtendedJSON */
|
|
247
253
|
/* Excluded from this release type: fromExtendedJSON */
|
|
248
254
|
inspect(): string;
|
|
@@ -354,7 +360,8 @@ export declare class Double {
|
|
|
354
360
|
* @returns returns the wrapped double number.
|
|
355
361
|
*/
|
|
356
362
|
valueOf(): number;
|
|
357
|
-
|
|
363
|
+
toJSON(): number;
|
|
364
|
+
toString(radix?: number): string;
|
|
358
365
|
/* Excluded from this release type: toExtendedJSON */
|
|
359
366
|
/* Excluded from this release type: fromExtendedJSON */
|
|
360
367
|
inspect(): string;
|
|
@@ -458,7 +465,8 @@ export declare class Int32 {
|
|
|
458
465
|
* @returns returns the wrapped int32 number.
|
|
459
466
|
*/
|
|
460
467
|
valueOf(): number;
|
|
461
|
-
|
|
468
|
+
toString(radix?: number): string;
|
|
469
|
+
toJSON(): number;
|
|
462
470
|
/* Excluded from this release type: toExtendedJSON */
|
|
463
471
|
/* Excluded from this release type: fromExtendedJSON */
|
|
464
472
|
inspect(): string;
|
|
@@ -788,7 +796,7 @@ export declare interface LongExtended {
|
|
|
788
796
|
$numberLong: string;
|
|
789
797
|
}
|
|
790
798
|
/** @public */
|
|
791
|
-
export declare type LongWithoutOverrides = new (low:
|
|
799
|
+
export declare type LongWithoutOverrides = new (low: unknown, high?: number, unsigned?: boolean) => {
|
|
792
800
|
[P in Exclude<keyof Long, TimestampOverrides>]: Long[P];
|
|
793
801
|
};
|
|
794
802
|
/** @public */
|
|
@@ -861,8 +869,14 @@ declare class ObjectId {
|
|
|
861
869
|
* @param time - pass in a second based timestamp.
|
|
862
870
|
*/
|
|
863
871
|
static generate(time?: number): Buffer;
|
|
864
|
-
|
|
865
|
-
|
|
872
|
+
/**
|
|
873
|
+
* Converts the id into a 24 character hex string for printing
|
|
874
|
+
*
|
|
875
|
+
* @param format - The Buffer toString format parameter.
|
|
876
|
+
*/
|
|
877
|
+
toString(format?: string): string;
|
|
878
|
+
/** Converts to its JSON the 24 character hex string representation. */
|
|
879
|
+
toJSON(): string;
|
|
866
880
|
/**
|
|
867
881
|
* Compares the equality of this ObjectId with `otherID`.
|
|
868
882
|
*
|
|
@@ -950,12 +964,19 @@ export declare class Timestamp extends LongWithoutOverridesClass {
|
|
|
950
964
|
/**
|
|
951
965
|
* @param low - A 64-bit Long representing the Timestamp.
|
|
952
966
|
*/
|
|
953
|
-
constructor(
|
|
967
|
+
constructor(long: Long);
|
|
968
|
+
/**
|
|
969
|
+
* @param value - A pair of two values indicating timestamp and increment.
|
|
970
|
+
*/
|
|
971
|
+
constructor(value: {
|
|
972
|
+
t: number;
|
|
973
|
+
i: number;
|
|
974
|
+
});
|
|
954
975
|
/**
|
|
955
976
|
* @param low - the low (signed) 32 bits of the Timestamp.
|
|
956
977
|
* @param high - the high (signed) 32 bits of the Timestamp.
|
|
978
|
+
* @deprecated Please use `Timestamp({ t: high, i: low })` or `Timestamp(Long(low, high))` instead.
|
|
957
979
|
*/
|
|
958
|
-
constructor(low: Long);
|
|
959
980
|
constructor(low: number, high: number);
|
|
960
981
|
toJSON(): {
|
|
961
982
|
$timestamp: string;
|
|
@@ -1019,8 +1040,15 @@ export declare class UUID {
|
|
|
1019
1040
|
* @param includeDashes - should the string exclude dash-separators.
|
|
1020
1041
|
* */
|
|
1021
1042
|
toHexString(includeDashes?: boolean): string;
|
|
1022
|
-
|
|
1023
|
-
|
|
1043
|
+
/**
|
|
1044
|
+
* Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified.
|
|
1045
|
+
*/
|
|
1046
|
+
toString(encoding?: string): string;
|
|
1047
|
+
/**
|
|
1048
|
+
* Converts the id into its JSON string representation.
|
|
1049
|
+
* A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
1050
|
+
*/
|
|
1051
|
+
toJSON(): string;
|
|
1024
1052
|
/**
|
|
1025
1053
|
* Compares the equality of this UUID with `otherID`.
|
|
1026
1054
|
*
|