Skip to content

Commit

Permalink
Merge pull request #156 from Huliiiiii/main
Browse files Browse the repository at this point in the history
Add type check in cloneHook
  • Loading branch information
SaltyAom authored Nov 16, 2024
2 parents 55b86f0 + 9e4a163 commit b89ab28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}

Expand Down

0 comments on commit b89ab28

Please sign in to comment.