File tree Expand file tree Collapse file tree
packages/superdoc/src/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -221,6 +221,7 @@ export class SuperDoc extends EventEmitter {
221221 const doc = this . config . document ;
222222 const hasDocumentConfig = ! ! doc && typeof doc === 'object' && Object . keys ( this . config . document ) ?. length ;
223223 const hasDocumentUrl = ! ! doc && typeof doc === 'string' && doc . length > 0 ;
224+ const hasDocumentFile = ! ! doc && doc instanceof File ;
224225 const hasListOfDocuments = this . config . documents && this . config . documents ?. length ;
225226 if ( hasDocumentConfig && hasListOfDocuments ) {
226227 console . warn ( '🦋 [superdoc] You can only provide one of document or documents' ) ;
@@ -237,6 +238,15 @@ export class SuperDoc extends EventEmitter {
237238 isNewFile : true ,
238239 } ,
239240 ] ;
241+ } else if ( hasDocumentFile ) {
242+ this . config . documents = [
243+ {
244+ type : this . config . document . type ,
245+ data : this . config . document ,
246+ name : this . config . document . name ,
247+ isNewFile : true ,
248+ } ,
249+ ] ;
240250 }
241251 }
242252
You can’t perform that action at this time.
0 commit comments