@elsikora/nestjs-crud-automator
Version:
A library for automating the creation of CRUD operations in NestJS.
22 lines (21 loc) • 1.09 kB
TypeScript
import type { TApiPropertyDefaultStringFormat, TApiPropertyDefaultStringFormatProperties } from '../../../type/decorator/api/property/index';
/**
* Returns default format properties for supported string types (EMAIL, IP, URL, UUID).
* This utility provides standard validation rules including pattern, length constraints,
* example values and descriptions for common string formats.
* @param {TApiPropertyDefaultStringFormat} format - The string format type (EMAIL, IP, URL, or UUID)
* @returns {TApiPropertyDefaultStringFormatProperties} Default properties for the specified format
* @example
* ```typescript
* const emailDefaults = GetDefaultStringFormatProperties(TApiPropertyDefaultStringFormat.EMAIL);
* // Returns:
* // {
* // description: "email",
* // exampleValue: "user@example.com",
* // maxLength: 321,
* // minLength: 5,
* // pattern: "/^([a-zA-Z0-9_\\-.+])+@([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}$/"
* // }
* ```
*/
export declare function GetDefaultStringFormatProperties(format: TApiPropertyDefaultStringFormat): TApiPropertyDefaultStringFormatProperties;