Skip to content

Commit ab9efb6

Browse files
Merge pull request #86 from ConvertAPI/feature/remove-alternative-converter
Remove alternative converter support
2 parents 3fc2cbe + fe757d8 commit ab9efb6

File tree

4 files changed

+1
-40
lines changed

4 files changed

+1
-40
lines changed

examples/alternative_converter.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/task.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
normalizeFilesParam,
33
buildFileParam,
44
detectFormat,
5-
detectConverter,
65
} from './utils';
76
import 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);

src/utils.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff 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-
};

test/index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)