()
| 274 | } |
| 275 | |
| 276 | toString() { |
| 277 | return this.parsedConfig |
| 278 | .map(({ line, section, subsection, name, value, modified = false }) => { |
| 279 | if (!modified) { |
| 280 | return line |
| 281 | } |
| 282 | if (name != null && value != null) { |
| 283 | if (typeof value === 'string' && /[#;]/.test(value)) { |
| 284 | // A `#` or `;` symbol denotes a comment, so we have to wrap it in double quotes |
| 285 | return `\t${name} = "${value}"` |
| 286 | } |
| 287 | return `\t${name} = ${value}` |
| 288 | } |
| 289 | if (subsection != null) { |
| 290 | return `[${section} "${subsection}"]` |
| 291 | } |
| 292 | return `[${section}]` |
| 293 | }) |
| 294 | .join('\n') |
| 295 | } |
| 296 | } |
no outgoing calls