Bare key when it's a simple identifier, otherwise a quoted key (e.g. a * KeymapId like "global.searchNotes" or a "status:todo" column id).
(key: string)
| 369 | /** Bare key when it's a simple identifier, otherwise a quoted key (e.g. a |
| 370 | * KeymapId like "global.searchNotes" or a "status:todo" column id). */ |
| 371 | function tomlKey(key: string): string { |
| 372 | return /^[A-Za-z0-9_-]+$/.test(key) |
| 373 | ? key |
| 374 | : `"${key.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"` |
| 375 | } |
| 376 | |
| 377 | /** |
| 378 | * Build the TOML document text from a portable config object. Always emits |
no outgoing calls
no test coverage detected