higher-order-logical-operators
Version:
Allows combination of lower order functions that evaluate to booleans. Extends Array prototype with 'one' function, which takes a callback and returns true if the callback returns true for one and only one member of the array.
20 lines (12 loc) • 729 B
Markdown
# Higher Order Logical Operators
Package provides higher order functions allowing for combination of lower order boolean functions using logical operators: and, not, or, xor.
In order to provide xor the Javascript Array object prototype is extended with the `one` function.
## Contents
- [Usage](##Usage)
- [API](https://github.com/darArch/higher-order-logical-operators/blob/master/docs/api.md)
## Usage
`and`, `not`, `or` and `xor` are named exports in `index.js` file for this module. They can therefore be imported for use individually as follows:
- ES5
- `var <function_name> = require('higher-order-logical-operators').<function_name>`
- ES6
- `import { <function_name> } from 'higher-order-logical-operators'`