Skip to main content

looseObject()

const looseObject: <T>(entries, message?) => ObjectConstraint<T> = object

Loose object schema - validates defined properties but ignores others.

Object schema with composition and constraints.


Type Parameters​

T: T extends Record<string, AnySchema>​


Parameters​

entries: T​

Object entries schema definition.

message?: string​

Custom error message (optional).


Returns: ObjectConstraint<T>​

ObjectConstraint with all constraints.


Since​

2.0.0


Remarks​

Alias for object - both create loose object schemas by default.


Since​

2.0.0