| 63 | } |
| 64 | |
| 65 | function normalizeDiagnostics(diagnostics: Diagnostics[]) { |
| 66 | return diagnostics |
| 67 | .map((diagnostic) => { |
| 68 | if (diagnostic.name === 'EVENT_BUILD_FEATURE_USAGE') { |
| 69 | diagnostic.payload = Object.fromEntries( |
| 70 | Object.entries(diagnostic.payload).map(([key, value]) => { |
| 71 | return [ |
| 72 | key.replace( |
| 73 | /^(x86_64|i686|aarch64)-(apple-darwin|unknown-linux-(gnu|musl)|pc-windows-msvc)$/g, |
| 74 | 'platform-triplet' |
| 75 | ), |
| 76 | value, |
| 77 | ] |
| 78 | }) |
| 79 | ) |
| 80 | } |
| 81 | return diagnostic |
| 82 | }) |
| 83 | .sort((a, b) => { |
| 84 | const a_ = JSON.stringify(a) |
| 85 | const b_ = JSON.stringify(b) |
| 86 | if (a_ < b_) return -1 |
| 87 | if (a_ > b_) return 1 |
| 88 | return 0 |
| 89 | }) |
| 90 | } |
| 91 | |
| 92 | function raceIterators<T>(iterators: AsyncIterableIterator<T>[]) { |
| 93 | const nexts = iterators.map((iterator, i) => |