Skip to content

Commit

Permalink
Update: Utilize file.extname in contentIncluded
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jun 17, 2017
1 parent ab4e5a0 commit 0d12aae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,19 @@ function write(file, destPath, options, cb) {
async.eachOf(file.sourceMap.sources, loadSources, callback);
}

var contentIncluded = function (callback) {
function contentIncluded(callback) {

var extension = file.relative.split('.').pop();
var newline = detectNewline(file.contents.toString());
var commentFormatter;

switch (extension) {
case 'css':
// TODO: use formatter from convert-source-map
switch (file.extname) {
case '.css':
commentFormatter = function(url) {
return newline + '/*# sourceMappingURL=' + url + ' */' + newline;
};
break;
case 'js':
case '.js':
commentFormatter = function(url) {
return newline + '//# sourceMappingURL=' + url + newline;
};
Expand Down

0 comments on commit 0d12aae

Please sign in to comment.