Server : LiteSpeed System : Linux ncr1.int3rnet.net 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64 User : digitaln ( 1704) PHP Version : 8.1.34 Disable Function : NONE Directory : /usr/lib/node_modules/npm/node_modules/prepend-http/ |
'use strict';
module.exports = function (url) {
if (typeof url !== 'string') {
throw new TypeError('Expected a string, got ' + typeof url);
}
url = url.trim();
if (/^\.*\/|^(?!localhost)\w+:/.test(url)) {
return url;
}
return url.replace(/^(?!(?:\w+:)?\/\/)/, 'http://');
};