* Get overwritten module source types. * @param {Module} module module * @returns {SourceTypes | undefined} source types
(module)
| 733 | * @returns {SourceTypes | undefined} source types |
| 734 | */ |
| 735 | _getOverwrittenModuleSourceTypes(module) { |
| 736 | let newSet = false; |
| 737 | /** @type {Set<SourceType> | undefined} */ |
| 738 | let sourceTypes; |
| 739 | for (const chunk of this.getModuleChunksIterable(module)) { |
| 740 | const cgc = this._getChunkGraphChunk(chunk); |
| 741 | if (cgc.sourceTypesByModule === undefined) return; |
| 742 | const st = cgc.sourceTypesByModule.get(module); |
| 743 | if (st === undefined) return; |
| 744 | if (!sourceTypes) { |
| 745 | sourceTypes = /** @type {Set<SourceType>} */ (st); |
| 746 | } else if (!newSet) { |
| 747 | for (const type of st) { |
| 748 | if (!newSet) { |
| 749 | if (!sourceTypes.has(type)) { |
| 750 | newSet = true; |
| 751 | sourceTypes = new Set(sourceTypes); |
| 752 | sourceTypes.add(type); |
| 753 | } |
| 754 | } else { |
| 755 | sourceTypes.add(type); |
| 756 | } |
| 757 | } |
| 758 | } else { |
| 759 | for (const type of st) sourceTypes.add(type); |
| 760 | } |
| 761 | } |
| 762 | |
| 763 | return sourceTypes; |
| 764 | } |
| 765 | |
| 766 | /** |
| 767 | * Gets ordered chunk modules iterable. |
no test coverage detected