From f65431992070d5ee1ec14045bb4472b727bec162 Mon Sep 17 00:00:00 2001 From: kawaizombi Date: Mon, 8 Jun 2020 16:09:35 +0300 Subject: [PATCH] Fix bug with partial path --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index b061cea..392e15d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,7 +16,7 @@ function createNode(path: string[], tree: TreeNode[]) : void { if(path.length !== 0) { createNode(path, tree[tree.length -1].children) } - } else { + } else if(path.length !== 0) { createNode(path, tree[idx].children) } }