diff --git a/src/app/+search-page/search-service/search-configuration.service.ts b/src/app/+search-page/search-service/search-configuration.service.ts index 5520b2c5aa..e55363f1f5 100644 --- a/src/app/+search-page/search-service/search-configuration.service.ts +++ b/src/app/+search-page/search-service/search-configuration.service.ts @@ -276,7 +276,7 @@ export class SearchConfigurationService implements OnDestroy { } /** - * Make sure to unsubscribe from all existing subscription to prevent memory leaksNormalizedRelationship + * Make sure to unsubscribe from all existing subscription to prevent memory leaks */ ngOnDestroy(): void { this.subs.forEach((sub) => { diff --git a/src/app/core/cache/builders/build-decorators.ts b/src/app/core/cache/builders/build-decorators.ts index f6651f2607..070f63be86 100644 --- a/src/app/core/cache/builders/build-decorators.ts +++ b/src/app/core/cache/builders/build-decorators.ts @@ -10,6 +10,11 @@ const relationshipKey = Symbol('relationship'); const relationshipMap = new Map(); const typeMap = new Map(); +/** + * Decorator function to map a normalized class to it's not-normalized counter part class + * It will also maps a type to the matching class + * @param value The not-normalized class to map to + */ export function mapsTo(value: GenericConstructor) { return function decorator(objectConstructor: GenericConstructor) { Reflect.defineMetadata(mapsToMetadataKey, value, objectConstructor); @@ -17,6 +22,12 @@ export function mapsTo(value: GenericConstructor) { } } + +/** + * Maps a type to the matching class + * @param value The resourse type + * @param objectConstructor The class to map to + */ function mapsToType(value: ResourceType, objectConstructor: GenericConstructor) { if (!objectConstructor || !value) { return; @@ -24,10 +35,18 @@ function mapsToType(value: ResourceType, objectConstructor: GenericConstructor