Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export type Json =
* A helper type to make properties with `undefined` in their type optional, but
* not `undefined` itself.
*
* @deprecated Use `ObjectType` and/or `ExactOptionalize` from `@metamask/superstruct@>=3.2.0` instead.
* @example
* ```ts
* type Foo = ObjectOptional<{ foo: string | undefined }>;
Expand All @@ -67,6 +68,8 @@ export type ObjectOptional<Schema extends Record<string, unknown>> = {
* An object type with support for exact optionals. This is used by the `object`
* struct. This uses the {@link ObjectOptional} helper to make properties with
* `undefined` in their type optional, but not `undefined` itself.
*
* @deprecated Use `ObjectType` from `@metamask/superstruct@>=3.2.0` instead.
*/
export type ObjectType<Schema extends ObjectSchema> = Simplify<
ObjectOptional<
Expand All @@ -80,6 +83,7 @@ export type ObjectType<Schema extends ObjectSchema> = Simplify<
* A struct to check if the given value is a valid object, with support for
* {@link exactOptional} types.
*
* @deprecated Use `exactOptional` and `object` from `@metamask/superstruct@>=3.2.0` instead.
* @param schema - The schema of the object.
* @returns A struct to check if the given value is an object.
*/
Expand Down Expand Up @@ -116,6 +120,7 @@ function hasOptional({ path, branch }: Context): boolean {
* This struct should be used in conjunction with the {@link object} from this
* library, to get proper type inference.
*
* @deprecated Use `exactOptional` and `object` from `@metamask/superstruct@>=3.2.0` instead.
* @param struct - The struct to check the value against, if present.
* @returns A struct to check if the given value is valid, or not present.
* @example
Expand Down
Loading