minor tweak

This commit is contained in:
Reinaldo Neto 2023-03-01 12:11:02 -03:00
parent 67811bb36b
commit fb47f8221f
1 changed files with 2 additions and 0 deletions

View File

@ -1,3 +1,5 @@
// If the link does not have the protocol at the beginning, we are inserting https as the default,
// since by conversion the most used is the secure protocol, with the same behavior as the web.
const addProtocol = (url: string): string => {
if (!url.toLowerCase().startsWith('http')) {
return `https://${url.replace('//', '')}`;