deno.land / x / rambda@v9.1.1 / source / maybe.js
1234567891011121314import { type } from './type.js'
export function maybe( ifRule, whenIf, whenElse){ const whenIfInput = ifRule && type(whenIf) === 'Function' ? whenIf() : whenIf
const whenElseInput = !ifRule && type(whenElse) === 'Function' ? whenElse() : whenElse
return ifRule ? whenIfInput : whenElseInput}
Version Info