eslint-plugin-mocha
Version:
Eslint rules for mocha.
28 lines • 1.07 kB
JavaScript
import { collectCallbackHandlingNodes } from "./callback-handling-node-collector.js";
import { getCodeAfterCallbackHandlingNode } from "./callback-handling-state.js";
function getRepeatedCallbackHandlingNode(context, pathState, operation) {
const repeatedNodeByOperationType = {
callbackHandoff() {
return undefined;
},
bindingAssignment() {
return undefined;
},
containerPropertyAssignment() {
return undefined;
},
call() {
if (!pathState.callbackHandled) {
return undefined;
}
return getCodeAfterCallbackHandlingNode(context.sourceCode, pathState, operation) === undefined
? operation.node
: undefined;
}
};
return repeatedNodeByOperationType[operation.type]();
}
export function collectRepeatedCallbackHandlingNodes(context) {
return collectCallbackHandlingNodes(context, getRepeatedCallbackHandlingNode);
}
//# sourceMappingURL=repeated-callback-handling-paths.js.map