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: tarnsform type value #2

Merged
merged 6 commits into from
Apr 16, 2024

Conversation

crazyair
Copy link

@crazyair crazyair commented Apr 16, 2024

yiminghe#339

不传 transform,会走到这个方法,会识别 value 类型设置 type

const required: ExecuteValidator = (rule, value, callback, source, options) => {
  const errors: string[] = [];
  const type = Array.isArray(value) ? 'array' : typeof value;
  rules.required(rule, value, source, errors, options, type);
  callback(errors);
};

所以在这里也增加 typeof 判断

src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
Copy link

codecov bot commented Apr 16, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@afc163 afc163 merged commit 70b4b02 into react-component:master Apr 16, 2024
3 checks passed
@afc163
Copy link
Member

afc163 commented Apr 16, 2024

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

Successfully merging this pull request may close these issues.

2 participants