From 23cff62505465f0c169815627ad12ef25eff3de3 Mon Sep 17 00:00:00 2001 From: Ali Movahedi Date: Mon, 28 Mar 2016 01:08:42 +0430 Subject: [PATCH] style: lint code lint code on files: index.js, poll.js and argument-parser.js --- build/functions/argument-parser.js | 8 ++++++-- build/functions/poll.js | 4 +++- build/index.js | 2 -- src/functions/argument-parser.js | 8 ++++++-- src/functions/poll.js | 4 +++- src/index.js | 2 -- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/build/functions/argument-parser.js b/build/functions/argument-parser.js index 81bc264..a1417ef 100644 --- a/build/functions/argument-parser.js +++ b/build/functions/argument-parser.js @@ -49,7 +49,9 @@ function argumentParser(format, string) { string = string.replace(/[^\s]+/, '').trim(); format = format.replace(/[^\s]+/, '').trim(); - if (!format) return { args: {}, params: {} }; + if (!format) { + return { args: {}, params: {} }; + } var indexes = [], params = {}; @@ -77,7 +79,9 @@ function argumentParser(format, string) { return getFormat(null, 'rest'); }); - if (!string) return { args: {}, params: params }; + if (!string) { + return { args: {}, params: params }; + } indexes = indexes.sort(function (a, b) { return a.offset < b.offset ? -1 : 1; diff --git a/build/functions/poll.js b/build/functions/poll.js index 8eabd3f..6698138 100644 --- a/build/functions/poll.js +++ b/build/functions/poll.js @@ -11,7 +11,9 @@ function poll(bot) { } bot.emit('update', response.result); - if (bot._stop) return null; + if (bot._stop) { + return null; + } return poll(bot); }); } diff --git a/build/index.js b/build/index.js index 4524dec..cf68987 100644 --- a/build/index.js +++ b/build/index.js @@ -69,8 +69,6 @@ var DEFAULTS = { var REQUIRED = 0; -console.log(_poll2.default); - /** * Bot class used to connect to a new bot * Bots have an api property which gives access to all Telegram API methods, diff --git a/src/functions/argument-parser.js b/src/functions/argument-parser.js index 9ed7460..48376a0 100644 --- a/src/functions/argument-parser.js +++ b/src/functions/argument-parser.js @@ -40,7 +40,9 @@ export default function argumentParser(format, string) { string = string.replace(/[^\s]+/, '').trim(); format = format.replace(/[^\s]+/, '').trim(); - if (!format) return {args: {}, params: {}}; + if (!format) { + return {args: {}, params: {}}; + } let indexes = [], params = {}; @@ -64,7 +66,9 @@ export default function argumentParser(format, string) { return getFormat(null, 'rest'); }); - if (!string) return {args: {}, params}; + if (!string) { + return {args: {}, params}; + } indexes = indexes.sort((a, b) => { return a.offset < b.offset ? -1 : 1; diff --git a/src/functions/poll.js b/src/functions/poll.js index 669a8f5..eb71b03 100644 --- a/src/functions/poll.js +++ b/src/functions/poll.js @@ -5,7 +5,9 @@ export default function poll(bot) { } bot.emit('update', response.result); - if (bot._stop) return null; + if (bot._stop) { + return null; + } return poll(bot); }); } diff --git a/src/index.js b/src/index.js index 1909af4..5f909ac 100644 --- a/src/index.js +++ b/src/index.js @@ -21,8 +21,6 @@ const DEFAULTS = { const REQUIRED = 0; -console.log(poll); - /** * Bot class used to connect to a new bot * Bots have an api property which gives access to all Telegram API methods,