text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  const minimatch = require("minimatch");
  function filterPkgs(pkgs, explicits, filters, excludes) {
      if (explicits.length) {
          pkgs = pkgs.filter((pkg) => matchesExplicits(pkg, explicits));
      }
      if (filters.length) {
          pkgs = pkgs.filter((pkg) => matchesFilters(pkg, filters));
      }
      pkgs = pkgs.filter((pkg) => !matchesFilters(pkg, excludes));
      return pkgs;
  }
  exports.filterPkgs = filterPkgs;
  function matchesExplicits(pkg, explicits) {
      for (let explicit of explicits) {
          let pkgName = pkg.jsonData.name;
          if (pkgName === explicit ||
              pkg.relDir === explicit) {
              return true;
          }
      }
      return false;
  }
  function matchesFilters(pkg, filters) {
      for (let filter of filters) {
          let pkgName = pkg.jsonData.name;
          if (pkgName && minimatch(pkg.jsonData.name, filter) ||
              minimatch(pkg.relDir, filter)) {
              return true;
          }
      }
      return false;
  }
  