mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2025-12-12 13:56:16 +00:00
fix: use semver sort for ccos updates
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import type { PageLoad } from "./$types";
|
import type { PageLoad } from "./$types";
|
||||||
import type { DirectoryListing } from "$lib/meta/types/listing";
|
import type { DirectoryListing } from "$lib/meta/types/listing";
|
||||||
|
import { compare } from "semver";
|
||||||
|
|
||||||
export const load = (async ({ fetch, params }) => {
|
export const load = (async ({ fetch, params }) => {
|
||||||
const result = await fetch(
|
const result = await fetch(
|
||||||
@@ -9,7 +10,7 @@ export const load = (async ({ fetch, params }) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
versions: (data as DirectoryListing[]).sort((a, b) =>
|
versions: (data as DirectoryListing[]).sort((a, b) =>
|
||||||
b.name.localeCompare(a.name),
|
compare(b.name, a.name),
|
||||||
),
|
),
|
||||||
device: params.device,
|
device: params.device,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user