MCPcopy Create free account
hub / github.com/github/gh-aw / extractImportFrontmatterForNested

Function extractImportFrontmatterForNested

pkg/parser/import_bfs.go:340–358  ·  view source on GitHub ↗
(content []byte, item importQueueItem)

Source from the content-addressed store, hash-verified

338}
339
340func extractImportFrontmatterForNested(content []byte, item importQueueItem) (*FrontmatterResult, error) {
341 result, err := extractFrontmatterForImport(item.fullPath, content)
342 if err != nil || result == nil {
343 return result, err
344 }
345 inputsWithDefaults := applyImportSchemaDefaultsFromFrontmatter(result.Frontmatter, item.inputs)
346 if len(inputsWithDefaults) == 0 {
347 return result, nil
348 }
349 origContent := string(content)
350 substituted := substituteImportInputsInContent(origContent, inputsWithDefaults)
351 if substituted == origContent {
352 return result, nil
353 }
354 if reparse, rerr := ExtractFrontmatterFromContent(substituted); rerr == nil {
355 result = reparse
356 }
357 return result, nil
358}
359
360func extractFrontmatterForImport(fullPath string, content []byte) (*FrontmatterResult, error) {
361 if strings.HasPrefix(fullPath, BuiltinPathPrefix) {

Callers 1

handleStandardImportItemFunction · 0.85

Tested by

no test coverage detected