grunt-decomment
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "grunt-decomment", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Removes comments from JSON, JavaScript, CSS, HTML, etc.", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -9,13 +9,17 @@ 'use strict'; | ||
var files = this.files.filter(function (f) { | ||
if (grunt.file.exists(f.src[0])) { | ||
return true; | ||
} | ||
grunt.log.warn('Source file "' + f.src + '" not found.'); | ||
}); | ||
var files = this.files.map(function (f) { | ||
var result = { | ||
src: f.orig.src.length ? f.orig.src[0] : '', | ||
dest: f.dest | ||
} | ||
if (grunt.file.exists(result.src)) { | ||
return result; | ||
} | ||
grunt.log.warn('Source file "' + result.src + '" not found.'); | ||
return null; | ||
}) | ||
.filter(function (f) { | ||
return !!f; | ||
}); | ||
if (!files.length) { | ||
return; | ||
} | ||
var type, opt = this.options(); | ||
@@ -36,4 +40,3 @@ | ||
files.forEach(function (f) { | ||
var src = f.src[0]; | ||
var code = grunt.file.read(src); | ||
var code = grunt.file.read(f.src); | ||
var result; | ||
@@ -43,3 +46,3 @@ try { | ||
} catch (e) { | ||
grunt.log.warn("Failed to decomment file '" + src + "'"); | ||
grunt.log.warn("Failed to decomment file '" + f.src + "'"); | ||
throw e; | ||
@@ -46,0 +49,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4883
43