UNPKG

get-metadata

Version:

A utility function for querying and normalizing DOM metadata content

2 lines 437 B
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.getMetadata=t()}(this,function(){return function(e,t){var n=(t&&t.key||"name")+'="'+e+'"',o=document.querySelector("meta["+n+"]");if(o){var r=o.getAttribute("content");try{return JSON.parse(r)}catch(e){return r}}else t&&t.warn&&console.warn("Element <meta "+n+"> does not exist")}}); //# sourceMappingURL=get-metadata.min.js.map