(
entityName: string,
data: T[]
)
| 242 | }; |
| 243 | |
| 244 | function createCollection<T extends { id: any }>( |
| 245 | entityName: string, |
| 246 | data: T[] |
| 247 | ) { |
| 248 | return { |
| 249 | ...collectionCreator.create<T>(entityName), |
| 250 | ids: data.map((e) => e.id), |
| 251 | entities: data.reduce((acc, e) => { |
| 252 | acc[e.id] = e; |
| 253 | return acc; |
| 254 | }, {} as any), |
| 255 | } as EntityCollection<T>; |
| 256 | } |
| 257 | } |
| 258 | // #endregion |
no test coverage detected