[建议]自定义规则能不能进行传参

Open
#28 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript
Domain
backend

Research direction

Start by tracing how custom rule methods receive rules and value, then inspect the available name and message fields described in the issue. Define the intended parameter-passing behavior and its edge cases before identifying the affected implementation and tests; done means the API is agreed and covered by tests.

Written by the indexing model from the issue text.

Description

因为看到 有很多取反 或者说合并之类需求

就在想假如 自定义规则能够 传入变量的话 那么扩展性就大大提高了.

而且 我试了一下 自定义规则的方法 是会传入 rules 和 value.

但是rules 里面好像没有什么有用的东西,一个就是name 一个就是message

我到现在都没看过message里面是有值的.

Dominant language
JavaScript
Stars
262
Forks
40
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eggjs/egg-validate

All issues in eggjs/egg-validate

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.