MCPcopy
hub / github.com/expr-lang/expr / Nature

Method Nature

types/types.go:102–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100const Extra = "[[__extra_keys__]]"
101
102func (m Map) Nature() Nature {
103 nt := NatureOf(map[string]any{})
104 if nt.TypeData == nil {
105 nt.TypeData = new(TypeData)
106 }
107 nt.Fields = make(map[string]Nature, len(m))
108 nt.Strict = true
109 for k, v := range m {
110 if k == Extra {
111 nt.Strict = false
112 natureOfDefaultValue := v.Nature()
113 nt.DefaultMapValue = &natureOfDefaultValue
114 continue
115 }
116 nt.Fields[k] = v.Nature()
117 }
118 return nt
119}
120
121func (m Map) Equal(t Type) bool {
122 if t == Any {

Callers

nothing calls this directly

Calls 2

NatureOfFunction · 0.85
NatureMethod · 0.65

Tested by

no test coverage detected