New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

convertapi

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convertapi - npm Package Compare versions

Comparing version
1.11.0
to
1.11.1
+1
-1
index.d.ts

@@ -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>;

@@ -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}`;

@@ -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;

{
"name": "convertapi",
"version": "1.11.0",
"version": "1.11.1",
"description": "Official convertapi.com API client",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -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}`;

@@ -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;