Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typescript definition): schema options for match #10744

Merged
merged 1 commit into from
Sep 18, 2021

Conversation

easen-amp
Copy link
Contributor

Summary

Fixes #10743

Examples

Can be used to return a custom error message

new Schema(
  {
    email: {
      type: String,
      trim: true,
      lowercase: true,
      match: [/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/, 'Invalid email address']
    }
  },
  { _id: false }
);

@vkarpov15 vkarpov15 added this to the 6.0.7 milestone Sep 18, 2021
@vkarpov15 vkarpov15 merged commit 6f39a90 into Automattic:master Sep 18, 2021
@vkarpov15 vkarpov15 added the typescript Types or Types-test related issue / Pull Request label Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect Typescript Definition SchemaString.prototype.match
2 participants