Skip to content

NestJS使用ValidationPipe使用正则表达式校验会偶发校验问题 #3

Description

@su37josephxia

再现方法

  app.useGlobalPipes(new ValidationPipe({
    forbidUnknownValues: false
  }))
  @Matches(regMobileCN, { message: '请输入正确手机号' })
  readonly phoneNumber: string;

同一输入内容,使用@matches会出现有时候校验通过有时候校验不通过的问题

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions