Files
med-notes/.pnpm-store/v10/files/fe/68a4777a1a896d4849bac090dfce63d218e46d685a9db00d1a657732ed6786b4496276195ba67b7a58d6c4b3931447a8a387ae8824f28adeaee698613820ae
2025-05-09 05:30:08 +02:00

30 lines
678 B
Plaintext

import type { RouteIds } from './routeInfo'
import type { RegisteredRouter } from './router'
export type NotFoundError = {
/**
@deprecated
Use `routeId: rootRouteId` instead
*/
global?: boolean
/**
@private
Do not use this. It's used internally to indicate a path matching error
*/
_global?: boolean
data?: any
throw?: boolean
routeId?: RouteIds<RegisteredRouter['routeTree']>
headers?: HeadersInit
}
export function notFound(options: NotFoundError = {}) {
;(options as any).isNotFound = true
if (options.throw) throw options
return options
}
export function isNotFound(obj: any): obj is NotFoundError {
return !!obj?.isNotFound
}