Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current none :
/
proc
/
thread-self
/
root
/
usr
/
lib
/
nodejs
/
prepend-http
/
Or
Select Your none :
Upload File :
New :
File
Dir
//proc/thread-self/root/usr/lib/nodejs/prepend-http/index.js
'use strict'; module.exports = (url, opts) => { if (typeof url !== 'string') { throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof url}\``); } url = url.trim(); opts = Object.assign({https: false}, opts); if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { return url; } return url.replace(/^(?!(?:\w+:)?\/\/)/, opts.https ? 'https://' : 'http://'); };