Skip to content

Commit

Permalink
chore(release): v1.3.0 (#5513)
Browse files Browse the repository at this point in the history
Co-authored-by: DigitalBrainJS <DigitalBrainJS@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and DigitalBrainJS committed Jan 31, 2023
1 parent 9263473 commit 7fbfbbe
Show file tree
Hide file tree
Showing 17 changed files with 462 additions and 108 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,23 @@
# Changelog

# [1.3.0](https://github.com/axios/axios/compare/v1.2.6...v1.3.0) (2023-01-31)


### Bug Fixes

* **headers:** fixed & optimized clear method; ([#5507](https://github.com/axios/axios/issues/5507)) ([9915635](https://github.com/axios/axios/commit/9915635c69d0ab70daca5738488421f67ca60959))
* **http:** add zlib headers if missing ([#5497](https://github.com/axios/axios/issues/5497)) ([65e8d1e](https://github.com/axios/axios/commit/65e8d1e28ce829f47a837e45129730e541950d3c))


### Features

* **fomdata:** added support for spec-compliant FormData & Blob types; ([#5316](https://github.com/axios/axios/issues/5316)) ([6ac574e](https://github.com/axios/axios/commit/6ac574e00a06731288347acea1e8246091196953))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+352/-67 (#5514 #5512 #5510 #5509 #5508 #5316 #5507 )")
- <img src="https://avatars.githubusercontent.com/u/35015993?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [ItsNotGoodName](https://github.com/ItsNotGoodName "+43/-2 (#5497 )")

## [1.2.6](https://github.com/axios/axios/compare/v1.2.5...v1.2.6) (2023-01-28)


Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,7 +1,7 @@
{
"name": "axios",
"main": "./dist/axios.js",
"version": "1.2.6",
"version": "1.3.0",
"homepage": "https://axios-http.com",
"authors": [
"Matt Zabriskie"
Expand Down
74 changes: 50 additions & 24 deletions dist/axios.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/axios.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/axios.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/axios.min.js.map

Large diffs are not rendered by default.

80 changes: 55 additions & 25 deletions dist/browser/axios.cjs
@@ -1,4 +1,4 @@
// Axios v1.2.6 Copyright (c) 2023 Matt Zabriskie and contributors
// Axios v1.3.0 Copyright (c) 2023 Matt Zabriskie and contributors
'use strict';

function bind(fn, thisArg) {
Expand Down Expand Up @@ -517,7 +517,7 @@ const matchAll = (regExp, str) => {
const isHTMLForm = kindOfTest('HTMLFormElement');

const toCamelCase = str => {
return str.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
function replacer(m, p1, p2) {
return p1.toUpperCase() + p2;
}
Expand Down Expand Up @@ -601,6 +601,37 @@ const toFiniteNumber = (value, defaultValue) => {
return Number.isFinite(value) ? value : defaultValue;
};

const ALPHA = 'abcdefghijklmnopqrstuvwxyz';

const DIGIT = '0123456789';

const ALPHABET = {
DIGIT,
ALPHA,
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
};

const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
let str = '';
const {length} = alphabet;
while (size--) {
str += alphabet[Math.random() * length|0];
}

return str;
};

/**
* If the thing is a FormData object, return true, otherwise return false.
*
* @param {unknown} thing - The thing to check.
*
* @returns {boolean}
*/
function isSpecCompliantForm(thing) {
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
}

const toJSONObject = (obj) => {
const stack = new Array(10);

Expand Down Expand Up @@ -678,6 +709,9 @@ var utils = {
findKey,
global: _global,
isContextDefined,
ALPHABET,
generateString,
isSpecCompliantForm,
toJSONObject
};

Expand Down Expand Up @@ -776,10 +810,8 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
return axiosError;
};

/* eslint-env browser */
var browser = typeof self == 'object' ? self.FormData : window.FormData;

var FormData$2 = browser;
// eslint-disable-next-line strict
var httpAdapter = null;

/**
* Determines if the given thing is a array or js object.
Expand Down Expand Up @@ -836,17 +868,6 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
return /^is[A-Z]/.test(prop);
});

/**
* If the thing is a FormData object, return true, otherwise return false.
*
* @param {unknown} thing - The thing to check.
*
* @returns {boolean}
*/
function isSpecCompliant(thing) {
return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator];
}

/**
* Convert a data object to FormData
*
Expand Down Expand Up @@ -876,7 +897,7 @@ function toFormData(obj, formData, options) {
}

// eslint-disable-next-line no-param-reassign
formData = formData || new (FormData$2 || FormData)();
formData = formData || new (FormData)();

// eslint-disable-next-line no-param-reassign
options = utils.toFlatObject(options, {
Expand All @@ -894,7 +915,7 @@ function toFormData(obj, formData, options) {
const dots = options.dots;
const indexes = options.indexes;
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
const useBlob = _Blob && isSpecCompliant(formData);
const useBlob = _Blob && utils.isSpecCompliantForm(formData);

if (!utils.isFunction(visitor)) {
throw new TypeError('visitor must be a function');
Expand Down Expand Up @@ -1734,8 +1755,20 @@ class AxiosHeaders {
return deleted;
}

clear() {
return Object.keys(this).forEach(this.delete.bind(this));
clear(matcher) {
const keys = Object.keys(this);
let i = keys.length;
let deleted = false;

while (i--) {
const key = keys[i];
if(!matcher || matchHeaderValue(this, this[key], key, matcher)) {
delete this[key];
deleted = true;
}
}

return deleted;
}

normalize(format) {
Expand Down Expand Up @@ -1879,9 +1912,6 @@ utils.inherits(CanceledError, AxiosError, {
__CANCEL__: true
});

// eslint-disable-next-line strict
var httpAdapter = null;

/**
* Resolve or reject a Promise based on response status.
*
Expand Down Expand Up @@ -2582,7 +2612,7 @@ function mergeConfig(config1, config2) {
return config;
}

const VERSION = "1.2.6";
const VERSION = "1.3.0";

const validators$1 = {};

Expand Down
2 changes: 1 addition & 1 deletion dist/browser/axios.cjs.map

Large diffs are not rendered by default.

0 comments on commit 7fbfbbe

Please sign in to comment.