export interface IGeneralFunctions { sleep ( ms ) : Promise < void > ; trimValues ( values ) : string [ ] ; trimValue ( value ) : string ; } export class GeneralFunctions implements IGeneralFunctions { public sleep ( ms ) { return new Promise ( resolve => setTimeout ( resolve , ms ) ) ; } public trimValues ( values ) { var returnValue = [ ] ; if ( values != null ) { values . forEach ( value => { returnValue . push ( this . trimValue ( value ) ) ; } ) ; } return returnValue ; } public trimValue ( value ) { if ( value !== null && value !== undefined ) { return value . trim ( ) ; } return value ; } }