import state from '../state/state' ; import importFreeplane from './importFreeplane' ; import { getUniqueFilename } from './file' ; param fileContents export default function importFile ( fileContents ) { if ( fileContents . startsWith ( '<map version' ) ) { importFreeplane ( fileContents ) ; } else if ( fileContents . startsWith ( '{' ) ) { state . doc . replaceCurrentDocFromJson ( getUniqueFilename ( 'Imported m3 Document' ) , fileContents ) ; } else { console . log ( 'Unable to determine file type' ) ; } }