Given the URLs:
Passing through the code:
var queryData = url.parse(request.url, true).query;
if (queryData["s"]) {
console.log("s present in hash");
} else {
console.log("s NOT present in hash");
}
I would expect URLs 1 and 2 to test true. They do in other langs/libs I have used before. In querystring parsing code they do not treat #2 as { "s" : null } it just doesn't put s in the hash.
Is there another node package I should use if I want this behavior or another way I should be able to test for s var in the querystring?
if (queryData["s"] && queryData["s"].length > 0) {