function inspectPatternElementForDeclarations(node, keyPath = []) {
  if (node.type === 'ObjectPattern') {
    return inspectObjectPatternForDeclarations(node, keyPath)
  } else if (node.type === 'ArrayPattern') {
    return inspectArrayPatternForDeclarations(node, keyPath)
  } else if (node.type === 'Identifier') {
    // done, return the node with the current path
    return [{ node, keyPath }]
  } else if (node.type === 'AssignmentPattern') {
    // AssignmentPattern is for provided a fallback value in a destructuring pattern
    return [{ node: node.left, keyPath }]
  } else {
    throw new Error(
      `LavaMoat/tofu - inspectPatternElementForDeclarations - unable to parse element "${node.type}"`
    )
  }
}
@param {import('@babel/types').LVal | import('@babel/types').Expression} node
@param {string[]} keyPath
@returns {Declaration[]} }