'use strict';

const isAndCriteria = (criteria) => Object.prototype.hasOwnProperty.call(criteria, "allOf");
const isOrCriteria = (criteria) => Object.prototype.hasOwnProperty.call(criteria, "anyOf");
const isNotCriteria = (criteria) => Object.prototype.hasOwnProperty.call(criteria, "not");
const createGetRule = (rules) => {
  const rulesMap = new Map(Object.values(rules).map((rule) => [rule.name, rule]));
  return (name) => {
    const rule = rulesMap.get(name);
    if (!rule) {
      throw new Error(`Unexpected permission rule: ${name}`);
    }
    return rule;
  };
};

exports.createGetRule = createGetRule;
exports.isAndCriteria = isAndCriteria;
exports.isNotCriteria = isNotCriteria;
exports.isOrCriteria = isOrCriteria;
//# sourceMappingURL=util.cjs.js.map
