phanpy/src/utils/isMastodonLinkMaybe.jsx
2023-05-05 08:54:06 +08:00

6 lines
202 B
JavaScript

export default function isMastodonLinkMaybe(url) {
const { pathname } = new URL(url);
return (
/^\/.*\/\d+$/i.test(pathname) || /^\/notes\/[a-z0-9]+$/i.test(pathname) // Misskey, Calckey
);
}