UNPKG

eslint-plugin-de-morgan

Version:

ESLint plugin for transforming negated boolean expressions via De Morgan’s laws

14 lines (13 loc) 527 B
import { createTestWithParameters } from './create-test-with-parameters.js' import { isLogicalExpression } from './is-logical-expression.js' import { hasOperator } from './has-operator.js' /** * Checks whether the given AST node represents a conjunction (logical AND). * * @param node - The AST node to check. * @returns True if the node is a LogicalExpression with operator `&&`. */ function isConjunction(node) { return createTestWithParameters(node)(isLogicalExpression, hasOperator('&&')) } export { isConjunction }