Es6 cmp migration (#113)
* migrate Alert component * convert Mainlist component * add webpack watch task * update build script for different manifests * add types for api responses * convert changeExtensionIcon * convert inArray, getDomainParts, contains to ts * convert changeExtensionTooltip * convert changeExtensionState to ts
This commit is contained in:
8
src/utils/getDomainFromUrl.ts
Normal file
8
src/utils/getDomainFromUrl.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Returns domain from given URL.
|
||||
*/
|
||||
export function getDomainFromUrl(url: string): string {
|
||||
const parts = url.split('/');
|
||||
|
||||
return parts[0] + '//' + parts[2];
|
||||
}
|
||||
Reference in New Issue
Block a user