(inputPath: string, options: ConvertOptions)
| 71 | } |
| 72 | |
| 73 | async function convertFile(inputPath: string, options: ConvertOptions): Promise<ConvertResult> { |
| 74 | const { absolutePath, isDirectory, extension: ext } = await resolvePath(inputPath) |
| 75 | |
| 76 | // Determine input format |
| 77 | const inputFormat = await determineInputFormat(absolutePath, isDirectory, ext) |
| 78 | |
| 79 | // Perform conversion |
| 80 | if (inputFormat === 'deepnote') { |
| 81 | const outputFormat = options.format ?? 'jupyter' |
| 82 | return convertFromDeepnote(absolutePath, outputFormat, options) |
| 83 | } |
| 84 | return convertToDeepnote(absolutePath, inputFormat, isDirectory, options) |
| 85 | } |
| 86 | |
| 87 | async function determineInputFormat(absolutePath: string, isDirectory: boolean, ext: string): Promise<NotebookFormat> { |
| 88 | if (ext === '.deepnote') { |
no test coverage detected