Classify Babel identifiers
npm install babel-identifiers> Classify Babel identifiers
``sh`
yarn add babel-identifiers
Identifier nodes fall into one of three kinds:
1. "binding" - let binding = ...reference;
2. "reference" - a.static
3. "static" -
And into one of four grammars:
1. "javascript" - let javascript = ...
1. "jsx" - ({}: flow)
2. "flow" - enum typescript {}
3. "typescript" -
`js
import {getIdentifierKind, getIdentifierGrammar} from 'babel-identifiers';
isIdentifierLike(path); // true | false
getIdentifierKind(path); // "binding" | "reference" | "static"
getIdentifierGrammar(path); // "javascript" | "flow" | "typescript"
``