UNPKG

398 BJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = normalize;
7function normalize(url) {
8 var protocol = (url.match(/(http|https)\:\/\//) || [])[1];
9 if (/\:443$/.test(url)) {
10 protocol = protocol || 'https';
11 } else {
12 protocol = 'http';
13 }
14 return protocol + '://' + url.replace(/(\:80|\:443)$/, '');
15}
16module.exports = exports['default'];
\No newline at end of file