Skip to content

Commit

Permalink
[#20] feat : hostname 뽑는 함수 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
choibumsu committed Feb 23, 2021
1 parent 30f30ab commit b2062f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ export const getFirstChildHeight = (element: HTMLElement) => {

return height
}

export const getHostFromUrl = (url: string): string => {
return url
.replace('https://', '')
.replace('http://', '')
.replace('www.', '')
.split('/')[0]
}

0 comments on commit b2062f9

Please sign in to comment.