File tree Expand file tree Collapse file tree 4 files changed +1
-40
lines changed
Expand file tree Collapse file tree 4 files changed +1
-40
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22 normalizeFilesParam ,
33 buildFileParam ,
44 detectFormat ,
5- detectConverter ,
65} from './utils' ;
76import Result from './result' ;
87
@@ -27,9 +26,7 @@ const Task = class {
2726 }
2827
2928 const fromFormat = this . fromFormat || detectFormat ( params , this . toFormat ) ;
30- const converter = detectConverter ( params ) ;
31- const converterPath = converter ? `/converter/${ converter } ` : '' ;
32- const path = `convert/${ fromFormat } /to/${ this . toFormat } ${ converterPath } ` ;
29+ const path = `convert/${ fromFormat } /to/${ this . toFormat } ` ;
3330 const response = await this . api . client . post ( path , params , timeout ) ;
3431
3532 return new Result ( this . api , response ) ;
Original file line number Diff line number Diff line change @@ -109,11 +109,3 @@ export const encodeFileName = (fileName) => {
109109 const str = encodeURIComponent ( fileName ) ;
110110 return str . replace ( / [ ! ' ( ) * ] / g, c => `%${ c . charCodeAt ( 0 ) . toString ( 16 ) } ` ) ;
111111} ;
112-
113- export const detectConverter = ( params ) => {
114- const converterKey = Object . keys ( params ) . find ( key => key . toLowerCase ( ) === 'converter' ) ;
115-
116- if ( ! converterKey ) return undefined ;
117-
118- return params [ converterKey ] ;
119- } ;
Original file line number Diff line number Diff line change @@ -76,13 +76,6 @@ describe('ConvertAPI', () => {
7676 expect ( result . file . url ) . to . be . a ( 'string' ) ;
7777 } ) ;
7878
79- it ( 'should convert file using alternative converter' , async ( ) => {
80- const params = { File : 'https://cdn.convertapi.com/cara/testfiles/document.docx?test=1' , converter : 'openoffice' } ;
81- const result = await api . convert ( 'pdf' , params ) ;
82-
83- expect ( result . file . url ) . to . be . a ( 'string' ) ;
84- } ) ;
85-
8679 it ( 'should convert url to pdf' , async ( ) => {
8780 const params = { Url : 'http://convertapi.com' } ;
8881 const result = await api . convert ( 'pdf' , params , 'web' ) ;
You can’t perform that action at this time.
0 commit comments