RSSHub/lib/routes/obsidian/utils.ts

9 lines
172 B
TypeScript

const regex = /([^/]+)\.md$/;
const getTitle = (path: string): string => {
const match = path.match(regex);
return match ? match[1] : '';
};
export { getTitle };