function inspectArrayPatternForKeys(node) {
  // if it has a RestElement, we cant meaningfully pursue any deeper
  // so return a single empty path, meaning "one result, the whole thing"
  const expansionForbidden = node.elements.some(
    (el) => el?.type === 'RestElement'
  )
  if (expansionForbidden) {
    return [[]]
  }
  /** @type {string[][]} */
  let keys = []
  // expand each property into a path, recursively
  node.elements.forEach((child, propName) => {
    if (child) {
      keys = keys.concat(
        inspectPatternElementForKeys(child).map((partial) => [
          String(propName),
          ...partial,
        ])
      )
    }
  })
  return keys
}
@param {import('@babel/types').ArrayPattern} node
@returns {string[][]}