* reorganize docs apps * add README * fix directory * add condition for old docs
8 lines
210 B
TypeScript
8 lines
210 B
TypeScript
const HEADING_REGEX = /# (?<title>.*)/
|
|
|
|
export default function findPageHeading(content: string): string | undefined {
|
|
const headingMatch = HEADING_REGEX.exec(content)
|
|
|
|
return headingMatch?.groups?.title
|
|
}
|