@eddaic/nestjs-decorators
Version:
Additional decorators intended for use with NestJS framework.
20 lines (19 loc) • 822 B
TypeScript
import { TransformOptions } from 'class-transformer';
export interface SplitStringTransformOptions extends TransformOptions {
/**
* A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
* @default ,
*/
separator?: string | RegExp;
/**
* A value used to limit the number of elements returned in the array.
*/
limit?: number;
}
export declare function splitString(value: unknown, options?: SplitStringTransformOptions): unknown;
/**
* Transforms a string by a delimiter which defaults to `,`. If the
* passed value is not a string, the value is returned unchanged.
* @returns
*/
export declare function SplitString(options?: SplitStringTransformOptions): PropertyDecorator;