Improve object metadata maps size (#8635)
## Context The object metadata map is becoming quite large and its structure could be simplified. We are removing byNameSingular/byNamePlural keys, the former can be retrieved through a new helper and the latter is not used in the code base currently.
This commit is contained in:
@ -9,8 +9,7 @@ export const generateObjectMetadataMaps = (
|
||||
): ObjectMetadataMaps => {
|
||||
const objectMetadataMaps: ObjectMetadataMaps = {
|
||||
byId: {},
|
||||
byNameSingular: {},
|
||||
byNamePlural: {},
|
||||
idByNameSingular: {},
|
||||
};
|
||||
|
||||
for (const objectMetadata of objectMetadataCollection) {
|
||||
@ -29,10 +28,8 @@ export const generateObjectMetadataMaps = (
|
||||
};
|
||||
|
||||
objectMetadataMaps.byId[objectMetadata.id] = processedObjectMetadata;
|
||||
objectMetadataMaps.byNameSingular[objectMetadata.nameSingular] =
|
||||
processedObjectMetadata;
|
||||
objectMetadataMaps.byNamePlural[objectMetadata.namePlural] =
|
||||
processedObjectMetadata;
|
||||
objectMetadataMaps.idByNameSingular[objectMetadata.nameSingular] =
|
||||
objectMetadata.id;
|
||||
}
|
||||
|
||||
return objectMetadataMaps;
|
||||
|
||||
Reference in New Issue
Block a user