Created
May 3, 2019 18:42
-
-
Save andreasvirkus/799cb8009abe3182ac26fe12f5f29848 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
export const subdomainRegex = new RegExp('^(([^.]*))', 'g') | |
export const parseSubdomain = hostname => (hostname || window.location.hostname).match(subdomainRegex)[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment