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

Fix value being decoded twice with arrayFormat option set to separator #243

Merged
merged 5 commits into from Apr 12, 2020

Conversation

cheqianxiao
Copy link
Contributor

fix part of #242 ( caused by #236

@sindresorhus
Copy link
Owner

part of 242

What part does this not fix?

@sindresorhus
Copy link
Owner

You can use Array#includes instead of indexOf

@cheqianxiao
Copy link
Contributor Author

part of 242

What part does this not fix?

it not fix :

parse(queryString, { arrayFormat: "comma", parseBooleans: true, parseNumbers: true });
// Request: id%28in%29=992232%2C992237%2C992240
// Parsed: 
// {
//    id(in): '992232,992237,992240'
// }

@sindresorhus
Copy link
Owner

Can you add a failing test for that case that you're not fixing?

test/parse.js Outdated Show resolved Hide resolved
@sindresorhus sindresorhus changed the title fix: value is decoded twice with arrayFormat separator Fix value being decoded twice with arrayFormat option set to separator Apr 4, 2020
test/parse.js Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

None yet

2 participants