Cleanup
This commit is contained in:
18
node_modules/bson/HISTORY.md
generated
vendored
18
node_modules/bson/HISTORY.md
generated
vendored
@@ -1,3 +1,21 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [1.1.6](https://github.com/mongodb/js-bson/compare/v1.1.5...v1.1.6) (2021-03-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Throw error on bigint usage and add helpers to Long ([#426](https://github.com/mongodb/js-bson/issues/426)) ([375f368](https://github.com/mongodb/js-bson/commit/375f368738807f2d41c7751e618fd09c8a1b94c9))
|
||||
|
||||
### [1.1.5](https://github.com/mongodb/js-bson/compare/v1.1.4...v1.1.5) (2020-08-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **object-id:** harden the duck-typing ([b526145](https://github.com/mongodb/js-bson/commit/b5261450c3bc4abb2e2fb19b5b1a7aba27982d44))
|
||||
|
||||
<a name="1.1.3"></a>
|
||||
## [1.1.3](https://github.com/mongodb/js-bson/compare/v1.1.2...v1.1.3) (2019-11-09)
|
||||
|
||||
|
||||
3
node_modules/bson/bower.json
generated
vendored
3
node_modules/bson/bower.json
generated
vendored
@@ -21,5 +21,6 @@
|
||||
"node_modules",
|
||||
"test",
|
||||
"tools"
|
||||
]
|
||||
],
|
||||
"version": "1.1.6"
|
||||
}
|
||||
|
||||
14
node_modules/bson/lib/bson/long.js
generated
vendored
14
node_modules/bson/lib/bson/long.js
generated
vendored
@@ -77,6 +77,11 @@ Long.prototype.toNumber = function() {
|
||||
return this.high_ * Long.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
|
||||
};
|
||||
|
||||
/** Converts the Long to a BigInt (arbitrary precision). */
|
||||
Long.prototype.toBigInt = function () {
|
||||
return BigInt(this.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the JSON value.
|
||||
*
|
||||
@@ -711,6 +716,15 @@ Long.fromNumber = function(value) {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
|
||||
* @param {bigint} value - The number in question
|
||||
* @returns {Long} The corresponding Long value
|
||||
*/
|
||||
Long.fromBigInt = function(value) {
|
||||
return Long.fromString(value.toString(10), 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
|
||||
*
|
||||
|
||||
7
node_modules/bson/lib/bson/objectid.js
generated
vendored
7
node_modules/bson/lib/bson/objectid.js
generated
vendored
@@ -66,7 +66,7 @@ var ObjectID = function ObjectID(id) {
|
||||
} else if (id != null && id.length === 12) {
|
||||
// assume 12 byte string
|
||||
this.id = id;
|
||||
} else if (id != null && id.toHexString) {
|
||||
} else if (id != null && typeof id.toHexString === 'function') {
|
||||
// Duck-typing to support ObjectId from different npm packages
|
||||
return id;
|
||||
} else {
|
||||
@@ -357,7 +357,10 @@ ObjectID.isValid = function isValid(id) {
|
||||
}
|
||||
|
||||
// Duck-Typing detection of ObjectId like objects
|
||||
if (id.toHexString) {
|
||||
if (
|
||||
typeof id.toHexString === 'function' &&
|
||||
(id.id instanceof _Buffer || typeof id.id === 'string')
|
||||
) {
|
||||
return id.id.length === 12 || (id.id.length === 24 && checkForHexRegExp.test(id.id));
|
||||
}
|
||||
|
||||
|
||||
6
node_modules/bson/lib/bson/parser/serializer.js
generated
vendored
6
node_modules/bson/lib/bson/parser/serializer.js
generated
vendored
@@ -709,6 +709,8 @@ var serializeInto = function serializeInto(
|
||||
index = serializeString(buffer, key, value, index, true);
|
||||
} else if (type === 'number') {
|
||||
index = serializeNumber(buffer, key, value, index, true);
|
||||
} else if(type === 'bigint') {
|
||||
throw new TypeError('Unsupported type BigInt, please use Decimal128');
|
||||
} else if (type === 'boolean') {
|
||||
index = serializeBoolean(buffer, key, value, index, true);
|
||||
} else if (value instanceof Date || isDate(value)) {
|
||||
@@ -820,6 +822,8 @@ var serializeInto = function serializeInto(
|
||||
index = serializeString(buffer, key, value, index);
|
||||
} else if (type === 'number') {
|
||||
index = serializeNumber(buffer, key, value, index);
|
||||
} else if(type === 'bigint') {
|
||||
throw new TypeError('Unsupported type BigInt, please use Decimal128');
|
||||
} else if (type === 'boolean') {
|
||||
index = serializeBoolean(buffer, key, value, index);
|
||||
} else if (value instanceof Date || isDate(value)) {
|
||||
@@ -923,6 +927,8 @@ var serializeInto = function serializeInto(
|
||||
index = serializeString(buffer, key, value, index);
|
||||
} else if (type === 'number') {
|
||||
index = serializeNumber(buffer, key, value, index);
|
||||
} else if(type === 'bigint') {
|
||||
throw new TypeError('Unsupported type BigInt, please use Decimal128');
|
||||
} else if (type === 'boolean') {
|
||||
index = serializeBoolean(buffer, key, value, index);
|
||||
} else if (value instanceof Date || isDate(value)) {
|
||||
|
||||
12
node_modules/bson/package.json
generated
vendored
12
node_modules/bson/package.json
generated
vendored
@@ -12,7 +12,7 @@
|
||||
"browser_build",
|
||||
"bower.json"
|
||||
],
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.6",
|
||||
"author": "Christian Amor Kvalheim <christkv@gmail.com>",
|
||||
"contributors": [],
|
||||
"repository": "mongodb/js-bson",
|
||||
@@ -31,6 +31,7 @@
|
||||
"babel-preset-stage-0": "^6.5.0",
|
||||
"babel-register": "^6.14.0",
|
||||
"conventional-changelog-cli": "^1.3.5",
|
||||
"standard-version": "^9.1.1",
|
||||
"webpack": "^1.13.2",
|
||||
"webpack-polyfills-plugin": "0.0.9"
|
||||
},
|
||||
@@ -49,12 +50,9 @@
|
||||
"build": "webpack --config ./webpack.dist.config.js",
|
||||
"changelog": "conventional-changelog -p angular -i HISTORY.md -s",
|
||||
"lint": "eslint lib test",
|
||||
"format": "prettier --print-width 100 --tab-width 2 --single-quote --write 'test/**/*.js' 'lib/**/*.js'"
|
||||
"format": "prettier --print-width 100 --tab-width 2 --single-quote --write 'test/**/*.js' 'lib/**/*.js'",
|
||||
"release": "standard-version -i HISTORY.md"
|
||||
},
|
||||
"browser": "lib/bson/bson.js",
|
||||
"license": "Apache-2.0"
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/bson/-/bson-1.1.4.tgz"
|
||||
,"_integrity": "sha512-S/yKGU1syOMzO86+dGpg2qGoDL0zvzcb262G+gqEy6TgP6rt6z6qxSFX/8X6vLC91P7G7C3nLs0+bvDzmvBA3Q=="
|
||||
,"_from": "bson@1.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user