Fix to preserve types using structuredClone (#3113)

This commit is contained in:
Jonathan Tran
2024-07-25 20:11:46 -04:00
committed by GitHub
parent 0e5d88df0b
commit e3b8807d6f
17 changed files with 76 additions and 87 deletions

View File

@ -1496,7 +1496,7 @@ export function transformSecondarySketchLinesTagFirst({
}
}
| Error {
// let node = JSON.parse(JSON.stringify(ast))
// let node = structuredClone(ast)
const primarySelection = selectionRanges.codeBasedSelections[0].range
const _tag = giveSketchFnCallTag(ast, primarySelection, forceSegName)
@ -1565,7 +1565,7 @@ export function transformAstSketchLines({
}
| Error {
// deep clone since we are mutating in a loop, of which any could fail
let node = JSON.parse(JSON.stringify(ast))
let node = structuredClone(ast)
let _valueUsedInTransform // TODO should this be an array?
const pathToNodeMap: PathToNodeMap = {}