convertapi
Advanced tools
+1
-1
@@ -43,3 +43,3 @@ export interface Options { | ||
| constructor (secret: string, options?: Options); | ||
| convert(toFormat: string, params: object): Promise<Result> | ||
| convert(toFormat: string, params: object, fromFormat?: string, conversionTimeout?: number): Promise<Result>; | ||
| getUser(): Promise<object>; | ||
@@ -46,0 +46,0 @@ upload(source: string | NodeJS.ReadableStream, fileName?: string): Promise<UploadResult>; |
+1
-1
@@ -40,3 +40,3 @@ 'use strict'; | ||
| const fromFormat = _this.fromFormat || (0, _utils.detectFormat)(params); | ||
| const fromFormat = _this.fromFormat || (0, _utils.detectFormat)(params, _this.toFormat); | ||
| const converter = params.converter ? `/converter/${params.converter}` : ''; | ||
@@ -43,0 +43,0 @@ const path = `convert/${fromFormat}/to/${_this.toFormat}${converter}`; |
+6
-1
@@ -48,2 +48,3 @@ 'use strict'; | ||
| const DEFAULT_URL_FORMAT = 'url'; | ||
| const ANY_FORMAT = 'any'; | ||
@@ -92,5 +93,9 @@ const normalizeFilesParam = exports.normalizeFilesParam = (() => { | ||
| const detectFormat = exports.detectFormat = params => { | ||
| const detectFormat = exports.detectFormat = (params, toFormat) => { | ||
| let resource; | ||
| if (toFormat.toString().toLowerCase() === 'zip') { | ||
| return ANY_FORMAT; | ||
| } | ||
| if (params.Url) { | ||
@@ -97,0 +102,0 @@ return DEFAULT_URL_FORMAT; |
+1
-1
| { | ||
| "name": "convertapi", | ||
| "version": "1.11.0", | ||
| "version": "1.11.1", | ||
| "description": "Official convertapi.com API client", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
+1
-1
@@ -24,3 +24,3 @@ import { normalizeFilesParam, buildFileParam, detectFormat } from './utils'; | ||
| const fromFormat = this.fromFormat || detectFormat(params); | ||
| const fromFormat = this.fromFormat || detectFormat(params, this.toFormat); | ||
| const converter = params.converter ? `/converter/${params.converter}` : ''; | ||
@@ -27,0 +27,0 @@ const path = `convert/${fromFormat}/to/${this.toFormat}${converter}`; |
+6
-1
@@ -12,2 +12,3 @@ import path from 'path'; | ||
| const DEFAULT_URL_FORMAT = 'url'; | ||
| const ANY_FORMAT = 'any'; | ||
@@ -44,5 +45,9 @@ export const normalizeFilesParam = async (promise) => { | ||
| export const detectFormat = (params) => { | ||
| export const detectFormat = (params, toFormat) => { | ||
| let resource; | ||
| if (toFormat.toString().toLowerCase() === 'zip') { | ||
| return ANY_FORMAT; | ||
| } | ||
| if (params.Url) { | ||
@@ -49,0 +54,0 @@ return DEFAULT_URL_FORMAT; |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
36601
0.87%791
1.02%