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
support passing most qs options to restify.queryParser #1209
Conversation
@yunong @DonutEspresso poke. Thanks. My intention is to:
Yunong, if you recall, you and I discussed this work ages ago in private chat. |
Oh, also, I'd like to do the 'make cutarelease' Makefile task for node-restify.git as I did for restify/clients.git (restify/clients@d691925) |
plainObjects: true, | ||
allowDots: true | ||
}; | ||
Object.keys(EXPOSED_QS_OPTIONS).forEach(function (k) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the performance impact of Object.keys, but presumably you could use https://www.npmjs.com/package/lodash.foreach to optimize this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restify 4.x doesn't have a dep on any lodash modules. I don't think adding a dep is justified for this here. If iteration code is in a hot path I typically use for (var i = 0; i < arr.length; i++) ...
which is typically much faster. However, this isn't a hot path at all: it is in section of queryParser that is just called once at server or endpoint setup. It isn't called for every request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough :)
allowDots: true | ||
}; | ||
Object.keys(EXPOSED_QS_OPTIONS).forEach(function (k) { | ||
EXPOSED_QS_OPTIONS[k](options[k], k); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind dropping a comment to describe what's happening here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
LGTM, feel free to merge. |
Thanks! |
restify@4.2.0 published with this |
Fixes #925