How to use trim with checkSchema in Typescript
See original GitHub issueHello, first of all I want to thank you for an amazing library. I am currently using the checkSchema method, and I would like to use it with trim, but I receive the issue:
Object literal may only specify known properties, and ‘trim’ does not exist in type ‘ValidationParamSchema’.
This is what I am using in my code.
checkSchema({
username: {
exists: true,
errorMessage: 'Invalid username name',
in: ['params'],
isLength: {
errorMessage: 'username should not be longer than 30 characters',
options: {
min: MINIMUM_SEARCH_LENGTH,
max: MAXIMUM_SEARCH_LENGTH
}
},
trim: true
}
})
Are you maybe missing trim as a property of checkSchema in types? or something on my end?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
express-validator.checkSchema JavaScript and Node.js code ...
Best JavaScript code snippets using express-validator.checkSchema(Showing top 15 results out of 315) · app/routes/api/public.js/publicRoutes. · routes/preview.js/ ...
Read more >Match string with values from array in express-validation
The way I do it is by using isIn() check('action') ...
Read more >Schema validation in TypeScript with Zod - LogRocket Blog
In this article, you will learn about schema design and validation in Zod and how to run it in a TypeScript codebase at...
Read more >Express Validator Tutorial - Auth0
Sanitizing fields with trim and escape. With Express Validator, you can also trim away spaces from your data and escape special characters using...
Read more >A Clean Approach to Using Express Validator
Express validator is one of the many npm packages for validating a request an express application. I... Tagged with node, express.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
🚢 v5.1.0 released with this
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.