Merge pull request #156 from Huliiiiii/main

Add type check in cloneHook
This commit is contained in:
SaltyAom
2024-11-17 05:31:58 +07:00
committed by GitHub

View File

@@ -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 }
}