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

Function validContainerPrimitive

parser.go:2285–2297  ·  view source on GitHub ↗

SYS-REQ-112

(value []byte)

Source from the content-addressed store, hash-verified

2283
2284// SYS-REQ-112
2285func validContainerPrimitive(value []byte) bool {
2286 for len(value) > 0 && isContainerWhitespace(value[len(value)-1]) {
2287 value = value[:len(value)-1]
2288 }
2289 if len(value) == 0 {
2290 return false
2291 }
2292
2293 if bytes.Equal(value, trueLiteral) || bytes.Equal(value, falseLiteral) || bytes.Equal(value, nullLiteral) {
2294 return true
2295 }
2296 return validJSONNumber(value)
2297}
2298
2299// SYS-REQ-112
2300func validJSONNumber(value []byte) bool {

Callers 1

scanContainerLenFunction · 0.85

Calls 2

isContainerWhitespaceFunction · 0.85
validJSONNumberFunction · 0.85

Tested by

no test coverage detected