* use @xarc/xrun to streamline tasks in an imperative manner * add lint-staged/husky for git hook tasks * run prettier across all files * fixing tests * add ci test workflow * add a ci workflow * remove precommit in favor of husky * add .prettierrc.js * reformat with prettier
14 lines
219 B
JavaScript
14 lines
219 B
JavaScript
/**
|
|
* Returns domain from given URL.
|
|
*
|
|
* @param url
|
|
* @returns {string}
|
|
*/
|
|
function getDomainFromUrl(url) {
|
|
var parts = url.split('/');
|
|
|
|
return parts[0] + '//' + parts[2];
|
|
}
|
|
|
|
module.exports = getDomainFromUrl;
|