export class Utils { public static sanitizePhone(dirtyPhone: string): string { let sanitizedPhone = ""; dirtyPhone = ((dirtyPhone || '')+'').split(" ").join(""); if (dirtyPhone.length >= 10) { sanitizedPhone = dirtyPhone.slice(dirtyPhone.length - 10); } return sanitizedPhone; } public static wait(t:number):Promise{ return new Promise((resolve)=>{ setTimeout(()=>{ return resolve(true); },t); }); } public static shuffleArray=(array:any[])=> { for (let i = array.length - 1; i > 0; i--) { let j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; // Swap elements } return array; } }