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

IsNumber throws error when first argument is not correctly set (null instead of {}) #2571

Open
BUONJG opened this issue Jan 10, 2025 · 0 comments

Comments

@BUONJG
Copy link

BUONJG commented Jan 10, 2025

Hello,

This week, one of my team member lost time debugging because he had an error due to wrong usage of IsNumber

On an array of numbers property he put the validator:

  • @IsNumber(null, { each: true })

When the first argument is supposed to be an object:

  • @IsNumber({}, { each: true })

Is there a way to make sure the validator does not throw an error in that case?

The issue is on the line 31: if (options.maxDecimalPlaces !== undefined)

Thank you

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

No branches or pull requests

1 participant