UNPKG

libxslt-wasm

Version:

JavaScript bindings for libxslt compiled to WebAssembly

18 lines (17 loc) 597 B
import { StringPtrArray } from "../common/StringPtrArray.js"; // If you see errors when passing params, considering double quoting params so // they are considered literals rather than XPath expressions const parseXsltParams = (params) => { if (params === undefined) { return null; } const entries = Object.entries(params); if (entries.length === 0) { return null; } const paramArray = entries .map(([key, value]) => [key, String(value)]) .flat(1); return StringPtrArray.fromStringArray(paramArray, true); }; export { parseXsltParams };