From b0cf35e4223920c611b2e683a9279fdd74bf995d Mon Sep 17 00:00:00 2001 From: Lotte Hofstede Date: Thu, 25 Jul 2019 11:55:55 +0200 Subject: [PATCH] added missing typedoc --- .../search-configuration.service.ts | 2 +- .../core/cache/builders/build-decorators.ts | 19 +++++++++++++++++++ .../config-submission-definition.model.ts | 3 +++ src/app/core/shared/resource-type.ts | 3 +++ 4 files changed, 26 insertions(+), 1 deletion(-) 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