Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: πŸ› adjust type of children in Link to be possibly undefined
  • Loading branch information
G-Rath committed Jul 12, 2019
1 parent 9bfb6f5 commit b4945c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node.ts
Expand Up @@ -236,7 +236,7 @@ export class Link extends EventEmitter {

parent: Link;

children: { [child: string]: Link } = {};
children: { [child: string]: Link | undefined } = {};

// Path to this node as Array: ['usr', 'bin', 'node'].
steps: string[] = [];
Expand Down Expand Up @@ -299,7 +299,7 @@ export class Link extends EventEmitter {
this.emit('child:delete', link, this);
}

getChild(name: string): Link {
getChild(name: string): Link | undefined {
return this.children[name];
}

Expand Down

0 comments on commit b4945c2

Please sign in to comment.