JSFiddle - React, Tailwind, and code Playground
HTML
<pre></pre>
JavaScript
var ret = {},
str = "param1:'test1' && param2:'test2'";
str.replace(/(\b[^:]+):'([^']+)'/g, function ($0, param, value) {
ret[param] = value;
});
if (window.JSON)
$("pre").text(JSON.stringify(ret, null, 4))
else
$("pre").text("JSON.stringify not supported in this browser, so I can't output the result :-p");