( input: Dictionary<A | undefined> )
| 121 | } |
| 122 | |
| 123 | export function dropUndefined<A>( |
| 124 | input: Dictionary<A | undefined> |
| 125 | ): Dictionary<A> { |
| 126 | const newR = pipe( |
| 127 | input, |
| 128 | Record.filter((x): x is A => x !== undefined) |
| 129 | ) |
| 130 | return newR |
| 131 | } |
| 132 | |
| 133 | type GetTag<T> = T extends { _tag: infer K } ? K : never |
| 134 | export const isOfType = <T extends { _tag: string }>(tag: GetTag<T>) => (e: { _tag: string }): e is T => e._tag === tag |
no test coverage detected
searching dependent graphs…