$ gnpm install ternary
Build a ternary statement
$ npm install --save ternary
var ternary = require('ternary')
ternary('condition', 'whenTruthy' : 'whenFalsy')
//=> condition ? whenTruthy : whenFalsy
ternary(condition, expr1, expr2)
-> string
Required
Type: string
The ternary condition.
Required
Type: string
The expression to use when the condition is truthy.
Required
Type: string
The expression to use when the condition is falsy.
MIT © Ben Drucker
Copyright 2013 - present © cnpmjs.org | Home |