1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-27 07:31:46 +01:00

chore: removes semver in favor of localeCompare (#2141)

* chore: removes semver in favor of localeCompare

* chore: removes v
This commit is contained in:
Amir Raminfar
2023-04-21 13:52:38 -07:00
committed by GitHub
parent 12891b17ea
commit 551fb1579d
3 changed files with 5 additions and 7 deletions

View File

@@ -131,7 +131,6 @@
</template>
<script lang="ts" setup>
import gt from "semver/functions/gt";
import {
search,
lightTheme,
@@ -147,7 +146,7 @@ const { t } = useI18n();
setTitle(t("title.settings"));
const currentVersion = $ref(config.version);
const currentVersion = config.version;
let nextRelease = $ref({ html_url: "", name: "" });
let hasUpdate = $ref(false);
@@ -156,7 +155,7 @@ async function fetchNextRelease() {
const response = await fetch("https://api.github.com/repos/amir20/dozzle/releases/latest");
if (response.ok) {
const release = await response.json();
hasUpdate = gt(release.tag_name, currentVersion);
hasUpdate = release.tag_name.slice(1).localeCompare(currentVersion, undefined, { numeric: true, sensitivity: 'base' }) > 0;
nextRelease = release;
}
} else {

View File

@@ -50,7 +50,6 @@
"fuse.js": "^6.6.2",
"lodash.debounce": "^4.0.8",
"pinia": "^2.0.35",
"semver": "^7.5.0",
"splitpanes": "^3.1.5",
"vue": "^3.2.47",
"vue-i18n": "^9.2.2",

6
pnpm-lock.yaml generated
View File

@@ -73,9 +73,6 @@ dependencies:
pinia:
specifier: ^2.0.35
version: 2.0.35(typescript@5.0.4)(vue@3.2.47)
semver:
specifier: ^7.5.0
version: 7.5.0
splitpanes:
specifier: ^3.1.5
version: 3.1.5
@@ -2974,6 +2971,7 @@ packages:
engines: {node: '>=10'}
dependencies:
yallist: 4.0.0
dev: true
/magic-string@0.25.9:
resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==}
@@ -3628,6 +3626,7 @@ packages:
hasBin: true
dependencies:
lru-cache: 6.0.0
dev: true
/shebang-command@1.2.0:
resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==}
@@ -4614,6 +4613,7 @@ packages:
/yallist@4.0.0:
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
dev: true
/yaml-eslint-parser@0.3.2:
resolution: {integrity: sha512-32kYO6kJUuZzqte82t4M/gB6/+11WAuHiEnK7FreMo20xsCKPeFH5tDBU7iWxR7zeJpNnMXfJyXwne48D0hGrg==}