From 24e379cb18bc2d82eb45a25d6f3f099c3c752323 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Thu, 2 May 2024 21:50:37 +0800 Subject: [PATCH] feat: use localeCompare --- packages/ui/client/composables/client/index.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/ui/client/composables/client/index.ts b/packages/ui/client/composables/client/index.ts index 9bde50766993..e05ee437b0e1 100644 --- a/packages/ui/client/composables/client/index.ts +++ b/packages/ui/client/composables/client/index.ts @@ -41,13 +41,7 @@ export const client = (function createVitestClient() { })() function sort(a: File, b: File) { - if (a.name < b.name) - return -1 - - if (a.name > b.name) - return 1 - - return 0 + return a.name.localeCompare(b.name) } export const config = shallowRef({} as any)