/** * Given an object with keys that might contain undefined values, returns a new * object only with keys that are not undefined. */ export function omitUndefinedKeys(record: Record) { return Object.fromEntries( Object.entries(record).filter(([_, v]) => v !== undefined), ) as Record; }