Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const Version: React.FC = ({ className }) => {
const { loading, version } = useContainer(VersionContainer);
if (loading || !version) {
// showProgress
return null;
}
const { flexgetVersion, apiVersion, latestVersion } = version;
return (
<div>
Version Info
{`Flexget: ${flexgetVersion} `}
{semver(latestVersion, flexgetVersion) !== 1 && (
)}
{`API: ${apiVersion}`}
</div>
);
};
return installers.latestVersionAsync({bridgeUrl: bridgeVersionUrl}).then(version => {
const isOutdated = semvercmp(transport.version, version) < 0;
transport.isOutdated = isOutdated;
return transport;
}, () => {
// latest.txt CORS error shouldn't bring trezor.js down :/
.then(({ version, note }) => {
if (this.lastKnown !== version) {
this.lastKnown = version;
if (1 === compare(version, currentVersion)) {
console.log('update found');
this.callback(version, note);
} else {
console.log('no update. latest:', version);
}
}
done();
})
.catch((err) => {
checkVersion(version => {
if (version && cmp(version, '0.2.0') !== -1) {
browserHistory.push('/home')
}
})
}
})
);
this.subscriptions.add(
atom.commands.add('atom-workspace', {
'elmjutsu:hide-usages-panel': () =>
this.findAndRenameUsages.hideCommand(),
'elmjutsu:toggle-sidekick': () => this.sidekick.toggleCommand(),
})
);
const linterPackage = atom.packages.getLoadedPackage('linter');
if (
!linterPackage ||
!linterPackage.metadata ||
!linterPackage.metadata.version ||
cmp(linterPackage.metadata.version, '2.3.0') < 0
) {
this.usingLinterV1 = true;
} else {
this.usingLinterV1 = false;
}
},
export async function getNpmStatus (): Promise {
const verNpm = await getNpmVersion();
if (verNpm === 'unknown') {
return null;
}
switch (semcmp(pkgJson.version, verNpm)) {
case 0:
return 'up to date';
case 1:
return `newer, ${verNpm} published`;
default:
return `outdated, ${verNpm} available`;
}
}
atLeast(version: string): boolean {
return semvercmp(this.getVersion(), version) >= 0;
}
return packages.map(mod => {
mod.needsUpdate =
target === 'latest'
? semverCompare(mod.version, mod.latest) === -1
: mod.version !== mod.latest
return mod
})
}
checkVersion(version => {
if (!version || cmp(version, '0.2.0') === -1) {
browserHistory.push('/update')
} else {
successCallback()
}
})
}
needsUpdate() {
let pkg = this.state.activepkg,
diff = 0;
let latest = pkg['dist-tags'].latest;
let installed = pkg.version;
diff = Semver(latest, installed);
return diff;
}
render() {