UNPKG

@atlaskit/eslint-plugin-no-lookahead-lookbehind-regexp

Version:

Fork of https://github.com/JonasBa/eslint-plugin-no-lookahead-lookbehind-regexp

9 lines 419 B
export function isRegExpLiteral(literal) { return 'regex' in literal; } export function isStringLiteralRegExp(literal) { return literal.parent !== null && literal.parent.type === 'NewExpression' && literal.parent.callee.type === 'Identifier' && literal.parent.callee.name === 'RegExp'; } export function isBinaryExpression(literal) { return literal.parent !== null && literal.parent.type === 'BinaryExpression'; }