import * as t from 'io-ts' ; import { Either } from 'fp-ts/lib/Either' ; import { throttle , ThrottleOrNull } from '../throttle' ; /**
 * Types the DefaultThrottleNull as:
 *   - If null or undefined, then a null will be set
 */ export const DefaultThrottleNull = new t . Type < ThrottleOrNull , ThrottleOrNull | undefined , unknown > ( 'DefaultThreatNull' , throttle . is , ( input , context ) : Either < t . Errors , ThrottleOrNull > => input == null ? t . success ( null ) : throttle . validate ( input , context ) , t . identity ) ;