fix(nuxt): improve isNuxtError type inference (#28814)

This commit is contained in:
Gianluca Di Francesco 2024-09-03 23:43:49 +02:00 committed by Daniel Roe
parent 9f64e8cb5d
commit 083946fe40
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B

View File

@ -56,7 +56,7 @@ export const clearError = async (options: { redirect?: string } = {}) => {
/** @since 3.0.0 */ /** @since 3.0.0 */
export const isNuxtError = <DataT = unknown>( export const isNuxtError = <DataT = unknown>(
error?: string | object, error: unknown,
): error is NuxtError<DataT> => !!error && typeof error === 'object' && NUXT_ERROR_SIGNATURE in error ): error is NuxtError<DataT> => !!error && typeof error === 'object' && NUXT_ERROR_SIGNATURE in error
/** @since 3.0.0 */ /** @since 3.0.0 */