Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-resource

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-resource - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

56

dist/vue-resource.common.js
/*!
* vue-resource v1.0.0
* vue-resource v1.0.1
* https://github.com/vuejs/vue-resource

@@ -657,13 +657,13 @@ * Released under the MIT License.

if (request.emulateJSON && isPlainObject(request.body)) {
request.body = Url.params(request.body);
request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
}
if (isFormData(request.body)) {
if (isFormData(request.body)) {
request.headers.delete('Content-Type');
}
} else if (isObject(request.body) || isArray(request.body)) {
if (isPlainObject(request.body)) {
request.body = JSON.stringify(request.body);
if (request.emulateJSON) {
request.body = Url.params(request.body);
request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
} else {
request.body = JSON.stringify(request.body);
}
}

@@ -862,7 +862,2 @@

xhr.open(request.method, request.getUrl(), true);
xhr.timeout = 0;
xhr.onload = handler;
xhr.onerror = handler;
if (request.progress) {

@@ -876,2 +871,4 @@ if (request.method === 'GET') {

xhr.open(request.method, request.getUrl(), true);
if ('responseType' in xhr) {

@@ -889,2 +886,5 @@ xhr.responseType = 'blob';

xhr.timeout = 0;
xhr.onload = handler;
xhr.onerror = handler;
xhr.send(request.getBody());

@@ -987,3 +987,3 @@ });

Headers.prototype.has = function has(name) {
return this.map.hasOwnProperty(normalizeName(name));
return getName(this.map, name) !== null;
};

@@ -993,3 +993,3 @@

var list = this.map[normalizeName(name)];
var list = this.map[getName(this.map, name)];

@@ -1000,7 +1000,7 @@ return list ? list[0] : null;

Headers.prototype.getAll = function getAll(name) {
return this.map[normalizeName(name)] || [];
return this.map[getName(this.map, name)] || [];
};
Headers.prototype.set = function set(name, value) {
this.map[normalizeName(name)] = [trim(value)];
this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
};

@@ -1010,13 +1010,13 @@

var list = this.map[normalizeName(name)];
var list = this.getAll(name);
if (!list) {
list = this.map[normalizeName(name)] = [];
if (list.length) {
list.push(trim(value));
} else {
this.set(name, value);
}
list.push(trim(value));
};
Headers.prototype.delete = function _delete(name) {
delete this.map[normalizeName(name)];
delete this.map[getName(name)];
};

@@ -1037,2 +1037,8 @@

function getName(map, name) {
return Object.keys(map).reduce(function (prev, curr) {
return toLower(name) === toLower(curr) ? curr : prev;
}, null);
}
function normalizeName(name) {

@@ -1044,3 +1050,3 @@

return toLower(trim(name));
return trim(name);
}

@@ -1047,0 +1053,0 @@

/*!
* vue-resource v1.0.0
* vue-resource v1.0.1
* https://github.com/vuejs/vue-resource

@@ -655,13 +655,13 @@ * Released under the MIT License.

if (request.emulateJSON && isPlainObject(request.body)) {
request.body = Url.params(request.body);
request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
}
if (isFormData(request.body)) {
if (isFormData(request.body)) {
request.headers.delete('Content-Type');
}
} else if (isObject(request.body) || isArray(request.body)) {
if (isPlainObject(request.body)) {
request.body = JSON.stringify(request.body);
if (request.emulateJSON) {
request.body = Url.params(request.body);
request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
} else {
request.body = JSON.stringify(request.body);
}
}

@@ -860,7 +860,2 @@

xhr.open(request.method, request.getUrl(), true);
xhr.timeout = 0;
xhr.onload = handler;
xhr.onerror = handler;
if (request.progress) {

@@ -874,2 +869,4 @@ if (request.method === 'GET') {

xhr.open(request.method, request.getUrl(), true);
if ('responseType' in xhr) {

@@ -887,2 +884,5 @@ xhr.responseType = 'blob';

xhr.timeout = 0;
xhr.onload = handler;
xhr.onerror = handler;
xhr.send(request.getBody());

@@ -985,3 +985,3 @@ });

Headers.prototype.has = function has(name) {
return this.map.hasOwnProperty(normalizeName(name));
return getName(this.map, name) !== null;
};

@@ -991,3 +991,3 @@

var list = this.map[normalizeName(name)];
var list = this.map[getName(this.map, name)];

@@ -998,7 +998,7 @@ return list ? list[0] : null;

Headers.prototype.getAll = function getAll(name) {
return this.map[normalizeName(name)] || [];
return this.map[getName(this.map, name)] || [];
};
Headers.prototype.set = function set(name, value) {
this.map[normalizeName(name)] = [trim(value)];
this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
};

@@ -1008,13 +1008,13 @@

var list = this.map[normalizeName(name)];
var list = this.getAll(name);
if (!list) {
list = this.map[normalizeName(name)] = [];
if (list.length) {
list.push(trim(value));
} else {
this.set(name, value);
}
list.push(trim(value));
};
Headers.prototype.delete = function _delete(name) {
delete this.map[normalizeName(name)];
delete this.map[getName(name)];
};

@@ -1035,2 +1035,8 @@

function getName(map, name) {
return Object.keys(map).reduce(function (prev, curr) {
return toLower(name) === toLower(curr) ? curr : prev;
}, null);
}
function normalizeName(name) {

@@ -1042,3 +1048,3 @@

return toLower(trim(name));
return trim(name);
}

@@ -1045,0 +1051,0 @@

/*!
* vue-resource v1.0.0
* vue-resource v1.0.1
* https://github.com/vuejs/vue-resource

@@ -661,13 +661,13 @@ * Released under the MIT License.

if (request.emulateJSON && isPlainObject(request.body)) {
request.body = Url.params(request.body);
request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
}
if (isFormData(request.body)) {
if (isFormData(request.body)) {
request.headers.delete('Content-Type');
}
} else if (isObject(request.body) || isArray(request.body)) {
if (isPlainObject(request.body)) {
request.body = JSON.stringify(request.body);
if (request.emulateJSON) {
request.body = Url.params(request.body);
request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
} else {
request.body = JSON.stringify(request.body);
}
}

@@ -866,7 +866,2 @@

xhr.open(request.method, request.getUrl(), true);
xhr.timeout = 0;
xhr.onload = handler;
xhr.onerror = handler;
if (request.progress) {

@@ -880,2 +875,4 @@ if (request.method === 'GET') {

xhr.open(request.method, request.getUrl(), true);
if ('responseType' in xhr) {

@@ -893,2 +890,5 @@ xhr.responseType = 'blob';

xhr.timeout = 0;
xhr.onload = handler;
xhr.onerror = handler;
xhr.send(request.getBody());

@@ -991,3 +991,3 @@ });

Headers.prototype.has = function has(name) {
return this.map.hasOwnProperty(normalizeName(name));
return getName(this.map, name) !== null;
};

@@ -997,3 +997,3 @@

var list = this.map[normalizeName(name)];
var list = this.map[getName(this.map, name)];

@@ -1004,7 +1004,7 @@ return list ? list[0] : null;

Headers.prototype.getAll = function getAll(name) {
return this.map[normalizeName(name)] || [];
return this.map[getName(this.map, name)] || [];
};
Headers.prototype.set = function set(name, value) {
this.map[normalizeName(name)] = [trim(value)];
this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
};

@@ -1014,13 +1014,13 @@

var list = this.map[normalizeName(name)];
var list = this.getAll(name);
if (!list) {
list = this.map[normalizeName(name)] = [];
if (list.length) {
list.push(trim(value));
} else {
this.set(name, value);
}
list.push(trim(value));
};
Headers.prototype.delete = function _delete(name) {
delete this.map[normalizeName(name)];
delete this.map[getName(name)];
};

@@ -1041,2 +1041,8 @@

function getName(map, name) {
return Object.keys(map).reduce(function (prev, curr) {
return toLower(name) === toLower(curr) ? curr : prev;
}, null);
}
function normalizeName(name) {

@@ -1048,3 +1054,3 @@

return toLower(trim(name));
return trim(name);
}

@@ -1051,0 +1057,0 @@

/*!
* vue-resource v1.0.0
* vue-resource v1.0.1
* https://github.com/vuejs/vue-resource

@@ -7,2 +7,2 @@ * Released under the MIT License.

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.VueResource=n()}(this,function(){"use strict";function t(t,n){t instanceof et?this.promise=t:this.promise=new et(t.bind(n)),this.context=n}function n(t){it=t.util,rt=t.config.debug||!t.config.silent}function e(t){"undefined"!=typeof console&&rt&&console.warn("[VueResource warn]: "+t)}function o(t){"undefined"!=typeof console&&console.error(t)}function r(t,n){return it.nextTick(t,n)}function i(t){return t.replace(/^\s*|\s*$/g,"")}function u(t){return t?t.toLowerCase():""}function s(t){return t?t.toUpperCase():""}function c(t){return"string"==typeof t}function a(t){return t===!0||t===!1}function f(t){return"function"==typeof t}function p(t){return null!==t&&"object"==typeof t}function h(t){return p(t)&&Object.getPrototypeOf(t)==Object.prototype}function l(t){return"undefined"!=typeof Blob&&t instanceof Blob}function d(t){return"undefined"!=typeof FormData&&t instanceof FormData}function m(n,e,o){var r=t.resolve(n);return arguments.length<2?r:r.then(e,o)}function y(t,n,e){return e=e||{},f(e)&&(e=e.call(n)),b(t.bind({$vm:n,$options:e}),t,{$options:e})}function v(t,n){var e,o;if(t&&"number"==typeof t.length)for(e=0;e<t.length;e++)n.call(t[e],t[e],e);else if(p(t))for(o in t)t.hasOwnProperty(o)&&n.call(t[o],t[o],o);return t}function b(t){var n=ut.call(arguments,1);return n.forEach(function(n){T(t,n,!0)}),t}function w(t){var n=ut.call(arguments,1);return n.forEach(function(n){for(var e in n)void 0===t[e]&&(t[e]=n[e])}),t}function g(t){var n=ut.call(arguments,1);return n.forEach(function(n){T(t,n)}),t}function T(t,n,e){for(var o in n)e&&(h(n[o])||st(n[o]))?(h(n[o])&&!h(t[o])&&(t[o]={}),st(n[o])&&!st(t[o])&&(t[o]=[]),T(t[o],n[o],e)):void 0!==n[o]&&(t[o]=n[o])}function x(t,n){var e=n(t);return c(t.root)&&!e.match(/^(https?:)?\//)&&(e=t.root+"/"+e),e}function E(t,n){var e=Object.keys(S.options.params),o={},r=n(t);return v(t.params,function(t,n){e.indexOf(n)===-1&&(o[n]=t)}),o=S.params(o),o&&(r+=(r.indexOf("?")==-1?"?":"&")+o),r}function j(t,n,e){var o=O(t),r=o.expand(n);return e&&e.push.apply(e,o.vars),r}function O(t){var n=["+","#",".","/",";","?","&"],e=[];return{vars:e,expand:function(o){return t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(t,r,i){if(r){var u=null,s=[];if(n.indexOf(r.charAt(0))!==-1&&(u=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(t){var n=/([^:\*]*)(?::(\d+)|(\*))?/.exec(t);s.push.apply(s,P(o,u,n[1],n[2]||n[3])),e.push(n[1])}),u&&"+"!==u){var c=",";return"?"===u?c="&":"#"!==u&&(c=u),(0!==s.length?u:"")+s.join(c)}return s.join(",")}return U(i)})}}}function P(t,n,e,o){var r=t[e],i=[];if(C(r)&&""!==r)if("string"==typeof r||"number"==typeof r||"boolean"==typeof r)r=r.toString(),o&&"*"!==o&&(r=r.substring(0,parseInt(o,10))),i.push(R(n,r,$(n)?e:null));else if("*"===o)Array.isArray(r)?r.filter(C).forEach(function(t){i.push(R(n,t,$(n)?e:null))}):Object.keys(r).forEach(function(t){C(r[t])&&i.push(R(n,r[t],t))});else{var u=[];Array.isArray(r)?r.filter(C).forEach(function(t){u.push(R(n,t))}):Object.keys(r).forEach(function(t){C(r[t])&&(u.push(encodeURIComponent(t)),u.push(R(n,r[t].toString())))}),$(n)?i.push(encodeURIComponent(e)+"="+u.join(",")):0!==u.length&&i.push(u.join(","))}else";"===n?i.push(encodeURIComponent(e)):""!==r||"&"!==n&&"?"!==n?""===r&&i.push(""):i.push(encodeURIComponent(e)+"=");return i}function C(t){return void 0!==t&&null!==t}function $(t){return";"===t||"&"===t||"?"===t}function R(t,n,e){return n="+"===t||"#"===t?U(n):encodeURIComponent(n),e?encodeURIComponent(e)+"="+n:n}function U(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t)),t}).join("")}function A(t){var n=[],e=j(t.url,t.params,n);return n.forEach(function(n){delete t.params[n]}),e}function S(t,n){var e,o=this||{},r=t;return c(t)&&(r={url:t,params:n}),r=b({},S.options,o.$options,r),S.transforms.forEach(function(t){e=I(t,e,o.$vm)}),e(r)}function I(t,n,e){return function(o){return t.call(e,o,n)}}function k(t,n,e){var o,r=st(n),i=h(n);v(n,function(n,u){o=p(n)||st(n),e&&(u=e+"["+(i||o?u:"")+"]"),!e&&r?t.add(n.name,n.value):o?k(t,n,u):t.add(u,n)})}function H(n){return new t(function(t){var e=new XDomainRequest,o=function(o){var r=n.respondWith(e.responseText,{status:e.status,statusText:e.statusText});t(r)};n.abort=function(){return e.abort()},e.open(n.method,n.getUrl(),!0),e.timeout=0,e.onload=o,e.onerror=o,e.ontimeout=function(){},e.onprogress=function(){},e.send(n.getBody())})}function L(t,n){!a(t.crossOrigin)&&N(t)&&(t.crossOrigin=!0),t.crossOrigin&&(ht||(t.client=H),delete t.emulateHTTP),n()}function N(t){var n=S.parse(S(t));return n.protocol!==pt.protocol||n.host!==pt.host}function q(t,n){t.emulateJSON&&h(t.body)&&(t.body=S.params(t.body),t.headers.set("Content-Type","application/x-www-form-urlencoded")),d(t.body)&&t.headers.delete("Content-Type"),h(t.body)&&(t.body=JSON.stringify(t.body)),n(function(t){return Object.defineProperty(t,"data",{get:function(){return this.body},set:function(t){this.body=t}}),t.bodyText?m(t.text(),function(n){var e=t.headers.get("Content-Type");if(c(e)&&0===e.indexOf("application/json"))try{t.body=JSON.parse(n)}catch(n){t.body=null}else t.body=n;return t}):t})}function B(n){return new t(function(t){var e,o,r=n.jsonp||"callback",i="_jsonp"+Math.random().toString(36).substr(2),u=null;e=function(e){var r=0;"load"===e.type&&null!==u?r=200:"error"===e.type&&(r=404),t(n.respondWith(u,{status:r})),delete window[i],document.body.removeChild(o)},n.params[r]=i,window[i]=function(t){u=JSON.stringify(t)},o=document.createElement("script"),o.src=n.getUrl(),o.type="text/javascript",o.async=!0,o.onload=e,o.onerror=e,document.body.appendChild(o)})}function J(t,n){"JSONP"==t.method&&(t.client=B),n(function(n){if("JSONP"==t.method)return m(n.json(),function(t){return n.body=t,n})})}function D(t,n){f(t.before)&&t.before.call(this,t),n()}function M(t,n){t.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(t.method)&&(t.headers.set("X-HTTP-Method-Override",t.method),t.method="POST"),n()}function X(t,n){var e=ct({},Q.headers.common,t.crossOrigin?{}:Q.headers.custom,Q.headers[u(t.method)]);v(e,function(n,e){t.headers.has(e)||t.headers.set(e,n)}),n()}function F(t,n){var e;t.timeout&&(e=setTimeout(function(){t.abort()},t.timeout)),n(function(t){clearTimeout(e)})}function W(n){return new t(function(t){var e=new XMLHttpRequest,o=function(o){var r=n.respondWith("response"in e?e.response:e.responseText,{status:1223===e.status?204:e.status,statusText:1223===e.status?"No Content":i(e.statusText)});v(i(e.getAllResponseHeaders()).split("\n"),function(t){r.headers.append(t.slice(0,t.indexOf(":")),t.slice(t.indexOf(":")+1))}),t(r)};n.abort=function(){return e.abort()},e.open(n.method,n.getUrl(),!0),e.timeout=0,e.onload=o,e.onerror=o,n.progress&&("GET"===n.method?e.addEventListener("progress",n.progress):/^(POST|PUT)$/i.test(n.method)&&e.upload.addEventListener("progress",n.progress)),"responseType"in e&&(e.responseType="blob"),n.credentials===!0&&(e.withCredentials=!0),n.headers.forEach(function(t,n){e.setRequestHeader(n,t)}),e.send(n.getBody())})}function G(n){function o(o){return new t(function(t){function s(){r=i.pop(),f(r)?r.call(n,o,c):(e("Invalid interceptor of type "+typeof r+", must be a function"),c())}function c(e){if(f(e))u.unshift(e);else if(p(e))return u.forEach(function(t){e=m(e,function(e){return t.call(n,e)||e})}),void m(e,t);s()}s()},n)}var r,i=[V],u=[];return p(n)||(n=null),o.use=function(t){i.push(t)},o}function V(t,n){var e=t.client||W;n(e(t))}function _(t){if(/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return u(i(t))}function z(n){return new t(function(t){var e=new FileReader;e.readAsText(n),e.onload=function(){t(e.result)}})}function K(t){return 0===t.type.indexOf("text")||t.type.indexOf("json")!==-1}function Q(n){var e=this||{},r=G(e.$vm);return w(n||{},e.$options,Q.options),Q.interceptors.forEach(function(t){r.use(t)}),r(new yt(n)).then(function(n){return n.ok?n:t.reject(n)},function(n){return n instanceof Error&&o(n),t.reject(n)})}function Y(t){this.state=xt,this.value=void 0,this.deferred=[];var n=this;try{t(function(t){n.resolve(t)},function(t){n.reject(t)})}catch(t){n.reject(t)}}function Z(t,n,e,o){var r=this||{},i={};return e=ct({},Z.actions,e),v(e,function(e,u){e=b({url:t,params:ct({},n)},o,e),i[u]=function(){return(r.$http||Q)(tt(e,arguments))}}),i}function tt(t,n){var e,o=ct({},t),r={};switch(n.length){case 2:r=n[0],e=n[1];break;case 1:/^(POST|PUT|PATCH)$/i.test(o.method)?e=n[0]:r=n[0];break;case 0:break;default:throw"Expected up to 4 arguments [params, body], got "+n.length+" arguments"}return o.body=e,o.params=ct({},o.params,r),o}function nt(e){nt.installed||(n(e),e.url=S,e.http=Q,e.resource=Z,e.Promise=t,Object.defineProperties(e.prototype,{$url:{get:function(){return y(e.url,this,this.$options.url)}},$http:{get:function(){return y(e.http,this,this.$options.http)}},$resource:{get:function(){return e.resource.bind(this)}},$promise:{get:function(){var t=this;return function(n){return new e.Promise(n,t)}}}}))}var et=window.Promise;t.all=function(n,e){return new t(et.all(n),e)},t.resolve=function(n,e){return new t(et.resolve(n),e)},t.reject=function(n,e){return new t(et.reject(n),e)},t.race=function(n,e){return new t(et.race(n),e)};var ot=t.prototype;ot.bind=function(t){return this.context=t,this},ot.then=function(n,e){return n&&n.bind&&this.context&&(n=n.bind(this.context)),e&&e.bind&&this.context&&(e=e.bind(this.context)),new t(this.promise.then(n,e),this.context)},ot.catch=function(n){return n&&n.bind&&this.context&&(n=n.bind(this.context)),new t(this.promise.catch(n),this.context)},ot.finally=function(t){return this.then(function(n){return t.call(this),n},function(n){return t.call(this),et.reject(n)})};var rt=!1,it={},ut=[].slice,st=Array.isArray,ct=Object.assign||g,at=document.documentMode,ft=document.createElement("a");S.options={url:"",root:null,params:{}},S.transforms=[A,E,x],S.params=function(t){var n=[],e=encodeURIComponent;return n.add=function(t,n){f(n)&&(n=n()),null===n&&(n=""),this.push(e(t)+"="+e(n))},k(n,t),n.join("&").replace(/%20/g,"+")},S.parse=function(t){return at&&(ft.href=t,t=ft.href),ft.href=t,{href:ft.href,protocol:ft.protocol?ft.protocol.replace(/:$/,""):"",port:ft.port,host:ft.host,hostname:ft.hostname,pathname:"/"===ft.pathname.charAt(0)?ft.pathname:"/"+ft.pathname,search:ft.search?ft.search.replace(/^\?/,""):"",hash:ft.hash?ft.hash.replace(/^#/,""):""}};var pt=S.parse(location.href),ht="withCredentials"in new XMLHttpRequest,lt=function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")},dt=function(){function t(n){var e=this;lt(this,t),this.map={},v(n,function(t,n){return e.append(n,t)})}return t.prototype.has=function(t){return this.map.hasOwnProperty(_(t))},t.prototype.get=function(t){var n=this.map[_(t)];return n?n[0]:null},t.prototype.getAll=function(t){return this.map[_(t)]||[]},t.prototype.set=function(t,n){this.map[_(t)]=[i(n)]},t.prototype.append=function(t,n){var e=this.map[_(t)];e||(e=this.map[_(t)]=[]),e.push(i(n))},t.prototype.delete=function(t){delete this.map[_(t)]},t.prototype.forEach=function(t,n){var e=this;v(this.map,function(o,r){v(o,function(o){return t.call(n,o,r,e)})})},t}(),mt=function(){function t(n,e){var o=e.url,r=e.headers,i=e.status,u=e.statusText;lt(this,t),this.url=o,this.ok=i>=200&&i<300,this.status=i||0,this.statusText=u||"",this.headers=new dt(r),this.body=n,c(n)?this.bodyText=n:l(n)&&(this.bodyBlob=n,K(n)&&(this.bodyText=z(n)))}return t.prototype.blob=function(){return m(this.bodyBlob)},t.prototype.text=function(){return m(this.bodyText)},t.prototype.json=function(){return m(this.text(),function(t){return JSON.parse(t)})},t}(),yt=function(){function t(n){lt(this,t),this.body=null,this.params={},ct(this,n,{method:s(n.method||"GET"),headers:new dt(n.headers)})}return t.prototype.getUrl=function(){return S(this)},t.prototype.getBody=function(){return this.body},t.prototype.respondWith=function(t,n){return new mt(t,ct(n||{},{url:this.getUrl()}))},t}(),vt={"X-Requested-With":"XMLHttpRequest"},bt={Accept:"application/json, text/plain, */*"},wt={"Content-Type":"application/json;charset=utf-8"};Q.options={},Q.headers={put:wt,post:wt,patch:wt,delete:wt,custom:vt,common:bt},Q.interceptors=[D,F,M,q,J,X,L],["get","delete","head","jsonp"].forEach(function(t){Q[t]=function(n,e){return this(ct(e||{},{url:n,method:t}))}}),["post","put","patch"].forEach(function(t){Q[t]=function(n,e,o){return this(ct(o||{},{url:n,method:t,body:e}))}});var gt=0,Tt=1,xt=2;Y.reject=function(t){return new Y(function(n,e){e(t)})},Y.resolve=function(t){return new Y(function(n,e){n(t)})},Y.all=function(t){return new Y(function(n,e){function o(e){return function(o){i[e]=o,r+=1,r===t.length&&n(i)}}var r=0,i=[];0===t.length&&n(i);for(var u=0;u<t.length;u+=1)Y.resolve(t[u]).then(o(u),e)})},Y.race=function(t){return new Y(function(n,e){for(var o=0;o<t.length;o+=1)Y.resolve(t[o]).then(n,e)})};var Et=Y.prototype;return Et.resolve=function(t){var n=this;if(n.state===xt){if(t===n)throw new TypeError("Promise settled with itself.");var e=!1;try{var o=t&&t.then;if(null!==t&&"object"==typeof t&&"function"==typeof o)return void o.call(t,function(t){e||n.resolve(t),e=!0},function(t){e||n.reject(t),e=!0})}catch(t){return void(e||n.reject(t))}n.state=gt,n.value=t,n.notify()}},Et.reject=function(t){var n=this;if(n.state===xt){if(t===n)throw new TypeError("Promise settled with itself.");n.state=Tt,n.value=t,n.notify()}},Et.notify=function(){var t=this;r(function(){if(t.state!==xt)for(;t.deferred.length;){var n=t.deferred.shift(),e=n[0],o=n[1],r=n[2],i=n[3];try{t.state===gt?r("function"==typeof e?e.call(void 0,t.value):t.value):t.state===Tt&&("function"==typeof o?r(o.call(void 0,t.value)):i(t.value))}catch(t){i(t)}}})},Et.then=function(t,n){var e=this;return new Y(function(o,r){e.deferred.push([t,n,o,r]),e.notify()})},Et.catch=function(t){return this.then(void 0,t)},Z.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},delete:{method:"DELETE"}},"undefined"!=typeof window&&(window.Promise||(window.Promise=Y),window.Vue&&window.Vue.use(nt)),nt});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.VueResource=n()}(this,function(){"use strict";function t(t,n){t instanceof ot?this.promise=t:this.promise=new ot(t.bind(n)),this.context=n}function n(t){ut=t.util,it=t.config.debug||!t.config.silent}function e(t){"undefined"!=typeof console&&it&&console.warn("[VueResource warn]: "+t)}function o(t){"undefined"!=typeof console&&console.error(t)}function r(t,n){return ut.nextTick(t,n)}function i(t){return t.replace(/^\s*|\s*$/g,"")}function u(t){return t?t.toLowerCase():""}function s(t){return t?t.toUpperCase():""}function c(t){return"string"==typeof t}function a(t){return t===!0||t===!1}function f(t){return"function"==typeof t}function h(t){return null!==t&&"object"==typeof t}function p(t){return h(t)&&Object.getPrototypeOf(t)==Object.prototype}function l(t){return"undefined"!=typeof Blob&&t instanceof Blob}function d(t){return"undefined"!=typeof FormData&&t instanceof FormData}function m(n,e,o){var r=t.resolve(n);return arguments.length<2?r:r.then(e,o)}function y(t,n,e){return e=e||{},f(e)&&(e=e.call(n)),b(t.bind({$vm:n,$options:e}),t,{$options:e})}function v(t,n){var e,o;if(t&&"number"==typeof t.length)for(e=0;e<t.length;e++)n.call(t[e],t[e],e);else if(h(t))for(o in t)t.hasOwnProperty(o)&&n.call(t[o],t[o],o);return t}function b(t){var n=st.call(arguments,1);return n.forEach(function(n){T(t,n,!0)}),t}function g(t){var n=st.call(arguments,1);return n.forEach(function(n){for(var e in n)void 0===t[e]&&(t[e]=n[e])}),t}function w(t){var n=st.call(arguments,1);return n.forEach(function(n){T(t,n)}),t}function T(t,n,e){for(var o in n)e&&(p(n[o])||ct(n[o]))?(p(n[o])&&!p(t[o])&&(t[o]={}),ct(n[o])&&!ct(t[o])&&(t[o]=[]),T(t[o],n[o],e)):void 0!==n[o]&&(t[o]=n[o])}function x(t,n){var e=n(t);return c(t.root)&&!e.match(/^(https?:)?\//)&&(e=t.root+"/"+e),e}function j(t,n){var e=Object.keys(S.options.params),o={},r=n(t);return v(t.params,function(t,n){e.indexOf(n)===-1&&(o[n]=t)}),o=S.params(o),o&&(r+=(r.indexOf("?")==-1?"?":"&")+o),r}function E(t,n,e){var o=O(t),r=o.expand(n);return e&&e.push.apply(e,o.vars),r}function O(t){var n=["+","#",".","/",";","?","&"],e=[];return{vars:e,expand:function(o){return t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(t,r,i){if(r){var u=null,s=[];if(n.indexOf(r.charAt(0))!==-1&&(u=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(t){var n=/([^:\*]*)(?::(\d+)|(\*))?/.exec(t);s.push.apply(s,P(o,u,n[1],n[2]||n[3])),e.push(n[1])}),u&&"+"!==u){var c=",";return"?"===u?c="&":"#"!==u&&(c=u),(0!==s.length?u:"")+s.join(c)}return s.join(",")}return R(i)})}}}function P(t,n,e,o){var r=t[e],i=[];if(C(r)&&""!==r)if("string"==typeof r||"number"==typeof r||"boolean"==typeof r)r=r.toString(),o&&"*"!==o&&(r=r.substring(0,parseInt(o,10))),i.push(A(n,r,$(n)?e:null));else if("*"===o)Array.isArray(r)?r.filter(C).forEach(function(t){i.push(A(n,t,$(n)?e:null))}):Object.keys(r).forEach(function(t){C(r[t])&&i.push(A(n,r[t],t))});else{var u=[];Array.isArray(r)?r.filter(C).forEach(function(t){u.push(A(n,t))}):Object.keys(r).forEach(function(t){C(r[t])&&(u.push(encodeURIComponent(t)),u.push(A(n,r[t].toString())))}),$(n)?i.push(encodeURIComponent(e)+"="+u.join(",")):0!==u.length&&i.push(u.join(","))}else";"===n?i.push(encodeURIComponent(e)):""!==r||"&"!==n&&"?"!==n?""===r&&i.push(""):i.push(encodeURIComponent(e)+"=");return i}function C(t){return void 0!==t&&null!==t}function $(t){return";"===t||"&"===t||"?"===t}function A(t,n,e){return n="+"===t||"#"===t?R(n):encodeURIComponent(n),e?encodeURIComponent(e)+"="+n:n}function R(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t)),t}).join("")}function U(t){var n=[],e=E(t.url,t.params,n);return n.forEach(function(n){delete t.params[n]}),e}function S(t,n){var e,o=this||{},r=t;return c(t)&&(r={url:t,params:n}),r=b({},S.options,o.$options,r),S.transforms.forEach(function(t){e=k(t,e,o.$vm)}),e(r)}function k(t,n,e){return function(o){return t.call(e,o,n)}}function I(t,n,e){var o,r=ct(n),i=p(n);v(n,function(n,u){o=h(n)||ct(n),e&&(u=e+"["+(i||o?u:"")+"]"),!e&&r?t.add(n.name,n.value):o?I(t,n,u):t.add(u,n)})}function H(n){return new t(function(t){var e=new XDomainRequest,o=function(o){var r=n.respondWith(e.responseText,{status:e.status,statusText:e.statusText});t(r)};n.abort=function(){return e.abort()},e.open(n.method,n.getUrl(),!0),e.timeout=0,e.onload=o,e.onerror=o,e.ontimeout=function(){},e.onprogress=function(){},e.send(n.getBody())})}function L(t,n){!a(t.crossOrigin)&&N(t)&&(t.crossOrigin=!0),t.crossOrigin&&(lt||(t.client=H),delete t.emulateHTTP),n()}function N(t){var n=S.parse(S(t));return n.protocol!==pt.protocol||n.host!==pt.host}function q(t,n){d(t.body)?t.headers.delete("Content-Type"):(h(t.body)||ct(t.body))&&(t.emulateJSON?(t.body=S.params(t.body),t.headers.set("Content-Type","application/x-www-form-urlencoded")):t.body=JSON.stringify(t.body)),n(function(t){return Object.defineProperty(t,"data",{get:function(){return this.body},set:function(t){this.body=t}}),t.bodyText?m(t.text(),function(n){var e=t.headers.get("Content-Type");if(c(e)&&0===e.indexOf("application/json"))try{t.body=JSON.parse(n)}catch(n){t.body=null}else t.body=n;return t}):t})}function B(n){return new t(function(t){var e,o,r=n.jsonp||"callback",i="_jsonp"+Math.random().toString(36).substr(2),u=null;e=function(e){var r=0;"load"===e.type&&null!==u?r=200:"error"===e.type&&(r=404),t(n.respondWith(u,{status:r})),delete window[i],document.body.removeChild(o)},n.params[r]=i,window[i]=function(t){u=JSON.stringify(t)},o=document.createElement("script"),o.src=n.getUrl(),o.type="text/javascript",o.async=!0,o.onload=e,o.onerror=e,document.body.appendChild(o)})}function J(t,n){"JSONP"==t.method&&(t.client=B),n(function(n){if("JSONP"==t.method)return m(n.json(),function(t){return n.body=t,n})})}function D(t,n){f(t.before)&&t.before.call(this,t),n()}function M(t,n){t.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(t.method)&&(t.headers.set("X-HTTP-Method-Override",t.method),t.method="POST"),n()}function X(t,n){var e=at({},Y.headers.common,t.crossOrigin?{}:Y.headers.custom,Y.headers[u(t.method)]);v(e,function(n,e){t.headers.has(e)||t.headers.set(e,n)}),n()}function F(t,n){var e;t.timeout&&(e=setTimeout(function(){t.abort()},t.timeout)),n(function(t){clearTimeout(e)})}function W(n){return new t(function(t){var e=new XMLHttpRequest,o=function(o){var r=n.respondWith("response"in e?e.response:e.responseText,{status:1223===e.status?204:e.status,statusText:1223===e.status?"No Content":i(e.statusText)});v(i(e.getAllResponseHeaders()).split("\n"),function(t){r.headers.append(t.slice(0,t.indexOf(":")),t.slice(t.indexOf(":")+1))}),t(r)};n.abort=function(){return e.abort()},n.progress&&("GET"===n.method?e.addEventListener("progress",n.progress):/^(POST|PUT)$/i.test(n.method)&&e.upload.addEventListener("progress",n.progress)),e.open(n.method,n.getUrl(),!0),"responseType"in e&&(e.responseType="blob"),n.credentials===!0&&(e.withCredentials=!0),n.headers.forEach(function(t,n){e.setRequestHeader(n,t)}),e.timeout=0,e.onload=o,e.onerror=o,e.send(n.getBody())})}function G(n){function o(o){return new t(function(t){function s(){r=i.pop(),f(r)?r.call(n,o,c):(e("Invalid interceptor of type "+typeof r+", must be a function"),c())}function c(e){if(f(e))u.unshift(e);else if(h(e))return u.forEach(function(t){e=m(e,function(e){return t.call(n,e)||e})}),void m(e,t);s()}s()},n)}var r,i=[V],u=[];return h(n)||(n=null),o.use=function(t){i.push(t)},o}function V(t,n){var e=t.client||W;n(e(t))}function _(t,n){return Object.keys(t).reduce(function(t,e){return u(n)===u(e)?e:t},null)}function z(t){if(/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return i(t)}function K(n){return new t(function(t){var e=new FileReader;e.readAsText(n),e.onload=function(){t(e.result)}})}function Q(t){return 0===t.type.indexOf("text")||t.type.indexOf("json")!==-1}function Y(n){var e=this||{},r=G(e.$vm);return g(n||{},e.$options,Y.options),Y.interceptors.forEach(function(t){r.use(t)}),r(new vt(n)).then(function(n){return n.ok?n:t.reject(n)},function(n){return n instanceof Error&&o(n),t.reject(n)})}function Z(t){this.state=jt,this.value=void 0,this.deferred=[];var n=this;try{t(function(t){n.resolve(t)},function(t){n.reject(t)})}catch(t){n.reject(t)}}function tt(t,n,e,o){var r=this||{},i={};return e=at({},tt.actions,e),v(e,function(e,u){e=b({url:t,params:at({},n)},o,e),i[u]=function(){return(r.$http||Y)(nt(e,arguments))}}),i}function nt(t,n){var e,o=at({},t),r={};switch(n.length){case 2:r=n[0],e=n[1];break;case 1:/^(POST|PUT|PATCH)$/i.test(o.method)?e=n[0]:r=n[0];break;case 0:break;default:throw"Expected up to 4 arguments [params, body], got "+n.length+" arguments"}return o.body=e,o.params=at({},o.params,r),o}function et(e){et.installed||(n(e),e.url=S,e.http=Y,e.resource=tt,e.Promise=t,Object.defineProperties(e.prototype,{$url:{get:function(){return y(e.url,this,this.$options.url)}},$http:{get:function(){return y(e.http,this,this.$options.http)}},$resource:{get:function(){return e.resource.bind(this)}},$promise:{get:function(){var t=this;return function(n){return new e.Promise(n,t)}}}}))}var ot=window.Promise;t.all=function(n,e){return new t(ot.all(n),e)},t.resolve=function(n,e){return new t(ot.resolve(n),e)},t.reject=function(n,e){return new t(ot.reject(n),e)},t.race=function(n,e){return new t(ot.race(n),e)};var rt=t.prototype;rt.bind=function(t){return this.context=t,this},rt.then=function(n,e){return n&&n.bind&&this.context&&(n=n.bind(this.context)),e&&e.bind&&this.context&&(e=e.bind(this.context)),new t(this.promise.then(n,e),this.context)},rt.catch=function(n){return n&&n.bind&&this.context&&(n=n.bind(this.context)),new t(this.promise.catch(n),this.context)},rt.finally=function(t){return this.then(function(n){return t.call(this),n},function(n){return t.call(this),ot.reject(n)})};var it=!1,ut={},st=[].slice,ct=Array.isArray,at=Object.assign||w,ft=document.documentMode,ht=document.createElement("a");S.options={url:"",root:null,params:{}},S.transforms=[U,j,x],S.params=function(t){var n=[],e=encodeURIComponent;return n.add=function(t,n){f(n)&&(n=n()),null===n&&(n=""),this.push(e(t)+"="+e(n))},I(n,t),n.join("&").replace(/%20/g,"+")},S.parse=function(t){return ft&&(ht.href=t,t=ht.href),ht.href=t,{href:ht.href,protocol:ht.protocol?ht.protocol.replace(/:$/,""):"",port:ht.port,host:ht.host,hostname:ht.hostname,pathname:"/"===ht.pathname.charAt(0)?ht.pathname:"/"+ht.pathname,search:ht.search?ht.search.replace(/^\?/,""):"",hash:ht.hash?ht.hash.replace(/^#/,""):""}};var pt=S.parse(location.href),lt="withCredentials"in new XMLHttpRequest,dt=function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")},mt=function(){function t(n){var e=this;dt(this,t),this.map={},v(n,function(t,n){return e.append(n,t)})}return t.prototype.has=function(t){return null!==_(this.map,t)},t.prototype.get=function(t){var n=this.map[_(this.map,t)];return n?n[0]:null},t.prototype.getAll=function(t){return this.map[_(this.map,t)]||[]},t.prototype.set=function(t,n){this.map[z(_(this.map,t)||t)]=[i(n)]},t.prototype.append=function(t,n){var e=this.getAll(t);e.length?e.push(i(n)):this.set(t,n)},t.prototype.delete=function(t){delete this.map[_(t)]},t.prototype.forEach=function(t,n){var e=this;v(this.map,function(o,r){v(o,function(o){return t.call(n,o,r,e)})})},t}(),yt=function(){function t(n,e){var o=e.url,r=e.headers,i=e.status,u=e.statusText;dt(this,t),this.url=o,this.ok=i>=200&&i<300,this.status=i||0,this.statusText=u||"",this.headers=new mt(r),this.body=n,c(n)?this.bodyText=n:l(n)&&(this.bodyBlob=n,Q(n)&&(this.bodyText=K(n)))}return t.prototype.blob=function(){return m(this.bodyBlob)},t.prototype.text=function(){return m(this.bodyText)},t.prototype.json=function(){return m(this.text(),function(t){return JSON.parse(t)})},t}(),vt=function(){function t(n){dt(this,t),this.body=null,this.params={},at(this,n,{method:s(n.method||"GET"),headers:new mt(n.headers)})}return t.prototype.getUrl=function(){return S(this)},t.prototype.getBody=function(){return this.body},t.prototype.respondWith=function(t,n){return new yt(t,at(n||{},{url:this.getUrl()}))},t}(),bt={"X-Requested-With":"XMLHttpRequest"},gt={Accept:"application/json, text/plain, */*"},wt={"Content-Type":"application/json;charset=utf-8"};Y.options={},Y.headers={put:wt,post:wt,patch:wt,delete:wt,custom:bt,common:gt},Y.interceptors=[D,F,M,q,J,X,L],["get","delete","head","jsonp"].forEach(function(t){Y[t]=function(n,e){return this(at(e||{},{url:n,method:t}))}}),["post","put","patch"].forEach(function(t){Y[t]=function(n,e,o){return this(at(o||{},{url:n,method:t,body:e}))}});var Tt=0,xt=1,jt=2;Z.reject=function(t){return new Z(function(n,e){e(t)})},Z.resolve=function(t){return new Z(function(n,e){n(t)})},Z.all=function(t){return new Z(function(n,e){function o(e){return function(o){i[e]=o,r+=1,r===t.length&&n(i)}}var r=0,i=[];0===t.length&&n(i);for(var u=0;u<t.length;u+=1)Z.resolve(t[u]).then(o(u),e)})},Z.race=function(t){return new Z(function(n,e){for(var o=0;o<t.length;o+=1)Z.resolve(t[o]).then(n,e)})};var Et=Z.prototype;return Et.resolve=function(t){var n=this;if(n.state===jt){if(t===n)throw new TypeError("Promise settled with itself.");var e=!1;try{var o=t&&t.then;if(null!==t&&"object"==typeof t&&"function"==typeof o)return void o.call(t,function(t){e||n.resolve(t),e=!0},function(t){e||n.reject(t),e=!0})}catch(t){return void(e||n.reject(t))}n.state=Tt,n.value=t,n.notify()}},Et.reject=function(t){var n=this;if(n.state===jt){if(t===n)throw new TypeError("Promise settled with itself.");n.state=xt,n.value=t,n.notify()}},Et.notify=function(){var t=this;r(function(){if(t.state!==jt)for(;t.deferred.length;){var n=t.deferred.shift(),e=n[0],o=n[1],r=n[2],i=n[3];try{t.state===Tt?r("function"==typeof e?e.call(void 0,t.value):t.value):t.state===xt&&("function"==typeof o?r(o.call(void 0,t.value)):i(t.value))}catch(t){i(t)}}})},Et.then=function(t,n){var e=this;return new Z(function(o,r){e.deferred.push([t,n,o,r]),e.notify()})},Et.catch=function(t){return this.then(void 0,t)},tt.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},delete:{method:"DELETE"}},"undefined"!=typeof window&&(window.Promise||(window.Promise=Z),window.Vue&&window.Vue.use(et)),et});
{
"name": "vue-resource",
"version": "1.0.0",
"version": "1.0.1",
"main": "dist/vue-resource.common.js",

@@ -5,0 +5,0 @@ "jsnext:main": "dist/vue-resource.es2015.js",

@@ -1,2 +0,2 @@

# vue-resource [![Downloads](https://img.shields.io/npm/dt/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![Version](https://img.shields.io/npm/v/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![License](https://img.shields.io/npm/l/vue-resource.svg)](https://www.npmjs.com/package/vue-resource)
# vue-resource [![Version](https://img.shields.io/npm/v/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![License](https://img.shields.io/npm/l/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![Downloads](https://img.shields.io/npm/dt/vue-resource.svg)](https://www.npmjs.com/package/vue-resource)

@@ -25,5 +25,5 @@ The plugin for [Vue.js](http://vuejs.org) provides services for making web requests and handle responses using a [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) or JSONP.

### CDN
Available on [jsdelivr](https://cdn.jsdelivr.net/vue.resource/1.0.0/vue-resource.min.js), [cdnjs](https://cdnjs.com/libraries/vue-resource) or [npmcdn](https://npmcdn.com/vue-resource@1.0.0/dist/vue-resource.min.js).
Available on [jsdelivr](https://cdn.jsdelivr.net/vue.resource/1.0.1/vue-resource.min.js), [cdnjs](https://cdnjs.com/libraries/vue-resource) or [npmcdn](https://npmcdn.com/vue-resource@1.0.1/dist/vue-resource.min.js).
```html
<script src="https://cdn.jsdelivr.net/vue.resource/1.0.0/vue-resource.min.js"></script>
<script src="https://cdn.jsdelivr.net/vue.resource/1.0.1/vue-resource.min.js"></script>
```

@@ -30,0 +30,0 @@

@@ -29,7 +29,2 @@ /**

xhr.open(request.method, request.getUrl(), true);
xhr.timeout = 0;
xhr.onload = handler;
xhr.onerror = handler;
if (request.progress) {

@@ -43,2 +38,4 @@ if (request.method === 'GET') {

xhr.open(request.method, request.getUrl(), true);
if ('responseType' in xhr) {

@@ -56,4 +53,7 @@ xhr.responseType = 'blob';

xhr.timeout = 0;
xhr.onload = handler;
xhr.onerror = handler;
xhr.send(request.getBody());
});
}

@@ -17,3 +17,3 @@ /**

has(name) {
return this.map.hasOwnProperty(normalizeName(name));
return getName(this.map, name) !== null;
}

@@ -23,3 +23,3 @@

var list = this.map[normalizeName(name)];
var list = this.map[getName(this.map, name)];

@@ -30,7 +30,7 @@ return list ? list[0] : null;

getAll(name) {
return this.map[normalizeName(name)] || [];
return this.map[getName(this.map, name)] || [];
}
set(name, value) {
this.map[normalizeName(name)] = [trim(value)];
this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
}

@@ -40,13 +40,13 @@

var list = this.map[normalizeName(name)];
var list = this.getAll(name);
if (!list) {
list = this.map[normalizeName(name)] = [];
if (list.length) {
list.push(trim(value));
} else {
this.set(name, value);
}
list.push(trim(value));
}
delete(name){
delete this.map[normalizeName(name)];
delete this.map[getName(name)];
}

@@ -62,2 +62,8 @@

function getName(map, name) {
return Object.keys(map).reduce((prev, curr) => {
return toLower(name) === toLower(curr) ? curr : prev;
}, null);
}
function normalizeName(name) {

@@ -69,3 +75,3 @@

return toLower(trim(name));
return trim(name);
}

@@ -6,17 +6,18 @@ /**

import Url from '../../url/index';
import { when, isString, isFormData, isPlainObject } from '../../util';
import { when, isString, isArray, isObject, isFormData } from '../../util';
export default function (request, next) {
if (request.emulateJSON && isPlainObject(request.body)) {
request.body = Url.params(request.body);
request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
}
if (isFormData(request.body)) {
if (isFormData(request.body)) {
request.headers.delete('Content-Type');
}
if (isPlainObject(request.body)) {
request.body = JSON.stringify(request.body);
} else if (isObject(request.body) || isArray(request.body)) {
if (request.emulateJSON) {
request.body = Url.params(request.body);
request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
} else {
request.body = JSON.stringify(request.body);
}
}

@@ -23,0 +24,0 @@

@@ -18,3 +18,3 @@ /**

if (isString(url)) {
options = {url: url, params: params};
options = {url, params};
}

@@ -24,3 +24,3 @@

Url.transforms.forEach((handler) => {
Url.transforms.forEach(handler => {
transform = factory(handler, transform, self.$vm);

@@ -27,0 +27,0 @@ });

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc