UNPKG

@putout/plugin-regexp

Version:
8 lines (6 loc) 397 B
const getType = (a) => (a.node || a).type; export const isDisjunction = (a) => getType(a) === 'Disjunction'; export const isCharacterClass = (a) => getType(a) === 'CharacterClass'; export const isParentDisjunction = ({parentPath}) => parentPath?.parent?.type === 'Disjunction'; export const isChar = (a) => getType(a) === 'Char'; export const isAlternative = (a) => getType(a) === 'Alternative';