Ternary wrapper.
Any value used to check in a ternary.
Any value used in the default return of a ternary.
import { EitherOr } from "@taystack/js-helpers";
EitherOr(false, true) // true
EitherOr(true, false) // true
EitherOr("foobar", undefined) // "foobar"
EitherOr(undefined, "foobar") // "foobar"
EitherOr(false, false) // false
EitherOr(undefined, false) // false
EitherOr(false, undefined) // undefined
Source: @taystack/js-helpers hosted on GitHub Author: taystack