@eddaic/nestjs-decorators
Version:
Additional decorators intended for use with NestJS framework.
14 lines (13 loc) • 472 B
TypeScript
/**
* Converts falsy values `null`, `undefined`, `0`, `false` and empty strings
* to false. Otherwise the value is returned as true
* @param value
* @returns
*/
export declare function toBoolean(value: unknown): boolean;
/**
* Transform a boolean value or leave undefined if not present
* @param field - the property name of the value to transform in the object
* @returns PropertyDecorator
*/
export declare function ToBoolean(field: string): PropertyDecorator;