Files
medusa-store/www/packages/build-scripts/src/utils/find-page-heading.ts
T
Shahed Nasser 4fe28f5a95 chore: reorganize docs apps (#7228)
* reorganize docs apps

* add README

* fix directory

* add condition for old docs
2024-05-03 17:36:38 +03:00

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
}