MCPcopy
hub / github.com/h2oai/wave / dump

Method dump

card.go:188–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186}
187
188func (c *Card) dump() CardD {
189 data := make(map[string]any)
190 var bufs []BufD
191
192 // Look for nested buffers within form_card.
193 if v, ok := c.data["view"]; ok {
194 if v, ok := v.(string); ok && v == "form" {
195 fillFormCardBufs(c.data, data, &bufs, make([]string, 0))
196 }
197 }
198
199 for k, iv := range c.data {
200 if v, ok := iv.(Buf); ok {
201 data[dataPrefix+k] = len(bufs)
202 bufs = append(bufs, v.dump())
203 } else {
204 data[k] = deepClone(iv)
205 }
206 }
207 return CardD{data, bufs}
208}
209
210func deepClone(ix any) any {
211 switch x := ix.(type) {

Callers

nothing calls this directly

Calls 4

makeFunction · 0.85
fillFormCardBufsFunction · 0.85
deepCloneFunction · 0.85
dumpMethod · 0.65

Tested by

no test coverage detected