style: lint code

lint code on files: index.js, poll.js and argument-parser.js
This commit is contained in:
Ali Movahedi 2016-03-28 01:08:42 +04:30
parent e5c25bd9c1
commit 23cff62505
6 changed files with 18 additions and 10 deletions

View File

@ -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;

View File

@ -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);
});
}

View File

@ -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,

View File

@ -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;

View File

@ -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);
});
}

View File

@ -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,