axios 1.9.0 → 1.12.0
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/CHANGELOG.md +76 -0
- package/README.md +31 -28
- package/dist/axios.js +398 -292
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +2 -2
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +333 -217
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +333 -217
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +2 -2
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +424 -217
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +23 -8
- package/index.d.ts +11 -5
- package/lib/adapters/adapters.js +6 -4
- package/lib/adapters/fetch.js +220 -163
- package/lib/adapters/http.js +18 -0
- package/lib/adapters/xhr.js +11 -8
- package/lib/core/Axios.js +2 -2
- package/lib/core/AxiosError.js +10 -3
- package/lib/core/dispatchRequest.js +1 -1
- package/lib/core/mergeConfig.js +1 -1
- package/lib/defaults/index.js +1 -1
- package/lib/env/data.js +1 -1
- package/lib/helpers/buildURL.js +1 -3
- package/lib/helpers/estimateDataURLDecodedBytes.js +73 -0
- package/lib/helpers/resolveConfig.js +13 -9
- package/lib/helpers/throttle.js +1 -1
- package/lib/helpers/toFormData.js +4 -0
- package/lib/helpers/toURLEncodedForm.js +4 -3
- package/lib/utils.js +42 -2
- package/package.json +24 -12
package/lib/adapters/http.js
CHANGED
|
@@ -25,6 +25,7 @@ import readBlob from "../helpers/readBlob.js";
|
|
|
25
25
|
import ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js';
|
|
26
26
|
import callbackify from "../helpers/callbackify.js";
|
|
27
27
|
import {progressEventReducer, progressEventDecorator, asyncDecorator} from "../helpers/progressEventReducer.js";
|
|
28
|
+
import estimateDataURLDecodedBytes from '../helpers/estimateDataURLDecodedBytes.js';
|
|
28
29
|
|
|
29
30
|
const zlibOptions = {
|
|
30
31
|
flush: zlib.constants.Z_SYNC_FLUSH,
|
|
@@ -46,6 +47,7 @@ const supportedProtocols = platform.protocols.map(protocol => {
|
|
|
46
47
|
return protocol + ':';
|
|
47
48
|
});
|
|
48
49
|
|
|
50
|
+
|
|
49
51
|
const flushOnFinish = (stream, [throttled, flush]) => {
|
|
50
52
|
stream
|
|
51
53
|
.on('end', flush)
|
|
@@ -54,6 +56,7 @@ const flushOnFinish = (stream, [throttled, flush]) => {
|
|
|
54
56
|
return throttled;
|
|
55
57
|
}
|
|
56
58
|
|
|
59
|
+
|
|
57
60
|
/**
|
|
58
61
|
* If the proxy or config beforeRedirects functions are defined, call them with the options
|
|
59
62
|
* object.
|
|
@@ -233,6 +236,21 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
233
236
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
234
237
|
|
|
235
238
|
if (protocol === 'data:') {
|
|
239
|
+
// Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
|
|
240
|
+
if (config.maxContentLength > -1) {
|
|
241
|
+
// Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed.
|
|
242
|
+
const dataUrl = String(config.url || fullPath || '');
|
|
243
|
+
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
|
244
|
+
|
|
245
|
+
if (estimated > config.maxContentLength) {
|
|
246
|
+
return reject(new AxiosError(
|
|
247
|
+
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
248
|
+
AxiosError.ERR_BAD_RESPONSE,
|
|
249
|
+
config
|
|
250
|
+
));
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
236
254
|
let convertedData;
|
|
237
255
|
|
|
238
256
|
if (method !== 'GET') {
|
package/lib/adapters/xhr.js
CHANGED
|
@@ -104,15 +104,18 @@ export default isXHRAdapterSupported && function (config) {
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
// Handle low level network errors
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
request.onerror = function handleError(event) {
|
|
108
|
+
// Browsers deliver a ProgressEvent in XHR onerror
|
|
109
|
+
// (message may be empty; when present, surface it)
|
|
110
|
+
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
111
|
+
const msg = event && event.message ? event.message : 'Network Error';
|
|
112
|
+
const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
|
|
113
|
+
// attach the underlying event for consumers who want details
|
|
114
|
+
err.event = event || null;
|
|
115
|
+
reject(err);
|
|
116
|
+
request = null;
|
|
114
117
|
};
|
|
115
|
-
|
|
118
|
+
|
|
116
119
|
// Handle timeout
|
|
117
120
|
request.ontimeout = function handleTimeout() {
|
|
118
121
|
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
package/lib/core/Axios.js
CHANGED
|
@@ -153,8 +153,8 @@ class Axios {
|
|
|
153
153
|
|
|
154
154
|
if (!synchronousRequestInterceptors) {
|
|
155
155
|
const chain = [dispatchRequest.bind(this), undefined];
|
|
156
|
-
chain.unshift
|
|
157
|
-
chain.push
|
|
156
|
+
chain.unshift(...requestInterceptorChain);
|
|
157
|
+
chain.push(...responseInterceptorChain);
|
|
158
158
|
len = chain.length;
|
|
159
159
|
|
|
160
160
|
promise = Promise.resolve(config);
|
package/lib/core/AxiosError.js
CHANGED
|
@@ -89,11 +89,18 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
|
89
89
|
return prop !== 'isAxiosError';
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
const msg = error && error.message ? error.message : 'Error';
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
|
|
95
|
+
const errCode = code == null && error ? error.code : code;
|
|
96
|
+
AxiosError.call(axiosError, msg, errCode, config, request, response);
|
|
95
97
|
|
|
96
|
-
|
|
98
|
+
// Chain the original error on the standard field; non-enumerable to avoid JSON noise
|
|
99
|
+
if (error && axiosError.cause == null) {
|
|
100
|
+
Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
axiosError.name = (error && error.name) || 'Error';
|
|
97
104
|
|
|
98
105
|
customProps && Object.assign(axiosError, customProps);
|
|
99
106
|
|
|
@@ -46,7 +46,7 @@ export default function dispatchRequest(config) {
|
|
|
46
46
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
|
|
49
|
+
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
50
50
|
|
|
51
51
|
return adapter(config).then(function onAdapterResolution(response) {
|
|
52
52
|
throwIfCancellationRequested(config);
|
package/lib/core/mergeConfig.js
CHANGED
|
@@ -96,7 +96,7 @@ export default function mergeConfig(config1, config2) {
|
|
|
96
96
|
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
utils.forEach(Object.keys(
|
|
99
|
+
utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
|
100
100
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
101
101
|
const configValue = merge(config1[prop], config2[prop], prop);
|
|
102
102
|
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
package/lib/defaults/index.js
CHANGED
|
@@ -111,7 +111,7 @@ const defaults = {
|
|
|
111
111
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
112
112
|
|
|
113
113
|
try {
|
|
114
|
-
return JSON.parse(data);
|
|
114
|
+
return JSON.parse(data, this.parseReviver);
|
|
115
115
|
} catch (e) {
|
|
116
116
|
if (strictJSONParsing) {
|
|
117
117
|
if (e.name === 'SyntaxError') {
|
package/lib/env/data.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.
|
|
1
|
+
export const VERSION = "1.12.0";
|
package/lib/helpers/buildURL.js
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estimate decoded byte length of a data:// URL *without* allocating large buffers.
|
|
3
|
+
* - For base64: compute exact decoded size using length and padding;
|
|
4
|
+
* handle %XX at the character-count level (no string allocation).
|
|
5
|
+
* - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} url
|
|
8
|
+
* @returns {number}
|
|
9
|
+
*/
|
|
10
|
+
export default function estimateDataURLDecodedBytes(url) {
|
|
11
|
+
if (!url || typeof url !== 'string') return 0;
|
|
12
|
+
if (!url.startsWith('data:')) return 0;
|
|
13
|
+
|
|
14
|
+
const comma = url.indexOf(',');
|
|
15
|
+
if (comma < 0) return 0;
|
|
16
|
+
|
|
17
|
+
const meta = url.slice(5, comma);
|
|
18
|
+
const body = url.slice(comma + 1);
|
|
19
|
+
const isBase64 = /;base64/i.test(meta);
|
|
20
|
+
|
|
21
|
+
if (isBase64) {
|
|
22
|
+
let effectiveLen = body.length;
|
|
23
|
+
const len = body.length; // cache length
|
|
24
|
+
|
|
25
|
+
for (let i = 0; i < len; i++) {
|
|
26
|
+
if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
|
|
27
|
+
const a = body.charCodeAt(i + 1);
|
|
28
|
+
const b = body.charCodeAt(i + 2);
|
|
29
|
+
const isHex =
|
|
30
|
+
((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
|
|
31
|
+
((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
|
|
32
|
+
|
|
33
|
+
if (isHex) {
|
|
34
|
+
effectiveLen -= 2;
|
|
35
|
+
i += 2;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let pad = 0;
|
|
41
|
+
let idx = len - 1;
|
|
42
|
+
|
|
43
|
+
const tailIsPct3D = (j) =>
|
|
44
|
+
j >= 2 &&
|
|
45
|
+
body.charCodeAt(j - 2) === 37 && // '%'
|
|
46
|
+
body.charCodeAt(j - 1) === 51 && // '3'
|
|
47
|
+
(body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
|
|
48
|
+
|
|
49
|
+
if (idx >= 0) {
|
|
50
|
+
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
51
|
+
pad++;
|
|
52
|
+
idx--;
|
|
53
|
+
} else if (tailIsPct3D(idx)) {
|
|
54
|
+
pad++;
|
|
55
|
+
idx -= 3;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (pad === 1 && idx >= 0) {
|
|
60
|
+
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
61
|
+
pad++;
|
|
62
|
+
} else if (tailIsPct3D(idx)) {
|
|
63
|
+
pad++;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const groups = Math.floor(effectiveLen / 4);
|
|
68
|
+
const bytes = groups * 3 - (pad || 0);
|
|
69
|
+
return bytes > 0 ? bytes : 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return Buffer.byteLength(body, 'utf8');
|
|
73
|
+
}
|
|
@@ -10,7 +10,7 @@ import buildURL from "./buildURL.js";
|
|
|
10
10
|
export default (config) => {
|
|
11
11
|
const newConfig = mergeConfig({}, config);
|
|
12
12
|
|
|
13
|
-
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
13
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
14
14
|
|
|
15
15
|
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
16
16
|
|
|
@@ -23,17 +23,21 @@ export default (config) => {
|
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
let contentType;
|
|
27
|
-
|
|
28
26
|
if (utils.isFormData(data)) {
|
|
29
27
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
30
|
-
headers.setContentType(undefined); //
|
|
31
|
-
} else if ((
|
|
32
|
-
//
|
|
33
|
-
const
|
|
34
|
-
headers
|
|
28
|
+
headers.setContentType(undefined); // browser handles it
|
|
29
|
+
} else if (utils.isFunction(data.getHeaders)) {
|
|
30
|
+
// Node.js FormData (like form-data package)
|
|
31
|
+
const formHeaders = data.getHeaders();
|
|
32
|
+
// Only set safe headers to avoid overwriting security headers
|
|
33
|
+
const allowedHeaders = ['content-type', 'content-length'];
|
|
34
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
35
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
36
|
+
headers.set(key, val);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
35
39
|
}
|
|
36
|
-
}
|
|
40
|
+
}
|
|
37
41
|
|
|
38
42
|
// Add xsrf header
|
|
39
43
|
// This is only done if running in a standard browser environment.
|
package/lib/helpers/throttle.js
CHANGED
|
@@ -120,6 +120,10 @@ function toFormData(obj, formData, options) {
|
|
|
120
120
|
return value.toISOString();
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
if (utils.isBoolean(value)) {
|
|
124
|
+
return value.toString();
|
|
125
|
+
}
|
|
126
|
+
|
|
123
127
|
if (!useBlob && utils.isBlob(value)) {
|
|
124
128
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
125
129
|
}
|
|
@@ -5,7 +5,7 @@ import toFormData from './toFormData.js';
|
|
|
5
5
|
import platform from '../platform/index.js';
|
|
6
6
|
|
|
7
7
|
export default function toURLEncodedForm(data, options) {
|
|
8
|
-
return toFormData(data, new platform.classes.URLSearchParams(),
|
|
8
|
+
return toFormData(data, new platform.classes.URLSearchParams(), {
|
|
9
9
|
visitor: function(value, key, path, helpers) {
|
|
10
10
|
if (platform.isNode && utils.isBuffer(value)) {
|
|
11
11
|
this.append(key, value.toString('base64'));
|
|
@@ -13,6 +13,7 @@ export default function toURLEncodedForm(data, options) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
16
|
-
}
|
|
17
|
-
|
|
16
|
+
},
|
|
17
|
+
...options
|
|
18
|
+
});
|
|
18
19
|
}
|
package/lib/utils.js
CHANGED
|
@@ -136,6 +136,27 @@ const isPlainObject = (val) => {
|
|
|
136
136
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Determine if a value is an empty object (safely handles Buffers)
|
|
141
|
+
*
|
|
142
|
+
* @param {*} val The value to test
|
|
143
|
+
*
|
|
144
|
+
* @returns {boolean} True if value is an empty object, otherwise false
|
|
145
|
+
*/
|
|
146
|
+
const isEmptyObject = (val) => {
|
|
147
|
+
// Early return for non-objects or Buffers to prevent RangeError
|
|
148
|
+
if (!isObject(val) || isBuffer(val)) {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
try {
|
|
153
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
154
|
+
} catch (e) {
|
|
155
|
+
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
139
160
|
/**
|
|
140
161
|
* Determine if a value is a Date
|
|
141
162
|
*
|
|
@@ -258,6 +279,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
258
279
|
fn.call(null, obj[i], i, obj);
|
|
259
280
|
}
|
|
260
281
|
} else {
|
|
282
|
+
// Buffer check
|
|
283
|
+
if (isBuffer(obj)) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
|
|
261
287
|
// Iterate over object keys
|
|
262
288
|
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
263
289
|
const len = keys.length;
|
|
@@ -271,6 +297,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
271
297
|
}
|
|
272
298
|
|
|
273
299
|
function findKey(obj, key) {
|
|
300
|
+
if (isBuffer(obj)){
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
|
|
274
304
|
key = key.toLowerCase();
|
|
275
305
|
const keys = Object.keys(obj);
|
|
276
306
|
let i = keys.length;
|
|
@@ -311,7 +341,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
311
341
|
* @returns {Object} Result of all merge properties
|
|
312
342
|
*/
|
|
313
343
|
function merge(/* obj1, obj2, obj3, ... */) {
|
|
314
|
-
const {caseless} = isContextDefined(this) && this || {};
|
|
344
|
+
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
|
315
345
|
const result = {};
|
|
316
346
|
const assignValue = (val, key) => {
|
|
317
347
|
const targetKey = caseless && findKey(result, key) || key;
|
|
@@ -322,7 +352,9 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
322
352
|
} else if (isArray(val)) {
|
|
323
353
|
result[targetKey] = val.slice();
|
|
324
354
|
} else {
|
|
325
|
-
|
|
355
|
+
if (!skipUndefined || !isUndefined(val)) {
|
|
356
|
+
result[targetKey] = val;
|
|
357
|
+
}
|
|
326
358
|
}
|
|
327
359
|
}
|
|
328
360
|
|
|
@@ -603,6 +635,8 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
603
635
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
604
636
|
}
|
|
605
637
|
|
|
638
|
+
|
|
639
|
+
|
|
606
640
|
/**
|
|
607
641
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
608
642
|
*
|
|
@@ -624,6 +658,11 @@ const toJSONObject = (obj) => {
|
|
|
624
658
|
return;
|
|
625
659
|
}
|
|
626
660
|
|
|
661
|
+
//Buffer check
|
|
662
|
+
if (isBuffer(source)) {
|
|
663
|
+
return source;
|
|
664
|
+
}
|
|
665
|
+
|
|
627
666
|
if(!('toJSON' in source)) {
|
|
628
667
|
stack[i] = source;
|
|
629
668
|
const target = isArray(source) ? [] : {};
|
|
@@ -695,6 +734,7 @@ export default {
|
|
|
695
734
|
isBoolean,
|
|
696
735
|
isObject,
|
|
697
736
|
isPlainObject,
|
|
737
|
+
isEmptyObject,
|
|
698
738
|
isReadableStream,
|
|
699
739
|
isRequest,
|
|
700
740
|
isResponse,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axios",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Promise based HTTP client for the browser and node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"require": "./index.d.cts",
|
|
10
10
|
"default": "./index.d.ts"
|
|
11
11
|
},
|
|
12
|
+
"react-native": {
|
|
13
|
+
"require": "./dist/browser/axios.cjs",
|
|
14
|
+
"default": "./dist/esm/axios.js"
|
|
15
|
+
},
|
|
12
16
|
"browser": {
|
|
13
17
|
"require": "./dist/browser/axios.cjs",
|
|
14
18
|
"default": "./index.js"
|
|
@@ -29,7 +33,9 @@
|
|
|
29
33
|
"./unsafe/adapters/http.js": "./lib/adapters/http.js",
|
|
30
34
|
"./unsafe/adapters/xhr.js": "./lib/adapters/xhr.js",
|
|
31
35
|
"./unsafe/utils.js": "./lib/utils.js",
|
|
32
|
-
"./package.json": "./package.json"
|
|
36
|
+
"./package.json": "./package.json",
|
|
37
|
+
"./dist/browser/axios.cjs": "./dist/browser/axios.cjs",
|
|
38
|
+
"./dist/node/axios.cjs": "./dist/node/axios.cjs"
|
|
33
39
|
},
|
|
34
40
|
"type": "module",
|
|
35
41
|
"types": "index.d.ts",
|
|
@@ -45,7 +51,7 @@
|
|
|
45
51
|
"test:build:version": "node ./bin/check-build-version.js",
|
|
46
52
|
"start": "node ./sandbox/server.js",
|
|
47
53
|
"preversion": "gulp version",
|
|
48
|
-
"version": "npm run build && git add
|
|
54
|
+
"version": "npm run build && git add package.json",
|
|
49
55
|
"prepublishOnly": "npm run test:build:version",
|
|
50
56
|
"postpublish": "git push && git push --tags",
|
|
51
57
|
"build": "gulp clear && cross-env NODE_ENV=production rollup -c -m",
|
|
@@ -85,6 +91,7 @@
|
|
|
85
91
|
"@commitlint/cli": "^17.8.1",
|
|
86
92
|
"@commitlint/config-conventional": "^17.8.1",
|
|
87
93
|
"@release-it/conventional-changelog": "^5.1.1",
|
|
94
|
+
"@rollup/plugin-alias": "^5.1.0",
|
|
88
95
|
"@rollup/plugin-babel": "^5.3.1",
|
|
89
96
|
"@rollup/plugin-commonjs": "^15.1.0",
|
|
90
97
|
"@rollup/plugin-json": "^4.1.0",
|
|
@@ -106,7 +113,6 @@
|
|
|
106
113
|
"fs-extra": "^10.1.0",
|
|
107
114
|
"get-stream": "^3.0.0",
|
|
108
115
|
"gulp": "^4.0.2",
|
|
109
|
-
"gzip-size": "^7.0.0",
|
|
110
116
|
"handlebars": "^4.7.8",
|
|
111
117
|
"husky": "^8.0.3",
|
|
112
118
|
"istanbul-instrumenter-loader": "^3.0.1",
|
|
@@ -125,6 +131,7 @@
|
|
|
125
131
|
"minimist": "^1.2.8",
|
|
126
132
|
"mocha": "^10.3.0",
|
|
127
133
|
"multer": "^1.4.4",
|
|
134
|
+
"pacote": "^20.0.0",
|
|
128
135
|
"pretty-bytes": "^6.1.1",
|
|
129
136
|
"release-it": "^15.11.0",
|
|
130
137
|
"rollup": "^2.79.1",
|
|
@@ -134,21 +141,26 @@
|
|
|
134
141
|
"sinon": "^4.5.0",
|
|
135
142
|
"stream-throttle": "^0.1.3",
|
|
136
143
|
"string-replace-async": "^3.0.2",
|
|
144
|
+
"tar-stream": "^3.1.7",
|
|
137
145
|
"terser-webpack-plugin": "^4.2.3",
|
|
138
|
-
"typescript": "^4.9.5"
|
|
139
|
-
"@rollup/plugin-alias": "^5.1.0"
|
|
146
|
+
"typescript": "^4.9.5"
|
|
140
147
|
},
|
|
141
148
|
"browser": {
|
|
142
149
|
"./lib/adapters/http.js": "./lib/helpers/null.js",
|
|
143
150
|
"./lib/platform/node/index.js": "./lib/platform/browser/index.js",
|
|
144
151
|
"./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js"
|
|
145
152
|
},
|
|
153
|
+
"react-native": {
|
|
154
|
+
"./lib/adapters/http.js": "./lib/helpers/null.js",
|
|
155
|
+
"./lib/platform/node/index.js": "./lib/platform/browser/index.js",
|
|
156
|
+
"./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js"
|
|
157
|
+
},
|
|
146
158
|
"jsdelivr": "dist/axios.min.js",
|
|
147
159
|
"unpkg": "dist/axios.min.js",
|
|
148
160
|
"typings": "./index.d.ts",
|
|
149
161
|
"dependencies": {
|
|
150
162
|
"follow-redirects": "^1.15.6",
|
|
151
|
-
"form-data": "^4.0.
|
|
163
|
+
"form-data": "^4.0.4",
|
|
152
164
|
"proxy-from-env": "^1.1.0"
|
|
153
165
|
},
|
|
154
166
|
"bundlesize": [
|
|
@@ -167,10 +179,10 @@
|
|
|
167
179
|
"Justin Beckwith (https://github.com/JustinBeckwith)",
|
|
168
180
|
"Martti Laine (https://github.com/codeclown)",
|
|
169
181
|
"Xianming Zhong (https://github.com/chinesedfan)",
|
|
170
|
-
"Rikki Gibson (https://github.com/RikkiGibson)",
|
|
171
182
|
"Remco Haszing (https://github.com/remcohaszing)",
|
|
172
|
-
"
|
|
173
|
-
"
|
|
183
|
+
"Rikki Gibson (https://github.com/RikkiGibson)",
|
|
184
|
+
"Willian Agostini (https://github.com/WillianAgostini)",
|
|
185
|
+
"Yasu Flores (https://github.com/yasuf)"
|
|
174
186
|
],
|
|
175
187
|
"sideEffects": false,
|
|
176
188
|
"release-it": {
|
|
@@ -199,8 +211,8 @@
|
|
|
199
211
|
},
|
|
200
212
|
"hooks": {
|
|
201
213
|
"before:init": "npm test",
|
|
202
|
-
"after:bump": "gulp version --bump ${version} && npm run build && npm run test:build:version
|
|
203
|
-
"before:release": "npm run release:changelog:fix",
|
|
214
|
+
"after:bump": "gulp version --bump ${version} && npm run build && npm run test:build:version",
|
|
215
|
+
"before:release": "npm run release:changelog:fix && git add ./package-lock.json",
|
|
204
216
|
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
|
|
205
217
|
}
|
|
206
218
|
},
|