| 122 | } |
| 123 | |
| 124 | getNodeMetas(): Record<ModuleUID, ModuleMeta> { |
| 125 | const nodeMetas: Record<ModuleUID, ModuleMeta> = {}; |
| 126 | for (const { uid: metaUid, meta } of Object.values(this.nodeMetas)) { |
| 127 | nodeMetas[metaUid] = { |
| 128 | ...meta, |
| 129 | imported: [...meta.imported].map((rawImport) => { |
| 130 | const [uid, dynamic] = rawImport.split(","); |
| 131 | const importData: ModuleImport = { uid }; |
| 132 | if (dynamic === "true") { |
| 133 | importData.dynamic = true; |
| 134 | } |
| 135 | return importData; |
| 136 | }), |
| 137 | importedBy: [...meta.importedBy].map((rawImport) => { |
| 138 | const [uid, dynamic] = rawImport.split(","); |
| 139 | const importData: ModuleImport = { uid }; |
| 140 | if (dynamic === "true") { |
| 141 | importData.dynamic = true; |
| 142 | } |
| 143 | return importData; |
| 144 | }), |
| 145 | }; |
| 146 | } |
| 147 | return nodeMetas; |
| 148 | } |
| 149 | |
| 150 | addImportedByLink(targetId: string, sourceId: string): void { |
| 151 | const sourceUid = this.getModuleUid(sourceId); |