export type HydraCollection<T> = {
  'hydra:member'?: T[]
}

export const extractItems = <T>(data: HydraCollection<T> | T[]): T[] => {
  return Array.isArray(data) ? data : data['hydra:member'] ?? []
}
