Skip to content

Commit e7d5215

Browse files
committed
🔧 fix: 1.3.0-exp.1
1 parent 2e27893 commit e7d5215

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/utils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,13 @@ export const registerSchemaPath = ({
160160
return x
161161

162162
case 'object':
163-
if (x && typeof x.fn !== 'string') return
163+
if (
164+
x &&
165+
typeof (x as { fn: string | Function })?.fn !== 'string'
166+
)
167+
return
164168

165-
switch (x.fn) {
169+
switch ((x as { fn: string | Function })?.fn) {
166170
case 'json':
167171
case 'application/json':
168172
return 'application/json'
@@ -185,7 +189,7 @@ export const registerSchemaPath = ({
185189
}
186190
}
187191
})
188-
.filter((x) => !!x)
192+
.filter((x) => x !== undefined)
189193

190194
if (!contentType || contentType.length === 0)
191195
contentType = ['application/json', 'multipart/form-data', 'text/plain']

0 commit comments

Comments
 (0)