MCPcopy Index your code
hub / github.com/google/magika / y

Function y

tests_data/basic/javascript/code.js:7–7  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

5*/
6var n=this||self,p=function(a,b){a=a.split(".");var c=n;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}:c[d]=b};function q(){for(var a=r,b={},c=0;c<a.length;++c)b[a[c]]=c;return b}function u(){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZ";a+=a.toLowerCase()+"0123456789-_";return a+"."}var r,v;
7function aa(a){function b(k){for(;d<a.length;){var m=a.charAt(d++),l=v[m];if(null!=l)return l;if(!/^[\s\xa0]*$/.test(m))throw Error("Unknown base64 encoding at char: "+m);}return k}r=r||u();v=v||q();for(var c="",d=0;;){var e=b(-1),f=b(0),h=b(64),g=b(64);if(64===g&&-1===e)return c;c+=String.fromCharCode(e<<2|f>>4);64!=h&&(c+=String.fromCharCode(f<<4&240|h>>2),64!=g&&(c+=String.fromCharCode(h<<6&192|g)))}};var w={},y=function(a){w.TAGGING=w.TAGGING||[];w.TAGGING[a]=!0};var ba=Array.isArray,ca=function(a,b){if(a&&ba(a))for(var c=0;c<a.length;c++)if(a[c]&&b(a[c]))return a[c]},z=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},A=function(a){for(var b in a)if(a.hasOwnProperty(b))return!0;return!1};var B=function(a){this.j=a};B.prototype.toString=function(){return this.j.toString()};var C=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;new B("about:invalid#zClosurez");new B("about:blank");var D=function(){this.i=""};D.prototype.toString=function(){return this.i.toString()};new D;var E=function(){this.h=""};E.prototype.toString=function(){return this.h.toString()};new E;var F=function(){this.g=n.trustedTypes&&n.trustedTypes.emptyHTML||""};F.prototype.toString=function(){return this.g.toString()};new F;var G=window,H=window.history,I=document,J=navigator,K=function(){var a={},b=G.google_tag_data;G.google_tag_data=void 0===b?a:b;return G.google_tag_data},L=function(a,b){I.addEventListener?I.addEventListener(a,b,!1):I.attachEvent&&I.attachEvent("on"+a,b)};var da=function(a){var b=M();b.pending||(b.pending=[]);ca(b.pending,function(c){return c.target.ctid===a.ctid&&c.target.isDestination===a.isDestination})||b.pending.push({target:a,onLoad:void 0})},ea=function(){this.container={};this.destination={};this.canonical={};this.pending=[]},M=function(){var a=K(),b=a.tidr;b||(b=new ea,a.tidr=b);return b};var N=/:[0-9]+$/,Q=function(a,b){b&&(b=String(b).toLowerCase());if("protocol"===b||"port"===b)a.protocol=O(a.protocol)||O(G.location.protocol);"port"===b?a.port=String(Number(a.hostname?a.port:G.location.port)||("http"===a.protocol?80:"https"===a.protocol?443:"")):"host"===b&&(a.hostname=(a.hostname||G.location.hostname).replace(N,"").toLowerCase());return P(a,b)},P=function(a,b,c){var d=O(a.protocol);b&&(b=String(b).toLowerCase());switch(b){case "url_no_fragment":c="";a&&a.href&&(c=a.href.indexOf("#"),
8c=0>c?a.href:a.href.substr(0,c));a=c;break;case "protocol":a=d;break;case "host":a=a.hostname.replace(N,"").toLowerCase();c&&(c=/^www\d*\./.exec(a))&&c[0]&&(a=a.substr(c[0].length));break;case "port":a=String(Number(a.port)||("http"===d?80:"https"===d?443:""));break;case "path":a.pathname||a.hostname||y(1);a="/"===a.pathname.substr(0,1)?a.pathname:"/"+a.pathname;a=a.split("/");0<=[].indexOf(a[a.length-1])&&(a[a.length-1]="");a=a.join("/");break;case "query":a=a.search.replace("?","");break;case "extension":a=
9a.pathname.split(".");a=1<a.length?a[a.length-1]:"";a=a.split("/")[0];break;case "fragment":a=a.hash.replace("#","");break;default:a=a&&a.href}return a},O=function(a){return a?a.replace(":","").toLowerCase():""},R=function(a){var b=I.createElement("a");a&&(b.href=a);var c=b.pathname;"/"!==c[0]&&(a||y(1),c="/"+c);a=b.hostname.replace(N,"");return{href:b.href,protocol:b.protocol,host:b.host,hostname:a,pathname:c,search:b.search,hash:b.hash,port:b.port}};var S;var U=function(){var a=fa,b=ha,c=T(),d=function(h){a(h.target||h.srcElement||{})},e=function(h){b(h.target||h.srcElement||{})};if(!c.init){L("mousedown",d);L("keyup",d);L("submit",e);var f=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(){b(this);f.call(this)};c.init=!0}},ia=function(a,b,c,d,e){a={callback:a,domains:b,fragment:2===c,placement:c,forms:d,sameHost:e};T().decorators.push(a)},V=function(a,b,c){for(var d=T().decorators,e={},f=0;f<d.length;++f){var h=d[f],g;if(g=
10!c||h.forms)a:{g=h.domains;var k=a,m=!!h.sameHost;if(g&&(m||k!==I.location.hostname))for(var l=0;l<g.length;l++)if(g[l]instanceof RegExp){if(g[l].test(k)){g=!0;break a}}else if(0<=k.indexOf(g[l])||m&&0<=g[l].indexOf(k)){g=!0;break a}g=!1}g&&(g=h.placement,void 0==g&&(g=h.fragment?2:1),g===b&&z(e,h.callback()))}return e};function T(){var a=K(),b=a.gl;b&&b.decorators||(b={decorators:[]},a.gl=b);return b};var ja=/(.*?)\*(.*?)\*(.*)/,ka=/([^?#]+)(\?[^#]*)?(#.*)?/;function W(a){return new RegExp("(.*?)(^|&)"+a+"=([^&]*)&?(.*)")}

Callers 4

PFunction · 0.85
RFunction · 0.85
naFunction · 0.85
code.jsFile · 0.85

Calls 10

eaFunction · 0.85
JFunction · 0.85
KeFunction · 0.85
qaFunction · 0.85
aeFunction · 0.85
cfFunction · 0.85
neFunction · 0.85
BFunction · 0.85
IdFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected