Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
v1.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffan committed Feb 11, 2018
1 parent aadc9ad commit ea80f37
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 150 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ $ npm install vue-resource
```

### CDN
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/[email protected].5), [unpkg](https://unpkg.com/[email protected].5) or [cdnjs](https://cdnjs.com/libraries/vue-resource).
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/[email protected].6), [unpkg](https://unpkg.com/[email protected].6) or [cdnjs](https://cdnjs.com/libraries/vue-resource).
```html
<script src="https://cdn.jsdelivr.net/npm/[email protected].5"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].6"></script>
```

## Example
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-resource",
"main": "dist/vue-resource.js",
"version": "1.3.5",
"version": "1.3.6",
"description": "The HTTP client for Vue.js",
"homepage": "https://github.com/pagekit/vue-resource",
"license": "MIT",
Expand Down
94 changes: 46 additions & 48 deletions dist/vue-resource.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.3.5
* vue-resource v1.3.6
* https://github.com/pagekit/vue-resource
* Released under the MIT License.
*/
Expand All @@ -12,7 +12,7 @@

var RESOLVED = 0;
var REJECTED = 1;
var PENDING = 2;
var PENDING = 2;

function Promise$1(executor) {

Expand Down Expand Up @@ -78,9 +78,9 @@ Promise$1.race = function race(iterable) {
});
};

var p$1 = Promise$1.prototype;
var p = Promise$1.prototype;

p$1.resolve = function resolve(x) {
p.resolve = function resolve(x) {
var promise = this;

if (promise.state === PENDING) {
Expand Down Expand Up @@ -121,7 +121,7 @@ p$1.resolve = function resolve(x) {
}
};

p$1.reject = function reject(reason) {
p.reject = function reject(reason) {
var promise = this;

if (promise.state === PENDING) {
Expand All @@ -135,7 +135,7 @@ p$1.reject = function reject(reason) {
}
};

p$1.notify = function notify() {
p.notify = function notify() {
var promise = this;

nextTick(function () {
Expand Down Expand Up @@ -169,7 +169,7 @@ p$1.notify = function notify() {
});
};

p$1.then = function then(onResolved, onRejected) {
p.then = function then(onResolved, onRejected) {
var promise = this;

return new Promise$1(function (resolve, reject) {
Expand All @@ -178,7 +178,7 @@ p$1.then = function then(onResolved, onRejected) {
});
};

p$1.catch = function (onRejected) {
p.catch = function (onRejected) {
return this.then(undefined, onRejected);
};

Expand Down Expand Up @@ -217,14 +217,14 @@ PromiseObj.race = function (iterable, context) {
return new PromiseObj(Promise.race(iterable), context);
};

var p = PromiseObj.prototype;
var p$1 = PromiseObj.prototype;

p.bind = function (context) {
p$1.bind = function (context) {
this.context = context;
return this;
};

p.then = function (fulfilled, rejected) {
p$1.then = function (fulfilled, rejected) {

if (fulfilled && fulfilled.bind && this.context) {
fulfilled = fulfilled.bind(this.context);
Expand All @@ -237,7 +237,7 @@ p.then = function (fulfilled, rejected) {
return new PromiseObj(this.promise.then(fulfilled, rejected), this.context);
};

p.catch = function (rejected) {
p$1.catch = function (rejected) {

if (rejected && rejected.bind && this.context) {
rejected = rejected.bind(this.context);
Expand All @@ -246,15 +246,15 @@ p.catch = function (rejected) {
return new PromiseObj(this.promise.catch(rejected), this.context);
};

p.finally = function (callback) {
p$1.finally = function (callback) {

return this.then(function (value) {
callback.call(this);
return value;
}, function (reason) {
callback.call(this);
return Promise.reject(reason);
}
callback.call(this);
return value;
}, function (reason) {
callback.call(this);
return Promise.reject(reason);
}
);
};

Expand Down Expand Up @@ -507,7 +507,7 @@ function parse(template) {
return {
vars: variables,
expand: function expand(context) {
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
return template.replace(/\{([^{}]+)\}|([^{}]+)/g, function (_, expression, literal) {
if (expression) {

var operator = null, values = [];
Expand All @@ -518,7 +518,7 @@ function parse(template) {
}

expression.split(/,/g).forEach(function (variable) {
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
var tmp = /([^:*]*)(?::(\d+)|(\*))?/.exec(variable);
values.push.apply(values, getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
variables.push(tmp[1]);
});
Expand Down Expand Up @@ -790,19 +790,19 @@ function xdrClient (request) {
return new PromiseObj(function (resolve) {

var xdr = new XDomainRequest(), handler = function (ref) {
var type = ref.type;
var type = ref.type;


var status = 0;
var status = 0;

if (type === 'load') {
status = 200;
} else if (type === 'error') {
status = 500;
}
if (type === 'load') {
status = 200;
} else if (type === 'error') {
status = 500;
}

resolve(request.respondWith(xdr.responseText, {status: status}));
};
resolve(request.respondWith(xdr.responseText, {status: status}));
};

request.abort = function () { return xdr.abort(); };

Expand Down Expand Up @@ -1035,19 +1035,18 @@ function xhrClient (request) {

var xhr = new XMLHttpRequest(), handler = function (event) {

var response = request.respondWith(
var response = request.respondWith(
'response' in xhr ? xhr.response : xhr.responseText, {
status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug
statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText)
}
);
});

each(trim(xhr.getAllResponseHeaders()).split('\n'), function (row) {
response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1));
});
each(trim(xhr.getAllResponseHeaders()).split('\n'), function (row) {
response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1));
});

resolve(response);
};
resolve(response);
};

request.abort = function () { return xhr.abort(); };

Expand Down Expand Up @@ -1111,10 +1110,9 @@ function nodeClient (request) {
client(url, {body: body, method: method, headers: headers}).then(handler = function (resp) {

var response = request.respondWith(resp.body, {
status: resp.statusCode,
statusText: trim(resp.statusMessage)
}
);
status: resp.statusCode,
statusText: trim(resp.statusMessage)
});

each(resp.headers, function (value, name) {
response.headers.set(name, value);
Expand Down Expand Up @@ -1226,7 +1224,7 @@ Headers.prototype.set = function set (name, value) {
this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
};

Headers.prototype.append = function append (name, value){
Headers.prototype.append = function append (name, value) {

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

Expand All @@ -1237,11 +1235,11 @@ Headers.prototype.append = function append (name, value){
}
};

Headers.prototype.delete = function delete$1 (name){
Headers.prototype.delete = function delete$1 (name) {
delete this.map[getName(this.map, name)];
};

Headers.prototype.deleteAll = function deleteAll (){
Headers.prototype.deleteAll = function deleteAll () {
this.map = {};
};

Expand All @@ -1261,7 +1259,7 @@ function getName(map, name) {

function normalizeName(name) {

if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
throw new TypeError('Invalid character in header field name');
}

Expand Down Expand Up @@ -1359,11 +1357,11 @@ var Request = function Request(options$$1) {
}
};

Request.prototype.getUrl = function getUrl (){
Request.prototype.getUrl = function getUrl () {
return Url(this);
};

Request.prototype.getBody = function getBody (){
Request.prototype.getBody = function getBody () {
return this.body;
};

Expand Down
Loading

0 comments on commit ea80f37

Please sign in to comment.