mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-05-07 06:49:35 +00:00
15 lines
417 B
TypeScript
15 lines
417 B
TypeScript
import { compare, diff } from 'semver'
|
|
|
|
import native from './native'
|
|
|
|
import { version } from '$app/environment'
|
|
|
|
function compareVersions (): 'ui' | 'client' | undefined {
|
|
const releaseType = diff(version, native.version())
|
|
if (!releaseType) return
|
|
if (releaseType === 'patch') return
|
|
|
|
return compare(version, native.version()) === -1 ? 'ui' : 'client'
|
|
}
|
|
|
|
export const outdatedComponent = compareVersions()
|