policyLookupHelper = (packagePolicy, field, itemName) => {
  if (!POLICY_FIELDS_LOOKUP.includes(field)) {
    throw Error(`Invalid field ${q(field)}`);
  }
  if (
    typeof packagePolicy !== 'object' ||
    packagePolicy === null ||
    !packagePolicy[field]
  ) {
    return false;
  }

  if (packagePolicy[field] === WILDCARD_POLICY_VALUE) {
    return true;
  }

  const value = /** @type {import('./types.js').AttenuationDefinition} */ (
    packagePolicy[field]
  );
  if (itemName in value) {
    return value[itemName];
  }
  return false;
}
@param {import('./types.js').PackagePolicy} packagePolicy
@param {'builtins'|'globals'|'packages'} field
@param {string} itemName
@returns {boolean | import('./types.js').AttenuationDefinition}