Skip to content

Commit

Permalink
fix: make --all flag work with files with extensions other than .js (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rundef authored and bcoe committed Jul 24, 2016
1 parent a0c87bc commit d0a8674
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,17 @@ NYC.prototype.addFile = function (filename) {
}
}

NYC.prototype._readTranspiledSource = function (path) {
NYC.prototype._readTranspiledSource = function (filePath) {
var source = null
Module._extensions['.js']({
var ext = path.extname(filePath)
if (typeof Module._extensions[ext] === 'undefined') {
ext = '.js'
}
Module._extensions[ext]({
_compile: function (content, filename) {
source = content
}
}, path)
}, filePath)
return source
}

Expand Down

0 comments on commit d0a8674

Please sign in to comment.