mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-03 13:33:18 +00:00
Fix npm-test (xo code style)
This commit is contained in:
12
app/main/link-helper.js
Normal file
12
app/main/link-helper.js
Normal file
@@ -0,0 +1,12 @@
|
||||
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
|
||||
};
|
||||
Reference in New Issue
Block a user