Same architecture as Lesstime: API Platform 4, JWT auth, @malio/layer-ui, PostgreSQL 16, Docker Compose (ports 8083/3003/5436), dark mode theme. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
11 lines
282 B
TypeScript
11 lines
282 B
TypeScript
export type HydraCollection<T> = {
|
|
'hydra:member'?: T[]
|
|
'hydra:totalItems'?: number
|
|
'member'?: T[]
|
|
'totalItems'?: number
|
|
}
|
|
|
|
export function extractHydraMembers<T>(response: HydraCollection<T>): T[] {
|
|
return response['hydra:member'] ?? response['member'] ?? []
|
|
}
|