function withinTypeNode(node) {
  /** @type {ASTNode | null} */
  let target = node
  while (target) {
    if (isTypeNode(target)) {
      return true
    }
    target = target.parent
  }
  return false
}
Checks whether the given node is in a type annotation.
@param {ESNode} node
@returns {boolean}