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 GitHub
parent dbb1a4e176
commit 0c9aa08858
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

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