syphonx-core
Version:
SyphonX is a template-driven solution for extracting data from HTML in a highly efficient way. It combines the power of jQuery, Regular Expressions, and Javascript into a declarative template-driven format that extracts and reshapes HTML data into JSON.
13 lines • 593 B
JavaScript
import { Controller } from "./controller.js";
import { flattenTemplateSelect } from "./utilities.js";
import { unwrap } from "./lib/unwrap.js";
export function select(selects, options = {}) {
if (!Array.isArray(selects) && typeof selects === "object" && selects !== null && selects.hasOwnProperty("actions"))
selects = flattenTemplateSelect(selects.actions);
const controller = new Controller(options);
let data = controller.select(selects);
if (options.unwrap)
data = unwrap(data);
return { ...controller.state, data };
}
//# sourceMappingURL=select.js.map