Rebasely Beta: data may be purged

justintypescript-ultra-strict Public

TypeScript · 15 lines · 470 B · at 8b87e58

export type User = { id: string; name: string; managerId?: string; email?: string };export class ChainError extends Error {  constructor(    public readonly kind: "unknown_user" | "cycle",    public readonly id: string,  ) {    super(`${kind}: ${id}`);  }}/** The first non-empty email up the chain, or undefined if there is none. Throws ChainError. */export function escalationEmail(users: readonly User[], userId: string): string | undefined {  // TODO}