UNPKG

generator-nest-js-boilerplate

Version:

This generator will help you to build your own Nest.js Mongodb API using TypeScript 4

23 lines (17 loc) 442 B
import { ApiProperty } from '@nestjs/swagger'; import { Type } from '@nestjs/common'; const DtoFactory = { wrap<T>(responseDto: T): Type<unknown> { class SuccessResponseDto { @ApiProperty({ type: String }) public message: string = ''; @ApiProperty({ type: responseDto }) public data: T | null = null; } return SuccessResponseDto; }, }; const AppUtils = { DtoFactory, }; export default AppUtils;