From 2c5a7a1143c0a2f67606caf59ffe8424480c9243 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Sat, 14 Dec 2024 03:34:21 +0100 Subject: [PATCH] Lib: Update type information --- src/lib/database.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/database.ts b/src/lib/database.ts index 49d3ebd..22a2293 100644 --- a/src/lib/database.ts +++ b/src/lib/database.ts @@ -1,7 +1,7 @@ /** * Retrieve an arbitrary object with a matching ID from an Array. - * Supposed to use on collections returned by the PocketBase API. + * Supposed to be used on collections returned by the PocketBase API. */ -export const get_by_id = (objects: Array, id: string): T | undefined => { +export const get_by_id = (objects: T[], id: string): T | undefined => { return objects.find((o: T) => ("id" in o ? o.id === id : false)); };