Skip to content

Commit

Permalink
update BSON due to vulnerability, minor fixes (#20)
Browse files Browse the repository at this point in the history
Update bson package from 2.0.8 to 4.4.0 due to a vulnerability in v2. The interface changed, so update the files that use the package.
Remove an unused TypeArray import.
Remove a stray comment.
  • Loading branch information
shannonwells authored Jul 1, 2021
1 parent f605856 commit ac8ebb2
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 23 deletions.
2 changes: 0 additions & 2 deletions lib/bloom/sbbf.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import TypedArray = NodeJS.TypedArray;

import parquet_thrift from "../../gen-nodejs/parquet_types";
import Long = require('long')
import XxHasher from "./xxhasher"
Expand Down
1 change: 0 additions & 1 deletion lib/codec/plain.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function decodeValues_INT32(cursor, count) {
function encodeValues_INT64(values) {
let buf = Buffer.alloc(8 * values.length);
for (let i = 0; i < values.length; i++) {
//console.log(typeof values[i]);
buf.writeBigInt64LE(BigInt(values[i]), i*8);
}

Expand Down
6 changes: 2 additions & 4 deletions lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,11 @@ function fromPrimitive_JSON(value) {
}

function toPrimitive_BSON(value) {
var encoder = new BSON();
return Buffer.from(encoder.serialize(value));
return Buffer.from(BSON.serialize(value));
}

function fromPrimitive_BSON(value) {
var decoder = new BSON();
return decoder.deserialize(value);
return BSON.deserialize(value);
}

function toPrimitive_TIME_MILLIS(value) {
Expand Down
65 changes: 50 additions & 15 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 @@ -20,7 +20,7 @@
"@types/thrift": "^0.10.10",
"assert": "^2.0.0",
"browserify-zlib": "^0.2.0",
"bson": "^2.0.8",
"bson": "4.4.0",
"cross-fetch": "^3.1.4",
"esbuild": "^0.12.11",
"events": "^3.3.0",
Expand Down

0 comments on commit ac8ebb2

Please sign in to comment.