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(props): support BigInt in props type validation #11191

Merged
merged 1 commit into from Mar 30, 2021
Merged

Conversation

AjiTae
Copy link
Contributor

@AjiTae AjiTae commented Mar 8, 2020

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:
Just a simple addition to make BigInt validation work.

Close #11126

@mcvnh
Copy link

mcvnh commented Apr 3, 2020

I don't think it has to support BigInt, BigInt rarely uses and not supported by most browsers.

@AjiTae
Copy link
Contributor Author

AjiTae commented Apr 3, 2020

I don't think it has to support BigInt, BigInt rarely uses and not supported by most browsers.

Rarely, yes, but nonetheless. There is no way to do a BigInt type check now even if I want to. Like [Number, BigInt] - won't work. It's counterintuitive.

@mcvnh
Copy link

mcvnh commented Apr 4, 2020

@AjiTae you might have to create the validator function for your props, for example:

yourBigInt: {
  validator: v => typeof v === 'bigint',
}

@posva posva mentioned this pull request May 8, 2020
13 tasks
Copy link

@mireinaa24hu mireinaa24hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okw

@posva posva added this to In Review in 2.6.13 Feb 24, 2021
@posva posva moved this from In Review to Reviewed once, needs another review in 2.6.13 Mar 9, 2021
@posva posva changed the title feat(validation): support BigInt in props type validation fix(validation): support BigInt in props type validation Mar 30, 2021
@posva posva changed the title fix(validation): support BigInt in props type validation fix(props): support BigInt in props type validation Mar 30, 2021
@posva posva merged commit fa1f81e into vuejs:dev Mar 30, 2021
@posva posva moved this from Reviewed once, needs another review to Done in 2.6.13 Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Allow BigInt usage in templates
4 participants