Created
August 12, 2016 19:21
-
-
Save tmcw/24b1049f367697295accdecd3d413ad5 to your computer and use it in GitHub Desktop.
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
var fs = require('fs'); | |
var path = require('path'); | |
// var utilPath = path.join(path.relative( | |
// path.dirname(process.argv[2]), | |
// path.join(__dirname, './js/lib')), 'd3.combobox.js'); | |
// convert old-fashioned d3 event dispatching with new-fashioned | |
fs.writeFileSync(process.argv[2], | |
fs.readFileSync(process.argv[2], 'utf8').replace(/\sevent\.(\w+)\((.*)?\)/g, function(res, p1, p2) { | |
if (p2) return ' event.call("' + p1 + '", ' + p2 + ')'; | |
return ' event.call("' + p1 + '")'; | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment