You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
460 B

4 years ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = getMatchFactory;
  6. function getMatchFactory(map) {
  7. return function getMatch(args) {
  8. const match = args.reduce((list, arg, i) => {
  9. return list.filter(keyword => keyword[1][i] === arg);
  10. }, map);
  11. if (match.length) {
  12. return match[0][0];
  13. }
  14. return false;
  15. };
  16. }
  17. module.exports = exports["default"];