import type { LoginData } from '@wireapp/api-client/src/auth/' ; export class LoginSanitizer { constructor ( ) { } public static removeNonPrintableCharacters ( loginData ) { const nonPrintableCharacters = /\s/gm ; if ( loginData . email ) { loginData . email = loginData . email . replace ( nonPrintableCharacters , '' ) ; } if ( loginData . handle ) { loginData . handle = loginData . handle . replace ( nonPrintableCharacters , '' ) ; } if ( loginData . password ) { loginData . password = loginData . password . toString ( ) ; } if ( loginData . phone ) { loginData . phone = loginData . phone . toString ( ) . replace ( nonPrintableCharacters , '' ) ; } } }