abhiramgp commented on code in PR #3575:
URL:
https://github.com/apache/incubator-kie-tools/pull/3575#discussion_r3284919611
##########
packages/bpmn-editor/src/normalization/normalize.ts:
##########
@@ -31,6 +32,86 @@ type WithRequiredDeep<T, K extends keyof any> = T extends
undefined
? { [P in K]-?: NonNullable<WithRequiredDeep<T[P], K>> }
: T);
+// Get the array for `key`, or create an empty one if missing.
+function addOrGetGroup<K, V>(map: Map<K, V[]>, key: K): V[] {
+ let group = map.get(key);
+ if (!group) {
+ group = [];
+ map.set(key, group);
+ }
+ return group;
+}
+
+function remapRef(remap: Map<string, string>, id: string | undefined): string
| undefined {
+ return id === undefined ? undefined : remap.get(id) ?? id;
+}
Review Comment:
sorry, I realised it and already started renaming it earlier, it's a map
from each duplicate itemDefinition id to the surviving id we want references to
point to. Renaming it to `itemDefinitionIdsToRemap`, pushing the changes in a
few minutes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]