export const maskSensitiveData = ( obj: Record, keysToMask: string[] ) => { const maskedObj = JSON.parse(JSON.stringify(obj)); keysToMask.forEach(key => { if (maskedObj.hasOwnProperty(key)) { maskedObj[key] = "***"; } }); return maskedObj; };