1
0
silverbullet/plug-api/lib/page.ts
2023-07-07 11:44:05 +02:00

5 lines
213 B
TypeScript

export function isValidPageName(name: string): boolean {
// Page can not be empty and not end with a file extension (e.g. "bla.md")
return name !== "" && !name.startsWith(".") && !/\.[a-zA-Z]+$/.test(name);
}