Skip to content

Instantly share code, notes, and snippets.

View rosswarren's full-sized avatar
⌨️
typing

Ross Warren rosswarren

⌨️
typing
View GitHub Profile
// Press ctrl+space for code completion
export default function transformer(file, api) {
const j = api.jscodeshift;
return j(file.source)
.find(j.CallExpression)
.filter(x => x.node.callee.object && x.node.callee.object.name === "assert")
.filter(x => x.node.callee.property && x.node.callee.property.name === "isFalse")
.filter(x => x.node.arguments.length > 0 && x.node.arguments[0].property && x.node.arguments[0].property.name === "called")
.forEach(path => {