Template base para proyectos SaaS multi-tenant. Estructura inicial: - apps/backend (NestJS API) - apps/frontend (React/Vite) - apps/database (PostgreSQL DDL) - docs/ (Documentación) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
53 lines
1.8 KiB
TypeScript
53 lines
1.8 KiB
TypeScript
import { Type } from '../interfaces';
|
|
import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-transform.interface';
|
|
import { ValidationPipe, ValidationPipeOptions } from './validation.pipe';
|
|
/**
|
|
* @publicApi
|
|
*/
|
|
export interface ParseArrayOptions extends Omit<ValidationPipeOptions, 'transform' | 'validateCustomDecorators' | 'exceptionFactory'> {
|
|
/**
|
|
* Type for items to be converted into
|
|
*/
|
|
items?: Type<unknown>;
|
|
/**
|
|
* Items separator to split string by
|
|
* @default ','
|
|
*/
|
|
separator?: string;
|
|
/**
|
|
* If true, the pipe will return null or undefined if the value is not provided
|
|
* @default false
|
|
*/
|
|
optional?: boolean;
|
|
/**
|
|
* A factory function that returns an exception object to be thrown
|
|
* if validation fails.
|
|
* @param error Error message or object
|
|
* @returns The exception object
|
|
*/
|
|
exceptionFactory?: (error: any) => any;
|
|
}
|
|
/**
|
|
* Defines the built-in ParseArray Pipe
|
|
*
|
|
* @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes)
|
|
*
|
|
* @publicApi
|
|
*/
|
|
export declare class ParseArrayPipe implements PipeTransform {
|
|
protected readonly options: ParseArrayOptions;
|
|
protected readonly validationPipe: ValidationPipe;
|
|
protected exceptionFactory: (error: string) => any;
|
|
constructor(options?: ParseArrayOptions);
|
|
/**
|
|
* Method that accesses and performs optional transformation on argument for
|
|
* in-flight requests.
|
|
*
|
|
* @param value currently processed route argument
|
|
* @param metadata contains metadata about the currently processed route argument
|
|
*/
|
|
transform(value: any, metadata: ArgumentMetadata): Promise<any>;
|
|
protected isExpectedTypePrimitive(): boolean;
|
|
protected validatePrimitive(originalValue: any, index?: number): any;
|
|
}
|