bson 6.0.0 → 6.2.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/bson.d.ts +51 -14
- package/lib/bson.bundle.js +197 -102
- package/lib/bson.bundle.js.map +1 -1
- package/lib/bson.cjs +197 -102
- package/lib/bson.cjs.map +1 -1
- package/lib/bson.mjs +197 -102
- package/lib/bson.mjs.map +1 -1
- package/lib/bson.rn.cjs +197 -102
- package/lib/bson.rn.cjs.map +1 -1
- package/package.json +1 -1
- package/src/binary.ts +10 -15
- package/src/bson_value.ts +15 -2
- package/src/code.ts +10 -10
- package/src/db_ref.ts +13 -11
- package/src/decimal128.ts +158 -48
- package/src/double.ts +4 -8
- package/src/error.ts +1 -3
- package/src/int_32.ts +4 -7
- package/src/long.ts +6 -7
- package/src/max_key.ts +0 -5
- package/src/min_key.ts +0 -5
- package/src/objectid.ts +4 -7
- package/src/parser/serializer.ts +7 -3
- package/src/parser/utils.ts +27 -0
- package/src/regexp.ts +7 -7
- package/src/symbol.ts +4 -7
- package/src/timestamp.ts +6 -7
package/src/timestamp.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BSONError } from './error';
|
|
2
2
|
import type { Int32 } from './int_32';
|
|
3
3
|
import { Long } from './long';
|
|
4
|
+
import { type InspectFn, defaultInspect } from './parser/utils';
|
|
4
5
|
|
|
5
6
|
/** @public */
|
|
6
7
|
export type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON' | 'inspect';
|
|
@@ -141,12 +142,10 @@ export class Timestamp extends LongWithoutOverridesClass {
|
|
|
141
142
|
return new Timestamp({ t, i });
|
|
142
143
|
}
|
|
143
144
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
inspect(): string {
|
|
150
|
-
return `new Timestamp({ t: ${this.getHighBits()}, i: ${this.getLowBits()} })`;
|
|
145
|
+
inspect(depth?: number, options?: unknown, inspect?: InspectFn): string {
|
|
146
|
+
inspect ??= defaultInspect;
|
|
147
|
+
const t = inspect(this.high >>> 0, options);
|
|
148
|
+
const i = inspect(this.low >>> 0, options);
|
|
149
|
+
return `new Timestamp({ t: ${t}, i: ${i} })`;
|
|
151
150
|
}
|
|
152
151
|
}
|