Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: πŸ› refactor #newFdNumber to be compatible w/ strictNullChecks
  • Loading branch information
G-Rath committed Jul 6, 2019
1 parent c9a0fd6 commit 0bc4a15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/volume.ts
Expand Up @@ -655,7 +655,8 @@ export class Volume {
}

private newFdNumber(): number {
return this.releasedFds.length ? this.releasedFds.pop() : Volume.fd--;
const releasedFd = this.releasedFds.pop();
return typeof releasedFd === 'number' ? releasedFd : Volume.fd--;
}

createNode(isDirectory: boolean = false, perm?: number): Node {
Expand Down

0 comments on commit 0bc4a15

Please sign in to comment.