( text: string, mapfn: (v: RegExpMatchArray, k: number) => T )
| 54 | export const TOKEN_MATCHER = new RegExp(REGEX, "gu"); |
| 55 | |
| 56 | export function tokenize<T>( |
| 57 | text: string, |
| 58 | mapfn: (v: RegExpMatchArray, k: number) => T |
| 59 | ) { |
| 60 | return matchAll(text, TOKEN_MATCHER, mapfn); |
| 61 | } |
| 62 | |
| 63 | //https://stackoverflow.com/a/6969486 |
| 64 | function escapeRegExp(string: string) { |
no test coverage detected