function isBindingNode(parent, identifierName) {
  if (['VariableDeclarator', 'ClassDeclaration'].includes(parent.type)) {
    // @ts-expect-error
    return nameOf(parent.id) === identifierName;
  }
  return [
    'ArrowFunctionExpression',
    'ImportDefaultSpecifier',
    'FunctionDeclaration',
    'ImportSpecifier',
  ].includes(parent.type);
}
Is the node:
- a declaration (like "const a = 1")?
- an import specifier (like "import { a } from 'b'")?
Handy to know if the parents of Identifiers mark a binding
@param {SwcNode} parent
@param {string} identifierName