Skip to content

Commit 868a287

Browse files
committed
chore(compartment-mapper): add note about package policy handling
1 parent 4afedea commit 868a287

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/compartment-mapper/src/policy.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,13 @@ export const makePackagePolicy = (label, { policy } = {}) => {
155155
};
156156
} else if (label === ENTRY_COMPARTMENT) {
157157
packagePolicy = policy.entry;
158+
// If policy.entry is `undefined`, we return `undefined` which is
159+
// equivalent to "allow everything".
158160
return packagePolicy;
159161
} else if (label) {
160162
packagePolicy = policy.resources?.[label];
161163
}
164+
// An empty object for a package policy is equivalent to "allow nothing"
162165
return packagePolicy ?? create(null);
163166
}
164167
return undefined;

0 commit comments

Comments
 (0)