2016-01-29 14:04:41 +00:00
|
|
|
import wurl from 'wurl';
|
|
|
|
import os from 'os';
|
2016-01-23 02:09:47 +00:00
|
|
|
|
|
|
|
function isOSX() {
|
|
|
|
return os.platform() === 'darwin';
|
|
|
|
}
|
|
|
|
|
2016-02-23 08:46:14 +00:00
|
|
|
function isLinux() {
|
|
|
|
return os.platform() === 'linux';
|
|
|
|
}
|
|
|
|
|
|
|
|
function isWindows() {
|
|
|
|
return os.platform() === 'win32';
|
|
|
|
}
|
|
|
|
|
2016-01-23 02:09:47 +00:00
|
|
|
function linkIsInternal(currentUrl, newUrl) {
|
|
|
|
var currentDomain = wurl('domain', currentUrl);
|
|
|
|
var newDomain = wurl('domain', newUrl);
|
|
|
|
return currentDomain === newDomain;
|
|
|
|
}
|
|
|
|
|
2016-01-29 14:04:41 +00:00
|
|
|
export default {
|
|
|
|
isOSX,
|
2016-02-23 08:46:14 +00:00
|
|
|
isLinux,
|
|
|
|
isWindows,
|
2016-01-29 14:04:41 +00:00
|
|
|
linkIsInternal
|
2016-01-23 02:09:47 +00:00
|
|
|
};
|