A correctly formed query string looks like:
http://baseurl.thing/update?id=123&foo=50&bar20
I want to map this "safely" into an object, but I don't want to end up with undefined values. Is there a nice way of validating the query string?
Details: I want to turn this into an object with the url module. i.e.:
var url_parts = url.parse(request.url, true);
and then I can route based on url_parts.pathname. I want to access url_parts.query.id, url_parts.query.foo and url_parts.query.bar, but only if they all exist and only if no other parameters were supplied, so that I don't get silent undefined values appearing.
queryobject already, so why not just doif (query.id && query.foo && query.bar) { ... }?