( source: ImportSource | undefined, payload: ImportPayload, )
| 33 | } |
| 34 | |
| 35 | export function detectImportSource( |
| 36 | source: ImportSource | undefined, |
| 37 | payload: ImportPayload, |
| 38 | ): ImportSource { |
| 39 | if (source) { |
| 40 | return source |
| 41 | } |
| 42 | |
| 43 | if (payload.space === 'notes') { |
| 44 | return 'obsidian' |
| 45 | } |
| 46 | |
| 47 | if (payload.space === 'code') { |
| 48 | return detectSnippetSource(payload) |
| 49 | } |
| 50 | |
| 51 | if (hasMarkdownFiles(payload)) { |
| 52 | return 'obsidian' |
| 53 | } |
| 54 | |
| 55 | return detectSnippetSource(payload) |
| 56 | } |
no test coverage detected