Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
37 changes: 5 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/core/operations/BSONDeserialise.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import Operation from "../Operation.mjs";
import bson from "bson";
import { deserialize } from "bson";
import OperationError from "../errors/OperationError.mjs";

/**
Expand Down Expand Up @@ -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());
Expand Down
5 changes: 3 additions & 2 deletions src/core/operations/BSONSerialise.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import Operation from "../Operation.mjs";
import bson from "bson";
import { serialize } from "bson";
import OperationError from "../errors/OperationError.mjs";

/**
Expand Down Expand Up @@ -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());
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/operations/ParseObjectIDTimestamp.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down