dd-trace
Version:
Datadog APM tracing client for JavaScript
1 lines • 3.26 kB
JavaScript
(()=>{var e={"./source-map/lib/url.js":function(e,t,r){"use strict";e.exports="function"==typeof URL?URL:r("url").URL},url:function(e){"use strict";e.exports=require("url")}},t={},r={};(()=>{let n=function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n](u,u.exports,r),u.exports}("./source-map/lib/url.js");r.getArg=function(e,t,r){if(t in e)return e[t];if(3==arguments.length)return r;throw Error('"'+t+'" is a required argument.')};let o=!("__proto__"in Object.create(null));function u(e){return e}function i(e){if(!e)return!1;let t=e.length;if(t<9||95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(let r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function l(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}r.toSetString=o?u:function(e){return i(e)?"$"+e:e},r.fromSetString=o?u:function(e){return i(e)?e.slice(1):e},r.compareByGeneratedPositionsInflated=function(e,t){let r=e.generatedLine-t.generatedLine;return 0!==r||0!=(r=e.generatedColumn-t.generatedColumn)||0!==(r=l(e.source,t.source))||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r:l(e.name,t.name)},r.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))};let a="http:",c=`${a}//host`;function s(e){return t=>{let r=g(t),o=h(t),u=new n(t,o);e(u);let i=u.toString();return"absolute"===r?i:"scheme-relative"===r?i.slice(a.length):"path-absolute"===r?i.slice(c.length):m(o,i)}}function f(e,t){return new n(e,t).toString()}function h(e){let t=e.split("..").length-1,r=function(e,t){let r=0;for(;;){let e="p"+r++;if(-1===t.indexOf(e))return e}}(0,e),n=`${c}/`;for(let e=0;e<t;e++)n+=`${r}/`;return n}let p=/^[A-Za-z0-9\+\-\.]+:/;function g(e){return"/"===e[0]?"/"===e[1]?"scheme-relative":"path-absolute":p.test(e)?"absolute":"path-relative"}function m(e,t){"string"==typeof e&&(e=new n(e)),"string"==typeof t&&(t=new n(t));let r=t.pathname.split("/"),o=e.pathname.split("/");for(o.length>0&&!o[o.length-1]&&o.pop();r.length>0&&o.length>0&&r[0]===o[0];)r.shift(),o.shift();return o.map(()=>"..").concat(r).join("/")+t.search+t.hash}let d=s(e=>{e.pathname=e.pathname.replace(/\/?$/,"/")}),C=s(e=>{e.href=new n(".",e.toString()).toString()}),b=s(e=>{});function A(e,t){let r=g(t),n=g(e);if(e=d(e),"absolute"===r)return f(t,void 0);if("absolute"===n)return f(t,e);if("scheme-relative"===r)return b(t);if("scheme-relative"===n)return f(t,f(e,c)).slice(a.length);if("path-absolute"===r)return b(t);if("path-absolute"===n)return f(t,f(e,c)).slice(c.length);let o=h(t+e),u=f(t,f(e,o));return m(o,u)}r.normalize=b,r.join=A,r.relative=function(e,t){let r=function(e,t){if(g(e)!==g(t))return null;let r=h(e+t),o=new n(e,r),u=new n(t,r);try{new n("",u.toString())}catch(e){return null}return u.protocol!==o.protocol||u.user!==o.user||u.password!==o.password||u.hostname!==o.hostname||u.port!==o.port?null:m(o,u)}(e,t);return"string"==typeof r?r:b(t)},r.computeSourceURL=function(e,t,r){e&&"path-absolute"===g(t)&&(t=t.replace(/^\//,""));let n=b(t||"");return e&&(n=A(e,n)),r&&(n=A(C(r),n)),n}})(),module.exports=r})();