getConfigsOfProjectsToRun.js 824 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.default = getConfigsOfProjectsToRun;
  6. var _getProjectDisplayName = _interopRequireDefault(
  7. require('./getProjectDisplayName')
  8. );
  9. function _interopRequireDefault(obj) {
  10. return obj && obj.__esModule ? obj : {default: obj};
  11. }
  12. /**
  13. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  14. *
  15. * This source code is licensed under the MIT license found in the
  16. * LICENSE file in the root directory of this source tree.
  17. */
  18. function getConfigsOfProjectsToRun(namesOfProjectsToRun, projectConfigs) {
  19. const setOfProjectsToRun = new Set(namesOfProjectsToRun);
  20. return projectConfigs.filter(config => {
  21. const name = (0, _getProjectDisplayName.default)(config);
  22. return name && setOfProjectsToRun.has(name);
  23. });
  24. }