1 | {"version":3,"file":"json-from-script.umd.js","sources":["../index.js"],"sourcesContent":["module.exports = function(className, attr) {\n return Array.from(\n document.getElementsByClassName(className || 'data')\n ).reduce(function(data, element) {\n return (data[\n element.getAttribute('data-' + (attr || 'attribute'))\n ] = JSON.parse(\n element.textContent\n .replace(/&/g, '&')\n .replace(/"/g, '\"')\n .replace(/'/g, \"'\")\n .replace(/</g, '<')\n .replace(/>/g, '>')\n )), data;\n }, {});\n};\n"],"names":["module","exports","className","attr","Array","from","document","getElementsByClassName","reduce","data","element","getAttribute","JSON","parse","textContent","replace"],"mappings":"0IAAAA,OAAOC,QAAU,SAASC,EAAWC,GACnC,OAAOC,MAAMC,KACXC,SAASC,uBAAuBL,GAAa,SAC7CM,OAAO,SAASC,EAAMC,GACtB,OAAQD,EACNC,EAAQC,aAAa,SAAWR,GAAQ,eACtCS,KAAKC,MACPH,EAAQI,YACLC,QAAQ,SAAU,KAClBA,QAAQ,UAAW,KACnBA,QAAQ,SAAU,KAClBA,QAAQ,QAAS,KACjBA,QAAQ,QAAS,MAClBN"} |