@tsed/schema
Version:
JsonSchema module for Ts.ED Framework
18 lines (17 loc) • 423 B
JavaScript
import { JsonFormatTypes } from "../domain/JsonFormatTypes.js";
import { string } from "./string.js";
/**
* Declare a new string model with `format: email`.
*
* See @@JsonSchema@@ to discover available methods.
*
* ### Example
*
* ```typescript
* const schema = email();
* // Results in: { type: "string", format: "email" }
* ```
*/
export function email() {
return string().format(JsonFormatTypes.EMAIL);
}