Files
zulip-desktop/app/main/link-helper.js
2016-08-15 00:14:14 -04:00

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
};