( options: ScreenshotCommandOptions, path: string, buffer: Buffer, )
| 35 | } |
| 36 | |
| 37 | function returnResult( |
| 38 | options: ScreenshotCommandOptions, |
| 39 | path: string, |
| 40 | buffer: Buffer, |
| 41 | ) { |
| 42 | if (!options.save) { |
| 43 | return buffer.toString('base64') |
| 44 | } |
| 45 | if (options.base64) { |
| 46 | return { path, base64: buffer.toString('base64') } |
| 47 | } |
| 48 | return path |
| 49 | } |