Skip to content

Commit

Permalink
fix: πŸ› refactor #writeFileBase to be compatible w/ strictNullChecks
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Jul 6, 2019
1 parent 2ba6e0f commit e931778
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1230,13 +1230,13 @@ export class Volume {

let offset = 0;
let length = buf.length;
let position = flagsNum & O_APPEND ? null : 0;
let position = flagsNum & O_APPEND ? undefined : 0;
try {
while (length > 0) {
const written = this.writeSync(fd, buf, offset, length, position);
offset += written;
length -= written;
if (position !== null) position += written;
if (position !== undefined) position += written;
}
} finally {
if (!isUserFd) this.closeSync(fd);
Expand Down

0 comments on commit e931778

Please sign in to comment.