MCPcopy Create free account
hub / github.com/buger/jsonparser / containerIs

Function containerIs

json_fuzz_test.go:1000–1012  ·  view source on GitHub ↗

============================================================================= Enhanced path-shape checker (catches nested D6 divergences) ============================================================================= containerIs reports whether data's first non-whitespace byte equals open. Used to ch

(data []byte, open byte)

Source from the content-addressed store, hash-verified

998// containerIs reports whether data's first non-whitespace byte equals open.
999// Used to check whether a JSON value is an object ('{') or array ('[').
1000func containerIs(data []byte, open byte) bool {
1001 for _, b := range data {
1002 switch b {
1003 case ' ', '\t', '\n', '\r':
1004 continue
1005 case open:
1006 return true
1007 default:
1008 return false
1009 }
1010 }
1011 return false
1012}
1013
1014// pathShapeMatchesData is a stricter version of pathShapeMatchesRoot that
1015// also verifies container-type compatibility at EVERY nesting level, not

Callers 2

pathShapeMatchesDataFunction · 0.85
runDifferentialGateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected