Created
August 4, 2021 10:27
-
-
Save oscarmarina/ead51bf4cee996183fda57782da04612 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const resolveDoc = document.createElement('a'); | |
| export const getAbsoluteUrl = url => { | |
| if (url && (url.indexOf('://') > 0 || url.indexOf('//') === 0)) { | |
| return url; | |
| } | |
| resolveDoc.href = url; | |
| return resolveDoc.href || url; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment