Skip to content
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

TS Error. Type 'IsURLOptions' does not include some properties #1258

Open
Makarovks320 opened this issue Nov 1, 2023 · 0 comments · May be fixed by #1259
Open

TS Error. Type 'IsURLOptions' does not include some properties #1258

Makarovks320 opened this issue Nov 1, 2023 · 0 comments · May be fixed by #1259

Comments

@Makarovks320
Copy link

I use 7.0.1 express-validator version.

I have to check input "websiteURL" param from request body.

import {body} from "express-validator";
export const websiteUrlValidation = body('websiteUrl')
    .trim()
    .isLength({max: 100}).withMessage('max length is 100')
    .isURL({ignore_max_length: true}).withMessage('websiteUrl should be url')

But I can't use the option "ignore_max_length" because I get an error:

error TS2345: Argument of type '{ ignore_max_length: boolean; }' is not assignable to parameter of type 'IsURLOptions'.
  Object literal may only specify known properties, and 'ignore_max_length' does not exist in type 'IsURLOptions'.

Also in type 'IsURLOptions' there are missing other properties that could be used in the function isFQDN() inside 'express-validator':

    allow_numeric_tld?: boolean;
    allow_wildcard?: boolean;
    ignore_max_length?: boolean;
Makarovks320 pushed a commit to Makarovks320/express-validator that referenced this issue Nov 1, 2023
these props may be needed in the function isFQDN()
@Makarovks320 Makarovks320 linked a pull request Nov 1, 2023 that will close this issue
1 task
Makarovks320 pushed a commit to Makarovks320/express-validator that referenced this issue Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants