UNPKG

@ea-lab/reactive-json

Version:

A REACT-based lib that transforms JSON (or YAML) into interactive HTML markup.

26 lines (25 loc) 644 B
import { dataLocationToPath as n, evaluateTemplateValueCollection as u } from "../../engine/TemplateSystem.js"; import { l as r } from "../../lodash-CYNxjS-I.js"; const i = (o) => { const { globalDataContext: t, templateContext: a } = o, { path: l, value: c } = o.args; if (l === void 0) return; const d = n({ currentPath: a.templatePath, dataLocation: l, globalDataContext: t, templateContext: a }), e = u({ valueToEvaluate: c, globalDataContext: t, templateContext: a }); t == null || t.updateData( typeof e != "object" ? e : r.cloneDeep(e), d, "add" ); }; export { i as addData };