Skip to content

Commit

Permalink
fix(compartment-mapper): throw if policy/packagePolicy mismatch
Browse files Browse the repository at this point in the history
The logic forbids it, but type inference doesn't necessarily--better to be safe.
  • Loading branch information
boneskull committed Jan 9, 2024
1 parent ed6f23e commit ece09e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/compartment-mapper/src/node-modules.js
Expand Up @@ -612,6 +612,12 @@ const translateGraph = (
policy,
);

/* c8 ignore next */
if (policy && !packagePolicy) {
// this should never happen
throw new TypeError('Unexpectedly falsy package policy');
}

/**
* @param {string} dependencyName
* @param {string} packageLocation
Expand Down

0 comments on commit ece09e2

Please sign in to comment.