File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -149,11 +149,13 @@ function cacheDto(dto) {
149
149
}
150
150
151
151
function dtoInCache (dto ) {
152
+ const existsNamed = namedDtoCache .hasOwnProperty (dto .signature )
152
153
// always prefer user specified name even when we have a similar DTO in cache for generated names
153
154
if (dto .hasUserProvidedName ) {
154
- return namedDtoCache . hasOwnProperty ( dto . signature )
155
+ return existsNamed
155
156
}
156
- return dtoCache .hasOwnProperty (dto .signature )
157
+ // prefer to re-use named DTO
158
+ return existsNamed || dtoCache .hasOwnProperty (dto .signature )
157
159
}
158
160
159
161
function obtainDtoName (dto ) {
Original file line number Diff line number Diff line change @@ -164,11 +164,13 @@ function cacheDto(dto) {
164
164
165
165
// LATER: reduce duplication with routes.go.ejs
166
166
function dtoInCache (dto ) {
167
+ const existsNamed = namedDtoCache .hasOwnProperty (dto .signature )
167
168
// always prefer user specified name even when we have a similar DTO in cache for generated names
168
169
if (dto .hasUserProvidedName ) {
169
- return namedDtoCache . hasOwnProperty ( dto . signature )
170
+ return existsNamed
170
171
}
171
- return dtoCache .hasOwnProperty (dto .signature )
172
+ // prefer to re-use named DTO
173
+ return existsNamed || dtoCache .hasOwnProperty (dto .signature )
172
174
}
173
175
174
176
function obtainDtoName (dto ) {
You can’t perform that action at this time.
0 commit comments