mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-03 05:23:17 +00:00
13 lines
299 B
JavaScript
13 lines
299 B
JavaScript
const wurl = require('wurl');
|
|
|
|
// Check link if it's internal/external
|
|
function linkIsInternal(currentUrl, newUrl) {
|
|
const currentDomain = wurl('domain', currentUrl);
|
|
const newDomain = wurl('domain', newUrl);
|
|
return currentDomain === newDomain;
|
|
}
|
|
|
|
exports = module.exports = {
|
|
linkIsInternal
|
|
};
|