Kusuma04-dev commented on code in PR #3305:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3305#discussion_r2434690969


##########
packages/i18n/src/core/immutableDeepMerge.ts:
##########
@@ -19,25 +19,30 @@
 
 import { DictionaryInterpolation, ReferenceDictionary, TranslatedDictionary } 
from "./Dictionary";
 
-function deepMerge<D>(target: ReferenceDictionary, source: 
TranslatedDictionary<ReferenceDictionary>) {
+function deepMerge<D extends ReferenceDictionary<D>>(
+  target: ReferenceDictionary<D>,
+  source: TranslatedDictionary<ReferenceDictionary<D>>
+): ReferenceDictionary<D> {
   Object.keys(source).forEach((key: Extract<keyof D, string>) => {
     const sourceValue = source[key];
 
     if (!sourceValue) {
       return;
     }
     if (typeof sourceValue === "string" || typeof sourceValue === "function") {
-      target[key] = sourceValue as string | DictionaryInterpolation;
+      target[key] = sourceValue as any;
     } else {
-      target[key] = deepMerge(createObjectCopy(target[key] as 
ReferenceDictionary), sourceValue as ReferenceDictionary);
+      target[key] = deepMerge(
+        createObjectCopy(target[key] as ReferenceDictionary<D>),
+        sourceValue as TranslatedDictionary<ReferenceDictionary<D>>
+      ) as any;

Review Comment:
   Thanks for the review @ljmotta. If we need to replace any then it can be 
with `as unknown as ReferenceDictionary<D>[typeof key];`. Is this okay ? 



-- 
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]

Reply via email to