cocoda-sdk 3.6.3 → 3.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@ import jskos from "jskos-tools";
|
|
|
2
2
|
import axios from "axios";
|
|
3
3
|
import { withCustomProps, listOfCapabilities, requestMethods, deepEqual } from "../utils/index.js";
|
|
4
4
|
import * as errors from "../errors/index.js";
|
|
5
|
-
const intersection = (
|
|
5
|
+
const intersection = (a1, a2) => a1.filter((x) => a2.includes(x));
|
|
6
6
|
class BaseProvider {
|
|
7
7
|
static providerName = "Base";
|
|
8
8
|
/**
|
|
@@ -90,9 +90,8 @@ class BaseProvider {
|
|
|
90
90
|
return data;
|
|
91
91
|
}, (error) => {
|
|
92
92
|
const count = error.config?._retryCount ?? 0;
|
|
93
|
-
const method = error.config.method;
|
|
94
93
|
const statusCode = error.response?.status;
|
|
95
|
-
if (this._retryConfig.methods.includes(method) && this._retryConfig.statusCodes.includes(statusCode) && count < this._retryConfig.count) {
|
|
94
|
+
if (this._retryConfig.methods.includes(error.config?.method) && this._retryConfig.statusCodes.includes(statusCode) && count < this._retryConfig.count) {
|
|
96
95
|
error.config._retryCount = count + 1;
|
|
97
96
|
if (error.config.data) {
|
|
98
97
|
error.config.data = JSON.parse(error.config.data);
|