v1.3.11: pass callback

This commit is contained in:
AJ ONeal 2019-05-23 13:25:20 -06:00
parent 28f3f783ae
commit 335dd98631
2 changed files with 3 additions and 3 deletions

View File

@ -391,12 +391,12 @@ function setDefaults(defs) {
return setDefaults(_defs);
};
[ 'get', 'put', 'post', 'patch', 'delete', 'head', 'options' ].forEach(function (method) {
urequest[method] = function (obj) {
urequest[method] = function (obj, cb) {
if ('string' === typeof obj) {
obj = { url: obj };
}
obj.method = method.toUpperCase();
urequest(obj);
urequest(obj, cb);
};
});
urequest.del = urequest.delete;

View File

@ -1,6 +1,6 @@
{
"name": "@root/request",
"version": "1.3.10",
"version": "1.3.11",
"description": "A lightweight, zero-dependency drop-in replacement for request",
"main": "index.js",
"files": [