switch-functional
Version:
Functional switch statement
50 lines (18 loc) • 254 B
JavaScript
import{applyReturnValues}from"./return.js";
export const addDefault=
(
{
resolved,
options,
input,
finalValue
})=>
(
...defaultReturnValues)=>
resolved?
finalValue:
applyReturnValues(
input,
defaultReturnValues,
options
);