validator.js
validator.js copied to clipboard
Type definitions not loading when using require("validator") in node.js
Describe the bug
When I use require("validator") in a node.js project, the type definitions from DefinitelyTyped are not properly loaded.
I can solve this by adding export = validator;
to the bottom of the index.d.ts file in @types/validator
Examples
Additional context Validator.js version: 13.7.0 Typescript version: 4.7 Node.js version: 12.x OS platform: macOS
If you need to add something in @types/validator I would recommend opening a PR there
Ho @davidnbooth, does the following work for you?
const validator = require('validator').default
@fedeci it does! Thank you! :)
correct me if I am wrong, but as those types are part of the @types/validator
project, that WikiRik mentioned above, I don't think there is an issue here?
If so: I would like to close this issue here.
@davidnbooth kindly confirm, if I can go ahead.
If I don't hear any feedback a week from now, I will close the issue
Confirmed, thank you!