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

Refactor `internals.shortcut` to have a fixed signature. #32

Closed
totherik opened this issue Aug 14, 2014 · 0 comments · Fixed by #37
Closed

Refactor `internals.shortcut` to have a fixed signature. #32

totherik opened this issue Aug 14, 2014 · 0 comments · Fixed by #37
Assignees
Milestone

Comments

@totherik
Copy link
Contributor

@totherik totherik commented Aug 14, 2014

Per #28:

We don't support dynamic APIs for runtime functions.

The internals.shortcut method (via HTTP verb convenience APIs) breaks this convention by allowing any combination of optional options, and callback arguments, e.g. get(uri, [options], [callback]);. As a performance optimization the signature should always be additive, requiring arguments to be provided for each position: get(uri, [options [, callback]]);

For example, to omit the options argument on get, one should:

Nipple.get(uri, null, function (err, res, payload)) {
 //...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.