MCPcopy Create free account
hub / github.com/openai/plugins / parseFrontmatter

Function parseFrontmatter

plugins/plugin-eval/src/lib/frontmatter.js:237–261  ·  view source on GitHub ↗
(markdown)

Source from the content-addressed store, hash-verified

235}
236
237export function parseFrontmatter(markdown) {
238 const extracted = extractFrontmatter(markdown);
239 if (extracted.errors.length > 0) {
240 return {
241 data: null,
242 body: extracted.body,
243 errors: extracted.errors,
244 };
245 }
246
247 try {
248 const parsed = parseYamlDocument(extracted.frontmatterText);
249 return {
250 data: parsed,
251 body: extracted.body,
252 errors: [],
253 };
254 } catch (error) {
255 return {
256 data: null,
257 body: extracted.body,
258 errors: [error instanceof Error ? error.message : String(error)],
259 };
260 }
261}

Callers 4

computeSkillBudgetFunction · 0.90
computePluginBudgetFunction · 0.90
evaluateSkillFunction · 0.90

Calls 2

extractFrontmatterFunction · 0.85
parseYamlDocumentFunction · 0.85

Tested by

no test coverage detected