THRIFT-5811: Update eslint & prettier
Client: js
Patch: Cameron Martin
This closes #3087
diff --git a/tutorial/nodejs/NodeClientPromise.js b/tutorial/nodejs/NodeClientPromise.js
index e6ff2d7..0ba5f4f 100644
--- a/tutorial/nodejs/NodeClientPromise.js
+++ b/tutorial/nodejs/NodeClientPromise.js
@@ -17,64 +17,62 @@
* under the License.
*/
-var thrift = require('thrift');
-var Calculator = require('./gen-nodejs/Calculator');
-var ttypes = require('./gen-nodejs/tutorial_types');
-const assert = require('assert');
+var thrift = require("thrift");
+var Calculator = require("./gen-nodejs/Calculator");
+var ttypes = require("./gen-nodejs/tutorial_types");
+const assert = require("assert");
var transport = thrift.TBufferedTransport;
var protocol = thrift.TBinaryProtocol;
var connection = thrift.createConnection("localhost", 9090, {
- transport : transport,
- protocol : protocol
+ transport: transport,
+ protocol: protocol,
});
-connection.on('error', function(err) {
+connection.on("error", function (err) {
assert(false, err);
});
// Create a Calculator client with the connection
var client = thrift.createClient(Calculator, connection);
+client.ping().then(function () {
+ console.log("ping()");
+});
-client.ping()
- .then(function() {
- console.log('ping()');
- });
-
-client.add(1,1)
- .then(function(response) {
- console.log("1+1=" + response);
- });
+client.add(1, 1).then(function (response) {
+ console.log("1+1=" + response);
+});
work = new ttypes.Work();
work.op = ttypes.Operation.DIVIDE;
work.num1 = 1;
work.num2 = 0;
-client.calculate(1, work)
- .then(function(message) {
- console.log('Whoa? You know how to divide by zero?');
+client
+ .calculate(1, work)
+ .then(function (message) {
+ console.log("Whoa? You know how to divide by zero?");
})
- .catch(function(err) {
+ .catch(function (err) {
console.log("InvalidOperation " + err);
});
-
work.op = ttypes.Operation.SUBTRACT;
work.num1 = 15;
work.num2 = 10;
-client.calculate(1, work)
- .then(function(value) {
- console.log('15-10=' + value);
- return client.getStruct(1);
+client
+ .calculate(1, work)
+ .then(function (value) {
+ console.log("15-10=" + value);
+ return client.getStruct(1);
})
- .then(function(message) {
- console.log('Check log: ' + message.value);
+ .then(function (message) {
+ console.log("Check log: " + message.value);
})
- .finally(function() {
- //close the connection once we're done
- connection.end();
+ .finally(function () {
+ //close the connection once we're done
+ connection.end();
});