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

Function validContainerPrimitive

parser.go:2358–2370  ·  view source on GitHub ↗

SYS-REQ-112

(value []byte)

Source from the content-addressed store, hash-verified

2356
2357// SYS-REQ-112
2358func validContainerPrimitive(value []byte) bool {
2359 for len(value) > 0 && isContainerWhitespace(value[len(value)-1]) {
2360 value = value[:len(value)-1]
2361 }
2362 if len(value) == 0 {
2363 return false
2364 }
2365
2366 if bytes.Equal(value, trueLiteral) || bytes.Equal(value, falseLiteral) || bytes.Equal(value, nullLiteral) {
2367 return true
2368 }
2369 return validJSONNumber(value)
2370}
2371
2372// SYS-REQ-112
2373func validJSONNumber(value []byte) bool {

Callers 1

scanContainerLenFunction · 0.85

Calls 2

isContainerWhitespaceFunction · 0.85
validJSONNumberFunction · 0.85

Tested by

no test coverage detected