From cbcf7d6a8e2a54ad65e52434272cbfbe2ae765d3 Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 22:15:05 +0000 Subject: [PATCH] fix: replace more any types with more specific types to fix linting errors --- server/routes/api/documents/documents.test.ts | 4 ++-- shared/utils/naturalSort.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/routes/api/documents/documents.test.ts b/server/routes/api/documents/documents.test.ts index b982b9ff4d..3995b936a1 100644 --- a/server/routes/api/documents/documents.test.ts +++ b/server/routes/api/documents/documents.test.ts @@ -825,7 +825,7 @@ describe("#documents.list", () => { const body = await res.json(); expect(res.status).toEqual(200); expect(body.data).toHaveLength(2); - const docIds = body.data.map((doc: any) => doc.id); + const docIds = body.data.map((doc: { id: string }) => doc.id); expect(docIds).toContain(docs[0].id); expect(docIds).toContain(docs[1].id); expect(docIds).not.toContain(docs[2].id); @@ -5361,7 +5361,7 @@ describe("#documents.documents", () => { expect(res.status).toBe(200); expect(body.data.id).toBe(parent.id); - const childIds = body.data.children.map((node: any) => node.id); + const childIds = body.data.children.map((node: { id: string }) => node.id); expect(childIds).toContain(child1.id); expect(childIds).toContain(child2.id); }); diff --git a/shared/utils/naturalSort.ts b/shared/utils/naturalSort.ts index d3cd4e255d..9714947382 100644 --- a/shared/utils/naturalSort.ts +++ b/shared/utils/naturalSort.ts @@ -14,7 +14,7 @@ const stripEmojis = (value: string) => value.replace(regex, ""); const cleanValue = (value: string) => stripEmojis(deburr(value)); -function getSortByField>( +function getSortByField>( item: T, keyOrCallback: string | ((item: T) => string) ) { @@ -25,7 +25,7 @@ function getSortByField>( return cleanValue(field); } -function naturalSortBy>( +function naturalSortBy>( items: T[], key: string | ((item: T) => string), sortOptions?: NaturalSortOptions