Skip to content

Commit

Permalink
fix(compartment-mapper): fix archive producing invalid compartment maps
Browse files Browse the repository at this point in the history
  • Loading branch information
naugtur committed Nov 2, 2023
1 parent 1ab5685 commit 111eee5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/compartment-mapper/src/archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,16 @@ const translateCompartmentMap = (compartments, sources, compartmentRenames) => {
if (compartment.modules) {
for (const name of keys(compartmentModules).sort()) {
const module = compartmentModules[name];
if (module.compartment !== undefined) {
if (
module.compartment !== undefined &&
compartmentRenames[module.compartment] !== undefined
) {
modules[name] = {
...module,
compartment: compartmentRenames[module.compartment],
};
} else {
modules[name] = module;
// If compartment is not defined, the module must not be part of the compartment map.
}
}
}
Expand Down

0 comments on commit 111eee5

Please sign in to comment.