abbot-http-client 0.0.34 → 0.0.35
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.
- package/dist/index.cjs +10 -10
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +10 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -202,18 +202,18 @@ function axiosConf(cfg) {
|
|
|
202
202
|
var AbbotHttp = class {
|
|
203
203
|
config = defaultConfig;
|
|
204
204
|
constructor(config) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
target[key] = srcVal;
|
|
205
|
+
function deepMerge(target, source) {
|
|
206
|
+
for (const key in source) {
|
|
207
|
+
const srcVal = source[key];
|
|
208
|
+
if (srcVal && typeof srcVal === "object" && !Array.isArray(srcVal)) {
|
|
209
|
+
target[key] = deepMerge(target[key], srcVal);
|
|
210
|
+
} else if (srcVal !== void 0) {
|
|
211
|
+
target[key] = srcVal;
|
|
212
|
+
}
|
|
214
213
|
}
|
|
214
|
+
return target;
|
|
215
215
|
}
|
|
216
|
-
|
|
216
|
+
this.config = deepMerge(this.config, config);
|
|
217
217
|
}
|
|
218
218
|
createAxiosInstance(option) {
|
|
219
219
|
const axios2 = axiosConf(this.config);
|
package/dist/index.d.cts
CHANGED
|
@@ -55,7 +55,6 @@ interface AbbotResponse$1<T> {
|
|
|
55
55
|
declare class AbbotHttp {
|
|
56
56
|
protected config: AbbotConfig;
|
|
57
57
|
constructor(config: DeepPartial<AbbotConfig>);
|
|
58
|
-
protected deepMerge<T>(target: T, source: DeepPartial<T>): T;
|
|
59
58
|
protected createAxiosInstance(option?: Partial<MethodOption>): AxiosInstance;
|
|
60
59
|
protected prepareRequestConfig(option?: Partial<MethodOption>): {
|
|
61
60
|
cryp: Cryp;
|
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,6 @@ interface AbbotResponse$1<T> {
|
|
|
55
55
|
declare class AbbotHttp {
|
|
56
56
|
protected config: AbbotConfig;
|
|
57
57
|
constructor(config: DeepPartial<AbbotConfig>);
|
|
58
|
-
protected deepMerge<T>(target: T, source: DeepPartial<T>): T;
|
|
59
58
|
protected createAxiosInstance(option?: Partial<MethodOption>): AxiosInstance;
|
|
60
59
|
protected prepareRequestConfig(option?: Partial<MethodOption>): {
|
|
61
60
|
cryp: Cryp;
|
package/dist/index.js
CHANGED
|
@@ -165,18 +165,18 @@ function axiosConf(cfg) {
|
|
|
165
165
|
var AbbotHttp = class {
|
|
166
166
|
config = defaultConfig;
|
|
167
167
|
constructor(config) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
target[key] = srcVal;
|
|
168
|
+
function deepMerge(target, source) {
|
|
169
|
+
for (const key in source) {
|
|
170
|
+
const srcVal = source[key];
|
|
171
|
+
if (srcVal && typeof srcVal === "object" && !Array.isArray(srcVal)) {
|
|
172
|
+
target[key] = deepMerge(target[key], srcVal);
|
|
173
|
+
} else if (srcVal !== void 0) {
|
|
174
|
+
target[key] = srcVal;
|
|
175
|
+
}
|
|
177
176
|
}
|
|
177
|
+
return target;
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
this.config = deepMerge(this.config, config);
|
|
180
180
|
}
|
|
181
181
|
createAxiosInstance(option) {
|
|
182
182
|
const axios2 = axiosConf(this.config);
|