MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / decodeJSONValue

Function decodeJSONValue

pkg/util/json/encode.go:299–316  ·  view source on GitHub ↗
(e jEntry, b []byte)

Source from the content-addressed store, hash-verified

297}
298
299func decodeJSONValue(e jEntry, b []byte) ([]byte, JSON, error) {
300 switch e.typCode {
301 case trueTag:
302 return b, TrueJSONValue, nil
303 case falseTag:
304 return b, FalseJSONValue, nil
305 case nullTag:
306 return b, NullJSONValue, nil
307 case stringTag:
308 return b[e.length:], jsonString(b[:e.length]), nil
309 case numberTag:
310 return decodeJSONNumber(b)
311 case containerTag:
312 return DecodeJSON(b)
313 }
314 return b, nil, errors.AssertionFailedf(
315 "error decoding JSON value, unexpected type code: %d", errors.Safe(e.typCode))
316}

Callers 3

DecodeJSONFunction · 0.85
decodeJSONArrayFunction · 0.85
decodeJSONObjectFunction · 0.85

Calls 3

jsonStringTypeAlias · 0.85
decodeJSONNumberFunction · 0.85
DecodeJSONFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…