MCPcopy
hub / github.com/davyxu/tabtoy / valueWrapperJson

Function valueWrapperJson

v2/printer/json.go:11–21  ·  view source on GitHub ↗
(t model.FieldType, node *model.Node)

Source from the content-addressed store, hash-verified

9)
10
11func valueWrapperJson(t model.FieldType, node *model.Node) string {
12
13 switch t {
14 case model.FieldType_String:
15 return util.StringWrap(util.StringEscape(node.Value))
16 case model.FieldType_Enum:
17 return strconv.Itoa(int(node.EnumValue))
18 }
19
20 return node.Value
21}
22
23type jsonPrinter struct {
24}

Callers 1

printTableJsonFunction · 0.85

Calls 2

StringWrapFunction · 0.92
StringEscapeFunction · 0.92

Tested by

no test coverage detected