An open API service indexing awesome lists of open source software.

https://github.com/sorodrigo/simplif

Simplify verbose if statements
https://github.com/sorodrigo/simplif

collections conditionals es6 if javascript tool

Last synced: 8 months ago
JSON representation

Simplify verbose if statements

Awesome Lists containing this project

README

          

# simplif
> Clean, debuggable solution to verbose if statements

## Installation
In a browser:
```

```
Using npm:
```
$ npm i -S simplif
```

## Usage

```
import { simplif as sif } from 'simplif';

// Arrays
sif([pouredSalt, waterBoiling, pouredPasta, timeInWater > 8], () => {
/* takes out spaghetti */
/* serves plate */
/* pours bolognesa */
});

// Objects
const spaghetti = {
pouredSalt: true,
waterBoiling: true,
pouredPasta: true,
timeInWater: totalTime > 8
};

sif(spaghetti, () => {
/* takes out spaghetti */
/* serves plate */
/* pours bolognesa */
});
```