mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 23:27:55 -05:00
Various small bug fixes
This commit is contained in:
@@ -51,7 +51,7 @@ export function gearTypeToInitial(gearType: GearType) {
|
||||
|
||||
export function pathnameFromPotentialURL(maybeUrl: string) {
|
||||
try {
|
||||
return new URL(maybeUrl).pathname.replace("/", "");
|
||||
return new URL(maybeUrl).pathname.replace(/^\/+|\/+$/g, "");
|
||||
} catch {
|
||||
return maybeUrl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user