nycJSorg/angular-presentation

View on GitHub
apps/kirjs/src/app/modules/ast/samples/find-debugger/traverse-debugger-babel.solved.ts

Summary

Maintainability
A
0 mins
Test Coverage
function traverseDebuggerSolved(code, { babylon, babelTraverse, log }) {
  const ast = babylon.parse(code);

  let hasCode = false;
  babelTraverse(ast, {
    DebuggerStatement: () => {
      hasCode = true;
    }
  });
  return hasCode;
}