1.0.1 • Published 3 months ago

@miaooo/class-transformer-split v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

@miaooo/class-transformer-split

version downloads license dependencies coveralls

DEPRECATED

This package has been deprecated. Please use @buka/class-transformer-extra instead.

A class transformer helper that splits the string into multiple string.

Usage

// my-query.dto.ts
export MyQueryDTO {
  @ApiProperty({ type: 'string' })
  @Split(',')
  types: string[];
}
// my.controller.ts
@Controller()
export class MyController {
  @Get("/")
  async get(@Query() filter: MyQueryDTO) {
    // query.types will be splited by ',' automated
    return query;
  }
}

Contributing & Development

If there is any doubt, it is very welcome to discuss the issue together. Please read Contributor Covenant Code of Conduct and CONTRIBUTING.