@react-form-builder/core
Version:
React JSON Schema Form Builder to create complex, validated, reusable forms with no deep React knowledge required
20 lines (19 loc) • 598 B
JavaScript
import { isString as i } from "../../../utils/isString.js";
import { replaceDotsDeep as p } from "./dots.js";
const l = (e) => e.replaceAll("{", '{"{"}').replaceAll("}", '{"}"}'), a = (e) => {
const t = i(e), n = t ? e : JSON.stringify(e), r = (t ? n : l(n)).split(`
`);
if (r.length <= 1) return r[0] ?? "";
const [s, ...o] = r;
return [
s ?? "",
...o.map((c) => ` ${c}`)
].join(`
`);
}, g = (e) => Object.entries(e).map(([t, n]) => `${t} = ${a(p(n))}`).join(`
`);
export {
a as fluentEncodeValue,
g as objectToFluentResource
};
//# sourceMappingURL=fluentResource.js.map