(patterns: string[], values: string[])
| 27 | typeof __webpack_require__ === "function" ? __non_webpack_require__ : require; |
| 28 | |
| 29 | export function matchPatterns(patterns: string[], values: string[]) { |
| 30 | const fullyQualifiedActions: string[] = []; |
| 31 | patterns.forEach(pattern => { |
| 32 | if (pattern.includes(".")) { |
| 33 | if (values.includes(pattern)) { |
| 34 | fullyQualifiedActions.push(pattern); |
| 35 | } |
| 36 | } else { |
| 37 | const matchingActions = values.filter(value => pattern === value.split(".").slice(-1)[0]); |
| 38 | if (matchingActions.length === 0) { |
| 39 | return; |
| 40 | } |
| 41 | if (matchingActions.length > 1) { |
| 42 | throw new Error(ambiguousActionNameMsg(pattern, matchingActions)); |
| 43 | } |
| 44 | fullyQualifiedActions.push(matchingActions[0]); |
| 45 | } |
| 46 | }); |
| 47 | return fullyQualifiedActions; |
| 48 | } |
| 49 | |
| 50 | export function getCallerFile(rootDir: string) { |
| 51 | let lastfile: string; |
nothing calls this directly
no test coverage detected