Skip to content

Commit b298d56

Browse files
authored
refactor: simplify location parsing (#1691)
* chore: maybe it's unnecessary to add this expression * style: format code
1 parent 8b59f86 commit b298d56

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/router/src/location.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ export function resolveRelativePath(to: string, from: string): string {
244244
return (
245245
fromSegments.slice(0, position).join('/') +
246246
'/' +
247-
toSegments
248-
// ensure we use at least the last element in the toSegments
249-
.slice(toPosition - (toPosition === toSegments.length ? 1 : 0))
250-
.join('/')
247+
toSegments.slice(toPosition).join('/')
251248
)
252249
}

0 commit comments

Comments
 (0)