Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.onMessageReceived(message => {
let { name, version } = message;
if (name === 'version-mismatch') {
let previousVersions = config.previousEmberVersionsSupported;
let [fromVersion, tillVersion] = config.emberVersionsSupported;
let neededVersion;
if (compareVersion(version, fromVersion) === -1) {
neededVersion = previousVersions[previousVersions.length - 1];
} else if (tillVersion && compareVersion(version, tillVersion) !== -1) {
neededVersion = tillVersion;
} else {
return;
}
this.onVersionMismatch(neededVersion);
}
});
this.sendMessage({ type: 'check-version', from: 'devtools' });