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

Function validateFrontmatterHashInputSize

pkg/parser/frontmatter_hash.go:300–311  ·  view source on GitHub ↗
(normalizedFrontmatterText string, normalizedImportedFrontmatterTexts []string)

Source from the content-addressed store, hash-verified

298}
299
300func validateFrontmatterHashInputSize(normalizedFrontmatterText string, normalizedImportedFrontmatterTexts []string) error {
301 totalBytes := len(normalizedFrontmatterText)
302 for _, text := range normalizedImportedFrontmatterTexts {
303 totalBytes += len(text)
304 }
305
306 if totalBytes > maxFrontmatterHashInputBytes {
307 return fmt.Errorf("frontmatter hash input exceeds %d bytes after normalization", maxFrontmatterHashInputBytes)
308 }
309
310 return nil
311}
312
313// extractImportsFromText extracts import paths from frontmatter text using simple text parsing.
314// For the array form, extracts all top-level array items under "imports:".

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected