From 789baf3a58b717e270ded37d4416ae25a650d99d Mon Sep 17 00:00:00 2001 From: mzabriskie Date: Wed, 15 Oct 2014 12:17:36 -0600 Subject: [PATCH] Releasing 0.4.1 --- CHANGELOG.md | 14 +++++++++----- bower.json | 2 +- dist/axios.amd.min.js | 2 +- dist/axios.amd.standalone.min.js | 2 +- dist/axios.min.js | 2 +- dist/axios.standalone.min.js | 2 +- package.json | 2 +- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59e8906..935f9ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ### 0.2.0 (Sep 12, 2014) - Adding support for `all` and `spread` -- Adding support for node.js +- Adding support for node.js ([#1](https://github.com/mzabriskie/axios/issues/1)) ### 0.2.1 (Sep 12, 2014) @@ -20,7 +20,7 @@ ### 0.3.0 (Sep 16, 2014) - Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/mzabriskie/axios/issues/8)) -- Updating `then` and `catch` to receive response data as a single object +- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/mzabriskie/axios/issues/6)) - Fixing issue with `all` not working ([#7](https://github.com/mzabriskie/axios/issues/7)) ### 0.3.1 (Sep 16, 2014) @@ -29,9 +29,13 @@ ### 0.4.0 (Oct 03, 2014) -- Adding support for `ArrayBuffer` and `ArrayBufferView` -- Adding support for utf-8 for node.js +- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/mzabriskie/axios/issues/10)) +- Adding support for utf-8 for node.js ([#13](https://github.com/mzabriskie/axios/issues/13)) - Adding support for SSL for node.js ([#12](https://github.com/mzabriskie/axios/issues/12)) - Fixing incorrect `Content-Type` header ([#9](https://github.com/mzabriskie/axios/issues/9)) - Adding standalone build without bundled es6-promise ([#11](https://github.com/mzabriskie/axios/issues/11)) -- Deprecating `success`/`error` in favor of `then`/`catch` \ No newline at end of file +- Deprecating `success`/`error` in favor of `then`/`catch` + +### 0.4.1 (Oct 15, 2014) + +- Adding error handling to request for node.js ([#18](https://github.com/mzabriskie/axios/issues/18)) \ No newline at end of file diff --git a/bower.json b/bower.json index 59c180f..3bff604 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "axios", "main": "./dist/axios.js", - "version": "0.4.0", + "version": "0.4.1", "homepage": "https://github.com/mzabriskie/axios", "authors": [ "Matt Zabriskie" diff --git a/dist/axios.amd.min.js b/dist/axios.amd.min.js index fb10229..181156b 100644 --- a/dist/axios.amd.min.js +++ b/dist/axios.amd.min.js @@ -1,3 +1,3 @@ -/* axios v0.4.0 | (c) 2014 by Matt Zabriskie */ +/* axios v0.4.1 | (c) 2014 by Matt Zabriskie */ define("axios",["undefined"],function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){(function(t){function r(){u.forEach(arguments,function(e){c[e]=function(t,n){return c(u.merge(n||{},{method:e,url:t}))}})}function o(){u.forEach(arguments,function(e){c[e]=function(t,n,r){return c(u.merge(r||{},{method:e,url:t,data:n}))}})}var i=n(13).Promise,s=n(3),u=n(4),c=e.exports=function(e){function r(e,t,n){try{console.warn("DEPRECATED method `"+e+"`."+(t?" Use `"+t+"` instead.":"")+" This method will be removed in a future release."),n&&console.warn("For more information about usage see "+n)}catch(r){}}e=u.merge({method:"get",headers:{},transformRequest:s.transformRequest,transformResponse:s.transformResponse},e),e.withCredentials=e.withCredentials||s.withCredentials;var o=new i(function(r,o){try{"undefined"!=typeof window?n(5)(r,o,e):"undefined"!=typeof t&&n(2)(r,o,e)}catch(i){o(i)}});return o.success=function(e){return r("success","then","https://github.com/mzabriskie/axios/blob/master/README.md#response-api"),o.then(function(t){e(t.data,t.status,t.headers,t.config)}),o},o.error=function(e){return r("error","catch","https://github.com/mzabriskie/axios/blob/master/README.md#response-api"),o.then(null,function(t){e(t.data,t.status,t.headers,t.config)}),o},o};c.defaults=s,c.all=function(e){return i.all(e)},c.spread=n(6),r("delete","get","head"),o("post","put","patch")}).call(t,n(7))},function(e){var t=new Error('Cannot find module "undefined"');throw t.code="MODULE_NOT_FOUND",t},function(e,t,n){"use strict";var r=n(4),o=/^\s*(\[|\{[^\{])/,i=/[\}\]]\s*$/,s=/^\)\]\}',?\n/,u={"Content-Type":"application/x-www-form-urlencoded"};e.exports={transformRequest:[function(e,t){return r.isArrayBuffer(e)?e:r.isArrayBufferView(e)?e.buffer:!r.isObject(e)||r.isFile(e)||r.isBlob(e)?e:(!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]="application/json;charset=utf-8"),JSON.stringify(e))}],transformResponse:[function(e){return"string"==typeof e&&(e=e.replace(s,""),o.test(e)&&i.test(e)&&(e=JSON.parse(e))),e}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:r.merge(u),post:r.merge(u),put:r.merge(u)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(e){function t(e){return"[object Array]"===h.call(e)}function n(e){return"[object ArrayBuffer]"===h.call(e)}function r(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function o(e){return"string"==typeof e}function i(e){return"number"==typeof e}function s(e){return"undefined"==typeof e}function u(e){return null!==e&&"object"==typeof e}function c(e){return"[object Date]"===h.call(e)}function a(e){return"[object File]"===h.call(e)}function f(e){return"[object Blob]"===h.call(e)}function l(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function p(e,t){if(null!==e&&"undefined"!=typeof e){var n=e.constructor===Array||"function"==typeof e.callee;if("object"==typeof e||n||(e=[e]),n)for(var r=0,o=e.length;o>r;r++)t.call(null,e[r],r,e);else for(var i in e)e.hasOwnProperty(i)&&t.call(null,e[i],i,e)}}function d(){var e={};return p(arguments,function(t){p(t,function(t,n){e[n]=t})}),e}var h=Object.prototype.toString;e.exports={isArray:t,isArrayBuffer:n,isArrayBufferView:r,isString:o,isNumber:i,isObject:u,isUndefined:s,isDate:c,isFile:a,isBlob:f,forEach:p,merge:d,trim:l}},function(e,t,n){var r=n(3),o=n(4),i=n(8),s=n(9),u=n(10),c=n(11),a=n(12);e.exports=function(e,t,n){var f=c(n.data,n.headers,n.transformRequest),l=o.merge(r.headers.common,r.headers[n.method]||{},n.headers||{}),p=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP");p.open(n.method,i(n.url,n.params),!0),p.onreadystatechange=function(){if(p&&4===p.readyState){var r=u(p.getAllResponseHeaders()),o={data:c(p.responseText,r,n.transformResponse),status:p.status,headers:r,config:n};(p.status>=200&&p.status<300?e:t)(o),p=null}};var d=a(n.url)?s.read(n.xsrfCookieName||r.xsrfCookieName):void 0;if(d&&(l[n.xsrfHeaderName||r.xsrfHeaderName]=d),o.forEach(l,function(e,t){f||"content-type"!==t.toLowerCase()?p.setRequestHeader(t,e):delete l[t]}),n.withCredentials&&(p.withCredentials=!0),n.responseType)try{p.responseType=n.responseType}catch(h){if("json"!==p.responseType)throw h}o.isArrayBuffer(f)&&(f=new DataView(f)),p.send(f)}},function(e){e.exports=function(e){return function(t){e.apply(null,t)}}},function(e){function t(){}var n=e.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=t,n.addListener=t,n.once=t,n.off=t,n.removeListener=t,n.removeAllListeners=t,n.emit=t,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}var o=n(4);e.exports=function(e,t){if(!t)return e;var n=[];return o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)||(e=[e]),o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),n.push(r(t)+"="+r(e))}))}),n.length>0&&(e+=(-1===e.indexOf("?")?"?":"&")+n.join("&")),e}},function(e,t,n){"use strict";var r=n(4);e.exports={write:function(e,t,n,o,i,s){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e){var t,n,o,i={};return e?(r.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t&&(i[t]=i[t]?i[t]+", "+n:n)}),i):i}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";function r(e){var t=e;return o&&(s.setAttribute("href",t),t=s.href),s.setAttribute("href",t),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:"/"===s.pathname.charAt(0)?s.pathname:"/"+s.pathname}}var o=/(msie|trident)/i.test(navigator.userAgent),i=n(4),s=document.createElement("a"),u=r(window.location.href);e.exports=function(e){var t=i.isString(e)?r(e):e;return t.protocol===u.protocol&&t.host===u.host}},function(e,t,n){"use strict";var r=n(14).Promise,o=n(15).polyfill;t.Promise=r,t.polyfill=o},function(e,t,n){"use strict";function r(e){if(!w(e))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof r))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],o(e,this)}function o(e,t){function n(e){a(t,e)}function r(e){l(t,e)}try{e(n,r)}catch(o){r(o)}}function i(e,t,n,r){var o,i,s,u,f=w(n);if(f)try{o=n(r),s=!0}catch(p){u=!0,i=p}else o=r,s=!0;c(t,o)||(f&&s?a(t,o):u?l(t,i):e===j?a(t,o):e===T&&l(t,o))}function s(e,t,n,r){var o=e._subscribers,i=o.length;o[i]=t,o[i+j]=n,o[i+T]=r}function u(e,t){for(var n,r,o=e._subscribers,s=e._detail,u=0;ur;r++)t.call(null,e[r],r,e);else for(var i in e)e.hasOwnProperty(i)&&t.call(null,e[i],i,e)}}function d(){var e={};return l(arguments,function(t){l(t,function(t,n){e[n]=t})}),e}var h=Object.prototype.toString;e.exports={isArray:t,isArrayBuffer:n,isArrayBufferView:r,isString:o,isNumber:i,isObject:u,isUndefined:s,isDate:a,isFile:c,isBlob:f,forEach:l,merge:d,trim:p}},function(e,t,n){var r=n(3),o=n(4),i=n(8),s=n(9),u=n(10),a=n(11),c=n(12);e.exports=function(e,t,n){var f=a(n.data,n.headers,n.transformRequest),p=o.merge(r.headers.common,r.headers[n.method]||{},n.headers||{}),l=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP");l.open(n.method,i(n.url,n.params),!0),l.onreadystatechange=function(){if(l&&4===l.readyState){var r=u(l.getAllResponseHeaders()),o={data:a(l.responseText,r,n.transformResponse),status:l.status,headers:r,config:n};(l.status>=200&&l.status<300?e:t)(o),l=null}};var d=c(n.url)?s.read(n.xsrfCookieName||r.xsrfCookieName):void 0;if(d&&(p[n.xsrfHeaderName||r.xsrfHeaderName]=d),o.forEach(p,function(e,t){f||"content-type"!==t.toLowerCase()?l.setRequestHeader(t,e):delete p[t]}),n.withCredentials&&(l.withCredentials=!0),n.responseType)try{l.responseType=n.responseType}catch(h){if("json"!==l.responseType)throw h}o.isArrayBuffer(f)&&(f=new DataView(f)),l.send(f)}},function(e){e.exports=function(e){return function(t){e.apply(null,t)}}},function(e){function t(){}var n=e.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=t,n.addListener=t,n.once=t,n.off=t,n.removeListener=t,n.removeAllListeners=t,n.emit=t,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}var o=n(4);e.exports=function(e,t){if(!t)return e;var n=[];return o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)||(e=[e]),o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),n.push(r(t)+"="+r(e))}))}),n.length>0&&(e+=(-1===e.indexOf("?")?"?":"&")+n.join("&")),e}},function(e,t,n){"use strict";var r=n(4);e.exports={write:function(e,t,n,o,i,s){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e){var t,n,o,i={};return e?(r.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t&&(i[t]=i[t]?i[t]+", "+n:n)}),i):i}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";function r(e){var t=e;return o&&(s.setAttribute("href",t),t=s.href),s.setAttribute("href",t),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:"/"===s.pathname.charAt(0)?s.pathname:"/"+s.pathname}}var o=/(msie|trident)/i.test(navigator.userAgent),i=n(4),s=document.createElement("a"),u=r(window.location.href);e.exports=function(e){var t=i.isString(e)?r(e):e;return t.protocol===u.protocol&&t.host===u.host}}])}); //# sourceMappingURL=axios.amd.standalone.min.map \ No newline at end of file diff --git a/dist/axios.min.js b/dist/axios.min.js index d982944..3cc9084 100644 --- a/dist/axios.min.js +++ b/dist/axios.min.js @@ -1,3 +1,3 @@ -/* axios v0.4.0 | (c) 2014 by Matt Zabriskie */ +/* axios v0.4.1 | (c) 2014 by Matt Zabriskie */ var axios=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){(function(t){function r(){u.forEach(arguments,function(e){c[e]=function(t,n){return c(u.merge(n||{},{method:e,url:t}))}})}function o(){u.forEach(arguments,function(e){c[e]=function(t,n,r){return c(u.merge(r||{},{method:e,url:t,data:n}))}})}var i=n(13).Promise,s=n(3),u=n(4),c=e.exports=function(e){function r(e,t,n){try{console.warn("DEPRECATED method `"+e+"`."+(t?" Use `"+t+"` instead.":"")+" This method will be removed in a future release."),n&&console.warn("For more information about usage see "+n)}catch(r){}}e=u.merge({method:"get",headers:{},transformRequest:s.transformRequest,transformResponse:s.transformResponse},e),e.withCredentials=e.withCredentials||s.withCredentials;var o=new i(function(r,o){try{"undefined"!=typeof window?n(5)(r,o,e):"undefined"!=typeof t&&n(2)(r,o,e)}catch(i){o(i)}});return o.success=function(e){return r("success","then","https://github.com/mzabriskie/axios/blob/master/README.md#response-api"),o.then(function(t){e(t.data,t.status,t.headers,t.config)}),o},o.error=function(e){return r("error","catch","https://github.com/mzabriskie/axios/blob/master/README.md#response-api"),o.then(null,function(t){e(t.data,t.status,t.headers,t.config)}),o},o};c.defaults=s,c.all=function(e){return i.all(e)},c.spread=n(6),r("delete","get","head"),o("post","put","patch")}).call(t,n(7))},function(e){var t=new Error('Cannot find module "undefined"');throw t.code="MODULE_NOT_FOUND",t},function(e,t,n){"use strict";var r=n(4),o=/^\s*(\[|\{[^\{])/,i=/[\}\]]\s*$/,s=/^\)\]\}',?\n/,u={"Content-Type":"application/x-www-form-urlencoded"};e.exports={transformRequest:[function(e,t){return r.isArrayBuffer(e)?e:r.isArrayBufferView(e)?e.buffer:!r.isObject(e)||r.isFile(e)||r.isBlob(e)?e:(!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]="application/json;charset=utf-8"),JSON.stringify(e))}],transformResponse:[function(e){return"string"==typeof e&&(e=e.replace(s,""),o.test(e)&&i.test(e)&&(e=JSON.parse(e))),e}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:r.merge(u),post:r.merge(u),put:r.merge(u)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(e){function t(e){return"[object Array]"===h.call(e)}function n(e){return"[object ArrayBuffer]"===h.call(e)}function r(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function o(e){return"string"==typeof e}function i(e){return"number"==typeof e}function s(e){return"undefined"==typeof e}function u(e){return null!==e&&"object"==typeof e}function c(e){return"[object Date]"===h.call(e)}function a(e){return"[object File]"===h.call(e)}function f(e){return"[object Blob]"===h.call(e)}function l(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function p(e,t){if(null!==e&&"undefined"!=typeof e){var n=e.constructor===Array||"function"==typeof e.callee;if("object"==typeof e||n||(e=[e]),n)for(var r=0,o=e.length;o>r;r++)t.call(null,e[r],r,e);else for(var i in e)e.hasOwnProperty(i)&&t.call(null,e[i],i,e)}}function d(){var e={};return p(arguments,function(t){p(t,function(t,n){e[n]=t})}),e}var h=Object.prototype.toString;e.exports={isArray:t,isArrayBuffer:n,isArrayBufferView:r,isString:o,isNumber:i,isObject:u,isUndefined:s,isDate:c,isFile:a,isBlob:f,forEach:p,merge:d,trim:l}},function(e,t,n){var r=n(3),o=n(4),i=n(8),s=n(9),u=n(10),c=n(11),a=n(12);e.exports=function(e,t,n){var f=c(n.data,n.headers,n.transformRequest),l=o.merge(r.headers.common,r.headers[n.method]||{},n.headers||{}),p=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP");p.open(n.method,i(n.url,n.params),!0),p.onreadystatechange=function(){if(p&&4===p.readyState){var r=u(p.getAllResponseHeaders()),o={data:c(p.responseText,r,n.transformResponse),status:p.status,headers:r,config:n};(p.status>=200&&p.status<300?e:t)(o),p=null}};var d=a(n.url)?s.read(n.xsrfCookieName||r.xsrfCookieName):void 0;if(d&&(l[n.xsrfHeaderName||r.xsrfHeaderName]=d),o.forEach(l,function(e,t){f||"content-type"!==t.toLowerCase()?p.setRequestHeader(t,e):delete l[t]}),n.withCredentials&&(p.withCredentials=!0),n.responseType)try{p.responseType=n.responseType}catch(h){if("json"!==p.responseType)throw h}o.isArrayBuffer(f)&&(f=new DataView(f)),p.send(f)}},function(e){e.exports=function(e){return function(t){e.apply(null,t)}}},function(e){function t(){}var n=e.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=t,n.addListener=t,n.once=t,n.off=t,n.removeListener=t,n.removeAllListeners=t,n.emit=t,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}var o=n(4);e.exports=function(e,t){if(!t)return e;var n=[];return o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)||(e=[e]),o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),n.push(r(t)+"="+r(e))}))}),n.length>0&&(e+=(-1===e.indexOf("?")?"?":"&")+n.join("&")),e}},function(e,t,n){"use strict";var r=n(4);e.exports={write:function(e,t,n,o,i,s){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e){var t,n,o,i={};return e?(r.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t&&(i[t]=i[t]?i[t]+", "+n:n)}),i):i}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";function r(e){var t=e;return o&&(s.setAttribute("href",t),t=s.href),s.setAttribute("href",t),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:"/"===s.pathname.charAt(0)?s.pathname:"/"+s.pathname}}var o=/(msie|trident)/i.test(navigator.userAgent),i=n(4),s=document.createElement("a"),u=r(window.location.href);e.exports=function(e){var t=i.isString(e)?r(e):e;return t.protocol===u.protocol&&t.host===u.host}},function(e,t,n){"use strict";var r=n(14).Promise,o=n(15).polyfill;t.Promise=r,t.polyfill=o},function(e,t,n){"use strict";function r(e){if(!w(e))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof r))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],o(e,this)}function o(e,t){function n(e){a(t,e)}function r(e){l(t,e)}try{e(n,r)}catch(o){r(o)}}function i(e,t,n,r){var o,i,s,u,f=w(n);if(f)try{o=n(r),s=!0}catch(p){u=!0,i=p}else o=r,s=!0;c(t,o)||(f&&s?a(t,o):u?l(t,i):e===j?a(t,o):e===T&&l(t,o))}function s(e,t,n,r){var o=e._subscribers,i=o.length;o[i]=t,o[i+j]=n,o[i+T]=r}function u(e,t){for(var n,r,o=e._subscribers,s=e._detail,u=0;ur;r++)t.call(null,e[r],r,e);else for(var i in e)e.hasOwnProperty(i)&&t.call(null,e[i],i,e)}}function d(){var e={};return l(arguments,function(t){l(t,function(t,n){e[n]=t})}),e}var h=Object.prototype.toString;e.exports={isArray:t,isArrayBuffer:n,isArrayBufferView:r,isString:o,isNumber:i,isObject:a,isUndefined:s,isDate:u,isFile:c,isBlob:f,forEach:l,merge:d,trim:p}},function(e,t,n){var r=n(3),o=n(4),i=n(8),s=n(9),a=n(10),u=n(11),c=n(12);e.exports=function(e,t,n){var f=u(n.data,n.headers,n.transformRequest),p=o.merge(r.headers.common,r.headers[n.method]||{},n.headers||{}),l=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP");l.open(n.method,i(n.url,n.params),!0),l.onreadystatechange=function(){if(l&&4===l.readyState){var r=a(l.getAllResponseHeaders()),o={data:u(l.responseText,r,n.transformResponse),status:l.status,headers:r,config:n};(l.status>=200&&l.status<300?e:t)(o),l=null}};var d=c(n.url)?s.read(n.xsrfCookieName||r.xsrfCookieName):void 0;if(d&&(p[n.xsrfHeaderName||r.xsrfHeaderName]=d),o.forEach(p,function(e,t){f||"content-type"!==t.toLowerCase()?l.setRequestHeader(t,e):delete p[t]}),n.withCredentials&&(l.withCredentials=!0),n.responseType)try{l.responseType=n.responseType}catch(h){if("json"!==l.responseType)throw h}o.isArrayBuffer(f)&&(f=new DataView(f)),l.send(f)}},function(e){e.exports=function(e){return function(t){e.apply(null,t)}}},function(e){function t(){}var n=e.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=t,n.addListener=t,n.once=t,n.off=t,n.removeListener=t,n.removeAllListeners=t,n.emit=t,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}var o=n(4);e.exports=function(e,t){if(!t)return e;var n=[];return o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)||(e=[e]),o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),n.push(r(t)+"="+r(e))}))}),n.length>0&&(e+=(-1===e.indexOf("?")?"?":"&")+n.join("&")),e}},function(e,t,n){"use strict";var r=n(4);e.exports={write:function(e,t,n,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e){var t,n,o,i={};return e?(r.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t&&(i[t]=i[t]?i[t]+", "+n:n)}),i):i}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";function r(e){var t=e;return o&&(s.setAttribute("href",t),t=s.href),s.setAttribute("href",t),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:"/"===s.pathname.charAt(0)?s.pathname:"/"+s.pathname}}var o=/(msie|trident)/i.test(navigator.userAgent),i=n(4),s=document.createElement("a"),a=r(window.location.href);e.exports=function(e){var t=i.isString(e)?r(e):e;return t.protocol===a.protocol&&t.host===a.host}}]); //# sourceMappingURL=axios.standalone.min.map \ No newline at end of file diff --git a/package.json b/package.json index 2fdbcf9..2daf5f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "axios", - "version": "0.4.0", + "version": "0.4.1", "description": "Promise based HTTP client for the browser and node.js", "main": "index.js", "scripts": {