@ea-lab/reactive-json
Version:
A REACT-based lib that transforms JSON (or YAML) into interactive HTML markup.
18 lines (17 loc) • 389 B
JavaScript
const r = {
class: "className",
for: "htmlFor"
}, a = (t) => {
if (typeof t != "object" || Object.keys(t).length === 0)
return {};
const e = {};
for (const [o, n] of Object.entries(t)) {
const s = c(o);
e[s] = n;
}
return e;
}, c = (t) => r.hasOwnProperty(t) ? r[t] : t;
export {
c as normalizeAttributeNameForReactJsx,
a as normalizeAttributesForReactJsx
};