UNPKG

eslint-plugin-de-morgan

Version:

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

12 lines (11 loc) 379 B
/** * Checks whether the given AST node is a boolean literal. This function * verifies that the node is a literal and its value is of boolean type. * * @param node - The AST node to check. * @returns True if the node is a literal with a boolean value. */ function isBoolean(node) { return node.type === 'Literal' && typeof node.value === 'boolean' } export { isBoolean }