gulp-sourcemaps
Advanced tools
Comparing version 2.6.4 to 2.6.5
{ | ||
"name": "gulp-sourcemaps", | ||
"version": "2.6.4", | ||
"version": "2.6.5", | ||
"description": "Source map support for Gulp.js", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/gulp-sourcemaps/gulp-sourcemaps", |
@@ -22,36 +22,34 @@ 'use strict'; | ||
var commentFormatters = { | ||
css: function cssCommentFormatter(preLine, newline, url) { | ||
return preLine + "/*# sourceMappingURL=" + url + " */" + newline; | ||
}, | ||
js: function jsCommentFormatter(preLine, newline, url) { | ||
return preLine + "//# sourceMappingURL=" + url + newline; | ||
}, | ||
'default': function defaultFormatter() { | ||
return ''; | ||
} | ||
} | ||
var getCommentFormatter = function (file) { | ||
var extension = file.relative.split('.').pop(), | ||
fileContents = file.contents.toString(), | ||
newline = detectNewline.graceful(fileContents || ''), | ||
commentFormatter = function(url) { | ||
return ''; | ||
}; | ||
fileContents = file.contents.toString(), | ||
newline = detectNewline.graceful(fileContents || ''); | ||
if (file.sourceMap.preExistingComment){ | ||
debug(function() { return 'preExistingComment commentFormatter'; }); | ||
commentFormatter = function(url) { | ||
return "//# sourceMappingURL=" + url + newline; | ||
}; | ||
return commentFormatter; | ||
} | ||
var commentFormatter = commentFormatters.default; | ||
switch (extension) { | ||
case 'css': | ||
debug(function() { return 'css commentFormatter';}); | ||
commentFormatter = function(url) { | ||
return newline + "/*# sourceMappingURL=" + url + " */" + newline; | ||
}; | ||
break; | ||
case 'js': | ||
debug(function() { return 'js commentFormatter'; }); | ||
commentFormatter = function(url) { | ||
return newline + "//# sourceMappingURL=" + url + newline; | ||
}; | ||
break; | ||
default: | ||
debug(function() { return 'unknown commentFormatter'; }); | ||
if (file.sourceMap.preExistingComment) { | ||
commentFormatter = (commentFormatters[extension] || commentFormatter).bind(undefined, '', newline) | ||
debug(function () { | ||
return 'preExistingComment commentFormatter ' + commentFormatter.name; | ||
}); | ||
} else { | ||
commentFormatter = (commentFormatters[extension] || commentFormatter).bind(undefined, newline, newline); | ||
} | ||
debug(function () { | ||
return 'commentFormatter ' + commentFormatter.name; | ||
}); | ||
return commentFormatter; | ||
@@ -58,0 +56,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
35371
505