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

Function parseBoolFromFrontmatter

pkg/parser/frontmatter_hash.go:28–30  ·  view source on GitHub ↗

parseBoolFromFrontmatter extracts a boolean value from a frontmatter map. Returns false if the key is absent, the map is nil, or the value is not a bool.

(m map[string]any, key string)

Source from the content-addressed store, hash-verified

26// parseBoolFromFrontmatter extracts a boolean value from a frontmatter map.
27// Returns false if the key is absent, the map is nil, or the value is not a bool.
28func parseBoolFromFrontmatter(m map[string]any, key string) bool {
29 return typeutil.ParseBool(m, key)
30}
31
32// FileReader is a function type that reads file content
33// This abstraction allows for different file reading strategies (disk, GitHub API, in-memory, etc.)

Calls 1

ParseBoolFunction · 0.92

Tested by

no test coverage detected