[ci] yarn format

This commit is contained in:
matthewp 2021-07-26 18:43:29 +00:00 committed by GitHub Actions
parent 4726e34408
commit 23735c53cc

View file

@ -11,7 +11,7 @@ export function canonicalURL(url: string, base?: string): URL {
pathname = pathname.replace(/\/1\/?$/, ''); // neither is a trailing /1/ (impl. detail of collections)
if (!path.extname(pathname)) pathname = pathname.replace(/(\/+)?$/, '/'); // add trailing slash if theres no extension
pathname = pathname.replace(/\/+/g, '/'); // remove duplicate slashes (URL() wont)
if(base) {
if (base) {
return new URL('.' + pathname, base);
} else {
return new URL(pathname, base);