https://github.com/nas5w/and-or
Easy javascript logic tests
https://github.com/nas5w/and-or
Last synced: 7 months ago
JSON representation
Easy javascript logic tests
- Host: GitHub
- URL: https://github.com/nas5w/and-or
- Owner: nas5w
- Created: 2019-02-10T02:47:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T16:22:14.000Z (almost 3 years ago)
- Last Synced: 2025-01-17T14:17:02.519Z (9 months ago)
- Language: JavaScript
- Size: 336 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

[](https://travis-ci.org/nas5w/and-or) [](https://codecov.io/gh/nas5w/and-or/branch/master) [](hhttps://img.shields.io/bundlephobia/min/andor.js.svg?style=flat)
Easy javascript logic tests.
## :rocket: Example Use
`andor.js` can be used to nest your `and` and `or` logic any number of levels deep, as complex as your heart desires.
### requirejs
```javascript
const { and, or } = require("andor.js");const test1 = and(true, true, or(true, false, true), true);
console.log(test1);
// trueconst test2 = and(true, true, or(true, false, true), false);
console.log(test2);
// false
```### es6 modules
```javascript
import { and, or } from "andor.js";const test1 = and(true, true, or(true, false, true), true);
console.log(test1);
// trueconst test2 = and(true, true, or(true, false, true), false);
console.log(test2);
// false
```# The MIT License (MIT)
Copyright © 2019 Nick Scialli
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.