import { fromNullable , getOrElse } from 'fp-ts/lib/Option' ; import { pipe } from 'fp-ts/lib/pipeable' ; function _defaultTo < A > ( d , value ? ) { return pipe ( fromNullable ( value ) , getOrElse ( ( ) => d ) ) ; } since export function defaultTo < A > ( d ) ; export function defaultTo < A > ( d , value ? ) ; export function defaultTo < A > ( d , value ? ) { switch ( arguments . length ) { case 1 : return ( value ? ) : A => { return _defaultTo ( d , value ) ; } ; case 2 : return _defaultTo ( d , value ) ; } }