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

add optional separator support to stringify #111

Closed
wants to merge 2 commits into from

Conversation

tetsuo
Copy link

@tetsuo tetsuo commented Jul 10, 2014

stringify({foo:1,bar:2}, null, ';'); // foo=1;bar=2

@rlidwka
Copy link

rlidwka commented Jul 10, 2014

I think that "null" really calls for an option object...

@tetsuo
Copy link
Author

tetsuo commented Jul 10, 2014

That's right. Changed stringify to accept an object now, keeping backwards compatibility:

stringify({foo:1,bar:2}, {separator: ';'}); // it is options if object is given
stringify({foo:1,bar:2}, 'foo'); // it is prefix if string is given
stringify({foo:1,bar:2}, {separator: ';', prefix: 'foo'}); // ...

@tj
Copy link
Owner

tj commented Jul 10, 2014

why not just use & like everyone else on the planet :D

@tetsuo
Copy link
Author

tetsuo commented Jul 10, 2014

heh, well semicolons is the new sexy. Resistance is futile.

@jonathanong
Copy link
Contributor

kind of tempted to go full mongodb-retard with querystrings and ;.

?a.b.c=1;key5.0=null;something=else;

and use something like https://github.com/hughsk/flat. heh

@rlidwka
Copy link

rlidwka commented Jul 10, 2014

heh, well semicolons is the new sexy

Yeah, I know quite a few people who have been saving semicolons in their js source code hoping to insert them into query strings instead. :P

@tetsuo
Copy link
Author

tetsuo commented Jul 10, 2014

actually it is quite possible that there are more people who use semicolons in query strings than people who use them correctly in sentences.

@tetsuo tetsuo closed this Nov 26, 2014
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

4 participants