rsuite / schema-typed

Schema for data modeling & validation
MIT License
198 stars 28 forks source link

NumberType doesn't accept some valid values #40

Open tcpalmer opened 2 years ago

tcpalmer commented 2 years ago

What version of schema-typed are you using?

2.0.2

Describe the Bug

NumberType doesn't accept values with a leading or trailing decimal point as valid. For example '.1' and '1.' are not considered valid.

Expected Behavior

Values with leading and trailing decimal points are valid numbers and should be accepted.

To Reproduce

const model = Schema.Model({ imageScale: NumberType('must be a number'), });

See screenshot for actual result. Screen Shot 2022-01-29 at 3 45 32 PM