import * as t from 'io-ts' ; import { Either } from 'fp-ts/lib/Either' ; import { threats , Threats } from '../threat' ; /**
 * Types the DefaultThreatArray as:
 *   - If null or undefined, then an empty array will be set
 */ export const DefaultThreatArray = new t . Type < Threats , Threats | undefined , unknown > ( 'DefaultThreatArray' , threats . is , ( input , context ) : Either < t . Errors , Threats > => input == null ? t . success ( [ ] ) : threats . validate ( input , context ) , t . identity ) ;