(filename: string, content?: string)
| 111 | * Non-throwing variant of {@link detectFormat}. |
| 112 | */ |
| 113 | export function tryDetectFormat(filename: string, content?: string): NotebookFormat | null { |
| 114 | try { |
| 115 | return detectFormat(filename, content) |
| 116 | } catch (error) { |
| 117 | if (error instanceof UnsupportedFormatError) { |
| 118 | return null |
| 119 | } |
| 120 | throw error |
| 121 | } |
| 122 | } |
no test coverage detected