I am trying to change CSS properties like this one.
-moz-border-radius
To the JavaScript CSS property like so.
MozBorderRadius
if you need to convert an entire object of hypen-delimited keys to camelCase:
const css2js = (obj) => Object.fromEntries(Object.entries(obj).map(x => [x[0].replace(/(-)([a-z])/g, c => c[1].toUpperCase()), x[1]]));
example
const a = {
"background-color": "#00aa",
marginTop: "10px"
};
console.log(css2js(a)); // {backgroundColor: "#00aa", marginTop: "10px"}
https://codepen.io/oriadam/pen/eYBNeyP