BenjaminVanRyseghem / numbro

A JS library for number formatting
http://numbrojs.com
MIT License
1.1k stars 198 forks source link

validate types seems wrong #757

Open ibesora opened 6 months ago

ibesora commented 6 months ago

The typing for validate is function validate(value: string, format: Format | string): boolean; but according to the code comments in validating.js#L244 the expected types are string | number | Numbro. This makes validating both the input and format like validate(325, { mantissa: 2 }) impossible because you get a typescript error.

Am I misunderstanding how validate should be used?