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

Method extractFeatures

pkg/workflow/frontmatter_extraction_metadata.go:19–38  ·  view source on GitHub ↗

extractFeatures extracts the features field from frontmatter Returns a map of feature flags and configuration options (supports boolean flags and string values)

(frontmatter map[string]any)

Source from the content-addressed store, hash-verified

17// extractFeatures extracts the features field from frontmatter
18// Returns a map of feature flags and configuration options (supports boolean flags and string values)
19func (c *Compiler) extractFeatures(frontmatter map[string]any) map[string]any {
20 frontmatterMetadataLog.Print("Extracting features from frontmatter")
21 value, exists := frontmatter["features"]
22 if !exists {
23 frontmatterMetadataLog.Print("No features field found in frontmatter")
24 return nil
25 }
26
27 // Features should be an object with any values (boolean or string)
28 if featuresMap, ok := value.(map[string]any); ok {
29 result := make(map[string]any)
30 // Accept any value type (boolean, string, etc.)
31 maps.Copy(result, featuresMap)
32 frontmatterMetadataLog.Printf("Extracted %d features", len(result))
33 return result
34 }
35
36 frontmatterMetadataLog.Print("Features field is not a map")
37 return nil
38}
39
40// extractDescription extracts the description field from frontmatter
41func (c *Compiler) extractDescription(frontmatter map[string]any) string {

Callers 2

extractYAMLSectionsMethod · 0.95
TestExtractFeaturesFunction · 0.95

Calls 2

PrintMethod · 0.80
PrintfMethod · 0.45

Tested by 1

TestExtractFeaturesFunction · 0.76