Skip to content

Commit

Permalink
TASK: Remove noAssert flags from buffer read/writes
Browse files Browse the repository at this point in the history
This flag was removed with nodejs 10.x for good reasons.
  • Loading branch information
albe committed Jul 5, 2019
1 parent 8d964c2 commit b9b0737
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class Index {
metadataSize += pad + 1;
const metadataBuffer = Buffer.allocUnsafe(8 + 4 + metadataSize);
metadataBuffer.write(HEADER_MAGIC, 0, 8, 'utf8');
metadataBuffer.writeUInt32BE(metadataSize, 8, true);
metadataBuffer.writeUInt32BE(metadataSize, 8);
metadataBuffer.write(metadata, 8 + 4, metadataSize, 'utf8');
fs.writeSync(this.fd, metadataBuffer, 0, metadataBuffer.byteLength, 0);
this.headerSize = 8 + 4 + metadataSize;
Expand Down Expand Up @@ -232,7 +232,7 @@ class Index {
}
throw new Error('Invalid file header.');
}
const metadataSize = headerBuffer.readUInt32BE(8, true);
const metadataSize = headerBuffer.readUInt32BE(8);
if (metadataSize < 3) {
throw new Error('Invalid metadata size.');
}
Expand Down

0 comments on commit b9b0737

Please sign in to comment.