bson 4.7.0 → 5.0.0-alpha.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/bson.d.ts +207 -259
- package/lib/bson.bundle.js +4034 -0
- package/lib/bson.bundle.js.map +1 -0
- package/lib/bson.cjs +4029 -0
- package/lib/bson.cjs.map +1 -0
- package/lib/bson.mjs +4003 -0
- package/lib/bson.mjs.map +1 -0
- package/package.json +49 -62
- package/src/binary.ts +64 -53
- package/src/bson.ts +27 -108
- package/src/code.ts +25 -14
- package/src/constants.ts +33 -0
- package/src/db_ref.ts +14 -8
- package/src/decimal128.ts +32 -25
- package/src/double.ts +8 -5
- package/src/error.ts +0 -2
- package/src/extended_json.ts +148 -148
- package/src/index.ts +19 -0
- package/src/int_32.ts +8 -5
- package/src/long.ts +17 -16
- package/src/max_key.ts +8 -6
- package/src/min_key.ts +8 -6
- package/src/objectid.ts +42 -74
- package/src/parser/calculate_size.ts +39 -63
- package/src/parser/deserializer.ts +41 -112
- package/src/parser/serializer.ts +234 -341
- package/src/parser/utils.ts +1 -99
- package/src/regexp.ts +17 -5
- package/src/symbol.ts +9 -5
- package/src/timestamp.ts +63 -27
- package/src/utils/byte_utils.ts +61 -0
- package/src/utils/node_byte_utils.ts +141 -0
- package/src/utils/web_byte_utils.ts +190 -0
- package/src/uuid_utils.ts +15 -15
- package/bower.json +0 -26
- package/dist/bson.browser.esm.js +0 -7470
- package/dist/bson.browser.esm.js.map +0 -1
- package/dist/bson.browser.umd.js +0 -7537
- package/dist/bson.browser.umd.js.map +0 -1
- package/dist/bson.bundle.js +0 -7536
- package/dist/bson.bundle.js.map +0 -1
- package/dist/bson.esm.js +0 -5436
- package/dist/bson.esm.js.map +0 -1
- package/lib/binary.js +0 -426
- package/lib/binary.js.map +0 -1
- package/lib/bson.js +0 -251
- package/lib/bson.js.map +0 -1
- package/lib/code.js +0 -46
- package/lib/code.js.map +0 -1
- package/lib/constants.js +0 -82
- package/lib/constants.js.map +0 -1
- package/lib/db_ref.js +0 -97
- package/lib/db_ref.js.map +0 -1
- package/lib/decimal128.js +0 -669
- package/lib/decimal128.js.map +0 -1
- package/lib/double.js +0 -76
- package/lib/double.js.map +0 -1
- package/lib/ensure_buffer.js +0 -25
- package/lib/ensure_buffer.js.map +0 -1
- package/lib/error.js +0 -55
- package/lib/error.js.map +0 -1
- package/lib/extended_json.js +0 -390
- package/lib/extended_json.js.map +0 -1
- package/lib/int_32.js +0 -58
- package/lib/int_32.js.map +0 -1
- package/lib/long.js +0 -900
- package/lib/long.js.map +0 -1
- package/lib/map.js +0 -123
- package/lib/map.js.map +0 -1
- package/lib/max_key.js +0 -33
- package/lib/max_key.js.map +0 -1
- package/lib/min_key.js +0 -33
- package/lib/min_key.js.map +0 -1
- package/lib/objectid.js +0 -299
- package/lib/objectid.js.map +0 -1
- package/lib/parser/calculate_size.js +0 -194
- package/lib/parser/calculate_size.js.map +0 -1
- package/lib/parser/deserializer.js +0 -665
- package/lib/parser/deserializer.js.map +0 -1
- package/lib/parser/serializer.js +0 -867
- package/lib/parser/serializer.js.map +0 -1
- package/lib/parser/utils.js +0 -115
- package/lib/parser/utils.js.map +0 -1
- package/lib/regexp.js +0 -74
- package/lib/regexp.js.map +0 -1
- package/lib/symbol.js +0 -48
- package/lib/symbol.js.map +0 -1
- package/lib/timestamp.js +0 -102
- package/lib/timestamp.js.map +0 -1
- package/lib/utils/global.js +0 -18
- package/lib/utils/global.js.map +0 -1
- package/lib/uuid_utils.js +0 -35
- package/lib/uuid_utils.js.map +0 -1
- package/lib/validate_utf8.js +0 -47
- package/lib/validate_utf8.js.map +0 -1
- package/src/ensure_buffer.ts +0 -27
- package/src/map.ts +0 -119
- package/src/utils/global.ts +0 -22
package/lib/int_32.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Int32 = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* A class representation of a BSON Int32 type.
|
|
6
|
-
* @public
|
|
7
|
-
* @category BSONType
|
|
8
|
-
*/
|
|
9
|
-
var Int32 = /** @class */ (function () {
|
|
10
|
-
/**
|
|
11
|
-
* Create an Int32 type
|
|
12
|
-
*
|
|
13
|
-
* @param value - the number we want to represent as an int32.
|
|
14
|
-
*/
|
|
15
|
-
function Int32(value) {
|
|
16
|
-
if (!(this instanceof Int32))
|
|
17
|
-
return new Int32(value);
|
|
18
|
-
if (value instanceof Number) {
|
|
19
|
-
value = value.valueOf();
|
|
20
|
-
}
|
|
21
|
-
this.value = +value | 0;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Access the number value.
|
|
25
|
-
*
|
|
26
|
-
* @returns returns the wrapped int32 number.
|
|
27
|
-
*/
|
|
28
|
-
Int32.prototype.valueOf = function () {
|
|
29
|
-
return this.value;
|
|
30
|
-
};
|
|
31
|
-
Int32.prototype.toString = function (radix) {
|
|
32
|
-
return this.value.toString(radix);
|
|
33
|
-
};
|
|
34
|
-
Int32.prototype.toJSON = function () {
|
|
35
|
-
return this.value;
|
|
36
|
-
};
|
|
37
|
-
/** @internal */
|
|
38
|
-
Int32.prototype.toExtendedJSON = function (options) {
|
|
39
|
-
if (options && (options.relaxed || options.legacy))
|
|
40
|
-
return this.value;
|
|
41
|
-
return { $numberInt: this.value.toString() };
|
|
42
|
-
};
|
|
43
|
-
/** @internal */
|
|
44
|
-
Int32.fromExtendedJSON = function (doc, options) {
|
|
45
|
-
return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt);
|
|
46
|
-
};
|
|
47
|
-
/** @internal */
|
|
48
|
-
Int32.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () {
|
|
49
|
-
return this.inspect();
|
|
50
|
-
};
|
|
51
|
-
Int32.prototype.inspect = function () {
|
|
52
|
-
return "new Int32(".concat(this.valueOf(), ")");
|
|
53
|
-
};
|
|
54
|
-
return Int32;
|
|
55
|
-
}());
|
|
56
|
-
exports.Int32 = Int32;
|
|
57
|
-
Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' });
|
|
58
|
-
//# sourceMappingURL=int_32.js.map
|
package/lib/int_32.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"int_32.js","sourceRoot":"","sources":["../src/int_32.ts"],"names":[],"mappings":";;;AAOA;;;;GAIG;AACH;IAIE;;;;OAIG;IACH,eAAY,KAAsB;QAChC,IAAI,CAAC,CAAC,IAAI,YAAY,KAAK,CAAC;YAAE,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;QAEtD,IAAK,KAAiB,YAAY,MAAM,EAAE;YACxC,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;SACzB;QAED,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACH,uBAAO,GAAP;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,wBAAQ,GAAR,UAAS,KAAc;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,sBAAM,GAAN;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,gBAAgB;IAChB,8BAAc,GAAd,UAAe,OAAsB;QACnC,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC;QACtE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC/C,CAAC;IAED,gBAAgB;IACT,sBAAgB,GAAvB,UAAwB,GAAkB,EAAE,OAAsB;QAChE,OAAO,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC/F,CAAC;IAED,gBAAgB;IAChB,gBAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,uBAAO,GAAP;QACE,OAAO,oBAAa,IAAI,CAAC,OAAO,EAAE,MAAG,CAAC;IACxC,CAAC;IACH,YAAC;AAAD,CAAC,AAvDD,IAuDC;AAvDY,sBAAK;AAyDlB,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC"}
|