@@ -72,7 +72,7 @@ func (w *WI2LDiffer) convertPatchToDiffEntries(patch jsondiff.Patch) []DiffEntry
7272 FromValue : w .formatPatchValue (op .OldValue ),
7373 ToValue : w .formatPatchValue (op .Value ),
7474 // For reconstruction compatibility, use old value type
75- ValueType : w .inferValueType (op .OldValue ),
75+ ValueType : w .inferValueType (op .OldValue ),
7676 })
7777 case "move" :
7878 // Handle move operations - could be array reordering
@@ -104,12 +104,12 @@ func (w *WI2LDiffer) postProcessArrays(diffs []DiffEntry, json1, json2 string) [
104104 // Always consolidate any array element changes to whole array operations
105105 arrayChanges := make (map [string ][]DiffEntry )
106106 var result []DiffEntry
107-
107+
108108 // Parse original JSONs once
109109 var obj1 , obj2 interface {}
110110 json .Unmarshal ([]byte (json1 ), & obj1 )
111111 json .Unmarshal ([]byte (json2 ), & obj2 )
112-
112+
113113 for _ , diff := range diffs {
114114 if w .isArrayElementPath (diff .FullPath ) {
115115 arrayPath := w .getArrayPathFromElement (diff .FullPath )
@@ -118,18 +118,18 @@ func (w *WI2LDiffer) postProcessArrays(diffs []DiffEntry, json1, json2 string) [
118118 result = append (result , diff )
119119 }
120120 }
121-
121+
122122 // Consolidate ALL array changes to whole array operations
123123 for arrayPath , changes := range arrayChanges {
124124 if len (changes ) > 0 {
125125 // Get the complete arrays from both JSONs
126126 oldArray := w .getValueAtPath (obj1 , arrayPath )
127127 newArray := w .getValueAtPath (obj2 , arrayPath )
128-
128+
129129 // Determine change type based on array existence
130130 var changeType string
131131 var fromValue , toValue * string
132-
132+
133133 if oldArray == nil && newArray != nil {
134134 changeType = "added"
135135 toValue = w .formatPatchValue (newArray )
@@ -141,7 +141,7 @@ func (w *WI2LDiffer) postProcessArrays(diffs []DiffEntry, json1, json2 string) [
141141 fromValue = w .formatPatchValue (oldArray )
142142 toValue = w .formatPatchValue (newArray )
143143 }
144-
144+
145145 result = append (result , DiffEntry {
146146 FullPath : arrayPath ,
147147 FieldName : w .extractFieldNameFromPath (arrayPath ),
@@ -152,7 +152,7 @@ func (w *WI2LDiffer) postProcessArrays(diffs []DiffEntry, json1, json2 string) [
152152 })
153153 }
154154 }
155-
155+
156156 return result
157157}
158158
@@ -275,4 +275,4 @@ func (w *WI2LDiffer) inferValueType(value interface{}) string {
275275 default :
276276 return "unknown"
277277 }
278- }
278+ }
0 commit comments