There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
import type { Page } from '@playwright/test';
export function getDocIdFromUrl(url: string) {
const pathname = new URL(url).pathname;
const match = pathname.match(/\/workspace\/([^/]+)\/([^/]+)\/?/);
if (match && match[2]) {
return match[2];
}
throw new Error('Failed to get doc id from url');
}
export function getCurrentDocIdFromUrl(page: Page) {
return getDocIdFromUrl(page.url());
}
export function getCurrentCollectionIdFromUrl(page: Page) {
const pathname = new URL(page.url()).pathname;
const match = pathname.match(/\/workspace\/([^/]+)\/collection\/([^/]+)\/?/);
if (match && match[2]) {
return match[2];
}
throw new Error('Failed to get collection id from url');
}