import * as t from 'io-ts' ; import { Either } from 'fp-ts/lib/Either' ; import { comment , CommentsArray } from '../comment' ; /**
 * Types the DefaultCommentsArray as:
 *   - If null or undefined, then a default array of type entry will be set
 */ export const DefaultCommentsArray = new t . Type < CommentsArray , CommentsArray , unknown > ( 'DefaultCommentsArray' , t . array ( comment ) . is , ( input ) : Either < t . Errors , CommentsArray > => input == null ? t . success ( [ ] ) : t . array ( comment ) . decode ( input ) , t . identity ) ;