Tumortisch-Dist/resources/app/node_modules/electron-process-reporter/lib/extractURLDomain.js

14 lines
475 B
JavaScript
Raw Normal View History

2021-06-15 16:00:08 +02:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const memoize = require("memoizee");
const url_1 = require("url");
const extractURLDomain = (urlString) => {
const url = url_1.parse(urlString);
if (url.protocol == 'https:' || url.protocol == 'http:') {
return url.hostname;
}
return '';
};
// memoize it for performance
exports.default = memoize(extractURLDomain, { max: 100 });
//# sourceMappingURL=extractURLDomain.js.map