@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
32 lines • 1.56 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataflowQueryDefinition = void 0;
const dataflow_query_executor_1 = require("./dataflow-query-executor");
const ansi_1 = require("../../../util/text/ansi");
const time_1 = require("../../../util/text/time");
const joi_1 = __importDefault(require("joi"));
const df_helper_1 = require("../../../dataflow/graph/df-helper");
exports.DataflowQueryDefinition = {
executor: dataflow_query_executor_1.executeDataflowQuery,
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
const out = queryResults;
result.push(`Query: ${(0, ansi_1.bold)('dataflow', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
result.push(` ╰ [Dataflow Graph](${df_helper_1.Dataflow.visualize.mermaid.url(out.graph)})`);
return true;
},
schema: joi_1.default.object({
type: joi_1.default.string().valid('dataflow').required().description('The type of the query.'),
}).description('The dataflow query simply returns the dataflow graph, there is no need to pass it multiple times!'),
flattenInvolvedNodes: queryResults => {
const flattened = [];
const out = queryResults;
for (const id of out.graph.idMap?.keys() ?? []) {
flattened.push(id);
}
return flattened;
}
};
//# sourceMappingURL=dataflow-query-format.js.map