forked from ReactiveX/rxjs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(code coverage): remap multi staged commonjs sourcemap into orig…
…inal typescript code closes ReactiveX#558
- Loading branch information
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var fs = require('fs-extra'); | ||
var glob = require('glob'); | ||
var jsonfile = require('jsonfile'); | ||
var transfer = require('multi-stage-sourcemap').transfer; | ||
|
||
glob('dist/es6/**/*.js.map', null, function (er, files) { | ||
files.forEach(function (file) { | ||
var source = jsonfile.readFileSync(file); | ||
var destFile = file.replace('es6', 'cjs'); | ||
var dest = jsonfile.readFileSync(destFile); | ||
|
||
var transferred = transfer({ fromSourceMap: JSON.stringify(dest), | ||
toSourceMap: JSON.stringify(source) }); | ||
|
||
fs.unlink(destFile); | ||
jsonfile.writeFile(destFile, transferred, function (err) { | ||
if (err) { | ||
console.log(err); | ||
} | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters