Created
July 3, 2016 19:22
-
-
Save DrewML/80b06ca48c445ed48e764b511e36a374 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Determine which `assert.x` methods are used in a codebase | |
// Run with jscodeshift using the --dry option | |
export default function transformer(file, api) { | |
const { jscodeshift: j, stats} = api; | |
const root = j(file.source); | |
root.find(j.CallExpression, { | |
callee: { | |
object: { name: 'assert' } | |
} | |
}).forEach(p => { | |
stats(p.node.callee.property.name); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment