File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ export function convertDtoFieldOperationTypes<
168168 origin,
169169 override,
170170} : OptionDiffReplacer = { origin : SEMI_BREAKING_CHANGE_TYPE , override : risky } ) : OperationType < J > [ ] {
171- return operationTypes . map ( ( type ) => {
171+ return operationTypes ? .map ( ( type ) => {
172172 return {
173173 ...type ,
174174 changesSummary : replacePropertyInChangesSummary < T , J > ( type . changesSummary , {
@@ -194,15 +194,22 @@ export function replacePropertyInChangesSummary<
194194 origin : SEMI_BREAKING_CHANGE_TYPE ,
195195 override : risky ,
196196 } ) : ChangeSummary < J > {
197- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
198- // @ts -ignore
199- obj [ override ] = obj [ origin ]
200- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
201- // @ts -ignore
202- delete obj [ origin ]
203- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
204- // @ts -ignore
205- return obj
197+ if ( Object . prototype . hasOwnProperty . call ( obj , origin ) ) {
198+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
199+ // @ts -ignore
200+ obj [ override ] = obj [ origin ]
201+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
202+ // @ts -ignore
203+ delete obj [ origin ]
204+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
205+ // @ts -ignore
206+ return obj
207+ } else {
208+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
209+ // @ts -ignore
210+ return obj
211+ }
212+
206213}
207214
208215export type DiffTypeCompare = DiffType | DiffTypeDto
You can’t perform that action at this time.
0 commit comments