export function first<T>(val: T | undefined, ...args: T[]): T | undefined { return args.find(item => item); } export function or<T>(val: T | undefined, fallback: T): T { return val || fallback; }