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

Function firstForbiddenCharInParamValue

pkg/workflow/model_identifier.go:146–153  ·  view source on GitHub ↗

firstForbiddenCharInParamValue returns the first character in s that is not in [A-Za-z0-9._-], or 0 if all characters are allowed. Used for parameter values (V-MAF-006).

(s string)

Source from the content-addressed store, hash-verified

144// [A-Za-z0-9._-], or 0 if all characters are allowed.
145// Used for parameter values (V-MAF-006).
146func firstForbiddenCharInParamValue(s string) rune {
147 for _, r := range s {
148 if !isAlpha(r) && !isDigit(r) && r != '_' && r != '.' && r != '-' {
149 return r
150 }
151 }
152 return 0
153}
154
155func isAlpha(r rune) bool { return isLetter(r) }
156

Callers 1

validateParamValueFunction · 0.85

Calls 2

isAlphaFunction · 0.85
isDigitFunction · 0.85

Tested by

no test coverage detected