garrensmith commented on a change in pull request #102: Promise support for
Nano - Issue 98
URL: https://github.com/apache/couchdb-nano/pull/102#discussion_r203308486
##########
File path: lib/nano.js
##########
@@ -738,6 +825,25 @@ module.exports = exports = nano = function dbScope(cfg) {
}, callback);
}
+ function insertAttAsStream(docName, attName, att, contentType, qs,
callback) {
+ if (typeof qs === 'function') {
Review comment:
we have this check everywhere. You could consider a function that does this
everywhere for us.
```
const {qs, callback} = getCallback(qs0, callback0);
function getCallback (opts, callback) {
if (typeof opts === 'function') {
callback = opts;
qs = {};
}
return {
qs,
callback
};
}
```
It might make things a little neater. I know we do something similar in
PouchDB.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services