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

Releasing 0.7.0

This commit is contained in:
mzabriskie
2015-09-29 00:38:15 -06:00
parent 87d8364675
commit e8136b1f74
8 changed files with 143 additions and 83 deletions
+10
View File
@@ -79,3 +79,13 @@
- Fixing issue preventing `length` to be used as a parameter ([#91](https://github.com/mzabriskie/axios/pull/91))
- Fixing issue with IE8 ([#85](https://github.com/mzabriskie/axios/pull/85))
- Converting build to UMD
### 0.7.0 (Sep 29, 2015)
- Fixing issue with minified bundle in IE8 ([#87](https://github.com/mzabriskie/axios/pull/87))
- Adding support for passing agent in node ([#102](https://github.com/mzabriskie/axios/pull/102))
- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/mzabriskie/axios/pull/106))
- Fixing typescript definition ([#105](https://github.com/mzabriskie/axios/pull/105))
- Fixing default timeout config for node ([#112](https://github.com/mzabriskie/axios/pull/112))
- Adding support for use in web workers, and react-native ([#70](https://github.com/mzabriskie/axios/issue/70)), ([#98](https://github.com/mzabriskie/axios/pull/98))
- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/mzabriskie/axios/issues/116))
Vendored
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for Axios v0.6.0
// Type definitions for Axios v0.7.0
// Project: https://github.com/mzabriskie/axios
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "axios",
"main": "./dist/axios.js",
"version": "0.6.0",
"version": "0.7.0",
"homepage": "https://github.com/mzabriskie/axios",
"authors": [
"Matt Zabriskie"
+126 -76
View File
@@ -1,3 +1,4 @@
/* axios v0.7.0 | (c) 2015 by Matt Zabriskie */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
@@ -67,10 +68,18 @@ return /******/ (function(modules) { // webpackBootstrap
var dispatchRequest = __webpack_require__(4);
var InterceptorManager = __webpack_require__(12);
var axios = module.exports = function axios(config) {
var axios = module.exports = function (config) {
// Allow for axios('example/url'[, config]) a la fetch API
if (typeof config === 'string') {
config = utils.merge({
url: arguments[0]
}, arguments[1]);
}
config = utils.merge({
method: 'get',
headers: {},
timeout: defaults.timeout,
transformRequest: defaults.transformRequest,
transformResponse: defaults.transformResponse
}, config);
@@ -356,6 +365,27 @@ return /******/ (function(modules) { // webpackBootstrap
return toString.call(val) === '[object Arguments]';
}
/**
* Determine if we're running in a standard browser environment
*
* This allows axios to run in a web worker, and react-native.
* Both environments support XMLHttpRequest, but not fully standard globals.
*
* web workers:
* typeof window -> undefined
* typeof document -> undefined
*
* react-native:
* typeof document.createelement -> undefined
*/
function isStandardBrowserEnv() {
return (
typeof window !== 'undefined' &&
typeof document !== 'undefined' &&
typeof document.createElement === 'function'
);
}
/**
* Iterate over an Array or an Object invoking a function for each item.
*
@@ -437,6 +467,7 @@ return /******/ (function(modules) { // webpackBootstrap
isDate: isDate,
isFile: isFile,
isBlob: isBlob,
isStandardBrowserEnv: isStandardBrowserEnv,
forEach: forEach,
merge: merge,
trim: trim
@@ -584,10 +615,8 @@ return /******/ (function(modules) { // webpackBootstrap
var defaults = __webpack_require__(2);
var utils = __webpack_require__(3);
var buildUrl = __webpack_require__(7);
var cookies = __webpack_require__(8);
var parseHeaders = __webpack_require__(9);
var transformData = __webpack_require__(10);
var urlIsSameOrigin = __webpack_require__(11);
var parseHeaders = __webpack_require__(8);
var transformData = __webpack_require__(9);
module.exports = function xhrAdapter(resolve, reject, config) {
// Transform request data
@@ -644,11 +673,20 @@ return /******/ (function(modules) { // webpackBootstrap
};
// Add xsrf header
var xsrfValue = urlIsSameOrigin(config.url) ?
cookies.read(config.xsrfCookieName || defaults.xsrfCookieName) :
undefined;
if (xsrfValue) {
requestHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;
// This is only done if running in a standard browser environment.
// Specifically not if we're in a web worker, or react-native.
if (utils.isStandardBrowserEnv()) {
var cookies = __webpack_require__(10);
var urlIsSameOrigin = __webpack_require__(11);
// Add xsrf header
var xsrfValue = urlIsSameOrigin(config.url) ?
cookies.read(config.xsrfCookieName || defaults.xsrfCookieName) :
undefined;
if (xsrfValue) {
requestHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;
}
}
// Add headers to the request
@@ -761,6 +799,77 @@ return /******/ (function(modules) { // webpackBootstrap
var utils = __webpack_require__(3);
/**
* Parse headers into an object
*
* ```
* Date: Wed, 27 Aug 2014 08:58:49 GMT
* Content-Type: application/json
* Connection: keep-alive
* Transfer-Encoding: chunked
* ```
*
* @param {String} headers Headers needing to be parsed
* @returns {Object} Headers parsed into an object
*/
module.exports = function parseHeaders(headers) {
var parsed = {}, key, val, i;
if (!headers) { return parsed; }
utils.forEach(headers.split('\n'), function(line) {
i = line.indexOf(':');
key = utils.trim(line.substr(0, i)).toLowerCase();
val = utils.trim(line.substr(i + 1));
if (key) {
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
}
});
return parsed;
};
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var utils = __webpack_require__(3);
/**
* Transform the data for a request or a response
*
* @param {Object|String} data The data to be transformed
* @param {Array} headers The headers for the request or response
* @param {Array|Function} fns A single function or Array of functions
* @returns {*} The resulting transformed data
*/
module.exports = function transformData(data, headers, fns) {
utils.forEach(fns, function (fn) {
data = fn(data, headers);
});
return data;
};
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* WARNING:
* This file makes references to objects that aren't safe in all environments.
* Please see lib/utils.isStandardBrowserEnv before including this file.
*/
var utils = __webpack_require__(3);
module.exports = {
write: function write(name, value, expires, path, domain, secure) {
var cookie = [];
@@ -796,77 +905,18 @@ return /******/ (function(modules) { // webpackBootstrap
};
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var utils = __webpack_require__(3);
/**
* Parse headers into an object
*
* ```
* Date: Wed, 27 Aug 2014 08:58:49 GMT
* Content-Type: application/json
* Connection: keep-alive
* Transfer-Encoding: chunked
* ```
*
* @param {String} headers Headers needing to be parsed
* @returns {Object} Headers parsed into an object
*/
module.exports = function parseHeaders(headers) {
var parsed = {}, key, val, i;
if (!headers) { return parsed; }
utils.forEach(headers.split('\n'), function(line) {
i = line.indexOf(':');
key = utils.trim(line.substr(0, i)).toLowerCase();
val = utils.trim(line.substr(i + 1));
if (key) {
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
}
});
return parsed;
};
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var utils = __webpack_require__(3);
/**
* Transform the data for a request or a response
*
* @param {Object|String} data The data to be transformed
* @param {Array} headers The headers for the request or response
* @param {Array|Function} fns A single function or Array of functions
* @returns {*} The resulting transformed data
*/
module.exports = function transformData(data, headers, fns) {
utils.forEach(fns, function (fn) {
data = fn(data, headers);
});
return data;
};
/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* WARNING:
* This file makes references to objects that aren't safe in all environments.
* Please see lib/utils.isStandardBrowserEnv before including this file.
*/
var utils = __webpack_require__(3);
var msie = /(msie|trident)/i.test(navigator.userAgent);
var urlParsingNode = document.createElement('a');
@@ -1005,7 +1055,7 @@ return /******/ (function(modules) { // webpackBootstrap
*/
module.exports = function spread(callback) {
return function (arr) {
callback.apply(null, arr);
return callback.apply(null, arr);
};
};
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
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
@@ -1,6 +1,6 @@
{
"name": "axios",
"version": "0.6.0",
"version": "0.7.0",
"description": "Promise based HTTP client for the browser and node.js",
"main": "index.js",
"scripts": {