import * as t from 'io-ts' ; import { Either } from 'fp-ts/lib/Either' ; import { from } from '../from' ; /**
 * Types the DefaultFromString as:
 *   - If null or undefined, then a default of the string "now-6m" will be used
 */ export const DefaultFromString = new t . Type < string , string | undefined , unknown > ( 'DefaultFromString' , t . string . is , ( input , context ) : Either < t . Errors , string > => { if ( input == null ) { return t . success ( 'now-6m' ) ; } return from . validate ( input , context ) ; } , t . identity ) ;