Repository URL to install this package:
|
Version:
1.1.6 ▾
|
import { isString, fromIshToString } from 'exotic';
function toUrlWithProtocol(url) {
const validURL = fromIshToString(url);
if (isString(validURL) && validURL !== '') {
const noProtocolURL = validURL.replace(/(^\w+:|^)\/\//, '');
const updatedURL = '//' + noProtocolURL;
return updatedURL;
}
else {
return validURL;
}
}
export { toUrlWithProtocol };
export default toUrlWithProtocol;
//# sourceMappingURL=toUrlWithProtocol.js.map