We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e27893 commit e7d5215Copy full SHA for e7d5215
src/utils.ts
@@ -160,9 +160,13 @@ export const registerSchemaPath = ({
160
return x
161
162
case 'object':
163
- if (x && typeof x.fn !== 'string') return
+ if (
164
+ x &&
165
+ typeof (x as { fn: string | Function })?.fn !== 'string'
166
+ )
167
+ return
168
- switch (x.fn) {
169
+ switch ((x as { fn: string | Function })?.fn) {
170
case 'json':
171
case 'application/json':
172
return 'application/json'
@@ -185,7 +189,7 @@ export const registerSchemaPath = ({
185
189
}
186
190
187
191
})
188
- .filter((x) => !!x)
192
+ .filter((x) => x !== undefined)
193
194
if (!contentType || contentType.length === 0)
195
contentType = ['application/json', 'multipart/form-data', 'text/plain']
0 commit comments