Rebasely Beta: data may be purged

justintypescript-ultra-strict Public

Text · 10 lines · 432 B · at 9ba9e6b

import { type Option, type Result } from "@tsus/runtime";export type User = { id: string; name: string; managerId: Option<string>; email: Option<string> };export type ChainError = { kind: "unknown_user" | "cycle"; id: string };/** The first non-empty email up the chain, or None if there is none. */export const escalationEmail = (users: readonly User[], userId: string): Result<Option<string>, ChainError> => {  // TODO};