From b5093a12d221e39bc796d5c06819106980845414 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Sat, 13 Jul 2019 12:37:42 +1200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20create=20`tryGetChild`=20?= =?UTF-8?q?util=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/__tests__/util.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/__tests__/util.ts b/src/__tests__/util.ts index 8e8500d7..abf640c4 100644 --- a/src/__tests__/util.ts +++ b/src/__tests__/util.ts @@ -10,12 +10,14 @@ export const createFs = (json?) => { return createFsFromVolume(create(json)); }; -export const tryGetChildNode = (link: Link, name: string): Node => { +export const tryGetChild = (link: Link, name: string): Link => { const child = link.getChild(name); if (!child) { throw new Error(`expected link to have a child named "${name}"`); } - return child.getNode(); + return child; }; + +export const tryGetChildNode = (link: Link, name: string): Node => tryGetChild(link, name).getNode();