Skip to content

Commit

Permalink
fix(useFetch): check if it's object for isFetchOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 5, 2023
1 parent cc7f48b commit c2bc621
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/useFetch/index.ts
Expand Up @@ -211,7 +211,7 @@ export interface CreateFetchOptions {
* to include the new options
*/
function isFetchOptions(obj: object): obj is UseFetchOptions {
return containsProp(obj, 'immediate', 'refetch', 'initialData', 'timeout', 'beforeFetch', 'afterFetch', 'onFetchError', 'fetch')
return obj && containsProp(obj, 'immediate', 'refetch', 'initialData', 'timeout', 'beforeFetch', 'afterFetch', 'onFetchError', 'fetch')
}

// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
Expand Down

0 comments on commit c2bc621

Please sign in to comment.