UNPKG

@sevinf/maybe

Version:

Maybe/Optional type implementation in Typescript. Main motivation for creating this library was handling `null` values in deeply nested data, coming from GraphQL APIs, but the library itself is not limited to GraphQL.

7 lines (6 loc) 267 B
import { Maybe, RemoveMaybe, Defined } from './maybe'; declare type UnwrapMaybeProperties<T extends {}> = { [K in keyof T]: Defined<RemoveMaybe<T[K]>>; }; export declare function allProperties<T extends {}>(object: T): Maybe<UnwrapMaybeProperties<T>>; export {};