@nativescript/doctor
Version:
Library that helps identifying if the environment can be used for development of {N} apps.
68 lines (67 loc) • 2.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HostInfo = void 0;
var HostInfo = (function () {
function HostInfo(winreg) {
this.winreg = winreg;
}
Object.defineProperty(HostInfo.prototype, "isWindows", {
get: function () {
return process.platform === HostInfo.WIN32_NAME;
},
enumerable: false,
configurable: true
});
Object.defineProperty(HostInfo.prototype, "isWindows64", {
get: function () {
return (this.isWindows &&
(this.isNode64Bit ||
process.env.hasOwnProperty(HostInfo.PROCESSOR_ARCHITEW6432)));
},
enumerable: false,
configurable: true
});
Object.defineProperty(HostInfo.prototype, "isWindows32", {
get: function () {
return this.isWindows && !this.isWindows64;
},
enumerable: false,
configurable: true
});
Object.defineProperty(HostInfo.prototype, "isDarwin", {
get: function () {
return process.platform === HostInfo.DARWIN_OS_NAME;
},
enumerable: false,
configurable: true
});
Object.defineProperty(HostInfo.prototype, "isLinux", {
get: function () {
return process.platform === HostInfo.LINUX_OS_NAME;
},
enumerable: false,
configurable: true
});
Object.defineProperty(HostInfo.prototype, "isNode64Bit", {
get: function () {
return process.arch === "x64";
},
enumerable: false,
configurable: true
});
HostInfo.prototype.dotNetVersion = function () {
if (this.isWindows) {
return this.winreg.getRegistryValue("Version", this.winreg.registryKeys.HKLM, HostInfo.DOT_NET_REGISTRY_PATH);
}
else {
return Promise.resolve(null);
}
};
HostInfo.WIN32_NAME = "win32";
HostInfo.PROCESSOR_ARCHITEW6432 = "PROCESSOR_ARCHITEW6432";
HostInfo.DARWIN_OS_NAME = "darwin";
HostInfo.LINUX_OS_NAME = "linux";
HostInfo.DOT_NET_REGISTRY_PATH = "\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Client";
return HostInfo;
}());
exports.HostInfo = HostInfo;