Last active
June 28, 2021 19:52
-
-
Save narennaik/bcd01964694c750620c5a2ce7065aad5 to your computer and use it in GitHub Desktop.
Split into multiple functions
This file contains 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 getDomainName = (item) => item.details.name; | |
const getProtocol = (item) => (item.details.valid ? 'https' : 'http'); | |
const getUrl = (item) => `${getProtocol(item)}://${getDomainName(item)}`; | |
// TODO: (temporary) Adding callback=true because server side redirection needs this parameter | |
const addCallbackParameter = (url) => `${url}?callback=true`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment