@putout/plugin-regexp
Version:
🐊Putout plugin helps with regexp
7 lines (5 loc) • 325 B
JavaScript
const getType = (a) => (a.node || a).type;
export const isDisjunction = (a) => getType(a) === 'Disjunction';
export const isParentDisjunction = ({parentPath}) => parentPath?.parent?.type === 'Disjunction';
export const isChar = (a) => getType(a) === 'Char';
export const isAlternative = (a) => getType(a) === 'Alternative';