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

Function validContainerPrimitive

parser.go:2417–2429  ·  view source on GitHub ↗

SYS-REQ-112

(value []byte)

Source from the content-addressed store, hash-verified

2415
2416// SYS-REQ-112
2417func validContainerPrimitive(value []byte) bool {
2418 for len(value) > 0 && isContainerWhitespace(value[len(value)-1]) {
2419 value = value[:len(value)-1]
2420 }
2421 if len(value) == 0 {
2422 return false
2423 }
2424
2425 if bytes.Equal(value, trueLiteral) || bytes.Equal(value, falseLiteral) || bytes.Equal(value, nullLiteral) {
2426 return true
2427 }
2428 return validJSONNumber(value)
2429}
2430
2431// SYS-REQ-112
2432func validJSONNumber(value []byte) bool {

Callers 1

scanContainerLenFunction · 0.85

Calls 2

isContainerWhitespaceFunction · 0.85
validJSONNumberFunction · 0.85

Tested by

no test coverage detected