( t: T | undefined, f: (_: T) => R, )
| 21 | } |
| 22 | |
| 23 | export function undefinedMap<T, R>( |
| 24 | t: T | undefined, |
| 25 | f: (_: T) => R, |
| 26 | ): R | undefined { |
| 27 | if (t === undefined) { |
| 28 | return t as undefined |
| 29 | } |
| 30 | return f(t) |
| 31 | } |
| 32 | |
| 33 | export function nullMap<T, R>(t: T | null, f: (_: T) => R): R | null { |
| 34 | if (t === null) { |
no outgoing calls
no test coverage detected