UNPKG

rhombic

Version:

SQL parsing, lineage extraction and manipulation

28 lines 851 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.printFilter = void 0; /** * Return the filter as a string. * * @param input filter tree */ const printFilter = (input) => input .map(item => { if (item.type === "operator") { return (")".repeat(item.closeParentheses.length) + (item.operator ? ` ${item.operator} ` : "") + "(".repeat(item.openParentheses.length)); } else { if (["in", "not in"].includes(item.operator)) { return `${item.dimension} ${item.operator} ${item.value ? `(${item.value})` : ""}`; } else { return `${item.dimension} ${item.operator} ${item.value ? `${item.value}` : ""}`; } } }) .join("") .trim(); exports.printFilter = printFilter; //# sourceMappingURL=printFilter.js.map