-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(types): add types file #2398
base: master
Are you sure you want to change the base?
Conversation
Having types file here will make sure the types and codebase are in sync. |
LGTM. Could you please also add some guidelines on how to use, on the README? Perhaps adding a section for Types? |
Sure thing. I will update the readme for this |
Since the types get installed along with the library, there is no need to install @types/validator package anymore for typescript support. I have added a small section on readme for that but we should also point this on the realease notes @profnandaa |
@@ -43,6 +43,9 @@ Or, import only a subset of the library: | |||
import isEmail from 'validator/lib/isEmail'; | |||
``` | |||
|
|||
#### Types | |||
Starting the latest version of validator.js , the types comes out of box. |
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.
nit: perhaps can add a small sample typescript code block? this could be more beginner friendly.
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.
yeah will do that
This PR adds types file within the repo itself .
The types file is derived from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/validator
with some modifications
Checklist