refactor(zod-openapi): change the position of functions (#688)

pull/687/head
Yusuke Wada 2024-08-10 16:10:24 +09:00 committed by GitHub
parent 96b0fd6174
commit 0add2f5800
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 11 deletions

View File

@ -259,17 +259,6 @@ export type OpenAPIObjectConfigure<E extends Env, P extends string> =
| OpenAPIObjectConfig
| ((context: Context<E, P>) => OpenAPIObjectConfig)
const isJSONContentType = (contentType: string) => {
return /^application\/([a-z-\.]+\+)?json/.test(contentType)
}
const isFormContentType = (contentType: string) => {
return (
contentType.startsWith('multipart/form-data') ||
contentType.startsWith('application/x-www-form-urlencoded')
)
}
export class OpenAPIHono<
E extends Env = Env,
S extends Schema = {},
@ -593,3 +582,14 @@ function addBasePathToDocument(document: Record<string, any>, basePath: string)
paths: updatedPaths,
}
}
function isJSONContentType(contentType: string) {
return /^application\/([a-z-\.]+\+)?json/.test(contentType)
}
function isFormContentType(contentType: string) {
return (
contentType.startsWith('multipart/form-data') ||
contentType.startsWith('application/x-www-form-urlencoded')
)
}