You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
4.3 KiB
1 line
4.3 KiB
3 years ago
|
{"ast":null,"code":"import \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.split.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/web.url.js\";\nimport \"core-js/modules/web.url-search-params.js\";\nimport getCurrentScriptSource from \"./getCurrentScriptSource.js\";\n/**\n * @param {string} resourceQuery\n * @returns {{ [key: string]: string | boolean }}\n */\n\nfunction parseURL(resourceQuery) {\n /** @type {{ [key: string]: string }} */\n var options = {};\n\n if (typeof resourceQuery === \"string\" && resourceQuery !== \"\") {\n var searchParams = resourceQuery.substr(1).split(\"&\");\n\n for (var i = 0; i < searchParams.length; i++) {\n var pair = searchParams[i].split(\"=\");\n options[pair[0]] = decodeURIComponent(pair[1]);\n }\n } else {\n // Else, get the url from the <script> this file was called with.\n var scriptSource = getCurrentScriptSource();\n var scriptSourceURL;\n\n try {\n // The placeholder `baseURL` with `window.location.href`,\n // is to allow parsing of path-relative or protocol-relative URLs,\n // and will have no effect if `scriptSource` is a fully valid URL.\n scriptSourceURL = new URL(scriptSource, self.location.href);\n } catch (error) {// URL parsing failed, do nothing.\n // We will still proceed to see if we can recover using `resourceQuery`\n }\n\n if (scriptSourceURL) {\n options = scriptSourceURL;\n options.fromCurrentScript = true;\n }\n }\n\n return options;\n}\n\nexport default parseURL;","map":{"version":3,"sources":["/tmp/vue-hello/node_modules/webpack-dev-server/client/utils/parseURL.js"],"names":["getCurrentScriptSource","parseURL","resourceQuery","options","searchParams","substr","split","i","length","pair","decodeURIComponent","scriptSource","scriptSourceURL","URL","self","location","href","error","fromCurrentScript"],"mappings":";;;;;;;AAAA,OAAOA,sBAAP,MAAmC,6BAAnC;AACA;AACA;AACA;AACA;;AAEA,SAASC,QAAT,CAAkBC,aAAlB,EAAiC;AAC/B;AACA,MAAIC,OAAO,GAAG,EAAd;;AAEA,MAAI,OAAOD,aAAP,KAAyB,QAAzB,IAAqCA,aAAa,KAAK,EAA3D,EAA+D;AAC7D,QAAIE,YAAY,GAAGF,aAAa,CAACG,MAAd,CAAqB,CAArB,EAAwBC,KAAxB,CAA8B,GAA9B,CAAnB;;AAEA,SAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,YAAY,CAACI,MAAjC,EAAyCD,CAAC,EAA1C,EAA8C;AAC5C,UAAIE,IAAI,GAAGL,YAAY,CAACG,CAAD,CAAZ,CAAgBD,KAAhB,CAAsB,GAAtB,CAAX;AACAH,MAAAA,OAAO,CAACM,IAAI,CAAC,CAAD,CAAL,CAAP,GAAmBC,kBAAkB,CAACD,IAAI,CAAC,CAAD,CAAL,CAArC;AACD;AACF,GAPD,MAOO;AACL;AACA,QAAIE,YAAY,GAAGX,sBAAsB,EAAzC;AACA,QAAIY,eAAJ;;AAEA,QAAI;AACF;AACA;AACA;AACAA,MAAAA,eAAe,GAAG,IAAIC,GAAJ,CAAQF,YAAR,EAAsBG,IAAI,CAACC,QAAL,CAAcC,IAApC,CAAlB;AACD,KALD,CAKE,OAAOC,KAAP,EAAc,CAAC;AACf;AACD;;AAED,QAAIL,eAAJ,EAAqB;AACnBT,MAAAA,OAAO,GAAGS,eAAV;AACAT,MAAAA,OAAO,CAACe,iBAAR,GAA4B,IAA5B;AACD;AACF;;AAED,SAAOf,OAAP;AACD;;AAED,eAAeF,QAAf","sourcesContent":["import getCurrentScriptSource from \"./getCurrentScriptSource.js\";\n/**\n * @param {string} resourceQuery\n * @returns {{ [key: string]: string | boolean }}\n */\n\nfunction parseURL(resourceQuery) {\n /** @type {{ [key: string]: string }} */\n var options = {};\n\n if (typeof resourceQuery === \"string\" && resourceQuery !== \"\") {\n var searchParams = resourceQuery.substr(1).split(\"&\");\n\n for (var i = 0; i < searchParams.length; i++) {\n var pair = searchParams[i].split(\"=\");\n options[pair[0]] = decodeURIComponent(pair[1]);\n }\n } else {\n // Else, get the url from the <script> this file was called with.\n var scriptSource = getCurrentScriptSource();\n var scriptSourceURL;\n\n try {\n // The placeholder `baseURL` with `window.location.href`,\n // is to allow parsing of path-relative or protocol-relative URLs,\n // and will have no effect if `scriptSource` is a fully valid URL.\n scriptSourceURL = new URL(scriptSource, self.location.href);\n } catch (error) {// URL parsing failed, do nothing.\n // We will still proceed to
|