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

querystring and json function names #3

Open
RiskoZoSlovenska opened this issue Feb 22, 2022 · 4 comments
Open

querystring and json function names #3

RiskoZoSlovenska opened this issue Feb 22, 2022 · 4 comments
Labels
proposal Input should be provided

Comments

@RiskoZoSlovenska
Copy link
Contributor

Luvit 2.x's json module provides the functions stringify() and parse() as aliases to the encode() and decode() functions. Node.js's querystring module does the same (technically, the latter are aliases for the former), but Luvit's querystring function only defines stringify() and parse(). Luvit 3.0 would be a good time and place to decide what to name json's and querystring's functions - whether to provide both sets, or just one.

@RiskoZoSlovenska
Copy link
Contributor Author

If I am to throw in my two cents, I personally prefer only having encode()/decode() - their names are similar and obvious, and the lack of aliases reduces confusion.

@truemedian truemedian added the proposal Input should be provided label Feb 22, 2022
@truemedian
Copy link
Owner

I've started with this in ba42b05, and I agree with using encode/decode over stringify/parse as it makes the link between them more obvious

@RiskoZoSlovenska
Copy link
Contributor Author

Keeping only encode/decode may be a challenge with the json module, unless we want to not offer an unmodified copy of dkjson like 2.x does.

@truemedian
Copy link
Owner

What happens to json depends on if we add a better json implementation in luvi itself (like cjson)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Input should be provided
Projects
None yet
Development

No branches or pull requests

2 participants