MCPcopy Create free account
hub / github.com/zxlie/FeHelper / formatJsonPathKey

Function formatJsonPathKey

apps/json-format/index.js:106–110  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

104}
105
106function formatJsonPathKey(key) {
107 return /^[A-Za-z_$][\w$]*$/.test(key)
108 ? `.${key}`
109 : `[${JSON.stringify(key)}]`;
110}
111
112function addLimited(list, value, limit = 18) {
113 if (value && list.length < limit && !list.includes(value)) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected