dd-trace
Version:
Datadog APM tracing client for JavaScript
1 lines • 2.6 kB
JavaScript
(()=>{"use strict";var e={"./shell-quote/parse.js":function(e){for(var t="(?:\\|\\||\\&\\&|;;|\\|\\&|\\<\\(|\\<\\<\\<|>>|>\\&|<\\&|[&;()|<>])",r=RegExp("^"+t+"$"),n="|&;()<> \\t",o=/^#$/,i="",s=0;s<4;s++)i+=(0x100000000*Math.random()).toString(16);var a=RegExp("^"+i);e.exports=function(e,s,u){var c=function(e,s,a){a||(a={});var u=a.escape||"\\",c=function(e,t){for(var r,n=t.lastIndex,o=[];r=t.exec(e);)o.push(r),t.lastIndex===r.index&&(t.lastIndex+=1);return t.lastIndex=n,o}(e,RegExp(["("+t+")","("+("(\\"+u+"['\""+n+"]|[^\\s'\""+n)+"])+|\"((\\\\\"|[^\"])*?)\"|'((\\\\'|[^'])*?)')+"].join("|"),"g"));if(0===c.length)return[];s||(s={});var f=!1;return c.map(function(t){var n,a=t[0];if(a&&!f){if(r.test(a))return{op:a};var c=!1,l=!1,p="",x=!1;for(n=0;n<a.length;n++){var v=a.charAt(n);if(x=x||!c&&("*"===v||"?"===v),l)p+=v,l=!1;else if(c)v===c?c=!1:"'"==c?p+=v:v===u?(n+=1,'"'===(v=a.charAt(n))||v===u||"$"===v?p+=v:p+=u+v):"$"===v?p+=g():p+=v;else if('"'===v||"'"===v)c=v;else if(r.test(v))return{op:a};else if(o.test(v)){f=!0;var d={comment:e.slice(t.index+n+1)};if(p.length)return[p,d];return[d]}else v===u?l=!0:"$"===v?p+=g():p+=v}return x?{op:"glob",pattern:p}:p}function g(){n+=1;var e,t,r,o,u,c=a.charAt(n);if("{"===c){if(n+=1,"}"===a.charAt(n))throw Error("Bad substitution: "+a.slice(n-2,n+1));if((o=a.indexOf("}",n))<0)throw Error("Bad substitution: "+a.slice(n));u=a.slice(n,o),n=o}else if(/[*@#?$!_-]/.test(c))u=c,n+=1;else{var f=a.slice(n);(o=f.match(/[^\w\d_]/))?(u=f.slice(0,o.index),n+=o.index-1):(u=f,n=a.length)}return e=s,t=u,(void 0===(r="function"==typeof e?e(t):e[t])&&""!=t?r="":void 0===r&&(r="$"),"object"==typeof r)?""+i+JSON.stringify(r)+i:""+r}}).reduce(function(e,t){return void 0===t?e:e.concat(t)},[])}(e,s,u);return"function"!=typeof s?c:c.reduce(function(e,t){if("object"==typeof t)return e.concat(t);var r=t.split(RegExp("("+i+".*?"+i+")","g"));return 1===r.length?e.concat(r[0]):e.concat(r.filter(Boolean).map(function(e){return a.test(e)?JSON.parse(e.split(i)[1]):e}))},[])}},"./shell-quote/quote.js":function(e){e.exports=function(e){return e.map(function(e){return""===e?"''":e&&"object"==typeof e?e.op.replace(/(.)/g,"\\$1"):/["\s\\]/.test(e)&&!/'/.test(e)?"'"+e.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(e)?'"'+e.replace(/(["\\$`!])/g,"\\$1")+'"':String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}var n={};n.quote=r("./shell-quote/quote.js"),n.parse=r("./shell-quote/parse.js"),module.exports=n})();