Fix all jshint warnings in core code

This commit is contained in:
Nick O'Leary
2014-07-01 23:46:25 +01:00
parent c18119f26e
commit 649c82f7d7
9 changed files with 108 additions and 60 deletions

View File

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