Fields implements Fielder. Returns all fields in O(n), where n is the number of entries in the map.
()
| 74 | |
| 75 | // Fields implements Fielder. Returns all fields in O(n), where n is the number of entries in the map. |
| 76 | func (f *F) Fields() map[string]any { |
| 77 | var r map[string]any |
| 78 | |
| 79 | if f.parent != nil { |
| 80 | r = f.parent.Fields() |
| 81 | } else { |
| 82 | r = make(map[string]any) |
| 83 | } |
| 84 | |
| 85 | maps.Copy(r, f.nodes) |
| 86 | |
| 87 | return r |
| 88 | } |
| 89 | |
| 90 | // With returns a new F that has the fields in nodes. |
| 91 | func (f *F) With(nodes map[string]any) *F { |