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:
10
src/utils.js
10
src/utils.js
@ -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 = {
|
||||
|
Reference in New Issue
Block a user