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

Function arrayToObject

src/core/resourceProcessor.js:274–295  ·  view source on GitHub ↗
(typeName, values, typeDefinitions)

Source from the content-addressed store, hash-verified

272 const key = this.getKeyFromPath(currPath);
273 return { key, data: JSON.parse(currFile), path: currPath };
274 } catch (err) {
275 logger.error(`读取 JSON 文件 ${currPath} 时出错:`, err);
276 return null;
277 }
278 });
279
280 for (const item of parsed) {
281 if (!item) continue;
282 this.nodeData[item.key] = item.data;
283 }
284
285 for (const item of parsed) {
286 if (!item) continue;
287 try {
288 await this.processImportFile(item.key, item.data, item.path);
289 } catch (err) {
290 logger.error(`处理 JSON 文件 ${item.path} 时出错:`, err);
291 }
292 }
293 },
294
295 isEmptyObject(obj) {
296 if (obj == null || typeof obj !== 'object') return true;
297 for (const key in obj) {
298 return false;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected