MCPcopy Create free account
hub / github.com/couchbase/fleece / canBeUnquotedJSON5Key

Function canBeUnquotedJSON5Key

Fleece/Support/JSONEncoder.cc:68–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67
68 static inline bool canBeUnquotedJSON5Key(slice key) {
69 if (key.size == 0 || isdigit(key[0]))
70 return false;
71 for (unsigned i = 0; i < key.size; i++) {
72 if (!isalnum(key[i]) && key[i] != '_' && key[i] != '$')
73 return false;
74 }
75 return true;
76 }
77
78 void JSONEncoder::writeKey(slice s) {
79 assert_precondition(s);

Callers 1

writeKeyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected