Comparing version 1.1.16 to 1.1.17
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("herbx",[],e):"object"==typeof exports?exports.herbx=e():t.herbx=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},function(t,e,n){var r=n(5),o=n(6),i=n(7);t.exports=function(t,e){return r(t)||o(t,e)||i()}},function(t,e,n){t.exports=n(8)},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,n){"use strict";n.r(e);var r,o=n(0),i=n.n(o),u=n(1),c=n.n(u),s=n(2),a=n.n(s);function f(t,e){return Object.prototype.toString.call(t)===r[e]}function l(t){return null==t}function m(t){return Array.isArray?Array.isArray(t):f(t,"array")}function d(t){return!!t&&"object"===a()(t)}function b(t){return f(t,"object")}function p(t){return f(t,"string")}function y(t){return f(t,"symbol")}function h(t){return!!t&&"function"==typeof t.then}function g(t){return"function"==typeof t}!function(t){t.array="[object Array]",t.date="[object Date]",t.set="[object Set]",t.map="[object Map]",t.object="[object Object]",t.string="[object String]",t.symbol="[object Symbol]"}(r||(r={}));var v=n(3),$=n.n(v);function j(t,e){for(var n=$()(e,2),r=n[0],o=n[1],i=0;i<t.length;i++)if(t[i][r]===o)return t[i]}function S(t,e){return t.indexOf(e)}function x(t,e){for(var n=Object.keys(t),r=0;r<n.length;r++){var o=n[r];e(t[o],o)}}function O(t,e){if("string"==typeof t){for(var n=t.length;n>=0;){var r=n-e.length;if(r<0)return-1;if(t.substr(r,e.length)===e)return r;n-=1}return-1}return-1}function P(t,e){var n=S(t,e);n>-1&&t.splice(n,1)}function T(){}function w(t,e){if(!t)throw new Error("[Herbx] "+e)}function k(t,e,n){0}function E(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(null===t||"object"!==a()(t))return t;var n=j(e,["origin",t]);if(n)return n.copy;var o=Object.prototype.toString.call(t),i={origin:t,copy:void 0};return e.push(i),o===r.array?(i.copy=[],i.copy=t.map((function(t){return E(t,e)}))):o===r.set?(i.copy=new Set,t.forEach((function(t){i.copy.add(E(t,e))}))):o===r.map?(i.copy=new Map,t.forEach((function(t,n){i.copy.set(n,E(t,e))}))):o===r.date?i.copy=new Date(t):(i.copy={},Object.keys(t).forEach((function(n){i.copy[n]=E(t[n],e)}))),i.copy}function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function C(t,e){if(d(t)){var n=Object.prototype.toString.call(t);n===r.object?x(t,(function(n,r){!function(t,e,n,r){var o=Object.getOwnPropertyDescriptor(t,e);if(o&&!1===o.configurable)return;var i=o&&o.get,u=o&&o.set;C(n,r),Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i?i.call(t):n},set:function(o){o!==(i?i.call(t):n)&&(i&&!u||(u?u.call(t,o):n=o,r(e,o,t),C(o,r)))}})}(t,r,n,e)})):n===r.array&&t.forEach((function(t){C(t,e)}))}}function M(t){var e=this,n=!!e.root,r={};return Object.defineProperties(r,{state:{get:function(){return e.state},enumerable:!0},getters:{get:function(){return e.getters},enumerable:!0},rootState:{get:function(){return n?e.root.state:void 0},enumerable:!0},rootGetters:{get:function(){return n?e.root.getters:void 0},enumerable:!0}}),r}function F(t,e){return[this.state,e]}function D(t,e){var n=this,r=!!n.root,o={};return Object.defineProperties(o,{commit:{get:function(){return n.commit},enumerable:!0},dispatch:{get:function(){return n.dispatch},enumerable:!0},state:{get:function(){return n.state},enumerable:!0},rootState:{get:function(){return r?n.root.state:void 0},enumerable:!0},getters:{get:function(){return n.getters},enumerable:!0},rootGetters:{get:function(){return r?n.root.getters:void 0},enumerable:!0},dispatchRoot:{get:function(){return r?n.root.dispatch:T},enumerable:!0},commitRoot:{get:function(){return r?n.root.commit:T},enumerable:!0}}),[o,e]}function H(t,e,n){var r=n[t];if(r)return r;var o=t.indexOf(e);if(o>-1){var i=n[t.substr(0,o)];if(i)return H(t.substr(o+e.length),i.$namespaceSep,i.modules)}}function N(t,e,n){var r=function(t,e){var n=O(t,e);if(!(n<0))return{moduleName:t.substr(0,n),method:t.substr(n+e.length)}}(t,e);if(r){var o=r.moduleName,i=r.method;return{module:H(o,e,n),method:i}}}function _(t,e){if(m(t))try{t.forEach((function(t){e(null,t)}))}catch(t){e(t)}}var q={},I=function(){function t(e){i()(this,t),this.queue=[],this.flushing=!1;var n=e.uid;this.uid=n,this.afterCreate()}return c()(t,[{key:"afterCreate",value:function(){A(q,this.uid)||(q[this.uid]=this)}},{key:"beforeDestroy",value:function(){A(q,this.uid)&&delete q[this.uid]}},{key:"setTimer",value:function(t,e){return setTimeout(t,e)}},{key:"clearTimer",value:function(t){return clearTimeout(t)}},{key:"addTask",value:function(t){this.queue.push(t)}},{key:"removeTask",value:function(t){P(this.queue,t)}},{key:"flush",value:function(t){var e=this;this.flushing=!0,this.clearTimer(this.timer);var n=this.queue.length;this.timer=this.setTimer((function(){e&&(_(e.queue.splice(0,n),(function(t,e){t?console.warn("[Herbx Flush Error] ",t):e()})),e.flushing=!1,g(t)&&t())}),0)}}]),t}(),G=0,J=function(){function t(e){var n=this;i()(this,t),this.$namespaceSep="/",this.$mutationFunctionContext=null,this.$actionFunctionContext=null,this.$uid=G++,this.$subscribers={mutation:[],action:[]},this.$modules={},this.afterCreate=function(){n.resetScheduler()},this.beforeDestory=function(){n.$scheduler.beforeDestroy()},this.resetScheduler=function(){n.$scheduler.addTask((function(){n.broadcast(),g(n.$listener)&&n.$listener(n)}))},this.broadcast=function(){x(n.$modules,(function(t,e){n&&t.notify()}))},this.notify=function(){n&&n.$scheduler.flush(n.resetScheduler)},this.subscribe=function(t,e){return n.$subscribers[t]?(S(n.$subscribers[t],e)<0&&n.$subscribers[t].push(e),function(){P(n.$subscribers[t],e)}):T},this.registerModule=function(e,r){A(n.$modules,e)&&w(!1,"namespace is exists: "+e),b(r)||w(!1,"options must be object: "+e);var o=new t(Object.assign({},r,{root:n,namespace:e}));return n.$modules[e]=o,o},this.unregisterModule=function(t){A(n.$modules,t)&&(n.$modules[t].beforeDestory(),delete n.$modules[t])},this.dispatch=function(t,e){var r=n.$actions[t];if("function"==typeof r){_(n.$subscribers.action,(function(r,o){if(r)return k(0,r.message);o(n,t,e)}));var o=D.call(n,t,e);return r.apply(n.$actionFunctionContext,"function"==typeof n.$actionParamsTransformer?n.$actionParamsTransformer.apply(null,o):o)}var i=N(t,n.$namespaceSep,n.$modules);if(i&&i.module)return i.module.dispatch(i.method,e);k()},this.commit=function(t,e){var r=n.$mutations[t];if("function"==typeof r){var o=F.call(n,t,e),i=r.apply(n.$mutationFunctionContext,"function"==typeof n.$mutationParamsTransformer?n.$mutationParamsTransformer.apply(null,o.concat(t)):o);return _(n.$subscribers.mutation,(function(r,o){if(r)return k(0,r.message);o(n,t,e)})),i}var u=N(t,n.$namespaceSep,n.$modules);if(u&&u.module)return u.module.commit(u.method,e);k()};var r=e.state,o=e.getters,u=e.mutations,c=e.actions,s=e.plugins,a=e.namespace,f=e.actionParamsTransformer,m=e.getterParamsTransformer,d=e.mutationParamsTransformer,p=e.root,y=e.listener,h=e.modules;this.$state=function(t,e){if(!l(t)){var n=b(t);if(n){var r=E(t);return C(r,e),r}k()}}(r,this.notify)||{},this.$getters=function(t,e){if(!l(t)){var n=b(t);if(n){var r={};return x(t,(function(t,n){"function"==typeof t?(r[n]=t,Object.defineProperty(r,n,{enumerable:!0,get:function(){var r=e(n);return t.call(null,r)}})):k()})),r}k()}}(o,(function(t){var e=M.call(n,t);return"function"==typeof n.$getterParamsTransformer?n.$getterParamsTransformer.call(null,e):e}))||{},this.$mutations=function(t){if(!l(t)){var e=b(t);if(e)return t;k()}}(u)||{},this.$actions=function(t){if(!l(t)){var e=b(t);if(e)return t;k()}}(c)||{},this.$namespace=a,this.$getterParamsTransformer=m,this.$actionParamsTransformer=f,this.$mutationParamsTransformer=d,this.$scheduler=new I({uid:this.$uid}),this.$listener=y,p&&p instanceof t&&(this.$root=p),b(h)&&x(h,(function(t,e){n.registerModule(e,t)})),_(s,(function(t,e){if(t)return k(0,t.message);g(e)&&e(n)})),this.afterCreate()}return c()(t,[{key:"state",get:function(){return this.$state}},{key:"getters",get:function(){return this.$getters}},{key:"root",get:function(){return this.$root}},{key:"modules",get:function(){return this.$modules}}]),t}();function R(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t){var e=E(t.state),n=console.info;t.subscribe("action",(function(t,e,r){n("%c [Herbx] Action: ".concat(JSON.stringify(e),", Payload: "),"color: #9E9E9E; font-weight: bold",r)}));t.subscribe("mutation",(function(t,r,o){var i=E(t.state);n("%c [Herbx] Prev State: ","color: #9E9E9E; font-weight: bold",e),n("%c [Herbx] Mutation: ".concat(JSON.stringify(r),", Payload: "),"color: #03A9F4; font-weight: bold",o),n("%c [Herbx] Next State: ","color: #4CAF50; font-weight: bold",i),e=i}))}}n.d(e,"Types",(function(){return r})),n.d(e,"is",(function(){return f})),n.d(e,"isNil",(function(){return l})),n.d(e,"isArray",(function(){return m})),n.d(e,"isObject",(function(){return d})),n.d(e,"isPlainObject",(function(){return b})),n.d(e,"isString",(function(){return p})),n.d(e,"isSymbol",(function(){return y})),n.d(e,"isPromise",(function(){return h})),n.d(e,"isFunction",(function(){return g})),n.d(e,"findByKey",(function(){return j})),n.d(e,"findIndex",(function(){return S})),n.d(e,"eachObject",(function(){return x})),n.d(e,"lastIndexOf",(function(){return O})),n.d(e,"remove",(function(){return P})),n.d(e,"noop",(function(){return T})),n.d(e,"assert",(function(){return w})),n.d(e,"log",(function(){return k})),n.d(e,"deepCopy",(function(){return E})),n.d(e,"hasOwnProperty",(function(){return A})),n.d(e,"LoggerPlugin",(function(){return R})),n.d(e,"Store",(function(){return J}));e.default=J}])})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("herbx",[],e):"object"==typeof exports?exports.herbx=e():t.herbx=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},function(t,e,n){var r=n(5),o=n(6),i=n(7);t.exports=function(t,e){return r(t)||o(t,e)||i()}},function(t,e,n){t.exports=n(8)},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,n){"use strict";n.r(e);var r,o=n(0),i=n.n(o),u=n(1),c=n.n(u),s=n(2),a=n.n(s);function f(t,e){return Object.prototype.toString.call(t)===r[e]}function l(t){return null==t}function m(t){return Array.isArray?Array.isArray(t):f(t,"array")}function d(t){return!!t&&"object"===a()(t)}function b(t){return f(t,"object")}function p(t){return f(t,"string")}function y(t){return f(t,"symbol")}function h(t){return!!t&&"function"==typeof t.then}function g(t){return"function"==typeof t}!function(t){t.array="[object Array]",t.date="[object Date]",t.set="[object Set]",t.map="[object Map]",t.object="[object Object]",t.string="[object String]",t.symbol="[object Symbol]"}(r||(r={}));var v=n(3),$=n.n(v);function j(t,e){for(var n=$()(e,2),r=n[0],o=n[1],i=0;i<t.length;i++)if(t[i][r]===o)return t[i]}function S(t,e){return t.indexOf(e)}function x(t,e){for(var n=Object.keys(t),r=0;r<n.length;r++){var o=n[r];e(t[o],o)}}function O(t,e){if("string"==typeof t){for(var n=t.length;n>=0;){var r=n-e.length;if(r<0)return-1;if(t.substr(r,e.length)===e)return r;n-=1}return-1}return-1}function P(t,e){var n=S(t,e);n>-1&&t.splice(n,1)}function T(){}function w(t,e){if(!t)throw new Error("[Herbx] "+e)}function k(t,e,n){0}function E(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(null===t||"object"!==a()(t))return t;var n=j(e,["origin",t]);if(n)return n.copy;var o=Object.prototype.toString.call(t),i={origin:t,copy:void 0};return e.push(i),o===r.array?(i.copy=[],i.copy=t.map((function(t){return E(t,e)}))):o===r.set?(i.copy=new Set,t.forEach((function(t){i.copy.add(E(t,e))}))):o===r.map?(i.copy=new Map,t.forEach((function(t,n){i.copy.set(n,E(t,e))}))):o===r.date?i.copy=new Date(t):(i.copy={},Object.keys(t).forEach((function(n){i.copy[n]=E(t[n],e)}))),i.copy}function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function C(t,e){if(d(t)){var n=Object.prototype.toString.call(t);n===r.object?x(t,(function(n,r){!function(t,e,n,r){var o=Object.getOwnPropertyDescriptor(t,e);if(o&&!1===o.configurable)return;var i=o&&o.get,u=o&&o.set;C(n,r),Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i?i.call(t):n},set:function(o){o!==(i?i.call(t):n)&&(i&&!u||(u?u.call(t,o):n=o,r(e,o,t),C(o,r)))}})}(t,r,n,e)})):n===r.array&&t.forEach((function(t){C(t,e)}))}}function M(t){var e=this,n=!!e.root,r={};return Object.defineProperties(r,{state:{get:function(){return e.state},enumerable:!0},getters:{get:function(){return e.getters},enumerable:!0},rootState:{get:function(){return n?e.root.state:void 0},enumerable:!0},rootGetters:{get:function(){return n?e.root.getters:void 0},enumerable:!0}}),r}function D(t,e){return[this.state,e]}function F(t,e){var n=this,r=!!n.root,o={};return Object.defineProperties(o,{commit:{get:function(){return n.commit},enumerable:!0},dispatch:{get:function(){return n.dispatch},enumerable:!0},state:{get:function(){return n.state},enumerable:!0},rootState:{get:function(){return r?n.root.state:void 0},enumerable:!0},getters:{get:function(){return n.getters},enumerable:!0},rootGetters:{get:function(){return r?n.root.getters:void 0},enumerable:!0},dispatchRoot:{get:function(){return r?n.root.dispatch:T},enumerable:!0},commitRoot:{get:function(){return r?n.root.commit:T},enumerable:!0}}),[o,e]}function H(t,e,n){var r=n[t];if(r)return r;var o=t.indexOf(e);if(o>-1){var i=n[t.substr(0,o)];if(i)return H(t.substr(o+e.length),i.$namespaceSep,i.modules)}}function N(t,e,n){var r=function(t,e){var n=O(t,e);if(!(n<0))return{moduleName:t.substr(0,n),method:t.substr(n+e.length)}}(t,e);if(r){var o=r.moduleName,i=r.method;return{module:H(o,e,n),method:i}}}function _(t,e){if(m(t))try{t.forEach((function(t){e(null,t)}))}catch(t){e(t)}}var q={},I=function(){function t(e){i()(this,t),this.queue=[],this.flushing=!1;var n=e.uid;this.uid=n,this.afterCreate()}return c()(t,[{key:"afterCreate",value:function(){A(q,this.uid)||(q[this.uid]=this)}},{key:"beforeDestroy",value:function(){A(q,this.uid)&&delete q[this.uid]}},{key:"setTimer",value:function(t,e){return setTimeout(t,e)}},{key:"clearTimer",value:function(t){return clearTimeout(t)}},{key:"addTask",value:function(t){this.queue.push(t)}},{key:"removeTask",value:function(t){P(this.queue,t)}},{key:"flush",value:function(t){var e=this;this.flushing=!0,this.clearTimer(this.timer);var n=this.queue.length;this.timer=this.setTimer((function(){e&&(_(e.queue.splice(0,n),(function(t,e){t?console.warn("[Herbx Flush Error] ",t):e()})),e.flushing=!1,g(t)&&t())}),0)}}]),t}(),G=0,J=function(){function t(e){var n=this;i()(this,t),this.$namespaceSep="/",this.$mutationFunctionContext=null,this.$actionFunctionContext=null,this.$uid=G++,this.$subscribers={mutation:[],action:[]},this.$modules={},this.afterCreate=function(){n.resetScheduler()},this.beforeDestory=function(){n.$scheduler.beforeDestroy()},this.resetScheduler=function(){n.$scheduler.addTask((function(){n.broadcast(),g(n.$listener)&&n.$listener(n)}))},this.broadcast=function(){x(n.$modules,(function(t,e){n&&t.notify()}))},this.notify=function(){n&&n.$scheduler.flush(n.resetScheduler)},this.subscribe=function(t,e){return n.$subscribers[t]?(S(n.$subscribers[t],e)<0&&n.$subscribers[t].push(e),function(){P(n.$subscribers[t],e)}):T},this.registerModule=function(e,r){A(n.$modules,e)&&w(!1,"namespace is exists: "+e),b(r)||w(!1,"options must be object: "+e);var o=new t(Object.assign({},r,{root:n,namespace:e}));return n.$modules[e]=o,o},this.unregisterModule=function(t){A(n.$modules,t)&&(n.$modules[t].beforeDestory(),delete n.$modules[t])},this.dispatch=function(t,e){var r=n.$actions[t];if("function"==typeof r){_(n.$subscribers.action,(function(r,o){if(r)return k(0,r.message);o(n,t,e)}));var o=F.call(n,t,e);return r.apply(n.$actionFunctionContext,"function"==typeof n.$actionParamsTransformer?n.$actionParamsTransformer.apply(null,o):o)}var i=N(t,n.$namespaceSep,n.$modules);if(i&&i.module)return i.module.dispatch(i.method,e);k()},this.commit=function(t,e){var r=n.$mutations[t];if("function"==typeof r){var o=D.call(n,t,e),i=r.apply(n.$mutationFunctionContext,"function"==typeof n.$mutationParamsTransformer?n.$mutationParamsTransformer.apply(null,o.concat(t)):o);return _(n.$subscribers.mutation,(function(r,o){if(r)return k(0,r.message);o(n,t,e)})),i}var u=N(t,n.$namespaceSep,n.$modules);if(u&&u.module)return u.module.commit(u.method,e);k()};var r=e.state,o=e.getters,u=e.mutations,c=e.actions,s=e.plugins,a=e.namespace,f=e.actionParamsTransformer,m=e.getterParamsTransformer,d=e.mutationParamsTransformer,p=e.root,y=e.listener,h=e.modules;this.$state=function(t,e){if(!l(t)){var n=b(t);if(n){var r=E(t);return C(r,e),r}k()}}(r,this.notify)||{},this.$getters=function(t,e){if(!l(t)){var n=b(t);if(n){var r={};return x(t,(function(t,n){"function"==typeof t?(r[n]=t,Object.defineProperty(r,n,{enumerable:!0,get:function(){var r=e(n);return t.call(null,r)}})):k()})),r}k()}}(o,(function(t){var e=M.call(n,t);return"function"==typeof n.$getterParamsTransformer?n.$getterParamsTransformer.call(null,e):e}))||{},this.$mutations=function(t){if(!l(t)){var e=b(t);if(e)return t;k()}}(u)||{},this.$actions=function(t){if(!l(t)){var e=b(t);if(e)return t;k()}}(c)||{},this.$namespace=a,this.$getterParamsTransformer=m,this.$actionParamsTransformer=f,this.$mutationParamsTransformer=d,this.$scheduler=new I({uid:this.$uid}),this.$listener=y,p&&p instanceof t&&(this.$root=p),b(h)&&x(h,(function(t,e){n.registerModule(e,t)})),_(s,(function(t,e){if(t)return k(0,t.message);g(e)&&e(n)})),this.afterCreate()}return c()(t,[{key:"state",get:function(){return this.$state}},{key:"getters",get:function(){return this.$getters}},{key:"root",get:function(){return this.$root}},{key:"modules",get:function(){return this.$modules}}]),t}();function R(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t){var e=E(t.state),n=console.info;t.subscribe("action",(function(t,e,r){n("%c [Herbx] Action: ".concat(JSON.stringify(e),", Payload: "),"color: #9E9E9E; font-weight: bold",r)}));t.subscribe("mutation",(function(t,r,o){var i=E(t.state);n("%c [Herbx] Prev State: ","color: #9E9E9E; font-weight: bold",e),n("%c [Herbx] Mutation: ".concat(JSON.stringify(r),", Payload: "),"color: #03A9F4; font-weight: bold",o),n("%c [Herbx] Next State: ","color: #4CAF50; font-weight: bold",i),e=i}))}}function B(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t){}}n.d(e,"Types",(function(){return r})),n.d(e,"is",(function(){return f})),n.d(e,"isNil",(function(){return l})),n.d(e,"isArray",(function(){return m})),n.d(e,"isObject",(function(){return d})),n.d(e,"isPlainObject",(function(){return b})),n.d(e,"isString",(function(){return p})),n.d(e,"isSymbol",(function(){return y})),n.d(e,"isPromise",(function(){return h})),n.d(e,"isFunction",(function(){return g})),n.d(e,"findByKey",(function(){return j})),n.d(e,"findIndex",(function(){return S})),n.d(e,"eachObject",(function(){return x})),n.d(e,"lastIndexOf",(function(){return O})),n.d(e,"remove",(function(){return P})),n.d(e,"noop",(function(){return T})),n.d(e,"assert",(function(){return w})),n.d(e,"log",(function(){return k})),n.d(e,"deepCopy",(function(){return E})),n.d(e,"hasOwnProperty",(function(){return A})),n.d(e,"LoggerPlugin",(function(){return R})),n.d(e,"DevToolPlugin",(function(){return B})),n.d(e,"Store",(function(){return J}));e.default=J}])})); |
export * from './logger'; | ||
export * from './devtool'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "herbx", | ||
"version": "1.1.16", | ||
"version": "1.1.17", | ||
"main": "lib/index.js", | ||
@@ -20,3 +20,3 @@ "files": [ | ||
}, | ||
"gitHead": "ab622896095f672da6cb00d588b23e7d3bfc47c2" | ||
"gitHead": "deeb6b9eccb8f57e6772a8101a0c038187598b23" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
80129
32
141