From db037577e239892b94885da3aa0572c1acdef7eb Mon Sep 17 00:00:00 2001 From: Tim Jacobi Date: Sun, 26 Feb 2017 12:30:07 +0000 Subject: [PATCH] formatting --- nano/couchdb-nano-tests.ts | 74 +++++++++----------------------------- 1 file changed, 16 insertions(+), 58 deletions(-) diff --git a/nano/couchdb-nano-tests.ts b/nano/couchdb-nano-tests.ts index 541580e484..de7f050340 100644 --- a/nano/couchdb-nano-tests.ts +++ b/nano/couchdb-nano-tests.ts @@ -20,35 +20,11 @@ const instance: nano.ServerScope = nano("http://localhost:5984 instance.dinosaur("", function (err, response) { }); const url = instance.config.url; -instance.relax({ - method: "POST", - path: "_users", - body: { - _id: "org.couchdb.user:", - type: "user", - name: "ss", - roles: ["admin"], - password: "rf" - } -}, function (err: any) { }); - +instance.relax({ method: "POST", path: "_users", body: { _id: "org.couchdb.user:", type: "user", name: "ss", roles: ["admin"], password: "rf" } }, function (err: any) { }); instance.session(function (error, session) { }); - -instance.request({ - db: "shared_headers", - doc: "new", - headers: {"If-None-Match": JSON.stringify({})} - }, function(error, helloWorld, rh) {}); - -instance.relax({ - db: "document_list", - doc: "_all_docs", - method: "GET", - qs: {limit: 1} - }, function(error, docs) {}); - -instance.auth("", "", function(err: any, _: any, headers: any) {}); - +instance.request({ db: "shared_headers", doc: "new", headers: { "If-None-Match": JSON.stringify({}) } }, function (error, helloWorld, rh) { }); +instance.relax({ db: "document_list", doc: "_all_docs", method: "GET", qs: { limit: 1 } }, function (error, docs) { }); +instance.auth("", "", function (err: any, _: any, headers: any) { }); instance.uuids(3, function (error, data) { }); /* @@ -57,11 +33,11 @@ instance.uuids(3, function (error, data) { }); const db: nano.DatabaseScope = instance.db; db.create("az09_$()+-/", function (err) { }); -db.get("database_get", function(error, response) {}); -db.destroy("_users", function() {}); -db.list(function(error, list) {}); -db.replicate(instance.use("a"), instance.use("b"), function(error: any) {}); -db.replicate("a", "b", function(error: any) {}); +db.get("database_get", function (error, response) { }); +db.destroy("_users", function () { }); +db.list(function (error, list) { }); +db.replicate(instance.use("a"), instance.use("b"), function (error: any) { }); +db.replicate("a", "b", function (error: any) { }); /* @@ -75,15 +51,7 @@ mydb.get("foobaz", { "revs_info": true }, function (error, foobaz) { }); mydb.head("foobaz", function (error, body, headers) { }); mydb.copy("foo_src", "foo_dest", { overwrite: true }, function (error, response, headers) { }); mydb.destroy(undefined, undefined, function (error, response) { }); -mydb.bulk( - { - "docs": [ - { "key": "baz", "name": "bazzel" }, - { "key": "bar", "name": "barry" } - ] - }, - function (error: any, response: any) { } -); +mydb.bulk({ "docs": [{ "key": "baz", "name": "bazzel" }, { "key": "bar", "name": "barry" }] }, function (error: any, response: any) { }); mydb.list(function (error: any, docs: any) { }); mydb.fetch({ keys: ["foobar"] }, function (error: any, docs: any) { }); mydb.fetchRevs({ keys: ["foobar"] }, function (error: any, docs: any) { }); @@ -92,27 +60,17 @@ mydb.compact(function (error) { }); const feed = mydb.follow({ since: "0" }); feed.on("change", function (change: any) { }); mydb.atomic("update", "addbaz", "baz", function (error: any, response: any) { }); -mydb.viewWithList("people", "by_name_and_city", "my_list", { - key: [ - "Derek", - "San Francisco" - ] -}, function (error, list) { } -); -mydb.view("alice", "by_id", { - keys: ["foobar", "barfoo"], - "include_docs": true -}, function (err, view) { } -); -mydb.show("people", "singleDoc", "p_clemens", function(error: any, doc: any, rh: any) {}); -mydb.replicate("database_replica", function(error: any) {}); +mydb.viewWithList("people", "by_name_and_city", "my_list", { key: ["Derek", "San Francisco"] }, function (error, list) { }); +mydb.view("alice", "by_id", { keys: ["foobar", "barfoo"], "include_docs": true }, function (err, view) { }); +mydb.show("people", "singleDoc", "p_clemens", function (error: any, doc: any, rh: any) { }); +mydb.replicate("database_replica", function (error: any) { }); mydb.attachment.insert("new", "att", "Hello World!", "text/plain", function (error: any, att: any) { }); mydb.attachment.destroy("new", "att", { rev: "123" }, function (error, response) { }); mydb.attachment.get("new_string", "att", function (error: any, helloWorld: any) { }); -mydb.multipart.insert({"foo": "baz"}, [{}], "foobaz", function(error, foo) {}); -mydb.multipart.get("foobaz", function(error: any, foobaz: any, headers: any) {}); +mydb.multipart.insert({ "foo": "baz" }, [{}], "foobaz", function (error, foo) { }); +mydb.multipart.get("foobaz", function (error: any, foobaz: any, headers: any) { }); const rs = fs.createReadStream(""); const is = mydb.attachment.insert("nodejs", "logo.png", null, "image/png");