quick bugfix (#78)

This commit is contained in:
Kurt Hutten
2023-03-21 19:02:18 +11:00
committed by GitHub
parent 5f7ee2c512
commit 45091d3c4f
3 changed files with 8 additions and 2 deletions

View File

@ -347,6 +347,11 @@ export function splitPathAtLastIndex(pathToNode: PathToNode): {
path: pathToNode.slice(0, -1),
index: last,
}
} else if (pathToNode.length === 0) {
return {
path: [],
index: -1,
}
}
return splitPathAtLastIndex(pathToNode.slice(0, -1))
}