vue-resource
Advanced tools
Comparing version 1.3.4 to 1.3.5
@@ -15,3 +15,3 @@ <!-- | ||
<!-- A minimal jsfiddle that can reproduce the bug. --> | ||
<!-- You could start with this template: https://jsfiddle.net/qhh7sqc6/ --> | ||
<!-- You could start with this template: https://jsfiddle.net/pjjr7e7m/ --> | ||
@@ -18,0 +18,0 @@ ### Steps to reproduce |
/*! | ||
* vue-resource v1.3.4 | ||
* vue-resource v1.3.5 | ||
* https://github.com/pagekit/vue-resource | ||
@@ -275,3 +275,3 @@ * Released under the MIT License. | ||
var Util = function (ref) { | ||
function Util (ref) { | ||
var config = ref.config; | ||
@@ -282,3 +282,3 @@ var nextTick = ref.nextTick; | ||
debug = config.debug || !config.silent; | ||
}; | ||
} | ||
@@ -456,3 +456,3 @@ function warn(msg) { | ||
var root = function (options$$1, next) { | ||
function root (options$$1, next) { | ||
@@ -466,3 +466,3 @@ var url = next(options$$1); | ||
return url; | ||
}; | ||
} | ||
@@ -473,3 +473,3 @@ /** | ||
var query = function (options$$1, next) { | ||
function query (options$$1, next) { | ||
@@ -491,3 +491,3 @@ var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1); | ||
return url; | ||
}; | ||
} | ||
@@ -649,3 +649,3 @@ /** | ||
var template = function (options) { | ||
function template (options) { | ||
@@ -659,3 +659,3 @@ var variables = [], url = expand(options.url, options.params, variables); | ||
return url; | ||
}; | ||
} | ||
@@ -797,3 +797,3 @@ /** | ||
var xdrClient = function (request) { | ||
function xdrClient (request) { | ||
return new PromiseObj(function (resolve) { | ||
@@ -831,3 +831,3 @@ | ||
}); | ||
}; | ||
} | ||
@@ -840,3 +840,3 @@ /** | ||
var cors = function (request, next) { | ||
function cors (request, next) { | ||
@@ -860,3 +860,3 @@ if (inBrowser) { | ||
next(); | ||
}; | ||
} | ||
@@ -867,3 +867,3 @@ /** | ||
var form = function (request, next) { | ||
function form (request, next) { | ||
@@ -881,3 +881,3 @@ if (isFormData(request.body)) { | ||
next(); | ||
}; | ||
} | ||
@@ -888,3 +888,3 @@ /** | ||
var json = function (request, next) { | ||
function json (request, next) { | ||
@@ -920,9 +920,10 @@ var type = request.headers.get('Content-Type') || ''; | ||
}); | ||
}; | ||
} | ||
function isJson(str) { | ||
var start = str.match(/^\[|^\{(?!\{)/), end = {'[': /]$/, '{': /}$/}; | ||
var start = str.match(/^\s*(\[|\{)/); | ||
var end = {'[': /]\s*$/, '{': /}\s*$/}; | ||
return start && end[start[0]].test(str); | ||
return start && end[start[1]].test(str); | ||
} | ||
@@ -934,3 +935,3 @@ | ||
var jsonpClient = function (request) { | ||
function jsonpClient (request) { | ||
return new PromiseObj(function (resolve) { | ||
@@ -983,3 +984,3 @@ | ||
}); | ||
}; | ||
} | ||
@@ -990,3 +991,3 @@ /** | ||
var jsonp = function (request, next) { | ||
function jsonp (request, next) { | ||
@@ -998,3 +999,3 @@ if (request.method == 'JSONP') { | ||
next(); | ||
}; | ||
} | ||
@@ -1005,3 +1006,3 @@ /** | ||
var before = function (request, next) { | ||
function before (request, next) { | ||
@@ -1013,3 +1014,3 @@ if (isFunction(request.before)) { | ||
next(); | ||
}; | ||
} | ||
@@ -1020,3 +1021,3 @@ /** | ||
var method = function (request, next) { | ||
function method (request, next) { | ||
@@ -1029,3 +1030,3 @@ if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) { | ||
next(); | ||
}; | ||
} | ||
@@ -1036,3 +1037,3 @@ /** | ||
var header = function (request, next) { | ||
function header (request, next) { | ||
@@ -1051,3 +1052,3 @@ var headers = assign({}, Http.headers.common, | ||
next(); | ||
}; | ||
} | ||
@@ -1058,3 +1059,3 @@ /** | ||
var xhrClient = function (request) { | ||
function xhrClient (request) { | ||
return new PromiseObj(function (resolve) { | ||
@@ -1116,3 +1117,3 @@ | ||
}); | ||
}; | ||
} | ||
@@ -1123,3 +1124,3 @@ /** | ||
var nodeClient = function (request) { | ||
function nodeClient (request) { | ||
@@ -1155,3 +1156,3 @@ var client = require('got'); | ||
}); | ||
}; | ||
} | ||
@@ -1162,3 +1163,3 @@ /** | ||
var Client = function (context) { | ||
function Client (context) { | ||
@@ -1218,3 +1219,3 @@ var reqHandlers = [sendRequest], resHandlers = [], handler; | ||
return Client; | ||
}; | ||
} | ||
@@ -1221,0 +1222,0 @@ function sendRequest(request, resolve) { |
/*! | ||
* vue-resource v1.3.4 | ||
* vue-resource v1.3.5 | ||
* https://github.com/pagekit/vue-resource | ||
@@ -279,3 +279,3 @@ * Released under the MIT License. | ||
var Util = function (ref) { | ||
function Util (ref) { | ||
var config = ref.config; | ||
@@ -286,3 +286,3 @@ var nextTick = ref.nextTick; | ||
debug = config.debug || !config.silent; | ||
}; | ||
} | ||
@@ -460,3 +460,3 @@ function warn(msg) { | ||
var root = function (options$$1, next) { | ||
function root (options$$1, next) { | ||
@@ -470,3 +470,3 @@ var url = next(options$$1); | ||
return url; | ||
}; | ||
} | ||
@@ -477,3 +477,3 @@ /** | ||
var query = function (options$$1, next) { | ||
function query (options$$1, next) { | ||
@@ -495,3 +495,3 @@ var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1); | ||
return url; | ||
}; | ||
} | ||
@@ -653,3 +653,3 @@ /** | ||
var template = function (options) { | ||
function template (options) { | ||
@@ -663,3 +663,3 @@ var variables = [], url = expand(options.url, options.params, variables); | ||
return url; | ||
}; | ||
} | ||
@@ -801,3 +801,3 @@ /** | ||
var xdrClient = function (request) { | ||
function xdrClient (request) { | ||
return new PromiseObj(function (resolve) { | ||
@@ -835,3 +835,3 @@ | ||
}); | ||
}; | ||
} | ||
@@ -844,3 +844,3 @@ /** | ||
var cors = function (request, next) { | ||
function cors (request, next) { | ||
@@ -864,3 +864,3 @@ if (inBrowser) { | ||
next(); | ||
}; | ||
} | ||
@@ -871,3 +871,3 @@ /** | ||
var form = function (request, next) { | ||
function form (request, next) { | ||
@@ -885,3 +885,3 @@ if (isFormData(request.body)) { | ||
next(); | ||
}; | ||
} | ||
@@ -892,3 +892,3 @@ /** | ||
var json = function (request, next) { | ||
function json (request, next) { | ||
@@ -924,9 +924,10 @@ var type = request.headers.get('Content-Type') || ''; | ||
}); | ||
}; | ||
} | ||
function isJson(str) { | ||
var start = str.match(/^\[|^\{(?!\{)/), end = {'[': /]$/, '{': /}$/}; | ||
var start = str.match(/^\s*(\[|\{)/); | ||
var end = {'[': /]\s*$/, '{': /}\s*$/}; | ||
return start && end[start[0]].test(str); | ||
return start && end[start[1]].test(str); | ||
} | ||
@@ -938,3 +939,3 @@ | ||
var jsonpClient = function (request) { | ||
function jsonpClient (request) { | ||
return new PromiseObj(function (resolve) { | ||
@@ -987,3 +988,3 @@ | ||
}); | ||
}; | ||
} | ||
@@ -994,3 +995,3 @@ /** | ||
var jsonp = function (request, next) { | ||
function jsonp (request, next) { | ||
@@ -1002,3 +1003,3 @@ if (request.method == 'JSONP') { | ||
next(); | ||
}; | ||
} | ||
@@ -1009,3 +1010,3 @@ /** | ||
var before = function (request, next) { | ||
function before (request, next) { | ||
@@ -1017,3 +1018,3 @@ if (isFunction(request.before)) { | ||
next(); | ||
}; | ||
} | ||
@@ -1024,3 +1025,3 @@ /** | ||
var method = function (request, next) { | ||
function method (request, next) { | ||
@@ -1033,3 +1034,3 @@ if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) { | ||
next(); | ||
}; | ||
} | ||
@@ -1040,3 +1041,3 @@ /** | ||
var header = function (request, next) { | ||
function header (request, next) { | ||
@@ -1055,3 +1056,3 @@ var headers = assign({}, Http.headers.common, | ||
next(); | ||
}; | ||
} | ||
@@ -1062,3 +1063,3 @@ /** | ||
var xhrClient = function (request) { | ||
function xhrClient (request) { | ||
return new PromiseObj(function (resolve) { | ||
@@ -1120,3 +1121,3 @@ | ||
}); | ||
}; | ||
} | ||
@@ -1127,3 +1128,3 @@ /** | ||
var nodeClient = function (request) { | ||
function nodeClient (request) { | ||
@@ -1159,3 +1160,3 @@ var client = require('got'); | ||
}); | ||
}; | ||
} | ||
@@ -1166,3 +1167,3 @@ /** | ||
var Client = function (context) { | ||
function Client (context) { | ||
@@ -1222,3 +1223,3 @@ var reqHandlers = [sendRequest], resHandlers = [], handler; | ||
return Client; | ||
}; | ||
} | ||
@@ -1225,0 +1226,0 @@ function sendRequest(request, resolve) { |
/*! | ||
* vue-resource v1.3.4 | ||
* vue-resource v1.3.5 | ||
* https://github.com/pagekit/vue-resource | ||
@@ -7,2 +7,2 @@ * Released under the MIT License. | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueResource=e()}(this,function(){"use strict";function t(t){this.state=J,this.value=void 0,this.deferred=[];var e=this;try{t(function(t){e.resolve(t)},function(t){e.reject(t)})}catch(t){e.reject(t)}}function e(t,e){t instanceof Promise?this.promise=t:this.promise=new Promise(t.bind(e)),this.context=e}function n(t){"undefined"!=typeof console&&_&&console.warn("[VueResource warn]: "+t)}function o(t){"undefined"!=typeof console&&console.error(t)}function r(t,e){return F(t,e)}function i(t){return t?t.replace(/^\s*|\s*$/g,""):""}function u(t,e){return t&&void 0===e?t.replace(/\s+$/,""):t&&e?t.replace(new RegExp("["+e+"]+$"),""):t}function s(t){return t?t.toLowerCase():""}function a(t){return t?t.toUpperCase():""}function c(t){return"string"==typeof t}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 d(t){return"undefined"!=typeof Blob&&t instanceof Blob}function l(t){return"undefined"!=typeof FormData&&t instanceof FormData}function m(t,n,o){var r=e.resolve(t);return arguments.length<2?r:r.then(n,o)}function y(t,e,n){return n=n||{},f(n)&&(n=n.call(e)),b(t.bind({$vm:e,$options:n}),t,{$options:n})}function v(t,e){var n,o;if(Q(t))for(n=0;n<t.length;n++)e.call(t[n],t[n],n);else if(p(t))for(o in t)G.call(t,o)&&e.call(t[o],t[o],o);return t}function b(t){return V.call(arguments,1).forEach(function(e){T(t,e,!0)}),t}function g(t){return V.call(arguments,1).forEach(function(e){for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t}function w(t){return V.call(arguments,1).forEach(function(e){T(t,e)}),t}function T(t,e,n){for(var o in e)n&&(h(e[o])||Q(e[o]))?(h(e[o])&&!h(t[o])&&(t[o]={}),Q(e[o])&&!Q(t[o])&&(t[o]=[]),T(t[o],e[o],n)):void 0!==e[o]&&(t[o]=e[o])}function x(t,e,n){var o=j(t),r=o.expand(e);return n&&n.push.apply(n,o.vars),r}function j(t){var e=["+","#",".","/",";","?","&"],n=[];return{vars:n,expand:function(o){return t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(t,r,i){if(r){var u=null,s=[];if(-1!==e.indexOf(r.charAt(0))&&(u=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(t){var e=/([^:\*]*)(?::(\d+)|(\*))?/.exec(t);s.push.apply(s,E(o,u,e[1],e[2]||e[3])),n.push(e[1])}),u&&"+"!==u){var a=",";return"?"===u?a="&":"#"!==u&&(a=u),(0!==s.length?u:"")+s.join(a)}return s.join(",")}return $(i)})}}}function E(t,e,n,o){var r=t[n],i=[];if(O(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(C(e,r,P(e)?n:null));else if("*"===o)Array.isArray(r)?r.filter(O).forEach(function(t){i.push(C(e,t,P(e)?n:null))}):Object.keys(r).forEach(function(t){O(r[t])&&i.push(C(e,r[t],t))});else{var u=[];Array.isArray(r)?r.filter(O).forEach(function(t){u.push(C(e,t))}):Object.keys(r).forEach(function(t){O(r[t])&&(u.push(encodeURIComponent(t)),u.push(C(e,r[t].toString())))}),P(e)?i.push(encodeURIComponent(n)+"="+u.join(",")):0!==u.length&&i.push(u.join(","))}else";"===e?i.push(encodeURIComponent(n)):""!==r||"&"!==e&&"?"!==e?""===r&&i.push(""):i.push(encodeURIComponent(n)+"=");return i}function O(t){return void 0!==t&&null!==t}function P(t){return";"===t||"&"===t||"?"===t}function C(t,e,n){return e="+"===t||"#"===t?$(e):encodeURIComponent(e),n?encodeURIComponent(n)+"="+e:e}function $(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,e){var n,o=this||{},r=t;return c(t)&&(r={url:t,params:e}),r=b({},U.options,o.$options,r),U.transforms.forEach(function(t){c(t)&&(t=U.transform[t]),f(t)&&(n=R(t,n,o.$vm))}),n(r)}function R(t,e,n){return function(o){return t.call(n,o,e)}}function A(t,e,n){var o,r=Q(e),i=h(e);v(e,function(e,u){o=p(e)||Q(e),n&&(u=n+"["+(i||o?u:"")+"]"),!n&&r?t.add(e.name,e.value):o?A(t,e,u):t.add(u,e)})}function S(t){var e=t.match(/^\[|^\{(?!\{)/),n={"[":/]$/,"{":/}$/};return e&&n[e[0]].test(t)}function k(t,e){e((t.client||(z?ht:dt))(t))}function I(t,e){return Object.keys(t).reduce(function(t,n){return s(e)===s(n)?n:t},null)}function q(t){if(/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return i(t)}function H(t){return new e(function(e){var n=new FileReader;n.readAsText(t),n.onload=function(){e(n.result)}})}function L(t){return 0===t.type.indexOf("text")||-1!==t.type.indexOf("json")}function B(t){var n=this||{},r=lt(n.$vm);return g(t||{},n.$options,B.options),B.interceptors.forEach(function(t){c(t)&&(t=B.interceptor[t]),f(t)&&r.use(t)}),r(new vt(t)).then(function(t){return t.ok?t:e.reject(t)},function(t){return t instanceof Error&&o(t),e.reject(t)})}function M(t,e,n,o){var r=this||{},i={};return n=Y({},M.actions,n),v(n,function(n,u){n=b({url:t,params:Y({},e)},o,n),i[u]=function(){return(r.$http||B)(N(n,arguments))}}),i}function N(t,e){var n,o=Y({},t),r={};switch(e.length){case 2:r=e[0],n=e[1];break;case 1:/^(POST|PUT|PATCH)$/i.test(o.method)?n=e[0]:r=e[0];break;case 0:break;default:throw"Expected up to 2 arguments [params, body], got "+e.length+" arguments"}return o.body=n,o.params=Y({},o.params,r),o}function D(t){D.installed||(K(t),t.url=U,t.http=B,t.resource=M,t.Promise=e,Object.defineProperties(t.prototype,{$url:{get:function(){return y(t.url,this,this.$options.url)}},$http:{get:function(){return y(t.http,this,this.$options.http)}},$resource:{get:function(){return t.resource.bind(this)}},$promise:{get:function(){var e=this;return function(n){return new t.Promise(n,e)}}}}))}var J=2;t.reject=function(e){return new t(function(t,n){n(e)})},t.resolve=function(e){return new t(function(t,n){t(e)})},t.all=function(e){return new t(function(n,o){var r=0,i=[];0===e.length&&n(i);for(var u=0;u<e.length;u+=1)t.resolve(e[u]).then(function(t){return function(o){i[t]=o,(r+=1)===e.length&&n(i)}}(u),o)})},t.race=function(e){return new t(function(n,o){for(var r=0;r<e.length;r+=1)t.resolve(e[r]).then(n,o)})};var W=t.prototype;W.resolve=function(t){var e=this;if(e.state===J){if(t===e)throw new TypeError("Promise settled with itself.");var n=!1;try{var o=t&&t.then;if(null!==t&&"object"==typeof t&&"function"==typeof o)return void o.call(t,function(t){n||e.resolve(t),n=!0},function(t){n||e.reject(t),n=!0})}catch(t){return void(n||e.reject(t))}e.state=0,e.value=t,e.notify()}},W.reject=function(t){var e=this;if(e.state===J){if(t===e)throw new TypeError("Promise settled with itself.");e.state=1,e.value=t,e.notify()}},W.notify=function(){var t=this;r(function(){if(t.state!==J)for(;t.deferred.length;){var e=t.deferred.shift(),n=e[0],o=e[1],r=e[2],i=e[3];try{0===t.state?r("function"==typeof n?n.call(void 0,t.value):t.value):1===t.state&&("function"==typeof o?r(o.call(void 0,t.value)):i(t.value))}catch(t){i(t)}}})},W.then=function(e,n){var o=this;return new t(function(t,r){o.deferred.push([e,n,t,r]),o.notify()})},W.catch=function(t){return this.then(void 0,t)},"undefined"==typeof Promise&&(window.Promise=t),e.all=function(t,n){return new e(Promise.all(t),n)},e.resolve=function(t,n){return new e(Promise.resolve(t),n)},e.reject=function(t,n){return new e(Promise.reject(t),n)},e.race=function(t,n){return new e(Promise.race(t),n)};var X=e.prototype;X.bind=function(t){return this.context=t,this},X.then=function(t,n){return t&&t.bind&&this.context&&(t=t.bind(this.context)),n&&n.bind&&this.context&&(n=n.bind(this.context)),new e(this.promise.then(t,n),this.context)},X.catch=function(t){return t&&t.bind&&this.context&&(t=t.bind(this.context)),new e(this.promise.catch(t),this.context)},X.finally=function(t){return this.then(function(e){return t.call(this),e},function(e){return t.call(this),Promise.reject(e)})};var F,G={}.hasOwnProperty,V=[].slice,_=!1,z="undefined"!=typeof window,K=function(t){var e=t.config,n=t.nextTick;F=n,_=e.debug||!e.silent},Q=Array.isArray,Y=Object.assign||w,Z=function(t,e){var n=e(t);return c(t.root)&&!/^(https?:)?\//.test(n)&&(n=u(t.root,"/")+"/"+n),n},tt=function(t,e){var n=Object.keys(U.options.params),o={},r=e(t);return v(t.params,function(t,e){-1===n.indexOf(e)&&(o[e]=t)}),(o=U.params(o))&&(r+=(-1==r.indexOf("?")?"?":"&")+o),r},et=function(t){var e=[],n=x(t.url,t.params,e);return e.forEach(function(e){delete t.params[e]}),n};U.options={url:"",root:null,params:{}},U.transform={template:et,query:tt,root:Z},U.transforms=["template","query","root"],U.params=function(t){var e=[],n=encodeURIComponent;return e.add=function(t,e){f(e)&&(e=e()),null===e&&(e=""),this.push(n(t)+"="+n(e))},A(e,t),e.join("&").replace(/%20/g,"+")},U.parse=function(t){var e=document.createElement("a");return document.documentMode&&(e.href=t,t=e.href),e.href=t,{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",port:e.port,host:e.host,hostname:e.hostname,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):""}};var nt=function(t){return new e(function(e){var n=new XDomainRequest,o=function(o){var r=o.type,i=0;"load"===r?i=200:"error"===r&&(i=500),e(t.respondWith(n.responseText,{status:i}))};t.abort=function(){return n.abort()},n.open(t.method,t.getUrl()),t.timeout&&(n.timeout=t.timeout),n.onload=o,n.onabort=o,n.onerror=o,n.ontimeout=o,n.onprogress=function(){},n.send(t.getBody())})},ot=z&&"withCredentials"in new XMLHttpRequest,rt=function(t,e){if(z){var n=U.parse(location.href),o=U.parse(t.getUrl());o.protocol===n.protocol&&o.host===n.host||(t.crossOrigin=!0,t.emulateHTTP=!1,ot||(t.client=nt))}e()},it=function(t,e){l(t.body)?t.headers.delete("Content-Type"):p(t.body)&&t.emulateJSON&&(t.body=U.params(t.body),t.headers.set("Content-Type","application/x-www-form-urlencoded")),e()},ut=function(t,e){var n=t.headers.get("Content-Type")||"";p(t.body)&&0===n.indexOf("application/json")&&(t.body=JSON.stringify(t.body)),e(function(t){return t.bodyText?m(t.text(),function(e){if(0===(n=t.headers.get("Content-Type")||"").indexOf("application/json")||S(e))try{t.body=JSON.parse(e)}catch(e){t.body=null}else t.body=e;return t}):t})},st=function(t){return new e(function(e){var n,o,r=t.jsonp||"callback",i=t.jsonpCallback||"_jsonp"+Math.random().toString(36).substr(2),u=null;n=function(n){var r=n.type,s=0;"load"===r&&null!==u?s=200:"error"===r&&(s=500),s&&window[i]&&(delete window[i],document.body.removeChild(o)),e(t.respondWith(u,{status:s}))},window[i]=function(t){u=JSON.stringify(t)},t.abort=function(){n({type:"abort"})},t.params[r]=i,t.timeout&&setTimeout(t.abort,t.timeout),(o=document.createElement("script")).src=t.getUrl(),o.type="text/javascript",o.async=!0,o.onload=n,o.onerror=n,document.body.appendChild(o)})},at=function(t,e){"JSONP"==t.method&&(t.client=st),e()},ct=function(t,e){f(t.before)&&t.before.call(this,t),e()},ft=function(t,e){t.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(t.method)&&(t.headers.set("X-HTTP-Method-Override",t.method),t.method="POST"),e()},pt=function(t,e){v(Y({},B.headers.common,t.crossOrigin?{}:B.headers.custom,B.headers[s(t.method)]),function(e,n){t.headers.has(n)||t.headers.set(n,e)}),e()},ht=function(t){return new e(function(e){var n=new XMLHttpRequest,o=function(o){var r=t.respondWith("response"in n?n.response:n.responseText,{status:1223===n.status?204:n.status,statusText:1223===n.status?"No Content":i(n.statusText)});v(i(n.getAllResponseHeaders()).split("\n"),function(t){r.headers.append(t.slice(0,t.indexOf(":")),t.slice(t.indexOf(":")+1))}),e(r)};t.abort=function(){return n.abort()},t.progress&&("GET"===t.method?n.addEventListener("progress",t.progress):/^(POST|PUT)$/i.test(t.method)&&n.upload.addEventListener("progress",t.progress)),n.open(t.method,t.getUrl(),!0),t.timeout&&(n.timeout=t.timeout),t.responseType&&"responseType"in n&&(n.responseType=t.responseType),(t.withCredentials||t.credentials)&&(n.withCredentials=!0),t.crossOrigin||t.headers.set("X-Requested-With","XMLHttpRequest"),t.headers.forEach(function(t,e){n.setRequestHeader(e,t)}),n.onload=o,n.onabort=o,n.onerror=o,n.ontimeout=o,n.send(t.getBody())})},dt=function(t){var n=require("got");return new e(function(e){var o,r=t.getUrl(),u=t.getBody(),s=t.method,a={};t.headers.forEach(function(t,e){a[e]=t}),n(r,{body:u,method:s,headers:a}).then(o=function(n){var o=t.respondWith(n.body,{status:n.statusCode,statusText:i(n.statusMessage)});v(n.headers,function(t,e){o.headers.set(e,t)}),e(o)},function(t){return o(t.response)})})},lt=function(t){function o(o){return new e(function(e,s){function a(){f(r=i.pop())?r.call(t,o,c):(n("Invalid interceptor of type "+typeof r+", must be a function"),c())}function c(n){if(f(n))u.unshift(n);else if(p(n))return u.forEach(function(e){n=m(n,function(n){return e.call(t,n)||n},s)}),void m(n,e,s);a()}a()},t)}var r,i=[k],u=[];return p(t)||(t=null),o.use=function(t){i.push(t)},o},mt=function(t){var e=this;this.map={},v(t,function(t,n){return e.append(n,t)})};mt.prototype.has=function(t){return null!==I(this.map,t)},mt.prototype.get=function(t){var e=this.map[I(this.map,t)];return e?e.join():null},mt.prototype.getAll=function(t){return this.map[I(this.map,t)]||[]},mt.prototype.set=function(t,e){this.map[q(I(this.map,t)||t)]=[i(e)]},mt.prototype.append=function(t,e){var n=this.map[I(this.map,t)];n?n.push(i(e)):this.set(t,e)},mt.prototype.delete=function(t){delete this.map[I(this.map,t)]},mt.prototype.deleteAll=function(){this.map={}},mt.prototype.forEach=function(t,e){var n=this;v(this.map,function(o,r){v(o,function(o){return t.call(e,o,r,n)})})};var yt=function(t,e){var n=e.url,o=e.headers,r=e.status,i=e.statusText;this.url=n,this.ok=r>=200&&r<300,this.status=r||0,this.statusText=i||"",this.headers=new mt(o),this.body=t,c(t)?this.bodyText=t:d(t)&&(this.bodyBlob=t,L(t)&&(this.bodyText=H(t)))};yt.prototype.blob=function(){return m(this.bodyBlob)},yt.prototype.text=function(){return m(this.bodyText)},yt.prototype.json=function(){return m(this.text(),function(t){return JSON.parse(t)})},Object.defineProperty(yt.prototype,"data",{get:function(){return this.body},set:function(t){this.body=t}});var vt=function(t){this.body=null,this.params={},Y(this,t,{method:a(t.method||"GET")}),this.headers instanceof mt||(this.headers=new mt(this.headers))};vt.prototype.getUrl=function(){return U(this)},vt.prototype.getBody=function(){return this.body},vt.prototype.respondWith=function(t,e){return new yt(t,Y(e||{},{url:this.getUrl()}))};var bt={Accept:"application/json, text/plain, */*"},gt={"Content-Type":"application/json;charset=utf-8"};return B.options={},B.headers={put:gt,post:gt,patch:gt,delete:gt,common:bt,custom:{}},B.interceptor={before:ct,method:ft,jsonp:at,json:ut,form:it,header:pt,cors:rt},B.interceptors=["before","method","jsonp","json","form","header","cors"],["get","delete","head","jsonp"].forEach(function(t){B[t]=function(e,n){return this(Y(n||{},{url:e,method:t}))}}),["post","put","patch"].forEach(function(t){B[t]=function(e,n,o){return this(Y(o||{},{url:e,method:t,body:n}))}}),M.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},delete:{method:"DELETE"}},"undefined"!=typeof window&&window.Vue&&window.Vue.use(D),D}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueResource=e()}(this,function(){"use strict";function t(t){this.state=$,this.value=void 0,this.deferred=[];var e=this;try{t(function(t){e.resolve(t)},function(t){e.reject(t)})}catch(t){e.reject(t)}}function e(t,e){t instanceof Promise?this.promise=t:this.promise=new Promise(t.bind(e)),this.context=e}function n(t){return t?t.replace(/^\s*|\s*$/g,""):""}function o(t){return t?t.toLowerCase():""}function r(t){return"string"==typeof t}function i(t){return"function"==typeof t}function s(t){return null!==t&&"object"==typeof t}function u(t){return s(t)&&Object.getPrototypeOf(t)==Object.prototype}function a(t,n,o){var r=e.resolve(t);return arguments.length<2?r:r.then(n,o)}function c(t,e,n){return n=n||{},i(n)&&(n=n.call(e)),p(t.bind({$vm:e,$options:n}),t,{$options:n})}function f(t,e){var n,o;if(H(t))for(n=0;n<t.length;n++)e.call(t[n],t[n],n);else if(s(t))for(o in t)S.call(t,o)&&e.call(t[o],t[o],o);return t}function p(t){return k.call(arguments,1).forEach(function(e){h(t,e,!0)}),t}function h(t,e,n){for(var o in e)n&&(u(e[o])||H(e[o]))?(u(e[o])&&!u(t[o])&&(t[o]={}),H(e[o])&&!H(t[o])&&(t[o]=[]),h(t[o],e[o],n)):void 0!==e[o]&&(t[o]=e[o])}function d(t,e,n){var o=function(t){var e=["+","#",".","/",";","?","&"],n=[];return{vars:n,expand:function(o){return t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(t,r,i){if(r){var s=null,u=[];if(-1!==e.indexOf(r.charAt(0))&&(s=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(t){var e=/([^:\*]*)(?::(\d+)|(\*))?/.exec(t);u.push.apply(u,function(t,e,n,o){var r=t[n],i=[];if(l(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(y(e,r,m(e)?n:null));else if("*"===o)Array.isArray(r)?r.filter(l).forEach(function(t){i.push(y(e,t,m(e)?n:null))}):Object.keys(r).forEach(function(t){l(r[t])&&i.push(y(e,r[t],t))});else{var s=[];Array.isArray(r)?r.filter(l).forEach(function(t){s.push(y(e,t))}):Object.keys(r).forEach(function(t){l(r[t])&&(s.push(encodeURIComponent(t)),s.push(y(e,r[t].toString())))}),m(e)?i.push(encodeURIComponent(n)+"="+s.join(",")):0!==s.length&&i.push(s.join(","))}else";"===e?i.push(encodeURIComponent(n)):""!==r||"&"!==e&&"?"!==e?""===r&&i.push(""):i.push(encodeURIComponent(n)+"=");return i}(o,s,e[1],e[2]||e[3])),n.push(e[1])}),s&&"+"!==s){var a=",";return"?"===s?a="&":"#"!==s&&(a=s),(0!==u.length?s:"")+u.join(a)}return u.join(",")}return v(i)})}}}(t),r=o.expand(e);return n&&n.push.apply(n,o.vars),r}function l(t){return void 0!==t&&null!==t}function m(t){return";"===t||"&"===t||"?"===t}function y(t,e,n){return e="+"===t||"#"===t?v(e):encodeURIComponent(e),n?encodeURIComponent(n)+"="+e:e}function v(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 b(t,e){var n,o=this||{},s=t;return r(t)&&(s={url:t,params:e}),s=p({},b.options,o.$options,s),b.transforms.forEach(function(t){r(t)&&(t=b.transform[t]),i(t)&&(n=function(t,e,n){return function(o){return t.call(n,o,e)}}(t,n,o.$vm))}),n(s)}function g(t,e,n){var o,r=H(e),i=u(e);f(e,function(e,u){o=s(e)||H(e),n&&(u=n+"["+(i||o?u:"")+"]"),!n&&r?t.add(e.name,e.value):o?g(t,e,u):t.add(u,e)})}function w(t){return new e(function(e){var n=new XDomainRequest,o=function(o){var r=o.type,i=0;"load"===r?i=200:"error"===r&&(i=500),e(t.respondWith(n.responseText,{status:i}))};t.abort=function(){return n.abort()},n.open(t.method,t.getUrl()),t.timeout&&(n.timeout=t.timeout),n.onload=o,n.onabort=o,n.onerror=o,n.ontimeout=o,n.onprogress=function(){},n.send(t.getBody())})}function T(t){return new e(function(e){var n,o,r=t.jsonp||"callback",i=t.jsonpCallback||"_jsonp"+Math.random().toString(36).substr(2),s=null;n=function(n){var r=n.type,u=0;"load"===r&&null!==s?u=200:"error"===r&&(u=500),u&&window[i]&&(delete window[i],document.body.removeChild(o)),e(t.respondWith(s,{status:u}))},window[i]=function(t){s=JSON.stringify(t)},t.abort=function(){n({type:"abort"})},t.params[r]=i,t.timeout&&setTimeout(t.abort,t.timeout),(o=document.createElement("script")).src=t.getUrl(),o.type="text/javascript",o.async=!0,o.onload=n,o.onerror=n,document.body.appendChild(o)})}function x(t){function n(n){return new e(function(e,c){function f(){i(o=r.pop())?o.call(t,n,p):(!function(t){"undefined"!=typeof console&&I&&console.warn("[VueResource warn]: "+t)}("Invalid interceptor of type "+typeof o+", must be a function"),p())}function p(n){if(i(n))u.unshift(n);else if(s(n))return u.forEach(function(e){n=a(n,function(n){return e.call(t,n)||n},c)}),void a(n,e,c);f()}f()},t)}var o,r=[j],u=[];return s(t)||(t=null),n.use=function(t){r.push(t)},n}function j(t,o){o((t.client||(q?function(t){return new e(function(e){var o=new XMLHttpRequest,r=function(r){var i=t.respondWith("response"in o?o.response:o.responseText,{status:1223===o.status?204:o.status,statusText:1223===o.status?"No Content":n(o.statusText)});f(n(o.getAllResponseHeaders()).split("\n"),function(t){i.headers.append(t.slice(0,t.indexOf(":")),t.slice(t.indexOf(":")+1))}),e(i)};t.abort=function(){return o.abort()},t.progress&&("GET"===t.method?o.addEventListener("progress",t.progress):/^(POST|PUT)$/i.test(t.method)&&o.upload.addEventListener("progress",t.progress)),o.open(t.method,t.getUrl(),!0),t.timeout&&(o.timeout=t.timeout),t.responseType&&"responseType"in o&&(o.responseType=t.responseType),(t.withCredentials||t.credentials)&&(o.withCredentials=!0),t.crossOrigin||t.headers.set("X-Requested-With","XMLHttpRequest"),t.headers.forEach(function(t,e){o.setRequestHeader(e,t)}),o.onload=r,o.onabort=r,o.onerror=r,o.ontimeout=r,o.send(t.getBody())})}:function(t){var o=require("got");return new e(function(e){var r,i=t.getUrl(),s=t.getBody(),u=t.method,a={};t.headers.forEach(function(t,e){a[e]=t}),o(i,{body:s,method:u,headers:a}).then(r=function(o){var r=t.respondWith(o.body,{status:o.statusCode,statusText:n(o.statusMessage)});f(o.headers,function(t,e){r.headers.set(e,t)}),e(r)},function(t){return r(t.response)})})}))(t))}function E(t,e){return Object.keys(t).reduce(function(t,n){return o(e)===o(n)?n:t},null)}function O(t){var n=this||{},o=x(n.$vm);return function(t){k.call(arguments,1).forEach(function(e){for(var n in e)void 0===t[n]&&(t[n]=e[n])})}(t||{},n.$options,O.options),O.interceptors.forEach(function(t){r(t)&&(t=O.interceptor[t]),i(t)&&o.use(t)}),o(new D(t)).then(function(t){return t.ok?t:e.reject(t)},function(t){return t instanceof Error&&function(t){"undefined"!=typeof console&&console.error(t)}(t),e.reject(t)})}function P(t,e,n,o){var r=this||{},i={};return n=L({},P.actions,n),f(n,function(n,s){n=p({url:t,params:L({},e)},o,n),i[s]=function(){return(r.$http||O)(function(t,e){var n,o=L({},t),r={};switch(e.length){case 2:r=e[0],n=e[1];break;case 1:/^(POST|PUT|PATCH)$/i.test(o.method)?n=e[0]:r=e[0];break;case 0:break;default:throw"Expected up to 2 arguments [params, body], got "+e.length+" arguments"}return o.body=n,o.params=L({},o.params,r),o}(n,arguments))}}),i}function C(t){C.installed||(!function(t){var e=t.config,n=t.nextTick;A=n,I=e.debug||!e.silent}(t),t.url=b,t.http=O,t.resource=P,t.Promise=e,Object.defineProperties(t.prototype,{$url:{get:function(){return c(t.url,this,this.$options.url)}},$http:{get:function(){return c(t.http,this,this.$options.http)}},$resource:{get:function(){return t.resource.bind(this)}},$promise:{get:function(){var e=this;return function(n){return new t.Promise(n,e)}}}}))}var $=2;t.reject=function(e){return new t(function(t,n){n(e)})},t.resolve=function(e){return new t(function(t,n){t(e)})},t.all=function(e){return new t(function(n,o){function r(t){return function(o){s[t]=o,(i+=1)===e.length&&n(s)}}var i=0,s=[];0===e.length&&n(s);for(var u=0;u<e.length;u+=1)t.resolve(e[u]).then(r(u),o)})},t.race=function(e){return new t(function(n,o){for(var r=0;r<e.length;r+=1)t.resolve(e[r]).then(n,o)})};var U=t.prototype;U.resolve=function(t){var e=this;if(e.state===$){if(t===e)throw new TypeError("Promise settled with itself.");var n=!1;try{var o=t&&t.then;if(null!==t&&"object"==typeof t&&"function"==typeof o)return void o.call(t,function(t){n||e.resolve(t),n=!0},function(t){n||e.reject(t),n=!0})}catch(t){return void(n||e.reject(t))}e.state=0,e.value=t,e.notify()}},U.reject=function(t){if(this.state===$){if(t===this)throw new TypeError("Promise settled with itself.");this.state=1,this.value=t,this.notify()}},U.notify=function(){var t=this;!function(t,e){A(t,e)}(function(){if(t.state!==$)for(;t.deferred.length;){var e=t.deferred.shift(),n=e[0],o=e[1],r=e[2],i=e[3];try{0===t.state?r("function"==typeof n?n.call(void 0,t.value):t.value):1===t.state&&("function"==typeof o?r(o.call(void 0,t.value)):i(t.value))}catch(t){i(t)}}})},U.then=function(e,n){var o=this;return new t(function(t,r){o.deferred.push([e,n,t,r]),o.notify()})},U.catch=function(t){return this.then(void 0,t)},"undefined"==typeof Promise&&(window.Promise=t),e.all=function(t,n){return new e(Promise.all(t),n)},e.resolve=function(t,n){return new e(Promise.resolve(t),n)},e.reject=function(t,n){return new e(Promise.reject(t),n)},e.race=function(t,n){return new e(Promise.race(t),n)};var R=e.prototype;R.bind=function(t){return this.context=t,this},R.then=function(t,n){return t&&t.bind&&this.context&&(t=t.bind(this.context)),n&&n.bind&&this.context&&(n=n.bind(this.context)),new e(this.promise.then(t,n),this.context)},R.catch=function(t){return t&&t.bind&&this.context&&(t=t.bind(this.context)),new e(this.promise.catch(t),this.context)},R.finally=function(t){return this.then(function(e){return t.call(this),e},function(e){return t.call(this),Promise.reject(e)})};var A,S={}.hasOwnProperty,k=[].slice,I=!1,q="undefined"!=typeof window,H=Array.isArray,L=Object.assign||function(t){return k.call(arguments,1).forEach(function(e){h(t,e)}),t};b.options={url:"",root:null,params:{}},b.transform={template:function(t){var e=[],n=d(t.url,t.params,e);return e.forEach(function(e){delete t.params[e]}),n},query:function(t,e){var n=Object.keys(b.options.params),o={},r=e(t);return f(t.params,function(t,e){-1===n.indexOf(e)&&(o[e]=t)}),(o=b.params(o))&&(r+=(-1==r.indexOf("?")?"?":"&")+o),r},root:function(t,e){var n=e(t);return r(t.root)&&!/^(https?:)?\//.test(n)&&(n=function(t,e){return t&&void 0===e?t.replace(/\s+$/,""):t&&e?t.replace(new RegExp("["+e+"]+$"),""):t}(t.root,"/")+"/"+n),n}},b.transforms=["template","query","root"],b.params=function(t){var e=[],n=encodeURIComponent;return e.add=function(t,e){i(e)&&(e=e()),null===e&&(e=""),this.push(n(t)+"="+n(e))},g(e,t),e.join("&").replace(/%20/g,"+")},b.parse=function(t){var e=document.createElement("a");return document.documentMode&&(e.href=t,t=e.href),e.href=t,{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",port:e.port,host:e.host,hostname:e.hostname,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):""}};var B=q&&"withCredentials"in new XMLHttpRequest,M=function(t){var e=this;this.map={},f(t,function(t,n){return e.append(n,t)})};M.prototype.has=function(t){return null!==E(this.map,t)},M.prototype.get=function(t){var e=this.map[E(this.map,t)];return e?e.join():null},M.prototype.getAll=function(t){return this.map[E(this.map,t)]||[]},M.prototype.set=function(t,e){this.map[function(t){if(/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return n(t)}(E(this.map,t)||t)]=[n(e)]},M.prototype.append=function(t,e){var o=this.map[E(this.map,t)];o?o.push(n(e)):this.set(t,e)},M.prototype.delete=function(t){delete this.map[E(this.map,t)]},M.prototype.deleteAll=function(){this.map={}},M.prototype.forEach=function(t,e){var n=this;f(this.map,function(o,r){f(o,function(o){return t.call(e,o,r,n)})})};var N=function(t,n){var o=n.url,i=n.headers,s=n.status,u=n.statusText;this.url=o,this.ok=s>=200&&s<300,this.status=s||0,this.statusText=u||"",this.headers=new M(i),this.body=t,r(t)?this.bodyText=t:function(t){return"undefined"!=typeof Blob&&t instanceof Blob}(t)&&(this.bodyBlob=t,function(t){return 0===t.type.indexOf("text")||-1!==t.type.indexOf("json")}(t)&&(this.bodyText=function(t){return new e(function(e){var n=new FileReader;n.readAsText(t),n.onload=function(){e(n.result)}})}(t)))};N.prototype.blob=function(){return a(this.bodyBlob)},N.prototype.text=function(){return a(this.bodyText)},N.prototype.json=function(){return a(this.text(),function(t){return JSON.parse(t)})},Object.defineProperty(N.prototype,"data",{get:function(){return this.body},set:function(t){this.body=t}});var D=function(t){this.body=null,this.params={},L(this,t,{method:function(t){return t?t.toUpperCase():""}(t.method||"GET")}),this.headers instanceof M||(this.headers=new M(this.headers))};D.prototype.getUrl=function(){return b(this)},D.prototype.getBody=function(){return this.body},D.prototype.respondWith=function(t,e){return new N(t,L(e||{},{url:this.getUrl()}))};var J={"Content-Type":"application/json;charset=utf-8"};return O.options={},O.headers={put:J,post:J,patch:J,delete:J,common:{Accept:"application/json, text/plain, */*"},custom:{}},O.interceptor={before:function(t,e){i(t.before)&&t.before.call(this,t),e()},method:function(t,e){t.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(t.method)&&(t.headers.set("X-HTTP-Method-Override",t.method),t.method="POST"),e()},jsonp:function(t,e){"JSONP"==t.method&&(t.client=T),e()},json:function(t,e){var n=t.headers.get("Content-Type")||"";s(t.body)&&0===n.indexOf("application/json")&&(t.body=JSON.stringify(t.body)),e(function(t){return t.bodyText?a(t.text(),function(e){if(0===(n=t.headers.get("Content-Type")||"").indexOf("application/json")||function(t){var e=t.match(/^\s*(\[|\{)/);return e&&{"[":/]\s*$/,"{":/}\s*$/}[e[1]].test(t)}(e))try{t.body=JSON.parse(e)}catch(e){t.body=null}else t.body=e;return t}):t})},form:function(t,e){!function(t){return"undefined"!=typeof FormData&&t instanceof FormData}(t.body)?s(t.body)&&t.emulateJSON&&(t.body=b.params(t.body),t.headers.set("Content-Type","application/x-www-form-urlencoded")):t.headers.delete("Content-Type"),e()},header:function(t,e){f(L({},O.headers.common,t.crossOrigin?{}:O.headers.custom,O.headers[o(t.method)]),function(e,n){t.headers.has(n)||t.headers.set(n,e)}),e()},cors:function(t,e){if(q){var n=b.parse(location.href),o=b.parse(t.getUrl());o.protocol===n.protocol&&o.host===n.host||(t.crossOrigin=!0,t.emulateHTTP=!1,B||(t.client=w))}e()}},O.interceptors=["before","method","jsonp","json","form","header","cors"],["get","delete","head","jsonp"].forEach(function(t){O[t]=function(e,n){return this(L(n||{},{url:e,method:t}))}}),["post","put","patch"].forEach(function(t){O[t]=function(e,n,o){return this(L(o||{},{url:e,method:t,body:n}))}}),P.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},delete:{method:"DELETE"}},"undefined"!=typeof window&&window.Vue&&window.Vue.use(C),C}); |
{ | ||
"name": "vue-resource", | ||
"version": "1.3.4", | ||
"version": "1.3.5", | ||
"main": "dist/vue-resource.common.js", | ||
"module": "dist/vue-resource.es2015.js", | ||
"module": "dist/vue-resource.esm.js", | ||
"unpkg": "dist/vue-resource.min.js", | ||
@@ -26,2 +26,3 @@ "jsdelivr": "dist/vue-resource.min.js", | ||
"test": "jest --env=node", | ||
"karma": "karma start test/karma.conf.js --single-run", | ||
"build": "node build/build.js", | ||
@@ -35,17 +36,24 @@ "release": "node build/release.js", | ||
"dependencies": { | ||
"got": "^7.0.0" | ||
"got": "^7.1.0" | ||
}, | ||
"devDependencies": { | ||
"buble": "^0.15.2", | ||
"buble": "^0.18.0", | ||
"buble-loader": "^0.4.1", | ||
"generate-release": "^0.13.0", | ||
"jasmine-core": "^2.6.2", | ||
"jest": "^20.0.4", | ||
"replace-in-file": "^2.5.0", | ||
"rollup": "^0.42.0", | ||
"rollup-plugin-buble": "^0.15.0", | ||
"uglify-js": "^3.0.15", | ||
"vue": "^2.3.3", | ||
"webpack": "^2.6.1" | ||
"generate-release": "^0.14.0", | ||
"jasmine": "^2.8.0", | ||
"jasmine-core": "^2.8.0", | ||
"jest": "^22.0.3", | ||
"karma": "^1.7.1", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-firefox-launcher": "^1.1.0", | ||
"karma-jasmine": "^1.1.1", | ||
"karma-safari-launcher": "^1.0.0", | ||
"karma-webpack": "^2.0.9", | ||
"replace-in-file": "^3.0.0", | ||
"rollup": "^0.52.3", | ||
"rollup-plugin-buble": "^0.18.0", | ||
"uglify-js": "^3.2.2", | ||
"vue": "^2.5.13", | ||
"webpack": "^3.10.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# 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) | ||
# vue-resource [![Build](https://img.shields.io/circleci/project/pagekit/vue-resource/develop.svg)](https://circleci.com/gh/pagekit/vue-resource) [![Downloads](https://img.shields.io/npm/dm/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) | ||
@@ -21,5 +21,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/npm/vue-resource@1.3.4), [unpkg](https://unpkg.com/vue-resource@1.3.4) or [cdnjs](https://cdnjs.com/libraries/vue-resource). | ||
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/vue-resource@1.3.5), [unpkg](https://unpkg.com/vue-resource@1.3.5) or [cdnjs](https://cdnjs.com/libraries/vue-resource). | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.3.4"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.3.5"></script> | ||
``` | ||
@@ -26,0 +26,0 @@ |
@@ -43,5 +43,6 @@ /** | ||
var start = str.match(/^\[|^\{(?!\{)/), end = {'[': /]$/, '{': /}$/}; | ||
const start = str.match(/^\s*(\[|\{)/); | ||
const end = {'[': /]\s*$/, '{': /}\s*$/}; | ||
return start && end[start[0]].test(str); | ||
return start && end[start[1]].test(str); | ||
} |
@@ -14,3 +14,2 @@ import Vue from 'vue'; | ||
expect(res.headers.get('Content-Type')).toBe('text/plain'); | ||
expect(res.headers.get('Content-Length')).toBe('4'); | ||
@@ -17,0 +16,0 @@ done(); |
@@ -0,1 +1,3 @@ | ||
var webpack = require('webpack'); | ||
module.exports = { | ||
@@ -11,3 +13,6 @@ entry: __dirname + '/index.js', | ||
] | ||
} | ||
}, | ||
plugins: [ | ||
new webpack.optimize.ModuleConcatenationPlugin() | ||
] | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
589797
13395
18
Updatedgot@^7.1.0