( source, indent, exportsInfo, moduleGraph, requestShortener, alreadyPrinted = new Set() )
| 53 | * @returns {void} |
| 54 | */ |
| 55 | const printExportsInfoToSource = ( |
| 56 | source, |
| 57 | indent, |
| 58 | exportsInfo, |
| 59 | moduleGraph, |
| 60 | requestShortener, |
| 61 | alreadyPrinted = new Set() |
| 62 | ) => { |
| 63 | const otherExportsInfo = exportsInfo.otherExportsInfo; |
| 64 | |
| 65 | let alreadyPrintedExports = 0; |
| 66 | |
| 67 | // determine exports to print |
| 68 | /** @type {ExportInfo[]} */ |
| 69 | const printedExports = []; |
| 70 | for (const exportInfo of exportsInfo.orderedExports) { |
| 71 | if (!alreadyPrinted.has(exportInfo)) { |
| 72 | alreadyPrinted.add(exportInfo); |
| 73 | printedExports.push(exportInfo); |
| 74 | } else { |
| 75 | alreadyPrintedExports++; |
| 76 | } |
| 77 | } |
| 78 | let showOtherExports = false; |
| 79 | if (!alreadyPrinted.has(otherExportsInfo)) { |
| 80 | alreadyPrinted.add(otherExportsInfo); |
| 81 | showOtherExports = true; |
| 82 | } else { |
| 83 | alreadyPrintedExports++; |
| 84 | } |
| 85 | |
| 86 | // print the exports |
| 87 | for (const exportInfo of printedExports) { |
| 88 | const target = exportInfo.getTarget(moduleGraph); |
| 89 | source.add( |
| 90 | `${Template.toComment( |
| 91 | `${indent}export ${JSON.stringify(exportInfo.name).slice( |
| 92 | 1, |
| 93 | -1 |
| 94 | )} [${exportInfo.getProvidedInfo()}] [${exportInfo.getUsedInfo()}] [${exportInfo.getRenameInfo()}]${ |
| 95 | target |
| 96 | ? ` -> ${target.module.readableIdentifier(requestShortener)}${ |
| 97 | target.export |
| 98 | ? ` .${target.export |
| 99 | .map((e) => JSON.stringify(e).slice(1, -1)) |
| 100 | .join(".")}` |
| 101 | : "" |
| 102 | }` |
| 103 | : "" |
| 104 | }` |
| 105 | )}\n` |
| 106 | ); |
| 107 | if (exportInfo.exportsInfo) { |
| 108 | printExportsInfoToSource( |
| 109 | source, |
| 110 | `${indent} `, |
| 111 | exportInfo.exportsInfo, |
| 112 | moduleGraph, |
no test coverage detected