Function
match
(input, position, matchers)
Source from the content-addressed store, hash-verified
| 22 | // https://github.com/pocka/slack-message-parser/blob/master/LICENSE |
| 23 | |
| 24 | function match(input, position, matchers) { |
| 25 | const { length } = matchers; |
| 26 | for (let index = 0; index < length; index++) { |
| 27 | const match = matchers[index](input, position); |
| 28 | |
| 29 | if (match) { |
| 30 | return match; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | return null; |
| 35 | } |
| 36 | |
| 37 | function parse(input, matchers) { |
| 38 | const children = []; |
Tested by
no test coverage detected