mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-28 02:55:55 +00:00
10 lines
237 B
JavaScript
10 lines
237 B
JavaScript
/**
|
|
* Creates a map of ids to entity
|
|
* @param {Array} entities = [] list of entities to map to ids
|
|
*/
|
|
export default (entities = []) =>
|
|
entities.reduce((idMap, entity) => {
|
|
idMap[entity.id] = entity;
|
|
return idMap;
|
|
}, {});
|