Skip to content

Instantly share code, notes, and snippets.

@DrewML
Created July 3, 2016 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DrewML/80b06ca48c445ed48e764b511e36a374 to your computer and use it in GitHub Desktop.
Save DrewML/80b06ca48c445ed48e764b511e36a374 to your computer and use it in GitHub Desktop.
// 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