in lib/index.ts [338:362]
function visit(node: ts.Node) {
switch (node.kind) {
case ts.SyntaxKind.Identifier:
if ((node as ts.Identifier).getText() === 'arguments') {
usedArguments = true;
}
break;
case ts.SyntaxKind.ReturnStatement:
const ret = node as ts.ReturnStatement;
if (funcStack.length === 0 && ret.expression && ret.expression.kind !== ts.SyntaxKind.VoidExpression) {
hasReturn = true;
}
}
switch (node.kind) {
case ts.SyntaxKind.FunctionExpression:
case ts.SyntaxKind.FunctionDeclaration:
funcStack.push(true);
ts.forEachChild(node, visit);
funcStack.pop();
default:
ts.forEachChild(node, visit);
break;
}
}