Skip to content

Commit

Permalink
feat: 🎸 enable TypeScript strict null checks
Browse files Browse the repository at this point in the history
BREAKING CHANGE: TypeScript strict null checks are now enabled which may
break some TypeScript users.
  • Loading branch information
streamich committed Nov 26, 2019
1 parent ab1aa4d commit 1998b24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/node.ts
Expand Up @@ -300,7 +300,7 @@ export class Link extends EventEmitter {
this.emit('child:delete', link, this);
}

getChild(name: string): Link {
getChild(name: string): Link | undefined {
if (Object.hasOwnProperty.call(this.children, name)) {
return this.children[name];
}
Expand Down
4 changes: 2 additions & 2 deletions src/volume.ts
Expand Up @@ -1415,7 +1415,7 @@ export class Volume {
private realpathBase(filename: string, encoding: TEncodingExtended | undefined): TDataOut {
const steps = filenameToSteps(filename);
const realLink = this.getResolvedLink(steps);
if (!realLink) throwError(ENOENT, 'realpath', filename);
if (!realLink) throw createError(ENOENT, 'realpath', filename);

return strToEncoding(realLink.getPath(), encoding);
}
Expand Down Expand Up @@ -1459,7 +1459,7 @@ export class Volume {
private statBase(filename: string, bigint: true): Stats<bigint>;
private statBase(filename: string, bigint: boolean = false): Stats {
const link = this.getResolvedLink(filenameToSteps(filename));
if (!link) throwError(ENOENT, 'stat', filename);
if (!link) throw createError(ENOENT, 'stat', filename);

return Stats.build(link.getNode(), bigint);
}
Expand Down

0 comments on commit 1998b24

Please sign in to comment.