(node)
| 42 | } |
| 43 | |
| 44 | export function isTruthy(node) { |
| 45 | if (!node) return false; |
| 46 | if (node.type === 'Literal') return !!node.value; |
| 47 | if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression); |
| 48 | if (node.operator in operators) return operators[node.operator](node); |
| 49 | return null; |
| 50 | } |
| 51 | |
| 52 | export function isFalsy(node) { |
| 53 | return not(isTruthy(node)); |
no outgoing calls
no test coverage detected