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

Option to ignore leading '?' in a search string #209

Closed
jinalskothari opened this issue May 14, 2017 · 1 comment
Closed

Option to ignore leading '?' in a search string #209

jinalskothari opened this issue May 14, 2017 · 1 comment

Comments

@jinalskothari
Copy link

I use react-router. It exposes a location.search string property. It includes the '?' character in the search string. I could write some code to remove it before I give to qs to parse; however it would be nice if qs could do that.

The api could look like this

var parsedObj = qs.parse('?itemType=theBest&itemCost=1gazillion', {ignoreLeadingQuestion:true})
assert.notEqual(parsedObj, {'?itemType':'theBest', itemCost:'1gazillion'})
@ljharb
Copy link
Owner

ljharb commented May 14, 2017

Duplicate of #177.

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

No branches or pull requests

2 participants