JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgithub.com/jrideout/melt.js/master/melt.js"></script>
Origional:
<pre id="old">
[{"Pass": "10", "Fail": "20", "Untested": "40"},
{"Pass": "20", "Fail": "40", "Untested": "50"},
{"Pass": "20", "Fail": "40", "Untested": "50", "extra": "2"},
{"Pass": "30", "Fail": "50", "Untested": "60"}]
</pre>
Melted:
<pre id="new">
</pre>
CSS
pre {
border: 1px dashed;
padding: 4px;
white-space: pre-wrap;
}
JavaScript
var old = document.getElementById("old").textContent,
old = JSON.parse(old);
var moltenObject = melt(old);
document.getElementById("new").textContent = JSON.stringify(moltenObject,null);