Find why this public-account helper does not redact the password hash.
TypeScript
interface Account {
id: string;
displayName: string;
passwordHash: string;
}
type PublicAccount = Omit<Account, "passwordHash">;
function toPublic(account: Account): PublicAccount {
return account;
}
console.log(JSON.stringify(toPublic({
id: "a-1", displayName: "Mina", passwordHash: "secret"
})));