Operator to apply.
First boolean value.
Optional
b: booleanSecond boolean value (optional, only used for binary operators).
The boolean value after applying the operator.
// Example usage:
import { applyOperator } from "@zk-kit/logical-expressions"
// Unary operator
const result1 = applyOperator("not", true)
console.log(result1) // Output: false
// Binary operator
const result2 = applyOperator("and", true, false)
console.log(result2) // Output: false
Function to apply unary or binary operators to boolean values. Logical operators supported:
and
,or
,not
,xor
.