(line)
| 36 | } |
| 37 | |
| 38 | function _stripTomlComment(line) { |
| 39 | let out = ''; |
| 40 | let quote = null; |
| 41 | let escaped = false; |
| 42 | for (const ch of String(line || '')) { |
| 43 | if (escaped) { |
| 44 | out += ch; |
| 45 | escaped = false; |
| 46 | continue; |
| 47 | } |
| 48 | if (ch === '\\' && quote === '"') { |
| 49 | out += ch; |
| 50 | escaped = true; |
| 51 | continue; |
| 52 | } |
| 53 | if ((ch === '"' || ch === "'") && !quote) { |
| 54 | quote = ch; |
| 55 | out += ch; |
| 56 | continue; |
| 57 | } |
| 58 | if (ch === quote) { |
| 59 | quote = null; |
| 60 | out += ch; |
| 61 | continue; |
| 62 | } |
| 63 | if (ch === '#' && !quote) break; |
| 64 | out += ch; |
| 65 | } |
| 66 | return out.trim(); |
| 67 | } |
| 68 | |
| 69 | function _tomlStringValue(value) { |
| 70 | const raw = _stripTomlComment(value); |
no outgoing calls
no test coverage detected