-
Notifications
You must be signed in to change notification settings - Fork 89
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(types): improve typing #339
Conversation
…lt error, ordonne like the documentation
I found other problems on typing, I will try to check this . getRuleFromSchema => typing say it only allow typescript doesn't work when imported by ESM typescript ( typescript think you are exporting a value "default" ) . Actually I can fix this on client side by doing : import Validator, { default as ValidatorDefault } from 'fastest-validator';
type ValidatorType = ValidatorDefault.default;
const v = new (Validator as unknown as new (opts?: ValidatorConstructorOptions) => ValidatorType)(); but not really clean, I need to investigate more on this |
More problems : Class.instanceOf seems mandatory ( else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
@icebob, I will wait a little to set this ready for review, because I sometimes find another problems (like some minutes before), So if I found another typescript errors, I will add them here |
@icebob any update on this ? |
Thanks, sorry for late. |
The array property
unique
was missing from the RuleArray definitionI've done mutiples modifications in the index.d.ts :
ValidationRuleName
mode
(quick
), and correct the default ofempty
to match doc