Skip to content

Commit b2d9890

Browse files
authored
Update all dependencies (#160)
# Problem bson and other dependencies were out of date. Closes #159 ## Solution Updated all dependencies, all tests passing after some minor type and import tweaks. ## Details - Needed to handle the conversion from ArrayBuffer to Uint8Array more explicitly - Chai 5 uses slightly different setup as it is now ESM
1 parent 4551071 commit b2d9890

9 files changed

+1948
-2490
lines changed

lib/browser/compression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ function buffer_from_result(result: ArrayBuffer | Buffer | Uint8Array): Buffer {
9898
if (Buffer.isBuffer(result)) {
9999
return result;
100100
} else {
101-
return Buffer.from(result);
101+
return Buffer.from(new Uint8Array(result));
102102
}
103103
}

lib/compression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ function buffer_from_result(result: ArrayBuffer | Buffer | Uint8Array): Buffer {
9090
if (Buffer.isBuffer(result)) {
9191
return result;
9292
} else {
93-
return Buffer.from(result);
93+
return Buffer.from(new Uint8Array(result));
9494
}
9595
}

lib/shred.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function shredRecordInternal(
110110
// checks if any typed array
111111
if (record[fieldName] instanceof Uint8Array) {
112112
// wrap in a buffer, since not supported by parquet_thrift
113-
values.push(Buffer.from(record[fieldName] as ArrayBuffer));
113+
values.push(Buffer.from(record[fieldName]));
114114
} else {
115115
throw Object.prototype.toString.call(record[fieldName]) + ' is not supported';
116116
}

lib/writer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,8 @@ async function encodeDataPage(
522522
}
523523

524524
/* build page header */
525-
let pageBody = Buffer.concat([rLevelsBuf, dLevelsBuf, valuesBuf]);
526-
pageBody = await parquet_compression.deflate(column.compression!, pageBody);
525+
const initialPageBody = Buffer.concat([rLevelsBuf, dLevelsBuf, valuesBuf]);
526+
const pageBody = await parquet_compression.deflate(column.compression!, initialPageBody);
527527

528528
const pageHeader = new parquet_thrift.PageHeader();
529529
pageHeader.type = parquet_thrift.PageType['DATA_PAGE'];

package-lock.json

Lines changed: 1915 additions & 2456 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,53 +15,53 @@
1515
"url": "git://github.com/LibertyDSNP/parquetjs.git"
1616
},
1717
"dependencies": {
18-
"@aws-sdk/client-s3": "^3.665.0",
18+
"@aws-sdk/client-s3": "^3.750.0",
1919
"@types/node-int64": "^0.4.32",
2020
"@types/thrift": "^0.10.17",
21-
"@zenfs/core": "^1.0.2",
21+
"@zenfs/core": "^1.11.2",
2222
"brotli-wasm": "^3.0.1",
23-
"bson": "6.8.0",
23+
"bson": "6.10.3",
2424
"int53": "^1.0.0",
25-
"long": "^5.2.3",
25+
"long": "^5.3.1",
2626
"node-int64": "^0.4.0",
2727
"snappyjs": "^0.7.0",
2828
"thrift": "0.21.0",
2929
"varint": "^6.0.0",
30-
"xxhash-wasm": "^1.0.2"
30+
"xxhash-wasm": "^1.1.0"
3131
},
3232
"devDependencies": {
33-
"@eslint/js": "^9.12.0",
34-
"@smithy/util-stream": "^3.1.9",
35-
"@types/chai": "^4.3.16",
33+
"@eslint/js": "^9.20.0",
34+
"@smithy/util-stream": "^4.1.1",
35+
"@types/chai": "^5.0.1",
3636
"@types/eslint__js": "^8.42.3",
3737
"@types/json-schema": "^7.0.15",
38-
"@types/mocha": "^10.0.8",
39-
"@types/node": "^22.7.4",
38+
"@types/mocha": "^10.0.10",
39+
"@types/node": "^22.13.4",
4040
"@types/sinon": "^17.0.3",
4141
"@types/varint": "^6.0.3",
4242
"assert": "^2.1.0",
43-
"aws-sdk-client-mock": "^4.0.2",
43+
"aws-sdk-client-mock": "^4.1.0",
4444
"buffer": "^6.0.3",
45-
"chai": "4.4.1",
46-
"core-js": "^3.38.1",
47-
"esbuild": "^0.24.0",
45+
"chai": "5.2.0",
46+
"core-js": "^3.40.0",
47+
"esbuild": "^0.25.0",
4848
"esbuild-plugin-wat": "^0.2.7",
49-
"eslint": "^9.12.0",
49+
"eslint": "^9.20.1",
5050
"eslint-plugin-mocha": "^10.5.0",
5151
"events": "^3.3.0",
52-
"mocha": "^10.7.3",
53-
"msw": "^2.4.9",
52+
"mocha": "^11.1.0",
53+
"msw": "^2.7.0",
5454
"object-stream": "^0.0.1",
55-
"prettier": "3.3.3",
55+
"prettier": "3.5.1",
5656
"process": "^0.11.10",
5757
"regenerator-runtime": "^0.14.1",
58-
"sinon": "^17.0.2",
59-
"sinon-chai": "^3.7.0",
58+
"sinon": "^19.0.2",
59+
"sinon-chai": "^4.0.0",
6060
"sinon-chai-in-order": "^0.1.0",
6161
"stream-browserify": "^3.0.0",
62-
"tsx": "^4.19.1",
63-
"typescript": "^5.6.2",
64-
"typescript-eslint": "^8.8.0"
62+
"tsx": "^4.19.3",
63+
"typescript": "^5.7.3",
64+
"typescript-eslint": "^8.24.1"
6565
},
6666
"scripts": {
6767
"build": "npm run build:node && npm run build:types",

test/bloomFilterReader.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import chai, { expect } from 'chai';
1+
import { expect, assert } from 'chai';
22
import { Int64 } from 'thrift';
33
import { parseBloomFilterOffsets } from '../lib/bloomFilterIO/bloomFilterReader';
44
import { ColumnChunkData, ColumnChunkExt, ColumnMetaDataExt } from '../lib/declare';
55
import XxHasher from '../lib/bloom/xxhasher';
6-
const assert = chai.assert;
76

87
const emptyOffset = () => new Int64(Buffer.from(''), 0);
98

test/lib/bufferReader.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import chai, { expect } from 'chai';
1+
import { use, expect } from 'chai';
22
import sinon from 'sinon';
33
import sinonChai from 'sinon-chai';
44
import sinonChaiInOrder from 'sinon-chai-in-order';
55
import BufferReader from '../../lib/bufferReader';
66
import { ParquetEnvelopeReader } from '../../lib/reader';
77

8-
chai.use(sinonChai);
9-
chai.use(sinonChaiInOrder);
8+
use(sinonChai);
9+
use(sinonChaiInOrder);
1010

1111
describe('bufferReader', function () {
1212
let reader;

test/sbbf.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('Split Block Bloom Filters', function () {
6060
new Long(0x0, 0x1, true),
6161
new Long(793516929, -2061372197, true), // regression test; this one was failing get blockIndex
6262
];
63-
// eslint-disable-next-line mocha/no-setup-in-describe
63+
6464
const badVal = Long.fromNumber(0xfafafafa, true);
6565

6666
it('filter insert + check works', function () {

0 commit comments

Comments
 (0)