Socket
Socket
Sign inDemoInstall

simplif

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    simplif

Simplify verbose if statements


Version published
Maintainers
1
Created

Readme

Source

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

Keywords

FAQs

Last updated on 16 Aug 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc