MCPcopy Create free account
hub / github.com/LumaAI-API/Luma-API / Any2Bool

Function Any2Bool

common/utils.go:75–99  ·  view source on GitHub ↗
(data any)

Source from the content-addressed store, hash-verified

73}
74
75func Any2Bool(data any) bool {
76 if data == nil {
77 return false
78 }
79 switch data.(type) {
80 case string:
81 if data == "true" {
82 return true
83 }
84 if data == "1" {
85 return true
86 }
87 return false
88 case int:
89 if data == 1 {
90 return true
91 }
92 return false
93 case bool:
94 return data.(bool)
95 case nil:
96 return false
97 }
98 return false
99}
100
101func GetUUID() string {
102 code := uuid.New().String()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected