File

libs/dtos/src/generics/Validateable.dto.ts

Index

Properties

Constructor

constructor(init: any)
Parameters :
Name Type Optional
init any No

Properties

Public validate
Type : function
import { validate as CVValidate, ValidationError } from 'class-validator'

export class ValidateableDto {
  constructor(init: any) {
    this.validate = async () => {
      return await CVValidate(this)
    }
    Object.assign(this as object, init)
  }

  public validate: () => Promise<ValidationError[]>
}

results matching ""

    No results matching ""