From b4945c2fe9ffb49949bf133d157602ef7c9799d6 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 12 Jul 2019 12:32:32 +1200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20adjust=20type=20of=20`chi?= =?UTF-8?q?ldren`=20in=20`Link`=20to=20be=20possibly=20undefined?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/node.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node.ts b/src/node.ts index 0b5f31ff..4a7a652f 100644 --- a/src/node.ts +++ b/src/node.ts @@ -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[] = []; @@ -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]; }