UNPKG

indicative-compiler

Version:

Indicative compiler to compile parsed schema into highly optimized functions

28 lines (27 loc) 668 B
"use strict"; /** * @module compiler/sanitizer */ Object.defineProperty(exports, "__esModule", { value: true }); /** * Executor is meant to execute the compiled functions with runtime * data. */ class Executor { constructor(fns) { this.fns = fns; } /** * Executes the compiled functions in sequence. */ exec(data, config) { /** * Creating a root data node. The `tip` and `pointer` will be copied * and mutated down the road */ const root = { tip: data, original: data }; this.fns.forEach((fn) => fn.exec(root, config)); return data; } } exports.Executor = Executor;