diff --git a/types/couchbase/couchbase-tests.ts b/types/couchbase/couchbase-tests.ts index d04b71c907..e6ea7c12d3 100644 --- a/types/couchbase/couchbase-tests.ts +++ b/types/couchbase/couchbase-tests.ts @@ -31,6 +31,11 @@ bucket.manager().createPrimaryIndex(function() { }); }); +// Ensure bucket.upsert is composable with normal callbacks +function composable(callback: (err?: Error) => void) { + bucket.upsert('key', {value: 1}, callback); +} + // From https://developer.couchbase.com/documentation/server/current/sdk/nodejs/n1ql-queries-with-sdk.html function n1ql_a() { const n1qlquery = N1qlQuery.fromString('SELECT name, email FROM users WHERE name=$1'); diff --git a/types/couchbase/index.d.ts b/types/couchbase/index.d.ts index f55ac6dbe9..813ee8f110 100644 --- a/types/couchbase/index.d.ts +++ b/types/couchbase/index.d.ts @@ -2019,10 +2019,10 @@ declare namespace Bucket { */ interface OpCallback { /** - * @param error The error for the operation. This can either be an Error object or a value which evaluates to false (null, undefined, 0 or false). + * @param error The error for the operation. This can either be an Error object or a value which evaluates to false. * @param result The result of the operation that was executed. This usually contains at least a cas property, and on some operations will contain a value property as well. */ - (error: CouchbaseError | number, result: any): void; + (error: CouchbaseError | null, result: any): void; } /**