AK: Properly implement steps for shortening a URLs path

Instead of implementing this inline, put it into a function. Use this
new function to correctly implement shortening paths for some places
where this logic was previously missing.

Before these changes, the pathname for the included test was incorrectly
being set to '/' as we were not considering the windows drive letter.
This commit is contained in:
Shannon Booth 2023-09-17 13:15:52 +12:00 committed by Andreas Kling
commit 453dd0cf44
Notes: sideshowbarker 2024-07-17 00:25:35 +09:00
4 changed files with 36 additions and 6 deletions

View file

@ -68,3 +68,13 @@ port => ''
pathname => '/hello'
search => ''
hash => ''
new URL('//d:/..', 'file:///C:/a/b')
protocol => 'file:'
username => ''
password => ''
host => ''
hostname => ''
port => ''
pathname => '/d:/'
search => ''
hash => ''