JSPM

ternary

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21405
  • Score
    100M100P100Q167889F
  • License MIT

Build a ternary statement

Package Exports

  • ternary

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ternary) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ternary Build Status

Build a ternary statement

Install

$ npm install --save ternary

Usage

var ternary = require('ternary')

ternary('condition', 'whenTruthy' : 'whenFalsy')
//=> condition ? whenTruthy : whenFalsy

API

ternary(condition, expr1, expr2) -> string

condition

Required
Type: string

The ternary condition.

expr1

Required
Type: string

The expression to use when the condition is truthy.

expr2

Required
Type: string

The expression to use when the condition is falsy.

License

MIT © Ben Drucker