Socket
Socket
Sign inDemoInstall

@cloudcommerce/api

Package Overview
Dependencies
0
Maintainers
1
Versions
376
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.10.7 to 2.11.0

9

lib/api.d.ts

@@ -13,2 +13,3 @@ import type { Endpoint, Config, ResponseBody, RequestBody, ErrorBody } from '../types.d';

config: Config;
url?: string;
response?: Response & {

@@ -20,3 +21,9 @@ data?: ErrorBody;

isTimeout: boolean;
constructor(config: Config, response?: ApiError['response'], msg?: string, isTimeout?: boolean);
constructor({ config, url, response, msg, isTimeout, }: {
config: Config;
url?: string;
response?: ApiError['response'];
msg?: string;
isTimeout?: boolean;
});
}

@@ -23,0 +30,0 @@ declare const def: {

15

lib/api.js

@@ -7,3 +7,5 @@ if (!globalThis.__apiCache) {

class ApiError extends Error {
constructor(config, response, msg, isTimeout = false) {
constructor({
config, url, response, msg, isTimeout = false,
}) {
if (response) {

@@ -16,2 +18,3 @@ super(response.statusText);

}
this.url = url;
this.config = config;

@@ -139,3 +142,9 @@ this.response = response;

}
throw new ApiError(config, response, msg, isTimeout);
throw new ApiError({
config,
url,
response,
msg,
isTimeout,
});
}

@@ -171,3 +180,3 @@ clearTimeout(timer);

}
throw new ApiError(config, response);
throw new ApiError({ config, url, response });
};

@@ -174,0 +183,0 @@ const get = (endpoint, config) => {

{
"name": "@cloudcommerce/api",
"type": "module",
"version": "2.10.7",
"version": "2.11.0",
"description": "E-Com Plus Cloud Commerce APIs client/adapter",

@@ -6,0 +6,0 @@ "main": "lib/api.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc