Looking to create a function with the following structure:
const updateNodeTypeByIndex = (index: Vec2 | Vec2[], type: NodeType | NodeType[]) => {
if (index instanceof Array && type instanceof Array){
// deal with array parameters
} else {
// regular parameter logic
}
}
Encountering errors while trying to implement this. Any insights on the correct approach for achieving this functionality?