使用方式
const getFunctionAggregation = require('function-name-export');
const content = 'const fn = () => {}';
let result = getFunctionAggregation(content);
支持的函数声明
// fn
const fn = () => {};
// fnA
function fnA() {}
// fnB
const fnB = function () {}
// fnD
const fnC = function fnD() {}
class A {
hello = function() {}
arrow = () => {}
render() {}
}
支持的检测函数执行方式/函数作为值的方式
// js
fn();
await fn();
() => fn();
this.fn();
const a = fn();
return fn;
return [fn];
return {fn};
out(fn);
out([fn]);
out({fn});
const obj = {
hello: fn
}
const arr = [fn];
// jsx
onClick={fn}
onClick={() => fn()}
onClick={fn.bind(null, 123)}
onClick={this.fn}
<div onClick={b}>
{arr.map(item => fn(item))}
</div>
Feature
支持的文件类型
优化