You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by gl...@apache.org on 2019/07/08 07:24:16 UTC
[couchdb-nano] branch master updated: get attachment should return
a Buffer (#173)
This is an automated email from the ASF dual-hosted git repository.
glynnbird pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git
The following commit(s) were added to refs/heads/master by this push:
new e5f2e43 get attachment should return a Buffer (#173)
e5f2e43 is described below
commit e5f2e43d6ee89334bb168d888715431bc9badaaf
Author: Glynn Bird <gl...@gmail.com>
AuthorDate: Mon Jul 8 08:24:12 2019 +0100
get attachment should return a Buffer (#173)
---
.npmignore | 3 +++
lib/nano.d.ts | 6 +++---
lib/nano.js | 2 +-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/.npmignore b/.npmignore
index 75d43a3..69ef77e 100644
--- a/.npmignore
+++ b/.npmignore
@@ -1,2 +1,5 @@
tests
scripts
+examples
+coverage
+.github
diff --git a/lib/nano.d.ts b/lib/nano.d.ts
index 506ecaa..ca5a29f 100644
--- a/lib/nano.d.ts
+++ b/lib/nano.d.ts
@@ -350,14 +350,14 @@ declare namespace nano {
contenttype: string,
params: any
): Request
- get(docname: string, attname: string, callback?: Callback<any>): Promise<any>;
+ get(docname: string, attname: string, callback?: Callback<Buffer>): Promise<Buffer>;
getAsStream(docname: string, attname: string): Request;
get(
docname: string,
attname: string,
params: any,
- callback?: Callback<any>
- ): Promise<any>;
+ callback?: Callback<Buffer>
+ ): Promise<Buffer>;
destroy(docname: string, attname: string, callback?: Callback<any>): Promise<any>;
destroy(
docname: string,
diff --git a/lib/nano.js b/lib/nano.js
index 8522a30..d73e634 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -226,7 +226,7 @@ module.exports = exports = function dbScope (cfg) {
}
// prevent bugs where people set encoding when piping
- if (opts.encoding !== undefined && callback) {
+ if (opts.encoding !== undefined) {
req.encoding = opts.encoding
delete req.headers['content-type']
delete req.headers.accept