Find why this high-coverage profile formatter can still fail at runtime.
TypeScript
type Profile = {
name: string;
};
function displayName(raw: string): string {
const profile = JSON.parse(raw) as Profile;
return profile.name.toUpperCase();
}
console.log(displayName('{"name":null}'));