in packages/babel-plugin-idx/src/babel-plugin-idx.js [234:245]
Program(path, state) {
const importName = state.opts.importName || 'idx';
// If there can't reasonably be an idx call, exit fast.
if (importName !== 'idx' || idxRe.test(state.file.code)) {
// We're very strict about the shape of idx. Some transforms, like
// "babel-plugin-transform-async-to-generator", will convert arrow
// functions inside async functions into regular functions. So we do
// our transformation before any one else interferes.
const newState = {file: state.file, importName};
path.traverse(declareVisitor, newState);
}
},