MCPcopy Create free account
hub / github.com/Autodesk/AutomaticComponentToolkit / diffParam

Function diffParam

Source/componentdiff.go:93–130  ·  view source on GitHub ↗
(path string, paramA ComponentDefinitionParam, paramB ComponentDefinitionParam)

Source from the content-addressed store, hash-verified

91}
92
93func diffParam(path string, paramA ComponentDefinitionParam, paramB ComponentDefinitionParam) ([]ComponentDiffAttributeChange, error) {
94 changes := make([]ComponentDiffAttributeChange, 0)
95
96 pathA := path + "/param[@name='" + paramA.ParamName + "']"
97 if (paramA.ParamDescription != paramB.ParamDescription) {
98 var change ComponentDiffAttributeChange
99 change.Path = pathA + "/description"
100 change.OldValue = paramA.ParamDescription
101 change.NewValue = paramB.ParamDescription
102 changes = append(changes, change)
103 }
104
105 if (paramA.ParamPass != paramB.ParamPass) {
106 var change ComponentDiffAttributeChange
107 change.Path = pathA + "/pass"
108 change.OldValue = paramA.ParamPass
109 change.NewValue = paramB.ParamPass
110 changes = append(changes, change)
111 }
112
113 if (paramA.ParamType != paramB.ParamType) {
114 var change ComponentDiffAttributeChange
115 change.Path = pathA + "/type"
116 change.OldValue = paramA.ParamType
117 change.NewValue = paramB.ParamType
118 changes = append(changes, change)
119 }
120
121 if (paramA.ParamClass != paramB.ParamClass) {
122 var change ComponentDiffAttributeChange
123 change.Path = pathA + "/class"
124 change.OldValue = paramA.ParamClass
125 change.NewValue = paramB.ParamClass
126 changes = append(changes, change)
127 }
128
129 return changes, nil
130}
131
132func diffMethod(path string, methodA ComponentDefinitionMethod, methodB ComponentDefinitionMethod) ([]ComponentDiffElementAdd, []ComponentDiffElementRemove, []ComponentDiffAttributeChange, error) {
133 changes := make([]ComponentDiffAttributeChange, 0)

Callers 1

diffMethodFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected