(typeName, values, typeDefinitions)
| 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; |
nothing calls this directly
no outgoing calls
no test coverage detected