MCPcopy Create free account
hub / github.com/AdRoll/baker / processJSON

Method processJSON

filter/expand_json.go:117–128  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

115}
116
117func (f *ExpandJSON) processJSON(data []byte) interface{} {
118 if len(data) == 0 {
119 return nil
120 }
121 d := json.NewDecoder(bytes.NewReader(data))
122 d.UseNumber() // leave numbers as strings
123 var x interface{}
124 if err := d.Decode(&x); err != nil {
125 return nil
126 }
127 return x
128}
129
130func (f *ExpandJSON) postProcessJSON(r interface{}) []byte {
131 switch typedValue := r.(type) {

Callers 1

ProcessMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected