Skip to content

Commit fa9fac0

Browse files
renovate[bot]runk
andauthored
chore(deps): update dependency @types/node to v22.14.0 (#889)
* chore(deps): update dependency @types/node to v22.14.0 * fix broken types --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Dmitry Shirokov <deadrunk@gmail.com>
1 parent f1083f8 commit fa9fac0

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@types/ip6addr": "0.2.6",
3535
"@types/jest": "29.5.14",
3636
"@types/netmask": "2.0.5",
37-
"@types/node": "22.10.3",
37+
"@types/node": "22.14.0",
3838
"@types/sinon": "17.0.4",
3939
"ip-address": "10.0.1",
4040
"ip6addr": "0.2.5",

src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ describe('index', () => {
114114
// it('should check for an error when cannot read database on update', async () => {
115115
// var counter = 0;
116116
// var cb = function(err, reader) {
117-
// // Indeed couter is kinda gross.
117+
// // Indeed counter is kinda gross.
118118
// switch (counter++) {
119119
// case 0:
120120
// assert.strictEqual(err, null);

src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,15 @@ const readLargeFile = async (filepath: string, size: number): Promise<Buffer> =>
4141
highWaterMark: STREAM_WATERMARK,
4242
});
4343

44-
stream.on('data', (chunk: Buffer) => {
45-
chunk.copy(buffer, offset);
46-
offset += chunk.length;
44+
stream.on('data', (chunk: string | Buffer) => {
45+
if (Buffer.isBuffer(chunk)) {
46+
chunk.copy(buffer, offset);
47+
offset += chunk.length;
48+
} else {
49+
const bufferChunk = Buffer.from(chunk);
50+
bufferChunk.copy(buffer, offset);
51+
offset += bufferChunk.length;
52+
}
4753
});
4854

4955
stream.on('end', () => {

0 commit comments

Comments
 (0)