Comparing version 1.4.8 to 1.5.0
@@ -1,46 +0,53 @@ | ||
/** | ||
* vxe-ajax.js v1.4.8 | ||
* (c) 2017-2018 Xu Liangzhan | ||
* ISC License. | ||
* @preserve | ||
*/ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global.VXEAjax = factory()); | ||
}(this, function () { | ||
'use strict' | ||
if (typeof define === "function" && define.amd) { | ||
define("vxe-ajax", ["exports"], factory); | ||
} else if (typeof exports !== "undefined") { | ||
factory(exports); | ||
} else { | ||
var mod = { | ||
exports: {} | ||
}; | ||
factory(mod.exports); | ||
global.VXEAjax = mod.exports.default; | ||
} | ||
})(this, function (_exports) { | ||
"use strict"; | ||
Object.defineProperty(_exports, "__esModule", { | ||
value: true | ||
}); | ||
_exports["default"] = void 0; | ||
function bindPromiseContext(callback, context) { | ||
return typeof callback === 'function' ? callback.bind(context) : callback | ||
return typeof callback === 'function' ? callback.bind(context) : callback; | ||
} | ||
function XEPromise(executor, context) { | ||
this.promise = executor instanceof Promise ? executor : new Promise(executor.bind(context)) | ||
this.context = context | ||
this.promise = executor instanceof Promise ? executor : new Promise(executor.bind(context)); | ||
this.context = context; | ||
} | ||
XEPromise.prototype.then = function (resolve, reject) { | ||
return new XEPromise(this.promise.then(bindPromiseContext(resolve, this.context), bindPromiseContext(reject, this.context)), this.context) | ||
} | ||
return new XEPromise(this.promise.then(bindPromiseContext(resolve, this.context), bindPromiseContext(reject, this.context)), this.context); | ||
}; | ||
XEPromise.prototype.catch = function (reject) { | ||
return new XEPromise(this.promise.catch(bindPromiseContext(reject, this.context)), this.context) | ||
} | ||
XEPromise.prototype["catch"] = function (reject) { | ||
return new XEPromise(this.promise["catch"](bindPromiseContext(reject, this.context)), this.context); | ||
}; | ||
XEPromise.all = function (iterable, context) { | ||
return new XEPromise(Promise.all(iterable), context) | ||
} | ||
return new XEPromise(Promise.all(iterable), context); | ||
}; | ||
XEPromise.race = function (reason, context) { | ||
return new XEPromise(Promise.race(reason), context) | ||
} | ||
return new XEPromise(Promise.race(reason), context); | ||
}; | ||
XEPromise.resolve = function (reason, context) { | ||
return new XEPromise(Promise.resolve(reason), context) | ||
} | ||
return new XEPromise(Promise.resolve(reason), context); | ||
}; | ||
XEPromise.reject = function (reason, context) { | ||
return new XEPromise(Promise.reject(reason), context) | ||
} | ||
return new XEPromise(Promise.reject(reason), context); | ||
}; | ||
@@ -50,15 +57,15 @@ function VXEAjax(Vue, XEAjax, options) { | ||
Object.defineProperty(Vue.prototype, '$ajax', { | ||
get: function () { | ||
XEAjax.$Promise = XEPromise | ||
XEAjax.$context = this | ||
return XEAjax | ||
get: function get() { | ||
XEAjax.$Promise = XEPromise; | ||
XEAjax.$context = this; | ||
return XEAjax; | ||
} | ||
}) | ||
}); | ||
} else { | ||
Vue.prototype.$ajax = XEAjax | ||
Vue.prototype.$ajax = XEAjax; | ||
} | ||
} | ||
return VXEAjax | ||
})) | ||
var _default = VXEAjax; | ||
_exports["default"] = _default; | ||
}); |
@@ -1,7 +0,1 @@ | ||
/** | ||
* vxe-ajax.js v1.4.8 | ||
* (c) 2017-2018 Xu Liangzhan | ||
* ISC License. | ||
* @preserve | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VXEAjax=e()}(this,function(){"use strict";function n(t,e){return"function"==typeof t?t.bind(e):t}function o(t,e){this.promise=t instanceof Promise?t:new Promise(t.bind(e)),this.context=e}return o.prototype.then=function(t,e){return new o(this.promise.then(n(t,this.context),n(e,this.context)),this.context)},o.prototype.catch=function(t){return new o(this.promise.catch(n(t,this.context)),this.context)},o.all=function(t,e){return new o(Promise.all(t),e)},o.race=function(t,e){return new o(Promise.race(t),e)},o.resolve=function(t,e){return new o(Promise.resolve(t),e)},o.reject=function(t,e){return new o(Promise.reject(t),e)},function(t,e,n){!n||!0!==n&&!0!==n.context?t.prototype.$ajax=e:Object.defineProperty(t.prototype,"$ajax",{get:function(){return e.$Promise=o,e.$context=this,e}})}}); | ||
!function(e,t){if("function"==typeof define&&define.amd)define("vxe-ajax",["exports"],t);else if("undefined"!=typeof exports)t(exports);else{var n={exports:{}};t(n.exports),e.VXEAjax=n.exports.default}}(this,function(e){"use strict";function n(e,t){return"function"==typeof e?e.bind(t):e}function o(e,t){this.promise=e instanceof Promise?e:new Promise(e.bind(t)),this.context=t}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,o.prototype.then=function(e,t){return new o(this.promise.then(n(e,this.context),n(t,this.context)),this.context)},o.prototype.catch=function(e){return new o(this.promise.catch(n(e,this.context)),this.context)},o.all=function(e,t){return new o(Promise.all(e),t)},o.race=function(e,t){return new o(Promise.race(e),t)},o.resolve=function(e,t){return new o(Promise.resolve(e),t)},o.reject=function(e,t){return new o(Promise.reject(e),t)};function t(e,t,n){!n||!0!==n&&!0!==n.context?e.prototype.$ajax=t:Object.defineProperty(e.prototype,"$ajax",{get:function(){return t.$Promise=o,t.$context=this,t}})}e.default=t}); |
@@ -48,2 +48,2 @@ function bindPromiseContext (callback, context) { | ||
module.exports = VXEAjax | ||
export default VXEAjax |
{ | ||
"name": "vxe-ajax", | ||
"version": "1.4.8", | ||
"version": "1.5.0", | ||
"description": "A small wrapper for integrating xe-ajax to Vuejs.", | ||
"main": "index.js", | ||
"unpkg": "dist/vxe-ajax.js", | ||
"jsdelivr": "dist/vxe-ajax.js", | ||
"typings": "types/index.d.ts", | ||
"main": "dist/index.common.js", | ||
"unpkg": "dist/index.js", | ||
"jsdelivr": "dist/index.js", | ||
"typings": "index.d.ts", | ||
"scripts": { | ||
"lint": "eslint dist/vxe-ajax.js index.js", | ||
"lib": "gulp build", | ||
"lint": "eslint index.js", | ||
"test": "npm run lint" | ||
}, | ||
"files": [ | ||
"src", | ||
"types", | ||
"dist" | ||
"dist", | ||
"index.d.ts", | ||
"index.js" | ||
], | ||
@@ -23,2 +24,6 @@ "dependencies": { | ||
"devDependencies": { | ||
"@babel/core": "^7.4.4", | ||
"@babel/plugin-transform-runtime": "^7.4.4", | ||
"@babel/preset-env": "^7.4.4", | ||
"@babel/runtime": "^7.4.4", | ||
"eslint": "^5.15.1", | ||
@@ -31,2 +36,11 @@ "eslint-config-standard": "^12.0.0", | ||
"eslint-plugin-standard": "^4.0.0", | ||
"gulp": "^4.0.2", | ||
"gulp-autoprefixer": "^6.1.0", | ||
"gulp-babel": "^8.0.0", | ||
"gulp-clean-css": "^4.2.0", | ||
"gulp-concat": "^2.6.1", | ||
"gulp-rename": "^1.4.0", | ||
"gulp-replace": "^1.0.0", | ||
"gulp-sass": "^4.0.2", | ||
"gulp-uglify": "^3.0.2", | ||
"markdown-doctest": "^0.9.1" | ||
@@ -33,0 +47,0 @@ }, |
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
10898
8
152
21