noahsalvi / svelte-use-form

The most compact reactive form controller (including Validation) that you'll ever see.
MIT License
252 stars 14 forks source link

Number validator is actually integers only #66

Open manterfield opened 1 year ago

manterfield commented 1 year ago

Hi,

I just had a look at the number validator, and it's actually only valid for integers.

It doesn't currently allow a leading dash (for negative numbers) or a decimal point.

I could make this change as a PR fairly easy since it's pretty straightforward, but it would be a breaking change. Not sure how to proceed as an additional validator really should have the name 'number' and the current implementation should be 'integer'.

noahsalvi commented 1 year ago

Yeah that definitely makes sense. If you'd like you can submit a PR where you fix this including renaming the current number validator. As it is a breaking change I will then consider it for the next major release.

manterfield commented 1 year ago

Perfect, will do! Might be this evening/tomorrow before I get time.