mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix all jshint warnings in core code
This commit is contained in:
@@ -127,7 +127,9 @@ function writeFile(root,path,meta,body,res) {
|
||||
var fn = fspath.join(root,path);
|
||||
var headers = "";
|
||||
for (var i in meta) {
|
||||
headers += "// "+i+": "+meta[i]+"\n";
|
||||
if (meta.hasOwnProperty(i)) {
|
||||
headers += "// "+i+": "+meta[i]+"\n";
|
||||
}
|
||||
}
|
||||
mkdirp(fspath.dirname(fn), function (err) {
|
||||
fs.writeFile(fn,headers+body,function(err) {
|
||||
@@ -255,7 +257,9 @@ var localfilesystem = {
|
||||
var rootPath = fspath.join(libDir,type,path);
|
||||
return promiseDir(root).then(function () {
|
||||
return nodeFn.call(fs.lstat, rootPath).then(function(stats) {
|
||||
if (stats.isFile()) return getFileBody(root,path);
|
||||
if (stats.isFile()) {
|
||||
return getFileBody(root,path);
|
||||
}
|
||||
if (path.substr(-1) == '/') {
|
||||
path = path.substr(0,path.length-1);
|
||||
}
|
||||
@@ -286,7 +290,9 @@ var localfilesystem = {
|
||||
var fn = fspath.join(libDir, type, path);
|
||||
var headers = "";
|
||||
for (var i in meta) {
|
||||
headers += "// "+i+": "+meta[i]+"\n";
|
||||
if (meta.hasOwnProperty(i)) {
|
||||
headers += "// "+i+": "+meta[i]+"\n";
|
||||
}
|
||||
}
|
||||
return promiseDir(fspath.dirname(fn)).then(function () {
|
||||
nodeFn.call(fs.writeFile, fn, headers+body);
|
||||
|
Reference in New Issue
Block a user