bson 5.3.0 → 5.5.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/README.md +4 -11
- package/bson.d.ts +20 -0
- package/lib/bson.bundle.js +137 -86
- package/lib/bson.bundle.js.map +1 -1
- package/lib/bson.cjs +137 -86
- package/lib/bson.cjs.map +1 -1
- package/lib/bson.mjs +137 -86
- package/lib/bson.mjs.map +1 -1
- package/lib/bson.rn.cjs +4159 -0
- package/lib/bson.rn.cjs.map +1 -0
- package/package.json +8 -7
- package/src/binary.ts +3 -2
- package/src/bson.ts +2 -2
- package/src/decimal128.ts +165 -84
- package/src/parser/deserializer.ts +8 -8
- package/src/timestamp.ts +7 -5
- package/src/utils/byte_utils.ts +1 -1
- package/src/utils/node_byte_utils.ts +3 -3
- package/src/utils/web_byte_utils.ts +2 -2
- package/vendor/base64/LICENSE-MIT.txt +20 -0
- package/vendor/base64/README.md +112 -0
- package/vendor/base64/base64.js +157 -0
- package/vendor/base64/package.json +43 -0
- package/vendor/text-encoding/LICENSE.md +237 -0
- package/vendor/text-encoding/README.md +111 -0
- package/vendor/text-encoding/index.js +9 -0
- package/vendor/text-encoding/lib/encoding-indexes.js +47 -0
- package/vendor/text-encoding/lib/encoding.js +3301 -0
- package/vendor/text-encoding/package.json +37 -0
- package/lib/binary.d.ts +0 -182
- package/lib/binary.d.ts.map +0 -1
- package/lib/bson.d.ts +0 -97
- package/lib/bson.d.ts.map +0 -1
- package/lib/bson_value.d.ts +0 -10
- package/lib/bson_value.d.ts.map +0 -1
- package/lib/code.d.ts +0 -32
- package/lib/code.d.ts.map +0 -1
- package/lib/constants.d.ts +0 -107
- package/lib/constants.d.ts.map +0 -1
- package/lib/db_ref.d.ts +0 -40
- package/lib/db_ref.d.ts.map +0 -1
- package/lib/decimal128.d.ts +0 -34
- package/lib/decimal128.d.ts.map +0 -1
- package/lib/double.d.ts +0 -35
- package/lib/double.d.ts.map +0 -1
- package/lib/error.d.ts +0 -50
- package/lib/error.d.ts.map +0 -1
- package/lib/extended_json.d.ts +0 -82
- package/lib/extended_json.d.ts.map +0 -1
- package/lib/index.d.ts +0 -4
- package/lib/index.d.ts.map +0 -1
- package/lib/int_32.d.ts +0 -35
- package/lib/int_32.d.ts.map +0 -1
- package/lib/long.d.ts +0 -323
- package/lib/long.d.ts.map +0 -1
- package/lib/max_key.d.ts +0 -19
- package/lib/max_key.d.ts.map +0 -1
- package/lib/min_key.d.ts +0 -19
- package/lib/min_key.d.ts.map +0 -1
- package/lib/objectid.d.ts +0 -96
- package/lib/objectid.d.ts.map +0 -1
- package/lib/regexp.d.ts +0 -36
- package/lib/regexp.d.ts.map +0 -1
- package/lib/symbol.d.ts +0 -28
- package/lib/symbol.d.ts.map +0 -1
- package/lib/timestamp.d.ts +0 -66
- package/lib/timestamp.d.ts.map +0 -1
- package/lib/validate_utf8.d.ts +0 -10
- package/lib/validate_utf8.d.ts.map +0 -1
package/lib/objectid.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objectid.d.ts","sourceRoot":"","sources":["../src/objectid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWzC,cAAc;AACd,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,GAAG,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,IAAI,MAAM,CAAC;CACvB;AAED,cAAc;AACd,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,QAAA,MAAM,GAAG,eAAe,CAAC;AAEzB;;;;GAIG;AACH,qBAAa,QAAS,SAAQ,SAAS;IACrC,IAAI,SAAS,IAAI,UAAU,CAE1B;IAED,gBAAgB;IAChB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAwC;IAE5D,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC;IAE/B,+BAA+B;IAC/B,OAA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AgB,GAAG,QAAQ;IAcxD,OAAO,IAAI,MAAM;CAGlB"}
|
package/lib/regexp.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { BSONValue } from './bson_value';
|
|
2
|
-
import type { EJSONOptions } from './extended_json';
|
|
3
|
-
/** @public */
|
|
4
|
-
export interface BSONRegExpExtendedLegacy {
|
|
5
|
-
$regex: string | BSONRegExp;
|
|
6
|
-
$options: string;
|
|
7
|
-
}
|
|
8
|
-
/** @public */
|
|
9
|
-
export interface BSONRegExpExtended {
|
|
10
|
-
$regularExpression: {
|
|
11
|
-
pattern: string;
|
|
12
|
-
options: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A class representation of the BSON RegExp type.
|
|
17
|
-
* @public
|
|
18
|
-
* @category BSONType
|
|
19
|
-
*/
|
|
20
|
-
export declare class BSONRegExp extends BSONValue {
|
|
21
|
-
get _bsontype(): 'BSONRegExp';
|
|
22
|
-
pattern: string;
|
|
23
|
-
options: string;
|
|
24
|
-
/**
|
|
25
|
-
* @param pattern - The regular expression pattern to match
|
|
26
|
-
* @param options - The regular expression options
|
|
27
|
-
*/
|
|
28
|
-
constructor(pattern: string, options?: string);
|
|
29
|
-
static parseOptions(options?: string): string;
|
|
30
|
-
/** @internal */
|
|
31
|
-
toExtendedJSON(options?: EJSONOptions): BSONRegExpExtendedLegacy | BSONRegExpExtended;
|
|
32
|
-
/** @internal */
|
|
33
|
-
static fromExtendedJSON(doc: BSONRegExpExtendedLegacy | BSONRegExpExtended): BSONRegExp;
|
|
34
|
-
inspect(): string;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=regexp.d.ts.map
|
package/lib/regexp.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"regexp.d.ts","sourceRoot":"","sources":["../src/regexp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMpD,cAAc;AACd,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,cAAc;AACd,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,EAAE;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,SAAS;IACvC,IAAI,SAAS,IAAI,YAAY,CAE5B;IAED,OAAO,EAAG,MAAM,CAAC;IACjB,OAAO,EAAG,MAAM,CAAC;IACjB;;;OAGG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAiC7C,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAI7C,gBAAgB;IAChB,cAAc,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,wBAAwB,GAAG,kBAAkB;IAQrF,gBAAgB;IAChB,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,wBAAwB,GAAG,kBAAkB,GAAG,UAAU;IAyBvF,OAAO,IAAI,MAAM;CAGlB"}
|
package/lib/symbol.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BSONValue } from './bson_value';
|
|
2
|
-
/** @public */
|
|
3
|
-
export interface BSONSymbolExtended {
|
|
4
|
-
$symbol: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* A class representation of the BSON Symbol type.
|
|
8
|
-
* @public
|
|
9
|
-
* @category BSONType
|
|
10
|
-
*/
|
|
11
|
-
export declare class BSONSymbol extends BSONValue {
|
|
12
|
-
get _bsontype(): 'BSONSymbol';
|
|
13
|
-
value: string;
|
|
14
|
-
/**
|
|
15
|
-
* @param value - the string representing the symbol.
|
|
16
|
-
*/
|
|
17
|
-
constructor(value: string);
|
|
18
|
-
/** Access the wrapped string value. */
|
|
19
|
-
valueOf(): string;
|
|
20
|
-
toString(): string;
|
|
21
|
-
inspect(): string;
|
|
22
|
-
toJSON(): string;
|
|
23
|
-
/** @internal */
|
|
24
|
-
toExtendedJSON(): BSONSymbolExtended;
|
|
25
|
-
/** @internal */
|
|
26
|
-
static fromExtendedJSON(doc: BSONSymbolExtended): BSONSymbol;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=symbol.d.ts.map
|
package/lib/symbol.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbol.d.ts","sourceRoot":"","sources":["../src/symbol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,cAAc;AACd,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,SAAS;IACvC,IAAI,SAAS,IAAI,YAAY,CAE5B;IAED,KAAK,EAAG,MAAM,CAAC;IACf;;OAEG;gBACS,KAAK,EAAE,MAAM;IAKzB,uCAAuC;IACvC,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,MAAM;IAIjB,MAAM,IAAI,MAAM;IAIhB,gBAAgB;IAChB,cAAc,IAAI,kBAAkB;IAIpC,gBAAgB;IAChB,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,kBAAkB,GAAG,UAAU;CAQ7D"}
|
package/lib/timestamp.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Long } from './long';
|
|
2
|
-
/** @public */
|
|
3
|
-
export type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON' | 'inspect';
|
|
4
|
-
/** @public */
|
|
5
|
-
export type LongWithoutOverrides = new (low: unknown, high?: number | boolean, unsigned?: boolean) => {
|
|
6
|
-
[P in Exclude<keyof Long, TimestampOverrides>]: Long[P];
|
|
7
|
-
};
|
|
8
|
-
/** @public */
|
|
9
|
-
export declare const LongWithoutOverridesClass: LongWithoutOverrides;
|
|
10
|
-
/** @public */
|
|
11
|
-
export interface TimestampExtended {
|
|
12
|
-
$timestamp: {
|
|
13
|
-
t: number;
|
|
14
|
-
i: number;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @public
|
|
19
|
-
* @category BSONType
|
|
20
|
-
*/
|
|
21
|
-
export declare class Timestamp extends LongWithoutOverridesClass {
|
|
22
|
-
get _bsontype(): 'Timestamp';
|
|
23
|
-
static readonly MAX_VALUE: Long;
|
|
24
|
-
/**
|
|
25
|
-
* @param int - A 64-bit bigint representing the Timestamp.
|
|
26
|
-
*/
|
|
27
|
-
constructor(int: bigint);
|
|
28
|
-
/**
|
|
29
|
-
* @param long - A 64-bit Long representing the Timestamp.
|
|
30
|
-
*/
|
|
31
|
-
constructor(long: Long);
|
|
32
|
-
/**
|
|
33
|
-
* @param value - A pair of two values indicating timestamp and increment.
|
|
34
|
-
*/
|
|
35
|
-
constructor(value: {
|
|
36
|
-
t: number;
|
|
37
|
-
i: number;
|
|
38
|
-
});
|
|
39
|
-
toJSON(): {
|
|
40
|
-
$timestamp: string;
|
|
41
|
-
};
|
|
42
|
-
/** Returns a Timestamp represented by the given (32-bit) integer value. */
|
|
43
|
-
static fromInt(value: number): Timestamp;
|
|
44
|
-
/** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */
|
|
45
|
-
static fromNumber(value: number): Timestamp;
|
|
46
|
-
/**
|
|
47
|
-
* Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits.
|
|
48
|
-
*
|
|
49
|
-
* @param lowBits - the low 32-bits.
|
|
50
|
-
* @param highBits - the high 32-bits.
|
|
51
|
-
*/
|
|
52
|
-
static fromBits(lowBits: number, highBits: number): Timestamp;
|
|
53
|
-
/**
|
|
54
|
-
* Returns a Timestamp from the given string, optionally using the given radix.
|
|
55
|
-
*
|
|
56
|
-
* @param str - the textual representation of the Timestamp.
|
|
57
|
-
* @param optRadix - the radix in which the text is written.
|
|
58
|
-
*/
|
|
59
|
-
static fromString(str: string, optRadix: number): Timestamp;
|
|
60
|
-
/** @internal */
|
|
61
|
-
toExtendedJSON(): TimestampExtended;
|
|
62
|
-
/** @internal */
|
|
63
|
-
static fromExtendedJSON(doc: TimestampExtended): Timestamp;
|
|
64
|
-
inspect(): string;
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=timestamp.d.ts.map
|
package/lib/timestamp.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../src/timestamp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,cAAc;AACd,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,SAAS,CAAC;AACjG,cAAc;AACd,MAAM,MAAM,oBAAoB,GAAG,KACjC,GAAG,EAAE,OAAO,EACZ,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,EACvB,QAAQ,CAAC,EAAE,OAAO,KACf;KACF,CAAC,IAAI,OAAO,CAAC,MAAM,IAAI,EAAE,kBAAkB,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;CACxD,CAAC;AACF,cAAc;AACd,eAAO,MAAM,yBAAyB,EAAE,oBACC,CAAC;AAE1C,cAAc;AACd,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACH;AAED;;;GAGG;AACH,qBAAa,SAAU,SAAQ,yBAAyB;IACtD,IAAI,SAAS,IAAI,WAAW,CAE3B;IAED,MAAM,CAAC,QAAQ,CAAC,SAAS,OAA2B;IAEpD;;OAEG;gBACS,GAAG,EAAE,MAAM;IACvB;;OAEG;gBACS,IAAI,EAAE,IAAI;IACtB;;OAEG;gBACS,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAwC3C,MAAM,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE;IAMhC,2EAA2E;IAC3E,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAIxC,iIAAiI;IACjI,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAI3C;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS;IAI7D;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS;IAI3D,gBAAgB;IAChB,cAAc,IAAI,iBAAiB;IAInC,gBAAgB;IAChB,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS;IAgB1D,OAAO,IAAI,MAAM;CAGlB"}
|
package/lib/validate_utf8.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determines if the passed in bytes are valid utf8
|
|
3
|
-
* @param bytes - An array of 8-bit bytes. Must be indexable and have length property
|
|
4
|
-
* @param start - The index to start validating
|
|
5
|
-
* @param end - The index to end validating
|
|
6
|
-
*/
|
|
7
|
-
export declare function validateUtf8(bytes: {
|
|
8
|
-
[index: number]: number;
|
|
9
|
-
}, start: number, end: number): boolean;
|
|
10
|
-
//# sourceMappingURL=validate_utf8.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate_utf8.d.ts","sourceRoot":"","sources":["../src/validate_utf8.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAClC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GACV,OAAO,CAyBT"}
|