Skip to main content
Glama
changesets-parse.esm.js914 B
import yaml from 'js-yaml'; const mdRegex = /\s*---([^]*?)\n\s*---(\s*(?:\n|$)[^]*)/; function parseChangesetFile(contents) { const execResult = mdRegex.exec(contents); if (!execResult) { throw new Error(`could not parse changeset - invalid frontmatter: ${contents}`); } let [, roughReleases, roughSummary] = execResult; let summary = roughSummary.trim(); let releases; try { const yamlStuff = yaml.safeLoad(roughReleases); if (yamlStuff) { releases = Object.entries(yamlStuff).map(([name, type]) => ({ name, type })); } else { releases = []; } } catch (e) { throw new Error(`could not parse changeset - invalid frontmatter: ${contents}`); } if (!releases) { throw new Error(`could not parse changeset - unknown error: ${contents}`); } return { releases, summary }; } export { parseChangesetFile as default };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ajaystream/hubspot-mcp-custom'

If you have feedback or need assistance with the MCP directory API, please join our Discord server