mirror of
https://github.com/zoriya/elysia-swagger.git
synced 2025-12-06 00:36:10 +00:00
add type check in cloneHook
This commit is contained in:
@@ -106,7 +106,8 @@ export const generateOperationId = (method: string, paths: string) => {
|
||||
|
||||
const cloneHook = <T>(hook: T) => {
|
||||
if (!hook) return
|
||||
|
||||
if (typeof hook === 'string') return hook
|
||||
if (Array.isArray(hook)) return [...hook]
|
||||
return { ...hook }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user