concordusapps / inquire.js

Generate advanced query strings.
http://concordusapps.github.io/inquire.js/
MIT License
11 stars 2 forks source link

Should the query string be part of the output? #5

Closed mehcode closed 11 years ago

mehcode commented 11 years ago

I was just wondering about the application. Consider that the ? character doesn't represent the query in the URI but is merely a separator between it and the path. What about other places that may want a generated query (say, in the path segment eg. GET /basket(color=red;circumference>=100)/fruit -- get fruit in all baskets where the color is red or the circumference is greater than 100 units).

I'm propsing the following

inquire \x, 4  #=> x=4

instead of

inquire \x, 4  #=> ?x=4
joneshf commented 11 years ago

The readme is way out of date. It's from like v0.3.0 when I was still mucking about with strings and stuff. #4 is supposed to help with this.

Your suggestion is actually what happens if you stringify it. The generate method prepends the question mark. The name is arbitrary and could be changed if it made more sense. I am not sure of all the different things you can do with queries in armet, so I'm just going by what I know at the time. Should there be a method that just returns the string representation of the query (aside from toString)?

mehcode commented 11 years ago

That looks fine if that is what it does. Thank you for clarifying.