eslint-plugin-de-morgan
Version:
ESLint plugin for transforming negated boolean expressions via De Morgan’s laws
13 lines (12 loc) • 365 B
TypeScript
import { UnaryExpression, Node } from 'estree'
type ParentedNode = {
parent?: Node
} & Node
/**
* Checks whether the given AST node is a negated expression.
*
* @param node - The AST node to check.
* @returns True if the node is a UnaryExpression with operator `!`.
*/
export declare function isNegated(node: ParentedNode): node is UnaryExpression
export {}