eslint-plugin-de-morgan
Version:
ESLint plugin for transforming negated boolean expressions via De Morgan’s laws
14 lines (13 loc) • 526 B
JavaScript
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 disjunction (logical OR).
*
* @param node - The AST node to check.
* @returns True if the node is a LogicalExpression with operator `||`.
*/
function isDisjunction(node) {
return createTestWithParameters(node)(isLogicalExpression, hasOperator('||'))
}
export { isDisjunction }