Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
423 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.default = getMatchFactory;
|
---|
7 |
|
---|
8 | function getMatchFactory(map) {
|
---|
9 | return function getMatch(args) {
|
---|
10 | const match = args.reduce((list, arg, i) => {
|
---|
11 | return list.filter(keyword => keyword[1][i] === arg);
|
---|
12 | }, map);
|
---|
13 |
|
---|
14 | if (match.length) {
|
---|
15 | return match[0][0];
|
---|
16 | }
|
---|
17 |
|
---|
18 | return false;
|
---|
19 | };
|
---|
20 | }
|
---|
21 |
|
---|
22 | module.exports = exports.default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.