From 3e44c0dac1ad15edaaef2e259134fce9a6b4645c Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Thu, 4 Jan 2024 11:12:51 -0800 Subject: [PATCH] chore(compartment-mapper): throw if no package policy --- packages/compartment-mapper/src/node-modules.js | 6 ++++++ 1 file changed, 6 insertions(+) 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