()
| 142 | } |
| 143 | |
| 144 | private getComponentsMap(): IPublicTypeComponentsMap { |
| 145 | return this.documents.reduce<IPublicTypeComponentsMap>(( |
| 146 | componentsMap: IPublicTypeComponentsMap, |
| 147 | curDoc: IDocumentModel, |
| 148 | ): IPublicTypeComponentsMap => { |
| 149 | const curComponentsMap = curDoc.getComponentsMap(); |
| 150 | if (Array.isArray(curComponentsMap)) { |
| 151 | curComponentsMap.forEach((item) => { |
| 152 | const found = componentsMap.find((eItem) => { |
| 153 | if ( |
| 154 | isProCodeComponentType(eItem) && |
| 155 | isProCodeComponentType(item) && |
| 156 | eItem.package === item.package && |
| 157 | eItem.componentName === item.componentName |
| 158 | ) { |
| 159 | return true; |
| 160 | } else if ( |
| 161 | isLowCodeComponentType(eItem) && |
| 162 | eItem.componentName === item.componentName |
| 163 | ) { |
| 164 | return true; |
| 165 | } |
| 166 | return false; |
| 167 | }); |
| 168 | if (found) return; |
| 169 | componentsMap.push(item); |
| 170 | }); |
| 171 | } |
| 172 | return componentsMap; |
| 173 | }, [] as IPublicTypeComponentsMap); |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * 获取项目整体 schema |
no test coverage detected