first commit
This commit is contained in:
39
app_vue/node_modules/mini-css-extract-plugin/dist/hmr/normalize-url.js
generated
vendored
Normal file
39
app_vue/node_modules/mini-css-extract-plugin/dist/hmr/normalize-url.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* @param {string[]} pathComponents
|
||||
* @returns {string}
|
||||
*/
|
||||
function normalizeUrl(pathComponents) {
|
||||
return pathComponents.reduce(function (accumulator, item) {
|
||||
switch (item) {
|
||||
case "..":
|
||||
accumulator.pop();
|
||||
break;
|
||||
case ".":
|
||||
break;
|
||||
default:
|
||||
accumulator.push(item);
|
||||
}
|
||||
return accumulator;
|
||||
}, /** @type {string[]} */[]).join("/");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} urlString
|
||||
* @returns {string}
|
||||
*/
|
||||
module.exports = function (urlString) {
|
||||
urlString = urlString.trim();
|
||||
if (/^data:/i.test(urlString)) {
|
||||
return urlString;
|
||||
}
|
||||
var protocol = urlString.indexOf("//") !== -1 ? urlString.split("//")[0] + "//" : "";
|
||||
var components = urlString.replace(new RegExp(protocol, "i"), "").split("/");
|
||||
var host = components[0].toLowerCase().replace(/\.$/, "");
|
||||
components[0] = "";
|
||||
var path = normalizeUrl(components);
|
||||
return protocol + host + path;
|
||||
};
|
Reference in New Issue
Block a user