MCPcopy Index your code
hub / github.com/deepnote/deepnote / tryDetectFormat

Function tryDetectFormat

packages/convert/src/format-detection.ts:113–122  ·  view source on GitHub ↗
(filename: string, content?: string)

Source from the content-addressed store, hash-verified

111 * Non-throwing variant of {@link detectFormat}.
112 */
113export 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}

Callers 3

determineInputFormatFunction · 0.90

Calls 1

detectFormatFunction · 0.85

Tested by

no test coverage detected