You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-06 23:56:13 +02:00
16 lines
618 B
TypeScript
16 lines
618 B
TypeScript
![]() |
import { compareVersions } from 'compare-versions';
|
||
|
import minVersionForPlatform from './minVersionForPlatform';
|
||
|
import { ManifestSlice } from './types';
|
||
|
import { AppType } from '../../../../models/Setting';
|
||
|
|
||
|
const isVersionCompatible = (appVersion: string, manifestMinVersion: string) => {
|
||
|
return compareVersions(appVersion, manifestMinVersion) >= 0;
|
||
|
};
|
||
|
|
||
|
const isCompatible = (appVersion: string, appType: AppType, manifest: ManifestSlice): boolean => {
|
||
|
const minVersion = minVersionForPlatform(appType, manifest);
|
||
|
return minVersion && isVersionCompatible(appVersion, minVersion);
|
||
|
};
|
||
|
|
||
|
export default isCompatible;
|