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

ParsedQuery interface is not compatible with ParsedQs interface from 'qs' #297

Closed
PavelKoroteev opened this issue Dec 16, 2020 · 1 comment

Comments

@PavelKoroteev
Copy link

Hello, everyone!

Next code is not works out of the box.

import queryString, { ParsedQuery } from 'query-string';
import { ParsedQs } from 'qs';

TS2345: Argument of type 'ParsedQuery' is not assignable to parameter of type 'ParsedQs'.  
Index signatures are incompatible.
Type 'string | string[] | null | undefined' is not assignable to type 'string | ParsedQs | string[] | ParsedQs[] | undefined'.       Type 'null' is not assignable to type 'string | ParsedQs | string[] | ParsedQs[] | undefined'.

I understand that maybe we have causes for this, but I quess that fix is minor but very helpful.

Thank you, sorry for my English :)

@sindresorhus
Copy link
Owner

These are different packages with different ways of working. I'm not sure why you're expecting them to just be seamlessly convertible. It's up to you to resolve this type incompatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants