* Factory for converting substrings to data objects and adding to an output * array.
(arr, index, text, match = false)
| 100 | * array. |
| 101 | */ |
| 102 | function addSubstring(arr, index, text, match = false) { |
| 103 | arr.push({ index, text, match }); |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Split the input string to an array of data objects, each representing a |