simplif

1.0.1-0 • Public • Published

simplif

Clean, debuggable solution to verbose if statements

Installation

In a browser:

<script src="simplif.js"></script>

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 */
});

Readme

Keywords

Package Sidebar

Install

npm i simplif

Weekly Downloads

1

Version

1.0.1-0

License

MIT

Last publish

Collaborators

  • sorodrigo