UNPKG
@pacote/iff
Version:
latest (3.0.4)
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.0.9
2.0.8
2.0.7
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.2
1.0.1
1.0.0
Conditional expressions with Option support.
@pacote/iff
/
lib
/
esm
/
index.js
11 lines
•
321 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
{
None
,
Some
}
from
'@pacote/option'
;
export
function
iff
(
predicate, onConsequent, onAlternative
) {
return
onAlternative ? predicate ?
onConsequent
() :
onAlternative
() : predicate ?
Some
(
onConsequent
()) :
None
; }
//# sourceMappingURL=index.js.map