import * as t from 'io-ts' ; import { Either } from 'fp-ts/lib/Either' ; /**
 * Types the NonEmptyString as:
 *   - A string that is not empty
 */ export const NonEmptyString = new t . Type < string , string , unknown > ( 'NonEmptyString' , t . string . is , ( input , context ) : Either < t . Errors , string > => { if ( typeof input === 'string' && input . trim ( ) !== '' ) { return t . success ( input ) ; } else { return t . failure ( input , context ) ; } } , t . identity ) ; export type NonEmptyStringC = typeof NonEmptyString ;