1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-14 02:26:20 +02:00

eslint fixes

This commit is contained in:
Kushagra Gour
2016-12-04 04:08:38 +05:30
parent 888a4c73bb
commit 9ca891f7d0
6 changed files with 43 additions and 31 deletions

View File

@ -21,9 +21,9 @@
}
function generateRandomId(len) {
len = len || 10;
var length = len || 10;
var id = '';
for (var i = len; i--;) {
for (var i = length; i--;) {
id += alphaNum[~~(Math.random() * alphaNum.length)];
}
return id;
@ -38,7 +38,7 @@
function log() {
if (window.DEBUG) {
console.log.apply(console, [].splice.call(arguments, 0));
console.log(...arguments);
}
}
@ -58,7 +58,7 @@
* @param {ASTBody} Body of an AST generated by esprima or any ES compliant AST
*/
function addInfiniteLoopProtection(astBody) {
if (!astBody) return;
if (!astBody) { return; }
if (!Array.isArray(astBody)) {
addInfiniteLoopProtection(astBody.body);
return;
@ -95,7 +95,7 @@
var retVal = d.getDate() + ' '
+ [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'][d.getMonth()] + ' '
+ d.getFullYear();
return retVal;
return retVal;
}
window.utils = {