@tsed/schema
Version:
JsonSchema module for Ts.ED Framework
22 lines (21 loc) • 519 B
JavaScript
import { from } from "./from.js";
/**
* Declare a new object model.
*
* See @@JsonSchema@@ to discover available methods.
*
* ### Example
*
* ```typescript
* const userSchema = object({
* name: string(),
* age: number()
* });
* ```
*
* @param properties - An object containing property definitions where each value is a JsonSchema
* @returns {JsonSchema} A new object model with the specified properties
*/
export function object(properties = {}) {
return from(Object).properties(properties);
}