deleting start of sketch => line tool should still work (#2983)

* deleting start of sketch line tool should still work

* add test

* fmt

* put big timout back in

* shotkey test patch

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)

* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)"

This reverts commit 6ee690a65a.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Kurt Hutten
2024-07-10 07:01:49 +10:00
committed by GitHub
parent a76eabbb80
commit d7f2bfdabe
3 changed files with 90 additions and 7 deletions

View File

@ -51,8 +51,16 @@ export function getNodeFromPath<T>(
let successfulPaths: PathToNode = []
let pathsExplored: PathToNode = []
for (const pathItem of path) {
if (typeof currentNode[pathItem[0]] !== 'object')
if (typeof currentNode[pathItem[0]] !== 'object') {
if (stopAtNode) {
return {
node: stopAtNode,
shallowPath: pathsExplored,
deepPath: successfulPaths,
}
}
return new Error('not an object')
}
currentNode = currentNode?.[pathItem[0]]
successfulPaths.push(pathItem)
if (!stopAtNode) {