Skip to content

Commit b89ab28

Browse files
authored
Merge pull request #156 from Huliiiiii/main
Add type check in cloneHook
2 parents 55b86f0 + 9e4a163 commit b89ab28

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)