update bson (#2425)

Co-authored-by: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> (update of dependabot excluded packages)
This commit is contained in:
Blank0120 2026-05-23 19:42:40 +08:00 committed by GitHub
parent fba4a0a0af
commit 6a3a370bb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 13 additions and 43 deletions

View File

@ -25,12 +25,8 @@ updates:
# see issue #2214 for rationale for each of these
- dependency-name: '@xmldom/xmldom'
versions: [ '>=0.9.0' ]
- dependency-name: 'bcryptjs'
versions: [ '>=3.0.0' ]
- dependency-name: 'bootstrap'
versions: [ '>=5.0.0' ]
- dependency-name: 'bson'
versions: [ '>=5.0.0' ]
- dependency-name: 'cbor'
versions: [ '>=10.0.0' ]
- dependency-name: 'eslint'

37
package-lock.json generated
View File

@ -27,7 +27,7 @@
"bootstrap-colorpicker": "^3.4.0",
"bootstrap-material-design": "^4.1.3",
"browserify-zlib": "^0.2.0",
"bson": "^4.7.2",
"bson": "^7.2.0",
"buffer": "^6.0.3",
"cbor": "9.0.2",
"chi-squared": "^1.1.0",
@ -6512,39 +6512,12 @@
}
},
"node_modules/bson": {
"version": "4.7.2",
"resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz",
"integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/bson/-/bson-7.2.0.tgz",
"integrity": "sha512-YCEo7KjMlbNlyHhz7zAZNDpIpQbd+wOEHJYezv0nMYTn4x31eIUM2yomNNubclAt63dObUzKHWsBLJ9QcZNSnQ==",
"license": "Apache-2.0",
"dependencies": {
"buffer": "^5.6.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/bson/node_modules/buffer": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT",
"dependencies": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
"node": ">=20.19.0"
}
},
"node_modules/buffer": {

View File

@ -111,7 +111,7 @@
"bootstrap-colorpicker": "^3.4.0",
"bootstrap-material-design": "^4.1.3",
"browserify-zlib": "^0.2.0",
"bson": "^4.7.2",
"bson": "^7.2.0",
"buffer": "^6.0.3",
"cbor": "9.0.2",
"chi-squared": "^1.1.0",

View File

@ -5,7 +5,7 @@
*/
import Operation from "../Operation.mjs";
import bson from "bson";
import { deserialize } from "bson";
import OperationError from "../errors/OperationError.mjs";
/**
@ -37,7 +37,7 @@ class BSONDeserialise extends Operation {
if (!input.byteLength) return "";
try {
const data = bson.deserialize(new Buffer(input));
const data = deserialize(new Uint8Array(input));
return JSON.stringify(data, null, 2);
} catch (err) {
throw new OperationError(err.toString());

View File

@ -5,7 +5,7 @@
*/
import Operation from "../Operation.mjs";
import bson from "bson";
import { serialize } from "bson";
import OperationError from "../errors/OperationError.mjs";
/**
@ -38,7 +38,8 @@ class BSONSerialise extends Operation {
try {
const data = JSON.parse(input);
return bson.serialize(data).buffer;
const result = serialize(data);
return result.buffer.slice(result.byteOffset, result.byteOffset + result.byteLength);
} catch (err) {
throw new OperationError(err.toString());
}

View File

@ -6,7 +6,7 @@
import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs";
import BSON from "bson";
import { ObjectId } from "bson";
/**
* Parse ObjectID timestamp operation
@ -35,7 +35,7 @@ class ParseObjectIDTimestamp extends Operation {
*/
run(input, args) {
try {
const objectId = new BSON.ObjectID(input);
const objectId = new ObjectId(input);
return objectId.getTimestamp().toISOString();
} catch (err) {
throw new OperationError(err);