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

Should qss check for object properties and bail if there is none? #9

Closed
mattpilott opened this issue Apr 5, 2020 · 5 comments
Closed

Comments

@mattpilott
Copy link

Hey Luke,

I ran into something today and after looking at the qss code wondered if it should return an empty string if the object passed to encode has no children/properties?

Just an idea, wondered what your take was on it

@lukeed
Copy link
Owner

lukeed commented Apr 5, 2020

Hey, that should already be the case. What are you passing in?

@mattpilott
Copy link
Author

Hey, yes you are right my mistake the reason i asked is todo with the prefix still being output

encode({}, '?') = '?' for example

@lukeed
Copy link
Owner

lukeed commented Apr 5, 2020

Gotcha

No I think that's fine. That prefix is used for more than just a ? - for example, many pass their full API endpoint as the prefix to get a return value.

Plus /foo is effectively the same as /foo?.

IMO, any conditionality will have to exist on your end if you want it

@mattpilott
Copy link
Author

Ok no problem, thanks for your time!

@lukeed
Copy link
Owner

lukeed commented Apr 5, 2020

Not a problem, thanks :)

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

No branches or pull requests

2 participants