(fileName: string, mimeType: string)
| 155 | "image/svg+xml": "svg", |
| 156 | }; |
| 157 | function addExtensionIfNeeded(fileName: string, mimeType: string): string { |
| 158 | const extension = mimeToExtension[mimeType]; |
| 159 | if (!path.extname(fileName) && extension) { |
| 160 | return `${fileName}.${extension}`; |
| 161 | } |
| 162 | return fileName; |
| 163 | } |
| 164 | defaultFileName = addExtensionIfNeeded(defaultFileName, mimeType); |
| 165 | electron.dialog |
| 166 | .showSaveDialog(ww, { |
no outgoing calls
no test coverage detected