MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / parseFrontmatterObject

Function parseFrontmatterObject

src/workspaces/issues/mutate.ts:258–267  ·  view source on GitHub ↗

Parse a YAML frontmatter block into a plain object, or null when it isn't a * mapping. Yields the RAW object for in-place merge — the record from * `parseIssueContent` has defaults baked in and drops author keys we want to * keep verbatim (the caller has already validated parseability).

(frontmatter: string)

Source from the content-addressed store, hash-verified

256 * `parseIssueContent` has defaults baked in and drops author keys we want to
257 * keep verbatim (the caller has already validated parseability). */
258function parseFrontmatterObject(frontmatter: string): Record<string, unknown> | null {
259 let data: unknown
260 try {
261 data = parseYaml(frontmatter)
262 } catch {
263 return null
264 }
265 if (data === null || typeof data !== 'object' || Array.isArray(data)) return null
266 return data as Record<string, unknown>
267}

Callers 1

updateIssueFieldsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected