( existingAttributes: Record<string, string>, newAttributes: Record<string, string>, source: string, importer: string )
| 486 | } |
| 487 | |
| 488 | export function logInconsistentImportAttributes( |
| 489 | existingAttributes: Record<string, string>, |
| 490 | newAttributes: Record<string, string>, |
| 491 | source: string, |
| 492 | importer: string |
| 493 | ): RollupLog { |
| 494 | return { |
| 495 | code: INCONSISTENT_IMPORT_ATTRIBUTES, |
| 496 | message: `Module "${relativeId(importer)}" tried to import "${relativeId( |
| 497 | source |
| 498 | )}" with ${formatAttributes( |
| 499 | newAttributes |
| 500 | )} attributes, but it was already imported elsewhere with ${formatAttributes( |
| 501 | existingAttributes |
| 502 | )} attributes. Please ensure that import attributes for the same module are always consistent.` |
| 503 | }; |
| 504 | } |
| 505 | |
| 506 | const formatAttributes = (attributes: Record<string, string>): string => { |
| 507 | const entries = Object.entries(attributes); |
no test coverage detected
searching dependent graphs…