opennms
Version:
Client API for the OpenNMS network monitoring platform
1 lines • 6.83 kB
JSON
{"remainingRequest":"/data/node_modules/babel-loader/lib/index.js!/data/node_modules/axios/lib/helpers/isURLSameOrigin.js","dependencies":[{"path":"/data/node_modules/axios/lib/helpers/isURLSameOrigin.js","mtime":1553611387516},{"path":"/data/.babelrc","mtime":1553611371556},{"path":"/data/node_modules/cache-loader/dist/cjs.js","mtime":1553611387012},{"path":"/data/node_modules/babel-loader/lib/index.js","mtime":1553611386992}],"contextDependencies":[],"result":["'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = utils.isStandardBrowserEnv() ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\nfunction standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;\n return parsed.protocol === originURL.protocol && parsed.host === originURL.host;\n };\n}() :\n\n// Non standard browser envs (web workers, react-native) lack needed support.\nfunction nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n}();",{"version":3,"sources":["node_modules/axios/lib/helpers/isURLSameOrigin.js"],"names":["utils","require","module","exports","isStandardBrowserEnv","standardBrowserEnv","msie","test","navigator","userAgent","urlParsingNode","document","createElement","originURL","resolveURL","url","href","setAttribute","protocol","replace","host","search","hash","hostname","port","pathname","charAt","window","location","isURLSameOrigin","requestURL","parsed","isString","nonStandardBrowserEnv"],"mappings":"AAAA;;AAEA,IAAIA,QAAQC,QAAQ,YAAR,CAAZ;;AAEAC,OAAOC,OAAP,GACEH,MAAMI,oBAAN;;AAEA;AACA;AACC,SAASC,kBAAT,GAA8B;AAC7B,MAAIC,OAAO,kBAAkBC,IAAlB,CAAuBC,UAAUC,SAAjC,CAAX;AACA,MAAIC,iBAAiBC,SAASC,aAAT,CAAuB,GAAvB,CAArB;AACA,MAAIC,SAAJ;;AAEA;;;;;;AAMA,WAASC,UAAT,CAAoBC,GAApB,EAAyB;AACvB,QAAIC,OAAOD,GAAX;;AAEA,QAAIT,IAAJ,EAAU;AACR;AACAI,qBAAeO,YAAf,CAA4B,MAA5B,EAAoCD,IAApC;AACAA,aAAON,eAAeM,IAAtB;AACD;;AAEDN,mBAAeO,YAAf,CAA4B,MAA5B,EAAoCD,IAApC;;AAEA;AACA,WAAO;AACLA,YAAMN,eAAeM,IADhB;AAELE,gBAAUR,eAAeQ,QAAf,GAA0BR,eAAeQ,QAAf,CAAwBC,OAAxB,CAAgC,IAAhC,EAAsC,EAAtC,CAA1B,GAAsE,EAF3E;AAGLC,YAAMV,eAAeU,IAHhB;AAILC,cAAQX,eAAeW,MAAf,GAAwBX,eAAeW,MAAf,CAAsBF,OAAtB,CAA8B,KAA9B,EAAqC,EAArC,CAAxB,GAAmE,EAJtE;AAKLG,YAAMZ,eAAeY,IAAf,GAAsBZ,eAAeY,IAAf,CAAoBH,OAApB,CAA4B,IAA5B,EAAkC,EAAlC,CAAtB,GAA8D,EAL/D;AAMLI,gBAAUb,eAAea,QANpB;AAOLC,YAAMd,eAAec,IAPhB;AAQLC,gBAAWf,eAAee,QAAf,CAAwBC,MAAxB,CAA+B,CAA/B,MAAsC,GAAvC,GACAhB,eAAee,QADf,GAEA,MAAMf,eAAee;AAV1B,KAAP;AAYD;;AAEDZ,cAAYC,WAAWa,OAAOC,QAAP,CAAgBZ,IAA3B,CAAZ;;AAEA;;;;;;AAMA,SAAO,SAASa,eAAT,CAAyBC,UAAzB,EAAqC;AAC1C,QAAIC,SAAU/B,MAAMgC,QAAN,CAAeF,UAAf,CAAD,GAA+BhB,WAAWgB,UAAX,CAA/B,GAAwDA,UAArE;AACA,WAAQC,OAAOb,QAAP,KAAoBL,UAAUK,QAA9B,IACFa,OAAOX,IAAP,KAAgBP,UAAUO,IADhC;AAED,GAJD;AAKD,CAlDD,EAJA;;AAwDA;AACC,SAASa,qBAAT,GAAiC;AAChC,SAAO,SAASJ,eAAT,GAA2B;AAChC,WAAO,IAAP;AACD,GAFD;AAGD,CAJD,EA1DF","file":"isURLSameOrigin.js","sourceRoot":"/data","sourcesContent":["'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n"]}]}