}
function resolve(
- // NOTE: it's easier to by pass the type generics which are just for type inference in the resolved route
rawLocation: RouteLocationRaw,
currentLocation?: RouteLocationNormalizedLoaded
): RouteLocationResolved {
hash: decode(locationNormalized.hash),
redirectedFrom: undefined,
href,
- }) as any // FIXME:
+ })
}
if (__DEV__ && !isRouteLocation(rawLocation)) {
? normalizeQuery(rawLocation.query)
: ((rawLocation.query || {}) as LocationQuery),
},
- // make it typed
- matchedRoute as RouteLocation,
+ matchedRoute,
{
redirectedFrom: undefined,
href,
if (
__DEV__ &&
- (!('path' in newTargetLocation) || newTargetLocation.path == null) &&
+ newTargetLocation.path == null &&
!('name' in newTargetLocation)
) {
warn(
}
function pushWithRedirect(
- to: RouteLocationRaw,
+ to: RouteLocationRaw | RouteLocation,
redirectedFrom?: RouteLocation
): Promise<NavigationFailure | void | undefined> {
const targetLocation: RouteLocation = (pendingLocation = resolve(to))