()
| 67 | } |
| 68 | |
| 69 | private getComponentsMap() { |
| 70 | return this.documents.reduce<ComponentsMap>((componentsMap: ComponentsMap, curDoc: Document): ComponentsMap => { |
| 71 | const curComponentsMap = curDoc.getComponentsMap() |
| 72 | if (Array.isArray(curComponentsMap)) { |
| 73 | curComponentsMap.forEach(item => { |
| 74 | const found = componentsMap.find(eItem => { |
| 75 | if ( |
| 76 | isProCodeComponentType(eItem) && |
| 77 | isProCodeComponentType(item) && |
| 78 | eItem.package === item.package && |
| 79 | eItem.version === item.version && |
| 80 | eItem.componentName === item.componentName |
| 81 | ) { |
| 82 | return true |
| 83 | } else if (isLowCodeComponentType(eItem) && eItem.componentName === item.componentName) { |
| 84 | return true |
| 85 | } |
| 86 | return false |
| 87 | }) |
| 88 | if (found) return |
| 89 | componentsMap.push(item) |
| 90 | }) |
| 91 | } |
| 92 | return componentsMap |
| 93 | }, [] as ComponentsMap) |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * load project schema |
no test coverage detected