diff --git a/packages/compartment-mapper/src/node-modules.js b/packages/compartment-mapper/src/node-modules.js index 9f94eb9d5f..10e497297d 100644 --- a/packages/compartment-mapper/src/node-modules.js +++ b/packages/compartment-mapper/src/node-modules.js @@ -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