Type alias ObjectOptional<Schema>
ObjectOptional<Schema>: { [ Key in keyof Schema as Schema[Key] extends ExactOptionalGuard ? Key : never]?: Schema[Key] extends ExactOptionalGuard & infer Original ? Original : never } & { [ Key in keyof Schema as Schema[Key] extends ExactOptionalGuard ? never : Key]: Schema[Key] }
Type Parameters
-
Schema extends Record<string, unknown>
A helper type to make properties with
undefined
in their type optional, but notundefined
itself.Deprecated
Use
ObjectType
and/orExactOptionalize
from@metamask/superstruct@>=3.2.0
instead.Example