bson 6.10.1 → 6.10.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/lib/bson.bundle.js +7 -1
- package/lib/bson.bundle.js.map +1 -1
- package/lib/bson.cjs +7 -1
- package/lib/bson.cjs.map +1 -1
- package/lib/bson.mjs +7 -1
- package/lib/bson.mjs.map +1 -1
- package/lib/bson.rn.cjs +7 -0
- package/lib/bson.rn.cjs.map +1 -1
- package/package.json +1 -1
- package/src/parser/calculate_size.ts +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Binary } from '../binary';
|
|
2
2
|
import type { Document } from '../bson';
|
|
3
|
-
import { BSONVersionError } from '../error';
|
|
3
|
+
import { BSONError, BSONVersionError } from '../error';
|
|
4
4
|
import * as constants from '../constants';
|
|
5
5
|
import { ByteUtils } from '../utils/byte_utils';
|
|
6
6
|
import { isAnyArrayBuffer, isDate, isRegExp } from './utils';
|
|
@@ -205,6 +205,13 @@ function calculateElement(
|
|
|
205
205
|
1
|
|
206
206
|
);
|
|
207
207
|
}
|
|
208
|
+
return 0;
|
|
209
|
+
case 'bigint':
|
|
210
|
+
return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (8 + 1);
|
|
211
|
+
case 'symbol':
|
|
212
|
+
return 0;
|
|
213
|
+
default:
|
|
214
|
+
throw new BSONError(`Unrecognized JS type: ${typeof value}`);
|
|
208
215
|
}
|
|
209
216
|
|
|
210
217
|
return 0;
|