getUrlPathname.tsx 136 B

1234567
  1. export default function getUrlPathname(url: string) {
  2. try {
  3. return new URL(url).pathname;
  4. } catch {
  5. return undefined;
  6. }
  7. }