1
0
silverbullet/plug-api/lib/page.ts

5 lines
213 B
TypeScript
Raw Normal View History

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