Skip to content

Commit 9e4a163

Browse files
committed
add type check in cloneHook
1 parent 55b86f0 commit 9e4a163

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ export const generateOperationId = (method: string, paths: string) => {
106106

107107
const cloneHook = <T>(hook: T) => {
108108
if (!hook) return
109-
109+
if (typeof hook === 'string') return hook
110+
if (Array.isArray(hook)) return [...hook]
110111
return { ...hook }
111112
}
112113

0 commit comments

Comments
 (0)