(entry)
| 119 | // --- Commands --- |
| 120 | |
| 121 | function normalizeStateEntry(entry) { |
| 122 | if (!entry) { |
| 123 | return { source: '', translation: '' }; |
| 124 | } |
| 125 | |
| 126 | if (typeof entry === 'string') { |
| 127 | return { source: entry, translation: '' }; |
| 128 | } |
| 129 | |
| 130 | if (typeof entry === 'object') { |
| 131 | return { |
| 132 | source: entry.source ?? '', |
| 133 | translation: entry.translation ?? '' |
| 134 | }; |
| 135 | } |
| 136 | |
| 137 | return { source: '', translation: '' }; |
| 138 | } |
| 139 | |
| 140 | /** `sync`: Updates manifest and state files. */ |
| 141 | async function sync() { |
no outgoing calls
no test coverage detected