Last active
March 31, 2016 15:15
-
-
Save tmcw/402de01c0b9c7851402303461e013e0e 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
module.exports = function (file, api) { | |
const j = api.jscodeshift; | |
return j(file.source) | |
.find(j.NewExpression) | |
.filter(p => p.value.callee && p.value.callee.name === 'Object') | |
.replaceWith(p => p.value.arguments[0]) | |
.toSource(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment