MCPcopy Create free account
hub / github.com/1Password/for-open-source / ParseCheckbox

Function ParseCheckbox

script/validator.go:115–125  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

113}
114
115func ParseCheckbox(value string) (bool, string, string) {
116 value = strings.TrimLeft(strings.ToLower(value), "- ")
117
118 if strings.HasPrefix(value, "[x]") {
119 return true, "true", ""
120 } else if strings.HasPrefix(value, "[]") || strings.HasPrefix(value, "[ ]") {
121 return true, "false", ""
122 }
123
124 return false, value, "could not parse checkbox"
125}
126
127func ParseNumber(value string) (bool, int, string) {
128 cleanedString := ""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected