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)); };