(text)
| 34 | // Remove comments and leading/trailing whitespace from a list of lines, and merge lines where the |
| 35 | // last character on the preceding line is "\". |
| 36 | function parseLines(text) { |
| 37 | return text.replace(/\\\n/g, "") |
| 38 | .split("\n") |
| 39 | .map((line) => line.trim()) |
| 40 | .filter((line) => (line.length > 0) && !(Array.from('#"').includes(line[0]))); |
| 41 | } |
| 42 | |
| 43 | // Returns the index of the nth occurrence of the regexp in the string. -1 if not found. |
| 44 | function nthRegexIndex(str, regex, n) { |
no test coverage detected