axios_rails 0.3.0 → 0.4.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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/axios.js +113 -45
- data/app/assets/javascripts/axios.min.js +2 -2
- data/lib/axios_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dbace6993e18b9590f6161d6a05e5f9d3224bd7
|
4
|
+
data.tar.gz: 6010c861f6ce174c7b61022ccfc274419c77c306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 714499c8a2e23eb178e5b3a948ef1b3ee68897c85374d6d667177f6297229078df28e85c8099632c5e887ccd66cf82e52d14ac2d8e7f6d9e8cb3d764b5500316
|
7
|
+
data.tar.gz: 905cfaf1b7a93def915fdbb6f24774196730e0fceeedd33fc61d6947fcb7062e6b9c201a2c481c76ac6c0a6a2496565db951e0617af9621b11ddbe146491dfa7
|
@@ -54,11 +54,11 @@ var axios =
|
|
54
54
|
/* WEBPACK VAR INJECTION */(function(process) {var Promise = __webpack_require__(13).Promise;
|
55
55
|
var defaults = __webpack_require__(3);
|
56
56
|
var utils = __webpack_require__(4);
|
57
|
-
var spread = __webpack_require__(5);
|
58
57
|
|
59
58
|
var axios = module.exports = function axios(config) {
|
60
59
|
config = utils.merge({
|
61
60
|
method: 'get',
|
61
|
+
headers: {},
|
62
62
|
transformRequest: defaults.transformRequest,
|
63
63
|
transformResponse: defaults.transformResponse
|
64
64
|
}, config);
|
@@ -70,7 +70,7 @@ var axios =
|
|
70
70
|
try {
|
71
71
|
// For browsers use XHR adapter
|
72
72
|
if (typeof window !== 'undefined') {
|
73
|
-
__webpack_require__(
|
73
|
+
__webpack_require__(5)(resolve, reject, config);
|
74
74
|
}
|
75
75
|
// For node use HTTP adapter
|
76
76
|
else if (typeof process !== 'undefined') {
|
@@ -81,8 +81,23 @@ var axios =
|
|
81
81
|
}
|
82
82
|
});
|
83
83
|
|
84
|
+
function deprecatedMethod(method, instead, docs) {
|
85
|
+
try {
|
86
|
+
console.warn(
|
87
|
+
'DEPRECATED method `' + method + '`.' +
|
88
|
+
(instead ? ' Use `' + instead + '` instead.' : '') +
|
89
|
+
' This method will be removed in a future release.');
|
90
|
+
|
91
|
+
if (docs) {
|
92
|
+
console.warn('For more information about usage see ' + docs);
|
93
|
+
}
|
94
|
+
} catch (e) {}
|
95
|
+
}
|
96
|
+
|
84
97
|
// Provide alias for success
|
85
98
|
promise.success = function success(fn) {
|
99
|
+
deprecatedMethod('success', 'then', 'https://github.com/mzabriskie/axios/blob/master/README.md#response-api');
|
100
|
+
|
86
101
|
promise.then(function(response) {
|
87
102
|
fn(response.data, response.status, response.headers, response.config);
|
88
103
|
});
|
@@ -91,6 +106,8 @@ var axios =
|
|
91
106
|
|
92
107
|
// Provide alias for error
|
93
108
|
promise.error = function error(fn) {
|
109
|
+
deprecatedMethod('error', 'catch', 'https://github.com/mzabriskie/axios/blob/master/README.md#response-api');
|
110
|
+
|
94
111
|
promise.then(null, function(response) {
|
95
112
|
fn(response.data, response.status, response.headers, response.config);
|
96
113
|
});
|
@@ -107,7 +124,7 @@ var axios =
|
|
107
124
|
axios.all = function (promises) {
|
108
125
|
return Promise.all(promises);
|
109
126
|
};
|
110
|
-
axios.spread =
|
127
|
+
axios.spread = __webpack_require__(6);
|
111
128
|
|
112
129
|
// Provide aliases for supported request methods
|
113
130
|
createShortMethods('delete', 'get', 'head');
|
@@ -155,16 +172,26 @@ var axios =
|
|
155
172
|
var JSON_START = /^\s*(\[|\{[^\{])/;
|
156
173
|
var JSON_END = /[\}\]]\s*$/;
|
157
174
|
var PROTECTION_PREFIX = /^\)\]\}',?\n/;
|
158
|
-
var
|
159
|
-
'Content-Type': 'application/
|
175
|
+
var DEFAULT_CONTENT_TYPE = {
|
176
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
160
177
|
};
|
161
178
|
|
162
179
|
module.exports = {
|
163
|
-
transformRequest: [function (data) {
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
180
|
+
transformRequest: [function (data, headers) {
|
181
|
+
if (utils.isArrayBuffer(data)) {
|
182
|
+
return data;
|
183
|
+
}
|
184
|
+
if (utils.isArrayBufferView(data)) {
|
185
|
+
return data.buffer;
|
186
|
+
}
|
187
|
+
if (utils.isObject(data) && !utils.isFile(data) && !utils.isBlob(data)) {
|
188
|
+
// Set application/json if no Content-Type has been specified
|
189
|
+
if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
|
190
|
+
headers['Content-Type'] = 'application/json;charset=utf-8';
|
191
|
+
}
|
192
|
+
return JSON.stringify(data);
|
193
|
+
}
|
194
|
+
return data;
|
168
195
|
}],
|
169
196
|
|
170
197
|
transformResponse: [function (data) {
|
@@ -181,9 +208,9 @@ var axios =
|
|
181
208
|
common: {
|
182
209
|
'Accept': 'application/json, text/plain, */*'
|
183
210
|
},
|
184
|
-
patch: utils.merge(
|
185
|
-
post: utils.merge(
|
186
|
-
put: utils.merge(
|
211
|
+
patch: utils.merge(DEFAULT_CONTENT_TYPE),
|
212
|
+
post: utils.merge(DEFAULT_CONTENT_TYPE),
|
213
|
+
put: utils.merge(DEFAULT_CONTENT_TYPE)
|
187
214
|
},
|
188
215
|
|
189
216
|
xsrfCookieName: 'XSRF-TOKEN',
|
@@ -208,6 +235,30 @@ var axios =
|
|
208
235
|
return toString.call(val) === '[object Array]';
|
209
236
|
}
|
210
237
|
|
238
|
+
/**
|
239
|
+
* Determine if a value is an ArrayBuffer
|
240
|
+
*
|
241
|
+
* @param {Object} val The value to test
|
242
|
+
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
243
|
+
*/
|
244
|
+
function isArrayBuffer(val) {
|
245
|
+
return toString.call(val) === '[object ArrayBuffer]';
|
246
|
+
}
|
247
|
+
|
248
|
+
/**
|
249
|
+
* Determine if a value is a view on an ArrayBuffer
|
250
|
+
*
|
251
|
+
* @param {Object} val The value to test
|
252
|
+
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
|
253
|
+
*/
|
254
|
+
function isArrayBufferView(val) {
|
255
|
+
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
256
|
+
return ArrayBuffer.isView(val);
|
257
|
+
} else {
|
258
|
+
return (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
|
259
|
+
}
|
260
|
+
}
|
261
|
+
|
211
262
|
/**
|
212
263
|
* Determine if a value is a String
|
213
264
|
*
|
@@ -228,6 +279,16 @@ var axios =
|
|
228
279
|
return typeof val === 'number';
|
229
280
|
}
|
230
281
|
|
282
|
+
/**
|
283
|
+
* Determine if a value is undefined
|
284
|
+
*
|
285
|
+
* @param {Object} val The value to test
|
286
|
+
* @returns {boolean} True if the value is undefined, otherwise false
|
287
|
+
*/
|
288
|
+
function isUndefined(val) {
|
289
|
+
return typeof val === 'undefined';
|
290
|
+
}
|
291
|
+
|
231
292
|
/**
|
232
293
|
* Determine if a value is an Object
|
233
294
|
*
|
@@ -349,9 +410,12 @@ var axios =
|
|
349
410
|
|
350
411
|
module.exports = {
|
351
412
|
isArray: isArray,
|
413
|
+
isArrayBuffer: isArrayBuffer,
|
414
|
+
isArrayBufferView: isArrayBufferView,
|
352
415
|
isString: isString,
|
353
416
|
isNumber: isNumber,
|
354
417
|
isObject: isObject,
|
418
|
+
isUndefined: isUndefined,
|
355
419
|
isDate: isDate,
|
356
420
|
isFile: isFile,
|
357
421
|
isBlob: isBlob,
|
@@ -364,43 +428,13 @@ var axios =
|
|
364
428
|
/* 5 */
|
365
429
|
/***/ function(module, exports, __webpack_require__) {
|
366
430
|
|
367
|
-
|
368
|
-
|
369
|
-
*
|
370
|
-
* Common use case would be to use `Function.prototype.apply`.
|
371
|
-
*
|
372
|
-
* ```js
|
373
|
-
* function f(x, y, z) {}
|
374
|
-
* var args = [1, 2, 3];
|
375
|
-
* f.apply(null, args);
|
376
|
-
* ```
|
377
|
-
*
|
378
|
-
* With `spread` this example can be re-written.
|
379
|
-
*
|
380
|
-
* ```js
|
381
|
-
* spread(function(x, y, z) {})([1, 2, 3]);
|
382
|
-
* ```
|
383
|
-
*
|
384
|
-
* @param {Function} callback
|
385
|
-
* @returns {Function}
|
386
|
-
*/
|
387
|
-
module.exports = function spread(callback) {
|
388
|
-
return function (arr) {
|
389
|
-
callback.apply(null, arr);
|
390
|
-
};
|
391
|
-
};
|
392
|
-
|
393
|
-
/***/ },
|
394
|
-
/* 6 */
|
395
|
-
/***/ function(module, exports, __webpack_require__) {
|
396
|
-
|
431
|
+
var defaults = __webpack_require__(3);
|
432
|
+
var utils = __webpack_require__(4);
|
397
433
|
var buildUrl = __webpack_require__(8);
|
398
434
|
var cookies = __webpack_require__(9);
|
399
|
-
var defaults = __webpack_require__(3);
|
400
435
|
var parseHeaders = __webpack_require__(10);
|
401
436
|
var transformData = __webpack_require__(11);
|
402
437
|
var urlIsSameOrigin = __webpack_require__(12);
|
403
|
-
var utils = __webpack_require__(4);
|
404
438
|
|
405
439
|
module.exports = function xhrAdapter(resolve, reject, config) {
|
406
440
|
// Transform request data
|
@@ -483,10 +517,44 @@ var axios =
|
|
483
517
|
}
|
484
518
|
}
|
485
519
|
|
520
|
+
if (utils.isArrayBuffer(data)) {
|
521
|
+
data = new DataView(data);
|
522
|
+
}
|
523
|
+
|
486
524
|
// Send the request
|
487
525
|
request.send(data);
|
488
526
|
};
|
489
527
|
|
528
|
+
/***/ },
|
529
|
+
/* 6 */
|
530
|
+
/***/ function(module, exports, __webpack_require__) {
|
531
|
+
|
532
|
+
/**
|
533
|
+
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
534
|
+
*
|
535
|
+
* Common use case would be to use `Function.prototype.apply`.
|
536
|
+
*
|
537
|
+
* ```js
|
538
|
+
* function f(x, y, z) {}
|
539
|
+
* var args = [1, 2, 3];
|
540
|
+
* f.apply(null, args);
|
541
|
+
* ```
|
542
|
+
*
|
543
|
+
* With `spread` this example can be re-written.
|
544
|
+
*
|
545
|
+
* ```js
|
546
|
+
* spread(function(x, y, z) {})([1, 2, 3]);
|
547
|
+
* ```
|
548
|
+
*
|
549
|
+
* @param {Function} callback
|
550
|
+
* @returns {Function}
|
551
|
+
*/
|
552
|
+
module.exports = function spread(callback) {
|
553
|
+
return function (arr) {
|
554
|
+
callback.apply(null, arr);
|
555
|
+
};
|
556
|
+
};
|
557
|
+
|
490
558
|
/***/ },
|
491
559
|
/* 7 */
|
492
560
|
/***/ function(module, exports, __webpack_require__) {
|
@@ -1,3 +1,3 @@
|
|
1
|
-
/* axios v0.
|
2
|
-
var axios=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){(function(e){function r(){u.forEach(arguments,function(t){a[t]=function(e,n){return a(u.merge(n||{},{method:t,url:e}))}})}function o(){u.forEach(arguments,function(t){a[t]=function(e,n,r){return a(u.merge(r||{},{method:t,url:e,data:n}))}})}var i=n(13).Promise,s=n(3),u=n(4),c=n(5),a=t.exports=function(t){t=u.merge({method:"get",transformRequest:s.transformRequest,transformResponse:s.transformResponse},t),t.withCredentials=t.withCredentials||s.withCredentials;var r=new i(function(r,o){try{"undefined"!=typeof window?n(6)(r,o,t):"undefined"!=typeof e&&n(2)(r,o,t)}catch(i){o(i)}});return r.success=function(t){return r.then(function(e){t(e.data,e.status,e.headers,e.config)}),r},r.error=function(t){return r.then(null,function(e){t(e.data,e.status,e.headers,e.config)}),r},r};a.defaults=s,a.all=function(t){return i.all(t)},a.spread=c,r("delete","get","head"),o("post","put","patch")}).call(e,n(7))},function(t){var e=new Error('Cannot find module "undefined"');throw e.code="MODULE_NOT_FOUND",e},function(t,e,n){"use strict";var r=n(4),o=/^\s*(\[|\{[^\{])/,i=/[\}\]]\s*$/,s=/^\)\]\}',?\n/,u={"Content-Type":"application/json;charset=utf-8"};t.exports={transformRequest:[function(t){return!r.isObject(t)||r.isFile(t)||r.isBlob(t)?null:JSON.stringify(t)}],transformResponse:[function(t){return"string"==typeof t&&(t=t.replace(s,""),o.test(t)&&i.test(t)&&(t=JSON.parse(t))),t}],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(t){function e(t){return"[object Array]"===l.call(t)}function n(t){return"string"==typeof t}function r(t){return"number"==typeof t}function o(t){return null!==t&&"object"==typeof t}function i(t){return"[object Date]"===l.call(t)}function s(t){return"[object File]"===l.call(t)}function u(t){return"[object Blob]"===l.call(t)}function c(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function a(t,e){if(null!==t&&"undefined"!=typeof t){var n=t.constructor===Array||"function"==typeof t.callee;if("object"==typeof t||n||(t=[t]),n)for(var r=0,o=t.length;o>r;r++)e.call(null,t[r],r,t);else for(var i in t)t.hasOwnProperty(i)&&e.call(null,t[i],i,t)}}function f(){var t={};return a(arguments,function(e){a(e,function(e,n){t[n]=e})}),t}var l=Object.prototype.toString;t.exports={isArray:e,isString:n,isNumber:r,isObject:o,isDate:i,isFile:s,isBlob:u,forEach:a,merge:f,trim:c}},function(t){t.exports=function(t){return function(e){t.apply(null,e)}}},function(t,e,n){var r=n(8),o=n(9),i=n(3),s=n(10),u=n(11),c=n(12),a=n(4);t.exports=function(t,e,n){var f=u(n.data,n.headers,n.transformRequest),l=a.merge(i.headers.common,i.headers[n.method]||{},n.headers||{}),p=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP");p.open(n.method,r(n.url,n.params),!0),p.onreadystatechange=function(){if(p&&4===p.readyState){var r=s(p.getAllResponseHeaders()),o={data:u(p.responseText,r,n.transformResponse),status:p.status,headers:r,config:n};(p.status>=200&&p.status<300?t:e)(o),p=null}};var d=c(n.url)?o.read(n.xsrfCookieName||i.xsrfCookieName):void 0;if(d&&(l[n.xsrfHeaderName||i.xsrfHeaderName]=d),a.forEach(l,function(t,e){f||"content-type"!==e.toLowerCase()?p.setRequestHeader(e,t):delete l[e]}),n.withCredentials&&(p.withCredentials=!0),n.responseType)try{p.responseType=n.responseType}catch(h){if("json"!==p.responseType)throw h}p.send(f)}},function(t){function e(){}var n=t.exports={};n.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=e,n.addListener=e,n.once=e,n.off=e,n.removeListener=e,n.removeAllListeners=e,n.emit=e,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(t,e,n){"use strict";function r(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}var o=n(4);t.exports=function(t,e){if(!e)return t;var n=[];return o.forEach(e,function(t,e){null!==t&&"undefined"!=typeof t&&(o.isArray(t)||(t=[t]),o.forEach(t,function(t){o.isDate(t)?t=t.toISOString():o.isObject(t)&&(t=JSON.stringify(t)),n.push(r(e)+"="+r(t))}))}),n.length>0&&(t+=(-1===t.indexOf("?")?"?":"&")+n.join("&")),t}},function(t,e,n){"use strict";var r=n(4);t.exports={write:function(t,e,n,o,i,s){var u=[];u.push(t+"="+encodeURIComponent(e)),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(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}},function(t,e,n){"use strict";var r=n(4);t.exports=function(t){var e,n,o,i={};return t?(r.forEach(t.split("\n"),function(t){o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e&&(i[e]=i[e]?i[e]+", "+n:n)}),i):i}},function(t,e,n){"use strict";var r=n(4);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";function r(t){var e=t;return o&&(s.setAttribute("href",e),e=s.href),s.setAttribute("href",e),{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);t.exports=function(t){var e=i.isString(t)?r(t):t;return e.protocol===u.protocol&&e.host===u.host}},function(t,e,n){"use strict";var r=n(14).Promise,o=n(15).polyfill;e.Promise=r,e.polyfill=o},function(t,e,n){"use strict";function r(t){if(!v(t))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(t,this)}function o(t,e){function n(t){a(e,t)}function r(t){l(e,t)}try{t(n,r)}catch(o){r(o)}}function i(t,e,n,r){var o,i,s,u,f=v(n);if(f)try{o=n(r),s=!0}catch(p){u=!0,i=p}else o=r,s=!0;c(e,o)||(f&&s?a(e,o):u?l(e,i):t===T?a(e,o):t===O&&l(e,o))}function s(t,e,n,r){var o=t._subscribers,i=o.length;o[i]=e,o[i+T]=n,o[i+O]=r}function u(t,e){for(var n,r,o=t._subscribers,s=t._detail,u=0;u<o.length;u+=3)n=o[u],r=o[u+e],i(e,n,r,s);t._subscribers=null}function c(t,e){var n,r=null;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(m(e)&&(r=e.then,v(r)))return r.call(e,function(r){return n?!0:(n=!0,void(e!==r?a(t,r):f(t,r)))},function(e){return n?!0:(n=!0,void l(t,e))}),!0}catch(o){return n?!0:(l(t,o),!0)}return!1}function a(t,e){t===e?f(t,e):c(t,e)||f(t,e)}function f(t,e){t._state===j&&(t._state=E,t._detail=e,h.async(p,t))}function l(t,e){t._state===j&&(t._state=E,t._detail=e,h.async(d,t))}function p(t){u(t,t._state=T)}function d(t){u(t,t._state=O)}var h=n(16).config,m=(n(16).configure,n(17).objectOrFunction),v=n(17).isFunction,w=(n(17).now,n(18).all),g=n(19).race,y=n(20).resolve,b=n(21).reject,x=n(22).asap;h.async=x;var j=void 0,E=0,T=1,O=2;r.prototype={constructor:r,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(t,e){var n=this,r=new this.constructor(function(){});if(this._state){var o=arguments;h.async(function(){i(n._state,r,o[n._state-1],n._detail)})}else s(this,r,t,e);return r},"catch":function(t){return this.then(null,t)}},r.all=w,r.race=g,r.resolve=y,r.reject=b,e.Promise=r},function(t,e,n){(function(t){"use strict";function r(){var e;e="undefined"!=typeof t?t:"undefined"!=typeof window&&window.document?window:self;var n="Promise"in e&&"resolve"in e.Promise&&"reject"in e.Promise&&"all"in e.Promise&&"race"in e.Promise&&function(){var t;return new e.Promise(function(e){t=e}),i(t)}();n||(e.Promise=o)}var o=n(14).Promise,i=n(17).isFunction;e.polyfill=r}).call(e,function(){return this}())},function(t,e){"use strict";function n(t,e){return 2!==arguments.length?r[t]:void(r[t]=e)}var r={instrument:!1};e.config=r,e.configure=n},function(t,e){"use strict";function n(t){return r(t)||"object"==typeof t&&null!==t}function r(t){return"function"==typeof t}function o(t){return"[object Array]"===Object.prototype.toString.call(t)}var i=Date.now||function(){return(new Date).getTime()};e.objectOrFunction=n,e.isFunction=r,e.isArray=o,e.now=i},function(t,e,n){"use strict";function r(t){var e=this;if(!o(t))throw new TypeError("You must pass an array to all.");return new e(function(e,n){function r(t){return function(e){o(t,e)}}function o(t,n){u[t]=n,0===--c&&e(u)}var s,u=[],c=t.length;0===c&&e([]);for(var a=0;a<t.length;a++)s=t[a],s&&i(s.then)?s.then(r(a),n):o(a,s)})}var o=n(17).isArray,i=n(17).isFunction;e.all=r},function(t,e,n){"use strict";function r(t){var e=this;if(!o(t))throw new TypeError("You must pass an array to race.");return new e(function(e,n){for(var r,o=0;o<t.length;o++)r=t[o],r&&"function"==typeof r.then?r.then(e,n):e(r)})}var o=n(17).isArray;e.race=r},function(t,e){"use strict";function n(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=this;return new e(function(e){e(t)})}e.resolve=n},function(t,e){"use strict";function n(t){var e=this;return new e(function(e,n){n(t)})}e.reject=n},function(t,e,n){(function(t,n){"use strict";function r(){return function(){n.nextTick(s)}}function o(){var t=0,e=new f(s),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function i(){return function(){l.setTimeout(s,1)}}function s(){for(var t=0;t<p.length;t++){var e=p[t],n=e[0],r=e[1];n(r)}p=[]}function u(t,e){var n=p.push([t,e]);1===n&&c()}var c,a="undefined"!=typeof window?window:{},f=a.MutationObserver||a.WebKitMutationObserver,l="undefined"!=typeof t?t:void 0===this?window:this,p=[];c="undefined"!=typeof n&&"[object process]"==={}.toString.call(n)?r():f?o():i(),e.asap=u}).call(e,function(){return this}(),n(7))}]);
|
1
|
+
/* axios v0.4.0 | (c) 2014 by Matt Zabriskie */
|
2
|
+
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;u<o.length;u+=3)n=o[u],r=o[u+t],i(t,n,r,s);e._subscribers=null}function c(e,t){var n,r=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(m(t)&&(r=t.then,w(r)))return r.call(t,function(r){return n?!0:(n=!0,void(t!==r?a(e,r):f(e,r)))},function(t){return n?!0:(n=!0,void l(e,t))}),!0}catch(o){return n?!0:(l(e,o),!0)}return!1}function a(e,t){e===t?f(e,t):c(e,t)||f(e,t)}function f(e,t){e._state===A&&(e._state=E,e._detail=t,h.async(p,e))}function l(e,t){e._state===A&&(e._state=E,e._detail=t,h.async(d,e))}function p(e){u(e,e._state=j)}function d(e){u(e,e._state=T)}var h=n(16).config,m=(n(16).configure,n(17).objectOrFunction),w=n(17).isFunction,v=(n(17).now,n(18).all),y=n(19).race,g=n(20).resolve,b=n(21).reject,x=n(22).asap;h.async=x;var A=void 0,E=0,j=1,T=2;r.prototype={constructor:r,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(e,t){var n=this,r=new this.constructor(function(){});if(this._state){var o=arguments;h.async(function(){i(n._state,r,o[n._state-1],n._detail)})}else s(this,r,e,t);return r},"catch":function(e){return this.then(null,e)}},r.all=v,r.race=y,r.resolve=g,r.reject=b,t.Promise=r},function(e,t,n){(function(e){"use strict";function r(){var t;t="undefined"!=typeof e?e:"undefined"!=typeof window&&window.document?window:self;var n="Promise"in t&&"resolve"in t.Promise&&"reject"in t.Promise&&"all"in t.Promise&&"race"in t.Promise&&function(){var e;return new t.Promise(function(t){e=t}),i(e)}();n||(t.Promise=o)}var o=n(14).Promise,i=n(17).isFunction;t.polyfill=r}).call(t,function(){return this}())},function(e,t){"use strict";function n(e,t){return 2!==arguments.length?r[e]:void(r[e]=t)}var r={instrument:!1};t.config=r,t.configure=n},function(e,t){"use strict";function n(e){return r(e)||"object"==typeof e&&null!==e}function r(e){return"function"==typeof e}function o(e){return"[object Array]"===Object.prototype.toString.call(e)}var i=Date.now||function(){return(new Date).getTime()};t.objectOrFunction=n,t.isFunction=r,t.isArray=o,t.now=i},function(e,t,n){"use strict";function r(e){var t=this;if(!o(e))throw new TypeError("You must pass an array to all.");return new t(function(t,n){function r(e){return function(t){o(e,t)}}function o(e,n){u[e]=n,0===--c&&t(u)}var s,u=[],c=e.length;0===c&&t([]);for(var a=0;a<e.length;a++)s=e[a],s&&i(s.then)?s.then(r(a),n):o(a,s)})}var o=n(17).isArray,i=n(17).isFunction;t.all=r},function(e,t,n){"use strict";function r(e){var t=this;if(!o(e))throw new TypeError("You must pass an array to race.");return new t(function(t,n){for(var r,o=0;o<e.length;o++)r=e[o],r&&"function"==typeof r.then?r.then(t,n):t(r)})}var o=n(17).isArray;t.race=r},function(e,t){"use strict";function n(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=this;return new t(function(t){t(e)})}t.resolve=n},function(e,t){"use strict";function n(e){var t=this;return new t(function(t,n){n(e)})}t.reject=n},function(e,t,n){(function(e,n){"use strict";function r(){return function(){n.nextTick(s)}}function o(){var e=0,t=new f(s),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function i(){return function(){l.setTimeout(s,1)}}function s(){for(var e=0;e<p.length;e++){var t=p[e],n=t[0],r=t[1];n(r)}p=[]}function u(e,t){var n=p.push([e,t]);1===n&&c()}var c,a="undefined"!=typeof window?window:{},f=a.MutationObserver||a.WebKitMutationObserver,l="undefined"!=typeof e?e:void 0===this?window:this,p=[];c="undefined"!=typeof n&&"[object process]"==={}.toString.call(n)?r():f?o():i(),t.asap=u}).call(t,function(){return this}(),n(7))}]);
|
3
3
|
//# sourceMappingURL=axios.min.map
|
data/lib/axios_rails/version.rb
CHANGED