import { Either } from 'fp-ts/lib/Either' ; import * as t from 'io-ts' ; import { parseScheduleDates } from '@kbn/securitysolution-io-ts-utils' ; const stringValidator = ( input ) : input is string => typeof input === 'string' ; export const from = new t . Type < string , string , unknown > ( 'From' , t . string . is , ( input , context ) : Either < t . Errors , string > => { if ( stringValidator ( input ) && parseScheduleDates ( input ) == null ) { return t . failure ( input , context , 'Failed to parse "from" on rule param' ) ; } return t . string . validate ( input , context ) ; } , t . identity ) ; export type From = t . TypeOf < typeof from > ; export const fromOrUndefined = t . union ( [ from , t . undefined ] ) ; export type FromOrUndefined = t . TypeOf < typeof fromOrUndefined > ;