UNPKG

@nodesecure/js-x-ray

Version:
26 lines 757 B
// Import Internal Dependencies import { getCallExpressionIdentifier } from "../estree/index.js"; function validateNode(node, ctx) { const { tracer } = ctx.sourceFile; const id = getCallExpressionIdentifier(node); if (id === null) { return [false]; } const data = tracer.getDataFromIdentifier(id); return [data !== null && data.identifierOrMemberExpr === "fetch"]; } function initialize(ctx) { const { sourceFile } = ctx; sourceFile.tracer.trace("fetch", { followConsecutiveAssignment: true }); } function main(_node, { sourceFile }) { sourceFile.flags.add("fetch"); } export default { name: "isFetch", validateNode, initialize, main, breakOnMatch: false }; //# sourceMappingURL=isFetch.js.map