2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

chore: release 1.1.3

This commit is contained in:
Jay
2022-10-15 15:43:01 +02:00
parent b0ebf9fcac
commit 9bd53214f6
15 changed files with 657 additions and 830 deletions
+36 -1
View File
@@ -217,4 +217,39 @@
### Contributors to this release
- [Jason Saayman](https://github.com/jasonsaayman)
- [Jason Saayman](https://github.com/jasonsaayman)
## [1.1.3] - 2022-10-15
### Added
Added custom params serializer support [#5113](https://github.com/axios/axios/pull/5113)
### Fixed
Fixed top-level export to keep them in-line with static properties [#5109](https://github.com/axios/axios/pull/5109)
Stopped including null values to query string. [#5108](https://github.com/axios/axios/pull/5108)
Restored proxy config backwards compatibility with 0.x [#5097](https://github.com/axios/axios/pull/5097)
Added back AxiosHeaders in AxiosHeaderValue [#5103](https://github.com/axios/axios/pull/5103)
Pin CDN install instructions to a specific version [#5060](https://github.com/axios/axios/pull/5060)
Handling of array values fixed for AxiosHeaders [#5085](https://github.com/axios/axios/pull/5085)
### Chores
docs: match badge style, add link to them [#5046](https://github.com/axios/axios/pull/5046)
chore: fixing comments typo [#5054](https://github.com/axios/axios/pull/5054)
chore: update issue template [#5061](https://github.com/axios/axios/pull/5061)
chore: added progress capturing section to the docs; [#5084](https://github.com/axios/axios/pull/5084)
### Contributors to this release
- [Jason Saayman](https://github.com/jasonsaayman)
- [scarf](https://github.com/scarf005)
- [Lenz Weber-Tronic](https://github.com/phryneas)
- [Arvindh](https://github.com/itsarvindh)
- [Félix Legrelle](https://github.com/FelixLgr)
- [Patrick Petrovic](https://github.com/ppati000)
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
- [littledian](https://github.com/littledian)
- [ChronosMasterOfAllTime](https://github.com/ChronosMasterOfAllTime)
- [Salman Shaikh](https://github.com/salmannotkhan)
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "axios",
"main": "./dist/axios.js",
"version": "1.1.2",
"version": "1.1.3",
"homepage": "https://axios-http.com",
"authors": [
"Matt Zabriskie"
+221 -484
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+35 -27
View File
@@ -1,4 +1,4 @@
// Axios v1.1.2 Copyright (c) 2022 Matt Zabriskie and contributors
// Axios v1.1.3 Copyright (c) 2022 Matt Zabriskie and contributors
function bind(fn, thisArg) {
return function wrap() {
return fn.apply(thisArg, arguments);
@@ -877,7 +877,7 @@ function toFormData(obj, formData, options) {
key = removeBrackets(key);
arr.forEach(function each(el, index) {
!utils.isUndefined(el) && formData.append(
!(utils.isUndefined(el) || el === null) && formData.append(
// eslint-disable-next-line no-nested-ternary
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
convertValue(el)
@@ -914,7 +914,7 @@ function toFormData(obj, formData, options) {
stack.push(value);
utils.forEach(value, function each(el, key) {
const result = !utils.isUndefined(el) && visitor.call(
const result = !(utils.isUndefined(el) || el === null) && visitor.call(
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
);
@@ -1020,21 +1020,28 @@ function buildURL(url, params, options) {
if (!params) {
return url;
}
const hashmarkIndex = url.indexOf('#');
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
const _encode = options && options.encode || encode;
const serializerParams = utils.isURLSearchParams(params) ?
params.toString() :
new AxiosURLSearchParams(params, options).toString(_encode);
const serializeFn = options && options.serialize;
if (serializerParams) {
url += (url.indexOf('?') === -1 ? '?' : '&') + serializerParams;
let serializedParams;
if (serializeFn) {
serializedParams = serializeFn(params, options);
} else {
serializedParams = utils.isURLSearchParams(params) ?
params.toString() :
new AxiosURLSearchParams(params, options).toString(_encode);
}
if (serializedParams) {
const hashmarkIndex = url.indexOf("#");
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
}
return url;
@@ -1525,7 +1532,7 @@ function normalizeValue(value) {
return value;
}
return String(value);
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
}
function parseTokens(str) {
@@ -1612,13 +1619,7 @@ Object.assign(AxiosHeaders.prototype, {
return;
}
if (utils.isArray(_value)) {
_value = _value.map(normalizeValue);
} else {
_value = normalizeValue(_value);
}
self[key || _header] = _value;
self[key || _header] = normalizeValue(_value);
}
if (utils.isPlainObject(header)) {
@@ -1732,13 +1733,13 @@ Object.assign(AxiosHeaders.prototype, {
return this;
},
toJSON: function() {
toJSON: function(asStrings) {
const obj = Object.create(null);
utils.forEach(Object.assign({}, this[$defaults] || null, this),
(value, header) => {
if (value == null || value === false) return;
obj[header] = utils.isArray(value) ? value.join(', ') : value;
obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value;
});
return obj;
@@ -2461,7 +2462,7 @@ function mergeConfig(config1, config2) {
return config;
}
const VERSION = "1.1.2";
const VERSION = "1.1.3";
const validators$1 = {};
@@ -2588,7 +2589,7 @@ class Axios {
config = mergeConfig(this.defaults, config);
const transitional = config.transitional;
const {transitional, paramsSerializer} = config;
if (transitional !== undefined) {
validator.assertOptions(transitional, {
@@ -2598,6 +2599,13 @@ class Axios {
}, false);
}
if (paramsSerializer !== undefined) {
validator.assertOptions(paramsSerializer, {
encode: validators.function,
serialize: validators.function
}, true);
}
// Set config.method
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+40 -31
View File
@@ -1,4 +1,4 @@
// Axios v1.1.2 Copyright (c) 2022 Matt Zabriskie and contributors
// Axios v1.1.3 Copyright (c) 2022 Matt Zabriskie and contributors
'use strict';
const FormData$1 = require('form-data');
@@ -897,7 +897,7 @@ function toFormData(obj, formData, options) {
key = removeBrackets(key);
arr.forEach(function each(el, index) {
!utils.isUndefined(el) && formData.append(
!(utils.isUndefined(el) || el === null) && formData.append(
// eslint-disable-next-line no-nested-ternary
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
convertValue(el)
@@ -934,7 +934,7 @@ function toFormData(obj, formData, options) {
stack.push(value);
utils.forEach(value, function each(el, key) {
const result = !utils.isUndefined(el) && visitor.call(
const result = !(utils.isUndefined(el) || el === null) && visitor.call(
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
);
@@ -1040,21 +1040,28 @@ function buildURL(url, params, options) {
if (!params) {
return url;
}
const hashmarkIndex = url.indexOf('#');
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
const _encode = options && options.encode || encode;
const serializerParams = utils.isURLSearchParams(params) ?
params.toString() :
new AxiosURLSearchParams(params, options).toString(_encode);
const serializeFn = options && options.serialize;
if (serializerParams) {
url += (url.indexOf('?') === -1 ? '?' : '&') + serializerParams;
let serializedParams;
if (serializeFn) {
serializedParams = serializeFn(params, options);
} else {
serializedParams = utils.isURLSearchParams(params) ?
params.toString() :
new AxiosURLSearchParams(params, options).toString(_encode);
}
if (serializedParams) {
const hashmarkIndex = url.indexOf("#");
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
}
return url;
@@ -1313,7 +1320,7 @@ function buildFullPath(baseURL, requestedURL) {
return requestedURL;
}
const VERSION = "1.1.2";
const VERSION = "1.1.3";
/**
* A `CanceledError` is an object that is thrown when an operation is canceled.
@@ -1451,7 +1458,7 @@ function normalizeValue(value) {
return value;
}
return String(value);
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
}
function parseTokens(str) {
@@ -1538,13 +1545,7 @@ Object.assign(AxiosHeaders.prototype, {
return;
}
if (utils.isArray(_value)) {
_value = _value.map(normalizeValue);
} else {
_value = normalizeValue(_value);
}
self[key || _header] = _value;
self[key || _header] = normalizeValue(_value);
}
if (utils.isPlainObject(header)) {
@@ -1658,13 +1659,13 @@ Object.assign(AxiosHeaders.prototype, {
return this;
},
toJSON: function() {
toJSON: function(asStrings) {
const obj = Object.create(null);
utils.forEach(Object.assign({}, this[$defaults] || null, this),
(value, header) => {
if (value == null || value === false) return;
obj[header] = utils.isArray(value) ? value.join(', ') : value;
obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value;
});
return obj;
@@ -2003,7 +2004,7 @@ function dispatchBeforeRedirect(options) {
* If the proxy or config afterRedirects functions are defined, call them with the options
*
* @param {http.ClientRequestArgs} options
* @param {AxiosProxyConfig} configProxy
* @param {AxiosProxyConfig} configProxy configuration from Axios options object
* @param {string} location
*
* @returns {http.ClientRequestArgs}
@@ -2034,13 +2035,14 @@ function setProxy(options, configProxy, location) {
}
options.headers.host = options.hostname + (options.port ? ':' + options.port : '');
options.hostname = proxy.hostname;
const proxyHost = proxy.hostname || proxy.host;
options.hostname = proxyHost;
// Replace 'host' since options is not a URL object
options.host = proxy.hostname;
options.host = proxyHost;
options.port = proxy.port;
options.path = location;
if (proxy.protocol) {
options.protocol = proxy.protocol;
options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;
}
}
@@ -3401,7 +3403,7 @@ class Axios {
config = mergeConfig(this.defaults, config);
const transitional = config.transitional;
const {transitional, paramsSerializer} = config;
if (transitional !== undefined) {
validator.assertOptions(transitional, {
@@ -3411,6 +3413,13 @@ class Axios {
}, false);
}
if (paramsSerializer !== undefined) {
validator.assertOptions(paramsSerializer, {
encode: validators.function,
serialize: validators.function
}, true);
}
// Set config.method
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
export const VERSION = "1.1.2";
export const VERSION = "1.1.3";
+313 -275
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1,12 +1,12 @@
{
"name": "axios",
"version": "1.1.2",
"version": "1.1.3",
"description": "Promise based HTTP client for the browser and node.js",
"main": "index.js",
"exports": {
".": {
"browser": {
"require": "./index.js",
"require": "./dist/node/axios.cjs",
"default": "./index.js"
},
"default": {
@@ -131,4 +131,4 @@
"Ben Carp (https://github.com/carpben)",
"Daniel Lopretto (https://github.com/timemachine3030)"
]
}
}