You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
This commit is contained in:
15
packages/lib/services/plugins/utils/isCompatible/index.ts
Normal file
15
packages/lib/services/plugins/utils/isCompatible/index.ts
Normal file
@ -0,0 +1,15 @@
|
||||
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;
|
Reference in New Issue
Block a user