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

validateMethods 字段没有用, 从实现当中移除 #85

Open
chenyong opened this issue Nov 8, 2019 · 1 comment
Open

validateMethods 字段没有用, 从实现当中移除 #85

chenyong opened this issue Nov 8, 2019 · 1 comment
Labels

Comments

@chenyong
Copy link
Member

chenyong commented Nov 8, 2019

查找了一遍已有的代码库, validateMethods 并没有真的使用, 而且功能上来说, 这个比较残缺, 目前项目当中都是用的 validator. 即便将来用 JSON 化的配置, 也不需要这个字段了.

计划移除.

@chenyong chenyong added the plan label Nov 8, 2019
@tiye
Copy link
Collaborator

tiye commented Feb 20, 2020

查看了一下已有的代码, 大致可以抽象出几种类型,

allowNull
required
string
  length
  regex
number
array
  length
fn

不过从代码量上未必能省代码, 毕竟 if 或者 v.test() 或者检查程度的代码都很短.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants