MCPcopy Index your code
hub / github.com/json5/json5 / serializeKey

Function serializeKey

lib/stringify.js:208–225  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

206 }
207
208 function serializeKey (key) {
209 if (key.length === 0) {
210 return quoteString(key, true)
211 }
212
213 const firstChar = String.fromCodePoint(key.codePointAt(0))
214 if (!util.isIdStartChar(firstChar)) {
215 return quoteString(key, true)
216 }
217
218 for (let i = firstChar.length; i < key.length; i++) {
219 if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
220 return quoteString(key, true)
221 }
222 }
223
224 return key
225 }
226
227 function serializeArray (value) {
228 if (stack.indexOf(value) >= 0) {

Callers 1

serializeObjectFunction · 0.85

Calls 1

quoteStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…