Files
medusa-store/www/apps/resources/utils/find-page-heading.mjs
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

13 lines
277 B
JavaScript

const HEADING_REGEX = /# (?<title>.*)/
/**
*
* @param {string} content - The content to search
* @returns {string | undefined}
*/
export default function findPageHeading(content) {
const headingMatch = HEADING_REGEX.exec(content)
return headingMatch?.groups?.title
}