MCPcopy Create free account
hub / github.com/Crain99/cc-reverse / processJsonFiles

Function processJsonFiles

src/core/resourceProcessor.js:174–188  ·  view source on GitHub ↗

* 处理 JSON 文件 * @returns {Promise }

()

Source from the content-addressed store, hash-verified

172 const s = String(ref);
173 if (/^\d+$/.test(s) && this._uuidList[Number(s)] != null) {
174 return this._uuidList[Number(s)];
175 }
176 return s;
177 },
178
179 decodeMaybe(compact) {
180 if (compact == null) return null;
181 const s = String(compact);
182 if (s.length === 22) return uuidUtils.decodeUuid(s) || s;
183 if (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(s)) {
184 return s.toLowerCase();
185 }
186 return s;
187 },
188
189 getKeyFromPath(filePath) {
190 const basename = path.basename(filePath);
191 return basename.substring(0, basename.lastIndexOf('.')) || basename;

Callers

nothing calls this directly

Calls 2

readFileFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected