Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const exportHostVersion = async minVer => {
if (!isString(minVer)) {
throw new TypeError(`Expected String but got ${getType(minVer)}.`);
}
if (!isValidSemVer(minVer)) {
throw new Error(`${minVer} is not valid SemVer.`);
}
const result = await compareSemVer(hostVersion, minVer);
const latest = await getLatestHostVersion();
let isLatest;
if (latest) {
const currentResult = await compareSemVer(hostVersion, latest);
isLatest = currentResult >= 0;
}
const msg = {
[HOST_VERSION]: {
isLatest,
latest,
result,
},
};