/**
 * Common response message type.
 */ import * as t from "io-ts" ; export const SuccessResponse = t . interface ( { message : t . string } ) ; export type SuccessResponse = t . TypeOf < typeof SuccessResponse > ; export const STRINGS_RECORD = t . record ( t . string , t . string ) ; export type STRINGS_RECORD = t . TypeOf < typeof STRINGS_RECORD > ; export function assertUnreachable ( _ ) { throw new Error ( "Unexpected type error" ) ; } param decoder returns export const CommaSeparatedListOf = ( decoder ) => new t . Type < ReadonlyArray < t . TypeOf < typeof decoder > > , string , unknown > ( `CommaSeparatedListOf<${ decoder . name }>` , ( value ) : value is ReadonlyArray < t . TypeOf < typeof decoder > > => Array . isArray ( value ) && value . every ( e => decoder . is ( e ) ) , input => t . readonlyArray ( decoder ) . decode ( typeof input === "string" ? input . split ( "," ) . map ( e => e . trim ( ) ) . filter ( Boolean ) : ! input ? [ ] : input ) , String ) ;