From b298d56db5e81fc1b94c639f4b34349fdecddda2 Mon Sep 17 00:00:00 2001 From: MonsterPi <43134418+MonsterPi13@users.noreply.github.com> Date: Fri, 15 Dec 2023 15:11:09 +0800 Subject: [PATCH] refactor: simplify location parsing (#1691) * chore: maybe it's unnecessary to add this expression * style: format code --- packages/router/src/location.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/router/src/location.ts b/packages/router/src/location.ts index ef85d359..1f29cfb6 100644 --- a/packages/router/src/location.ts +++ b/packages/router/src/location.ts @@ -244,9 +244,6 @@ export function resolveRelativePath(to: string, from: string): string { return ( fromSegments.slice(0, position).join('/') + '/' + - toSegments - // ensure we use at least the last element in the toSegments - .slice(toPosition - (toPosition === toSegments.length ? 1 : 0)) - .join('/') + toSegments.slice(toPosition).join('/') ) } -- 2.47.2