Socket
Socket
Sign inDemoInstall

commonly-decorators

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commonly-decorators - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

16

dist/commonly-decorators.es.js

@@ -469,3 +469,3 @@ import freezeClick from 'freeze-click';

}
function PollingClear(content, pollingId) {
function pollingClear(content, pollingId) {
var _a, _b;

@@ -483,3 +483,3 @@ if (pollingId === void 0) { pollingId = "__polling__"; }

}
function PollingClearAll(content) {
function pollingClearAll(content) {
try {

@@ -512,8 +512,8 @@ Object.keys((content === null || content === void 0 ? void 0 : content.__polling__list__) || {}).forEach(function (pollingId) {

return originResult.then(function () {
PollingClearAll(_this);
pollingClearAll(_this);
}, function () {
PollingClearAll(_this);
pollingClearAll(_this);
});
}
PollingClearAll(this);
pollingClearAll(this);
return originResult;

@@ -529,4 +529,4 @@ };

AssembleValue: AssembleValue,
PollingClear: PollingClear,
PollingClearAll: PollingClearAll,
pollingClear: pollingClear,
pollingClearAll: pollingClearAll,
PollingClearAllDeco: PollingClearAllDeco

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

export { Assemble, AssembleValue, param as ParamDecorator, Polling, PollingClear, PollingClearAll, PollingClearAllDeco, index as default, freeze };
export { Assemble, AssembleValue, param as ParamDecorator, Polling, PollingClearAllDeco, index as default, freeze, pollingClear, pollingClearAll };
//# sourceMappingURL=commonly-decorators.es.js.map

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

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("freeze-click")):"function"==typeof define&&define.amd?define(["exports","freeze-click"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).commonlyDecorators={},t.freezeClick)}(this,(function(t,n){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=e(n),o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)};function i(t,n,e,r){return new(e||(e=Promise))((function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function l(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(u,l)}a((r=r.apply(t,n||[])).next())}))}function u(t,n){var e,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=n.call(t,u)}catch(t){i=[6,t],r=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function l(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}function a(t){return void 0===t&&(t=1e4),function(n,e,o){var l=o.value;o.value=r.default((function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return i(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),[4,l.apply(this,n)];case 1:return[2,e.sent()];case 2:throw e.sent();case 3:return t.cancel(),[7];case 4:return[2]}}))}))}),t)}}function s(t,n,e){return function(r,o){var a=r[t];"function"==typeof a||"function"==typeof(null==a?void 0:a.then)?r[t]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return i(this,void 0,void 0,(function(){var r;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r=(t[0]?null==e?void 0:e.map((function(n){return t[0][n]})):[])||[],this[o]=new(n.bind.apply(n,l([void 0],r,!1))),[4,a.apply(this,t)];case 1:return[2,i.sent()];case 2:throw i.sent();case 3:return[2]}}))}))}:r[t]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return i(this,void 0,void 0,(function(){var r;return u(this,(function(i){try{r=(t[0]?null==e?void 0:e.map((function(n){return t[0][n]})):[])||[],this[o]=new(n.bind.apply(n,l([void 0],r,!1)))}catch(t){console.error(t)}return[2]}))}))}}}function c(t,n){return function(e,r){var o=e[t];"function"==typeof o||"function"==typeof(null==o?void 0:o.then)?e[t]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this[r]=n,[4,o.apply(this,t)];case 1:return[2,e.sent()];case 2:throw e.sent();case 3:return[2]}}))}))}:e[t]=function(){return i(this,void 0,void 0,(function(){return u(this,(function(t){try{this[r]=n}catch(t){console.error(t)}return[2]}))}))}}}var f=function(){function t(t,n,e){void 0===n&&(n=null),void 0===e&&(e="success"),this.msg="",this.extraData=null,this.status=t,this.data=n,this.msg=e}return t.prototype.getStatus=function(){return this.status},t.prototype.getData=function(){return this.data},t.prototype.getMsg=function(){return this.msg},t.prototype.setMsg=function(t){this.msg=t},t.prototype.getExtraData=function(){return this.extraData},t.prototype.setExtraData=function(t){this.extraData=t},t.isOk=function(t){return _(t)&&"ok"===t.getStatus()},t.isFail=function(t){return _(t)&&"fail"===t.getStatus()},t.isDeny=function(t){return _(t)&&"deny"===t.getStatus()},t.hasData=function(t){if(!t||"function"!=typeof t.getData)return!1;var n=t.getData();return!(null==n)},t.isNetWorkError=function(n){return t.getStatusIsFunction(n)&&"NETWORK_ERROR"===n.getStatus()||"NETWORK_ERROR"===(null==n?void 0:n.status)},t.cover=function(n,e){t[n]=e},t.success=function(n){return new t("ok",n)},t.fail=function(n){var e=new t("fail",null);return e.setMsg(n||""),e},t.exception=function(n){return new t(n.getStatus(),n.getData(),n.getMsg())},t.deny=function(n){return new t("deny",null,n||"")},t.networkError=function(n){return new t("NETWORK_ERROR",null,n||"网络异常,请重试")},t.interrupt=function(n){return new t("INTERRUPT",null,n||"程序中断,请重试")},t.isInterrupt=function(n){return"INTERRUPT"===t.getStatusValue(n)},t.cancel=function(n){return new t("CANCEL",null,n||"网络异常,请重试")},t.isCancel=function(n){return"CANCEL"===t.getStatusValue(n)},t.error=function(t){return new this("ERROR",null,t||"程序中断,请重试")},t.isError=function(n){return"ERROR"===t.getStatusValue(n)},t.getStatusIsFunction=function(t){return t&&"function"==typeof t.getStatus},t.getStatusValue=function(n){var e;return t.getStatusIsFunction(n)?n.getStatus():null!==(e=null==n?void 0:n.status)&&void 0!==e?e:""},t}();function _(t){return t&&"function"==typeof t.getStatus}function p(t,n){return void 0===t&&(t=1e3),void 0===n&&(n="__polling__"),function(e,r,o){var l=o.value;o.value=function e(){for(var r=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return this.__polling__list__||(this.__polling__list__=Object.create(null)),this.__polling__list__[n]||(this.__polling__list__[n]=[]),Array.isArray(this.__polling__list__[n])||(this.__polling__list__[n]=[this.__polling__list__[n]]),new Promise((function(a){return i(r,void 0,void 0,(function(){var r,s,c=this;return u(this,(function(_){switch(_.label){case 0:return[4,l.apply(this,o)];case 1:return r=_.sent(),f.isOk(r)?(a(r),[2]):(s=setTimeout((function(){return i(c,void 0,void 0,(function(){var t,r;return u(this,(function(i){return this.__polling__list__[n]=null===(r=null===(t=this.__polling__list__)||void 0===t?void 0:t[n])||void 0===r?void 0:r.filter((function(t){return t!==s})),clearTimeout(s),e.apply(this,o),[2]}))}))}),t),this.__polling__list__[n].push(s),[2])}}))}))}))};var a=e.onUnload;e.onUnload=function(){for(var t,e,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return i(this,void 0,void 0,(function(){return u(this,(function(o){switch(o.label){case 0:return null===(e=null===(t=null==this?void 0:this.__polling__list__)||void 0===t?void 0:t[n])||void 0===e||e.forEach((function(t){clearTimeout(t)})),this.__polling__list__[n]=null,[4,a.apply(this,r)];case 1:return[2,o.sent()]}}))}))}}}function h(t,n){var e,r;void 0===n&&(n="__polling__");try{null===(r=null===(e=t.__polling__list__)||void 0===e?void 0:e[n])||void 0===r||r.forEach((function(t){clearTimeout(t)})),t.__polling__list__[n]=null}catch(t){console.error(t)}}function v(t){try{Object.keys((null==t?void 0:t.__polling__list__)||{}).forEach((function(n){var e,r,o;null===(r=null===(e=null==t?void 0:t.__polling__list__)||void 0===e?void 0:e[n])||void 0===r||r.forEach((function(t){clearTimeout(t)})),clearTimeout(null===(o=null==t?void 0:t.__polling__list__)||void 0===o?void 0:o[n]),t.__polling__list__[n]=null}))}catch(t){console.error(t)}}function d(){return function(t,n,e){var r=e.value;e.value=function(){for(var t=this,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=r.apply(this,n);return"object"==typeof o&&"function"==typeof(null==o?void 0:o.then)?o.then((function(){v(t)}),(function(){v(t)})):(v(this),o)}}}var g=Object.freeze({__proto__:null,Polling:p,Assemble:s,AssembleValue:c,PollingClear:h,PollingClearAll:v,PollingClearAllDeco:d});var y=function(t){function n(n){var e=t.call(this,n)||this;return e.__id="ParameterDecoratorError",e.status="PARAM_ERROR",e.data=null,e.from="CheckParamRequired",e}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(n,t),n.prototype.setData=function(t){this.data=t},n.prototype.getData=function(){return this.data},n.prototype.setStatus=function(t){this.status=t},n.prototype.getStatus=function(){return this.status},n.prototype.setFrom=function(t){this.from=t},n.prototype.getFrom=function(){return this.from},n.isParameterDecoratorError=function(t){return t instanceof n||(null==t?void 0:t.__id)===new n("").__id},n}(Error);var b={Required:function(t,n){return void 0===n&&(n=""),function(e,r,o){(null==e?void 0:e.__requiredData)||(e.__requiredData=new Map),e.__requiredData.set(r,{index:o,errMsg:t,propertyPath:n})}},CheckParamRequired:function(t,n,e){var r=e.value;e.value=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return i(this,void 0,void 0,(function(){var o,i,l,a,s,c;return u(this,(function(u){switch(u.label){case 0:if(o=null==t?void 0:t.__requiredData,i=o.get(n),l=Number(null==i?void 0:i.index),a=null==i?void 0:i.propertyPath,s=(null==a?void 0:a.split("."))||[],c=s.reduce((function(t,n){return null==t||!n&&0!==n||"."===n?t:null==t?void 0:t[n]}),null==e?void 0:e[l]),!isNaN(l)&&(void 0===c||""===c||null===c))throw new y((null==i?void 0:i.errMsg)||"第".concat(l+1,"个参数必传"));return[4,r.apply(this,e)];case 1:return[2,u.sent()]}}))}))}},ParameterDecoratorError:y},w={freeze:a,miniprogram:g};t.Assemble=s,t.AssembleValue=c,t.ParamDecorator=b,t.Polling=p,t.PollingClear=h,t.PollingClearAll=v,t.PollingClearAllDeco=d,t.default=w,t.freeze=a,Object.defineProperty(t,"__esModule",{value:!0})}));//# sourceMappingURL=commonly-decorators.min.js.map
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("freeze-click")):"function"==typeof define&&define.amd?define(["exports","freeze-click"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).commonlyDecorators={},t.freezeClick)}(this,(function(t,n){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=e(n),o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)};function i(t,n,e,r){return new(e||(e=Promise))((function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function l(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(u,l)}a((r=r.apply(t,n||[])).next())}))}function u(t,n){var e,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=n.call(t,u)}catch(t){i=[6,t],r=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function l(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}function a(t){return void 0===t&&(t=1e4),function(n,e,o){var l=o.value;o.value=r.default((function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return i(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),[4,l.apply(this,n)];case 1:return[2,e.sent()];case 2:throw e.sent();case 3:return t.cancel(),[7];case 4:return[2]}}))}))}),t)}}function s(t,n,e){return function(r,o){var a=r[t];"function"==typeof a||"function"==typeof(null==a?void 0:a.then)?r[t]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return i(this,void 0,void 0,(function(){var r;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r=(t[0]?null==e?void 0:e.map((function(n){return t[0][n]})):[])||[],this[o]=new(n.bind.apply(n,l([void 0],r,!1))),[4,a.apply(this,t)];case 1:return[2,i.sent()];case 2:throw i.sent();case 3:return[2]}}))}))}:r[t]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return i(this,void 0,void 0,(function(){var r;return u(this,(function(i){try{r=(t[0]?null==e?void 0:e.map((function(n){return t[0][n]})):[])||[],this[o]=new(n.bind.apply(n,l([void 0],r,!1)))}catch(t){console.error(t)}return[2]}))}))}}}function c(t,n){return function(e,r){var o=e[t];"function"==typeof o||"function"==typeof(null==o?void 0:o.then)?e[t]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this[r]=n,[4,o.apply(this,t)];case 1:return[2,e.sent()];case 2:throw e.sent();case 3:return[2]}}))}))}:e[t]=function(){return i(this,void 0,void 0,(function(){return u(this,(function(t){try{this[r]=n}catch(t){console.error(t)}return[2]}))}))}}}var f=function(){function t(t,n,e){void 0===n&&(n=null),void 0===e&&(e="success"),this.msg="",this.extraData=null,this.status=t,this.data=n,this.msg=e}return t.prototype.getStatus=function(){return this.status},t.prototype.getData=function(){return this.data},t.prototype.getMsg=function(){return this.msg},t.prototype.setMsg=function(t){this.msg=t},t.prototype.getExtraData=function(){return this.extraData},t.prototype.setExtraData=function(t){this.extraData=t},t.isOk=function(t){return _(t)&&"ok"===t.getStatus()},t.isFail=function(t){return _(t)&&"fail"===t.getStatus()},t.isDeny=function(t){return _(t)&&"deny"===t.getStatus()},t.hasData=function(t){if(!t||"function"!=typeof t.getData)return!1;var n=t.getData();return!(null==n)},t.isNetWorkError=function(n){return t.getStatusIsFunction(n)&&"NETWORK_ERROR"===n.getStatus()||"NETWORK_ERROR"===(null==n?void 0:n.status)},t.cover=function(n,e){t[n]=e},t.success=function(n){return new t("ok",n)},t.fail=function(n){var e=new t("fail",null);return e.setMsg(n||""),e},t.exception=function(n){return new t(n.getStatus(),n.getData(),n.getMsg())},t.deny=function(n){return new t("deny",null,n||"")},t.networkError=function(n){return new t("NETWORK_ERROR",null,n||"网络异常,请重试")},t.interrupt=function(n){return new t("INTERRUPT",null,n||"程序中断,请重试")},t.isInterrupt=function(n){return"INTERRUPT"===t.getStatusValue(n)},t.cancel=function(n){return new t("CANCEL",null,n||"网络异常,请重试")},t.isCancel=function(n){return"CANCEL"===t.getStatusValue(n)},t.error=function(t){return new this("ERROR",null,t||"程序中断,请重试")},t.isError=function(n){return"ERROR"===t.getStatusValue(n)},t.getStatusIsFunction=function(t){return t&&"function"==typeof t.getStatus},t.getStatusValue=function(n){var e;return t.getStatusIsFunction(n)?n.getStatus():null!==(e=null==n?void 0:n.status)&&void 0!==e?e:""},t}();function _(t){return t&&"function"==typeof t.getStatus}function p(t,n){return void 0===t&&(t=1e3),void 0===n&&(n="__polling__"),function(e,r,o){var l=o.value;o.value=function e(){for(var r=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return this.__polling__list__||(this.__polling__list__=Object.create(null)),this.__polling__list__[n]||(this.__polling__list__[n]=[]),Array.isArray(this.__polling__list__[n])||(this.__polling__list__[n]=[this.__polling__list__[n]]),new Promise((function(a){return i(r,void 0,void 0,(function(){var r,s,c=this;return u(this,(function(_){switch(_.label){case 0:return[4,l.apply(this,o)];case 1:return r=_.sent(),f.isOk(r)?(a(r),[2]):(s=setTimeout((function(){return i(c,void 0,void 0,(function(){var t,r;return u(this,(function(i){return this.__polling__list__[n]=null===(r=null===(t=this.__polling__list__)||void 0===t?void 0:t[n])||void 0===r?void 0:r.filter((function(t){return t!==s})),clearTimeout(s),e.apply(this,o),[2]}))}))}),t),this.__polling__list__[n].push(s),[2])}}))}))}))};var a=e.onUnload;e.onUnload=function(){for(var t,e,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return i(this,void 0,void 0,(function(){return u(this,(function(o){switch(o.label){case 0:return null===(e=null===(t=null==this?void 0:this.__polling__list__)||void 0===t?void 0:t[n])||void 0===e||e.forEach((function(t){clearTimeout(t)})),this.__polling__list__[n]=null,[4,a.apply(this,r)];case 1:return[2,o.sent()]}}))}))}}}function h(t,n){var e,r;void 0===n&&(n="__polling__");try{null===(r=null===(e=t.__polling__list__)||void 0===e?void 0:e[n])||void 0===r||r.forEach((function(t){clearTimeout(t)})),t.__polling__list__[n]=null}catch(t){console.error(t)}}function v(t){try{Object.keys((null==t?void 0:t.__polling__list__)||{}).forEach((function(n){var e,r,o;null===(r=null===(e=null==t?void 0:t.__polling__list__)||void 0===e?void 0:e[n])||void 0===r||r.forEach((function(t){clearTimeout(t)})),clearTimeout(null===(o=null==t?void 0:t.__polling__list__)||void 0===o?void 0:o[n]),t.__polling__list__[n]=null}))}catch(t){console.error(t)}}function d(){return function(t,n,e){var r=e.value;e.value=function(){for(var t=this,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=r.apply(this,n);return"object"==typeof o&&"function"==typeof(null==o?void 0:o.then)?o.then((function(){v(t)}),(function(){v(t)})):(v(this),o)}}}var g=Object.freeze({__proto__:null,Polling:p,Assemble:s,AssembleValue:c,pollingClear:h,pollingClearAll:v,PollingClearAllDeco:d});var y=function(t){function n(n){var e=t.call(this,n)||this;return e.__id="ParameterDecoratorError",e.status="PARAM_ERROR",e.data=null,e.from="CheckParamRequired",e}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(n,t),n.prototype.setData=function(t){this.data=t},n.prototype.getData=function(){return this.data},n.prototype.setStatus=function(t){this.status=t},n.prototype.getStatus=function(){return this.status},n.prototype.setFrom=function(t){this.from=t},n.prototype.getFrom=function(){return this.from},n.isParameterDecoratorError=function(t){return t instanceof n||(null==t?void 0:t.__id)===new n("").__id},n}(Error);var b={Required:function(t,n){return void 0===n&&(n=""),function(e,r,o){(null==e?void 0:e.__requiredData)||(e.__requiredData=new Map),e.__requiredData.set(r,{index:o,errMsg:t,propertyPath:n})}},CheckParamRequired:function(t,n,e){var r=e.value;e.value=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return i(this,void 0,void 0,(function(){var o,i,l,a,s,c;return u(this,(function(u){switch(u.label){case 0:if(o=null==t?void 0:t.__requiredData,i=o.get(n),l=Number(null==i?void 0:i.index),a=null==i?void 0:i.propertyPath,s=(null==a?void 0:a.split("."))||[],c=s.reduce((function(t,n){return null==t||!n&&0!==n||"."===n?t:null==t?void 0:t[n]}),null==e?void 0:e[l]),!isNaN(l)&&(void 0===c||""===c||null===c))throw new y((null==i?void 0:i.errMsg)||"第".concat(l+1,"个参数必传"));return[4,r.apply(this,e)];case 1:return[2,u.sent()]}}))}))}},ParameterDecoratorError:y},w={freeze:a,miniprogram:g};t.Assemble=s,t.AssembleValue=c,t.ParamDecorator=b,t.Polling=p,t.PollingClearAllDeco=d,t.default=w,t.freeze=a,t.pollingClear=h,t.pollingClearAll=v,Object.defineProperty(t,"__esModule",{value:!0})}));//# sourceMappingURL=commonly-decorators.min.js.map

@@ -39,3 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.PollingClearAllDeco = exports.PollingClearAll = exports.PollingClear = void 0;
exports.PollingClearAllDeco = exports.pollingClearAll = exports.pollingClear = void 0;
var return_data_1 = require("return-data");

@@ -116,3 +116,3 @@ function Polling(intervalTime, pollingId) {

exports.default = Polling;
function PollingClear(content, pollingId) {
function pollingClear(content, pollingId) {
var _a, _b;

@@ -130,4 +130,4 @@ if (pollingId === void 0) { pollingId = "__polling__"; }

}
exports.PollingClear = PollingClear;
function PollingClearAll(content) {
exports.pollingClear = pollingClear;
function pollingClearAll(content) {
try {

@@ -147,3 +147,3 @@ Object.keys((content === null || content === void 0 ? void 0 : content.__polling__list__) || {}).forEach(function (pollingId) {

}
exports.PollingClearAll = PollingClearAll;
exports.pollingClearAll = pollingClearAll;
function PollingClearAllDeco() {

@@ -162,8 +162,8 @@ return function closurePollingClearAllDeco(target, property, descriptor) {

return originResult.then(function () {
PollingClearAll(_this);
pollingClearAll(_this);
}, function () {
PollingClearAll(_this);
pollingClearAll(_this);
});
}
PollingClearAll(this);
pollingClearAll(this);
return originResult;

@@ -170,0 +170,0 @@ };

{
"name": "commonly-decorators",
"version": "0.6.1",
"version": "0.6.2",
"description": "some commonly decorators",

@@ -5,0 +5,0 @@ "author": "yiri.zhou",

export default function Polling(intervalTime?: number, pollingId?: string): (target: any, property: string, descriptor: PropertyDescriptor) => void;
export declare function PollingClear(content: any, pollingId?: string): void;
export declare function PollingClearAll(content: any): void;
export declare function pollingClear(content: any, pollingId?: string): void;
export declare function pollingClearAll(content: any): void;
export declare function PollingClearAllDeco(): (target: any, property: string, descriptor: PropertyDescriptor) => void;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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