UNPKG

854 BJavaScriptView Raw
1export default (fileInfo, api) => {
2 const j = api.jscodeshift;
3 return j(fileInfo.source)
4 .find(j.FunctionExpression)
5 .forEach(path => {
6 console.warn("-- Console oa", path.value );
7 })
8 .toSource();
9 // return j(fileInfo.source)
10 // .find(j.CallExpression, {
11 // callee: {
12 // type: "MemberExpression",
13 // object: { type: "Identifier", name: "function" }
14 // }
15 // })
16 // .remove()
17 // .toSource();
18 // return api
19 // .jscodeshift(fileInfo.source)
20 // .find(j.CallExpression, {
21 // callee: {
22 // type: "MemberExpression",
23 // object: { type: "Identifier", name: "function" }
24 // }
25 // })
26 // .renameTo("zebra")
27 // .toSource();
28};