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
2.9 KiB
1 line
2.9 KiB
3 years ago
|
{"ast":null,"code":"import \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.error.cause.js\";\n\n/**\n * @returns {string}\n */\nfunction getCurrentScriptSource() {\n // `document.currentScript` is the most accurate way to find the current script,\n // but is not supported in all browsers.\n if (document.currentScript) {\n return document.currentScript.getAttribute(\"src\");\n } // Fallback to getting all scripts running in the document.\n\n\n var scriptElements = document.scripts || [];\n var scriptElementsWithSrc = Array.prototype.filter.call(scriptElements, function (element) {\n return element.getAttribute(\"src\");\n });\n\n if (scriptElementsWithSrc.length > 0) {\n var currentScript = scriptElementsWithSrc[scriptElementsWithSrc.length - 1];\n return currentScript.getAttribute(\"src\");\n } // Fail as there was no script to use.\n\n\n throw new Error(\"[webpack-dev-server] Failed to get current script source.\");\n}\n\nexport default getCurrentScriptSource;","map":{"version":3,"sources":["/tmp/vue-hello/node_modules/webpack-dev-server/client/utils/getCurrentScriptSource.js"],"names":["getCurrentScriptSource","document","currentScript","getAttribute","scriptElements","scripts","scriptElementsWithSrc","Array","prototype","filter","call","element","length","Error"],"mappings":";;;;AAAA;AACA;AACA;AACA,SAASA,sBAAT,GAAkC;AAChC;AACA;AACA,MAAIC,QAAQ,CAACC,aAAb,EAA4B;AAC1B,WAAOD,QAAQ,CAACC,aAAT,CAAuBC,YAAvB,CAAoC,KAApC,CAAP;AACD,GAL+B,CAK9B;;;AAGF,MAAIC,cAAc,GAAGH,QAAQ,CAACI,OAAT,IAAoB,EAAzC;AACA,MAAIC,qBAAqB,GAAGC,KAAK,CAACC,SAAN,CAAgBC,MAAhB,CAAuBC,IAAvB,CAA4BN,cAA5B,EAA4C,UAAUO,OAAV,EAAmB;AACzF,WAAOA,OAAO,CAACR,YAAR,CAAqB,KAArB,CAAP;AACD,GAF2B,CAA5B;;AAIA,MAAIG,qBAAqB,CAACM,MAAtB,GAA+B,CAAnC,EAAsC;AACpC,QAAIV,aAAa,GAAGI,qBAAqB,CAACA,qBAAqB,CAACM,MAAtB,GAA+B,CAAhC,CAAzC;AACA,WAAOV,aAAa,CAACC,YAAd,CAA2B,KAA3B,CAAP;AACD,GAhB+B,CAgB9B;;;AAGF,QAAM,IAAIU,KAAJ,CAAU,2DAAV,CAAN;AACD;;AAED,eAAeb,sBAAf","sourcesContent":["/**\n * @returns {string}\n */\nfunction getCurrentScriptSource() {\n // `document.currentScript` is the most accurate way to find the current script,\n // but is not supported in all browsers.\n if (document.currentScript) {\n return document.currentScript.getAttribute(\"src\");\n } // Fallback to getting all scripts running in the document.\n\n\n var scriptElements = document.scripts || [];\n var scriptElementsWithSrc = Array.prototype.filter.call(scriptElements, function (element) {\n return element.getAttribute(\"src\");\n });\n\n if (scriptElementsWithSrc.length > 0) {\n var currentScript = scriptElementsWithSrc[scriptElementsWithSrc.length - 1];\n return currentScript.getAttribute(\"src\");\n } // Fail as there was no script to use.\n\n\n throw new Error(\"[webpack-dev-server] Failed to get current script source.\");\n}\n\nexport default getCurrentScriptSource;"]},"metadata":{},"sourceType":"module"}
|