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

Any reason for dropping null from the types for ParsedQueryString #362

Closed
birtles opened this issue Dec 14, 2022 · 1 comment
Closed

Any reason for dropping null from the types for ParsedQueryString #362

birtles opened this issue Dec 14, 2022 · 1 comment

Comments

@birtles
Copy link

birtles commented Dec 14, 2022

Prior to c2ab7cd ("Require Node.js 14 and move to ESM"), ParsedQueryString was defined as:

export interface ParsedQuery<T = string> {
	[key: string]: T | null | Array<T | null>;
}

But that patch made it

export type ParsedQuery<T = string> = Record<string, T | undefined | Array<T | undefined>>;

Was that change intentional? I can't see anything about it in the release notes and the docs still say that:

Note that keys with undefined as the value are always skipped.

And if that's true, are we expecting to be passed back keys with undefined values from parsing while passing in null values for keys with don't have a value?

@sindresorhus
Copy link
Owner

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