New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

herbx

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

herbx - npm Package Compare versions

Comparing version 1.2.20 to 1.2.21

4

lib/helpers/init.d.ts

@@ -12,5 +12,5 @@ import { IFunction, IHerbWatchOption, IObject } from 'herb-core-include';

}) => any;
export declare function initWatch(store: StoreInstanceType, watch: IObject<IHerbWatchOption<IObject>>): Record<any, Watcher | Watcher[]>;
export declare function initWatch(store: StoreInstanceType, watch: IObject<IHerbWatchOption<IObject>>): void;
export declare function createWatcher(store: StoreInstanceType, path: string, watch: IHerbWatchOption<IObject>): Watcher;
export declare function uninstallWatchers(getters: IObject, watch: IObject<Watcher | Watcher[]>): void;
export declare function uninstallWatchers(store: StoreInstanceType): void;
export declare function initMutations<T>(mutations: T): IInitFunctionResponse<T>;

@@ -17,0 +17,0 @@ export declare function initActions<T>(actions: T): IInitFunctionResponse<T>;

@@ -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=7)}([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(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e,n){var r=n(8),o=n(9),i=n(5),u=n(10);t.exports=function(t){return r(t)||o(t)||i(t)||u()}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}},function(t,e,n){var r=n(4);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}},function(t,e,n){var r=n(11),o=n(12),i=n(5),u=n(13);t.exports=function(t,e){return r(t)||o(t,e)||i(t,e)||u()}},function(t,e,n){t.exports=n(14)},function(t,e,n){var r=n(4);t.exports=function(t){if(Array.isArray(t))return r(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,o=!1,i=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e,n){"use strict";n.r(e),n.d(e,"when",(function(){return vt})),n.d(e,"findByKey",(function(){return E})),n.d(e,"findIndex",(function(){return F})),n.d(e,"eachObject",(function(){return I})),n.d(e,"lastIndexOf",(function(){return C})),n.d(e,"remove",(function(){return M})),n.d(e,"copyAugment",(function(){return N})),n.d(e,"protoAugment",(function(){return H})),n.d(e,"copyArrayFast",(function(){return W})),n.d(e,"mapArrayFast",(function(){return z})),n.d(e,"_Set",(function(){return o})),n.d(e,"hasProto",(function(){return q})),n.d(e,"Types",(function(){return r})),n.d(e,"is",(function(){return y})),n.d(e,"isNil",(function(){return b})),n.d(e,"isUndefined",(function(){return v})),n.d(e,"isArray",(function(){return m})),n.d(e,"isObject",(function(){return g})),n.d(e,"isPlainObject",(function(){return w})),n.d(e,"isString",(function(){return _})),n.d(e,"isSymbol",(function(){return $})),n.d(e,"isPromise",(function(){return x})),n.d(e,"isFunction",(function(){return S})),n.d(e,"isNative",(function(){return j})),n.d(e,"noop",(function(){return O})),n.d(e,"assert",(function(){return P})),n.d(e,"log",(function(){return k})),n.d(e,"deepCopy",(function(){return A})),n.d(e,"hasOwnProperty",(function(){return D})),n.d(e,"def",(function(){return T})),n.d(e,"LoggerPlugin",(function(){return mt})),n.d(e,"DevToolPlugin",(function(){return gt})),n.d(e,"Store",(function(){return yt})),n.d(e,"Watcher",(function(){return it}));var r,o,i=n(3),u=n.n(i),a=n(0),s=n.n(a),c=n(1),f=n.n(c),l=n(6),h=n.n(l),d=n(2),p=n.n(d);function y(t,e){return Object.prototype.toString.call(t)===r[e]}function b(t){return null==t}function v(t){return void 0===t}function m(t){return Array.isArray?Array.isArray(t):y(t,"array")}function g(t){return null!==t&&"object"===p()(t)}function w(t){return y(t,"object")}function _(t){return y(t,"string")}function $(t){return y(t,"symbol")}function x(t){return!!t&&"function"==typeof t.then}function S(t){return"function"==typeof t}function j(t){return"function"==typeof t&&/native code/.test(t.toString())}function O(){}function P(t,e){if(!t)throw new Error("[Herbx] "+e)}function k(t,e,n){0}function A(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(null===t||"object"!==p()(t))return t;var n=E(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=z(t,(function(t){return A(t,e)}))):o===r.set?(i.copy=new Set,t.forEach((function(t){i.copy.add(A(t,e))}))):o===r.map?(i.copy=new Map,t.forEach((function(t,n){i.copy.set(n,A(t,e))}))):o===r.date?i.copy=new Date(t):(i.copy={},I(t,(function(t,n){i.copy[n]=A(t,e)}))),i.copy}function D(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function T(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function E(t,e){for(var n=h()(e,2),r=n[0],o=n[1],i=0,u=t.length;i<u;i++)if(t[i][r]===o)return t[i]}function F(t,e){return t.indexOf(e)}function I(t,e){for(var n=Object.keys(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}function C(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 M(t,e){if(t.length){var n=F(t,e);n>-1&&t.splice(n,1)}}function N(t,e,n){for(var r=0,o=n.length;r<o;r++){var i=n[r];T(t,i,e[i])}}function H(t,e){t.__proto__=e}function W(t){for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e}function z(t,e){for(var n=[],r=0,o=t.length;r<o;r++)n[r]=e(t[r]);return n}!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={})),o="undefined"!=typeof Set&&j(Set)?Set:function(){function t(){s()(this,t),this.set=Object.create(null)}return f()(t,[{key:"has",value:function(t){return!0===this.set[t]}},{key:"add",value:function(t){this.set[t]=!0}},{key:"clear",value:function(){this.set=Object.create(null)}}]),t}();var q="__proto__"in{};function U(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 G(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return[this.state].concat(n)}function J(t){var e=this,n=!!e.root,r={};Object.defineProperties(r,{commit:{get:function(){return e.commit},enumerable:!0},dispatch:{get:function(){return e.dispatch},enumerable:!0},state:{get:function(){return e.state},enumerable:!0},rootState:{get:function(){return n?e.root.state:void 0},enumerable:!0},getters:{get:function(){return e.getters},enumerable:!0},rootGetters:{get:function(){return n?e.root.getters:void 0},enumerable:!0},dispatchRoot:{get:function(){return n?e.root.dispatch:O},enumerable:!0},commitRoot:{get:function(){return n?e.root.commit:O},enumerable:!0}});for(var o=arguments.length,i=new Array(o>1?o-1:0),u=1;u<o;u++)i[u-1]=arguments[u];return[r].concat(i)}var R=0,B=function(){function t(){s()(this,t),this.id=R++,this.subs=[]}return f()(t,[{key:"addSub",value:function(t){this.subs.push(t)}},{key:"removeSub",value:function(t){M(this.subs,t)}},{key:"depend",value:function(){t.target&&t.target.addDep(this)}},{key:"notify",value:function(){for(var t=this.subs.slice(),e=0,n=t.length;e<n;e++)t[e].update()}}]),t}();B.target=null;var K=[];var L=["push","pop","shift","unshift","splice","sort","reverse"],Q=Array.prototype,V=Object.create(Q);function X(t,e,n){var r=Object.getOwnPropertyDescriptor(t,e);if(!r||!1!==r.configurable){var o=new B,i=r&&r.get,u=r&&r.set;i&&!u||2!==arguments.length||(n=t[e]);var a=Z(n);Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var e=i?i.call(t):n;return B.target&&(o.depend(),a&&(a.dep.depend(),m(e)&&Y(e))),e},set:function(e){e!==(i?i.call(t):n)&&(i&&!u||(u?u.call(t,e):n=e,a=Z(e),o.notify()))}})}}function Y(t){for(var e,n=0,r=t.length;n<r;n++)(e=t[n])&&e.__ob__&&e.__ob__.dep.depend(),m(e)&&Y(e)}function Z(t){var e;if(g(t))return D(t,"__ob__")&&t.__ob__ instanceof tt?e=t.__ob__:(m(t)||w(t))&&Object.isExtensible(t)&&(e=new tt(t)),e}L.forEach((function(t){var e=Q[t];T(V,t,(function(){var n,r=W(arguments),o=e.apply(this,r),i=this.__ob__;switch(t){case"push":case"unshift":n=r;break;case"splice":n=r.slice(2)}return n&&i.observeArray(n),i.dep.notify(),o}))}));var tt=function(){function t(e){s()(this,t),this.value=e,this.dep=new B,T(e,"__ob__",this,!1),m(e)?(!function(t){q?H(t,V):N(t,V,L)}(e),this.observeArray(e)):this.walk(e)}return f()(t,[{key:"walk",value:function(t){for(var e=Object.keys(t),n=0;n<e.length;n++)X(t,e[n])}},{key:"observeArray",value:function(t){for(var e=0,n=t.length;e<n;e++)Z(t[e])}}]),t}(),et=new(function(){function t(){s()(this,t),this.ids={},this.queue=[],this.flushing=!1}return f()(t,[{key:"addWatcher",value:function(t){var e=t.id;this.ids[e]||(this.ids[e]=!0,this.queue.push(t))}},{key:"resetState",value:function(){this.queue.length=0,this.ids={},this.flushing=!1}},{key:"flush",value:function(){var t=this;this.flushing||(clearTimeout(this.timer),this.timer=setTimeout((function(){if(t){t.flushing=!0;for(var e=0;e<t.queue.length;e++)try{var n=t.queue[e];t.ids[n.id]=null,n.run()}catch(t){console.warn("[Herbx Flush Error] ",t)}t.resetState()}}),0))}}]),t}()),nt=new o;function rt(t){!function t(e,n){var r,o,i=m(e);if(!i&&!g(e)||Object.isFrozen(e))return;if(e.__ob__){var u=e.__ob__.dep.id;if(n.has(u))return;n.add(u)}if(i)for(r=e.length;r--;)t(e[r],n);else for(o=Object.keys(e),r=o.length;r--;)t(e[o[r]],n)}(t,nt),nt.clear()}var ot=0,it=function(){function t(e){s()(this,t),this.active=!0,this.deps=[],this.depIds=new Set,this.newDeps=[],this.newDepIds=new Set;var n=e.getter,r=e.notify,o=e.deep,i=e.sync,u=e.lazy;this.id=++ot,this.notify=r,this.getter="function"==typeof n?n:O,this.dirty=this.lazy=!!u,this.deep=!!o,this.sync=!!i,this.value=this.lazy?void 0:this.get()}return f()(t,[{key:"get",value:function(){var t,e;t=this,K.push(t),B.target=t;try{e=this.getter()}catch(t){throw t}finally{this.deep&&rt(e),K.pop(),B.target=K[K.length-1],this.cleanUpDeps()}return e}},{key:"evaluate",value:function(){this.value=this.get(),this.dirty=!this.deps||!this.deps.length}},{key:"addDep",value:function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))}},{key:"cleanUpDeps",value:function(){for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0}},{key:"update",value:function(){this.lazy?this.dirty=!0:this.sync?this.run():(et.addWatcher(this),et.flush())}},{key:"run",value:function(){if(this.active){var t=this.get();if(t!==this.value||g(t)||this.deep){var e=this.value;this.value=t;try{this.notify&&this.notify(t,e)}catch(t){console.error(t)}}}}},{key:"depend",value:function(){for(var t=this.deps.length;t--;)this.deps[t].depend()}},{key:"teardown",value:function(){if(this.active){for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}}}]),t}();function ut(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 ut(t.substr(o+e.length),i.$namespaceSep,i.modules)}}function at(t,e,n){var r=function(t,e){var n=C(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:ut(o,e,n),method:i}}}var st=/[^\w.$]/;function ct(t,e){if(!st.test(t)&&e){var n,r=t.split(".");if(r[0])if(D(e.state,r[0])?n=e.state:D(e.getters,r[0])&&(n=e.getters),n)return function(){for(var t=n,e=0;e<r.length;e++){if(!t)return;t=n[r[e]]}return t}}}function ft(t,e){if(!b(e)){var n=w(e);if(n){var r={},o={};return T(r,"__gw__",o,!1),I(e,(function(e,n){"function"==typeof e?(o[n]=new it({getter:function(){return function(t,e,n){var r=U.call(t,e);"function"==typeof t.$getterParamsTransformer&&(r=t.$getterParamsTransformer.call(null,r));return n.call(null,r)}(t,n,e)},lazy:!0}),Object.defineProperty(r,n,{enumerable:!0,get:lt(n)})):k()})),r}k()}}function lt(t){return function(){var e=this.__gw__&&this.__gw__[t];if(e)return e.dirty&&e.evaluate(),B.target&&e.depend(),e.value}}function ht(t,e,n){if("function"==typeof n)return new it({getter:ct(e,t),notify:function(e,r){return n.call(t.$actionFunctionContext||t,e,r)}});if("string"==typeof n)return new it({getter:ct(e,t),notify:function(n,r){return t.dispatch(e,n,r)}});if(w(n)){var r=n.sync,o=n.immediate,i=n.deep,u=n.handler;if("function"==typeof u){var a=new it({getter:ct(e,t),notify:function(e,n){return u.call(t.$actionFunctionContext||t,e,n)},deep:i,sync:r});return o&&u.call(t.$actionFunctionContext||t,a.value),a}}}function dt(t,e){m(t)&&t.forEach((function(t){try{e(null,t)}catch(t){console.error("[Herbx] ForEach Call Function Error: ",t)}}))}var pt=0,yt=function(){function t(e){var n=this;s()(this,t),this.$namespaceSep="/",this.$namespaced=!1,this.$uid=pt++,this.$subscribers={mutation:[],action:[]},this.$modules={},this.beforeDestory=function(){!function(t,e){t.__gw__&&(I(t.__gw__,(function(t){t.teardown()})),I(e,(function(t){m(t)?t.forEach((function(t){return t.teardown()})):t.teardown()})))}(n.$getters,n.$watchers),I(n.$modules,(function(t){t.beforeDestory()}))},this.notify=function(){n&&(n.$namespaced?n.root&&n.root.notify():(n.broadcast(),n.$renderWatcher&&n.$renderWatcher.update()))},this.broadcast=function(){I(n.$modules,(function(t,e){n&&!t.$namespaced&&t.notify()}))},this.subscribe=function(t,e){return n.$subscribers[t]?(F(n.$subscribers[t],e)<0&&n.$subscribers[t].push(e),function(){M(n.$subscribers[t],e)}):O},this.registerModule=function(e,r){D(n.$modules,e)&&P(!1,"namespace is exists: "+e),w(r)||P(!1,"options must be object: "+e);var o=Object.assign({},r,{root:n,namespace:e}),i=new t(o);return n.$modules[e]=i,o.namespaced&&(D(n.$state,e)&&P(!1,"module state namespace is exists: "+e),D(n.$getters,e)&&P(!1,"module getters namespace is exists: "+e),Object.defineProperty(n.state,e,{get:function(){return i.$state},enumerable:!0}),Object.defineProperty(n.getters,e,{get:function(){return i.$getters},enumerable:!0})),i},this.unregisterModule=function(t){D(n.$modules,t)&&(n.$modules[t].beforeDestory(),delete n.$modules[t])},this.dispatch=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var o=e[0],i=n.$actions[o];if("function"==typeof i){n.execSubcribers("action",e);var a=J.apply(n,e),s=i.apply(n.$actionFunctionContext,"function"==typeof n.$actionParamsTransformer?n.$actionParamsTransformer.apply(null,a):a);return s}var c,f=at(o,n.$namespaceSep,n.$modules);if(f&&f.module)return(c=f.module).dispatch.apply(c,[f.method].concat(u()(e.slice(1))));k()},this.commit=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var o=e[0];if(w(o)){var i=Object.assign(n.state,o);return n.execSubcribers("mutation",e),n.notify(),i}var a=n.$mutations[o];if("function"==typeof a){var s=G.apply(n,e),c=a.apply(n.$mutationFunctionContext,"function"==typeof n.$mutationParamsTransformer?n.$mutationParamsTransformer.apply(null,s.concat(o)):s);return n.execSubcribers("mutation",e),n.notify(),c}var f,l=at(o,n.$namespaceSep,n.$modules);if(l&&l.module)return(f=l.module).commit.apply(f,[l.method].concat(u()(e.slice(1))));k()};var r=e.state,o=e.getters,i=e.mutations,a=e.actions,c=e.watch,f=e.plugins,l=e.namespace,h=e.actionFunctionContext,d=e.mutationFunctionContext,p=e.actionParamsTransformer,y=e.getterParamsTransformer,v=e.mutationParamsTransformer,g=e.root,_=e.modules,$=e.namespaced,x=void 0!==$&&$,j=e.renderWatcher;this.$getterParamsTransformer=y,this.$actionParamsTransformer=p,this.$mutationParamsTransformer=v,this.$actionFunctionContext=h||null,this.$mutationFunctionContext=d||null,g&&g instanceof t&&(this.$root=g),this.$renderWatcher=j,this.$namespace=l,this.$namespaced=!!x,this.$state=function(t){if(!b(t)){var e=w(t);if(e)return Z(A(t)).value;k()}}(r)||{},this.$getters=ft(this,o)||{},this.$mutations=function(t){if(!b(t)){var e=w(t);if(e)return t;k()}}(i)||{},this.$actions=function(t){if(!b(t)){var e=w(t);if(e)return t;k()}}(a)||{},this.$watchers=function(t,e){if(!b(e)){var n=w(e);if(n){var r={};return I(e,(function(e,n){if(m(e)){r[n]=[];for(var o=0;o<e.length;o++){var i=ht(t,n,e[o]);i&&(r[n][o]=i)}}else{var u=ht(t,n,e);u&&(r[n]=u)}})),r}k()}}(this,c)||{},w(_)&&I(_,(function(t,e){n.registerModule(e,t)})),dt(f,(function(t,e){if(t)return k(0,t.message);S(e)&&e(n)}))}return f()(t,[{key:"execSubcribers",value:function(t,e){var n=this;dt(this.$subscribers[t],(function(t,r){if(t)return k(0,t.message);S(r)&&r.apply(void 0,[n].concat(u()(e)))}))}},{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 bt(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=new it({getter:t,sync:!0,notify:function(t){t&&(o.teardown(),"number"==typeof r.timeout?n=setTimeout((function(){e()}),r.timeout):e())}});return o.value?(o.notify(o.value),O):function(){o.teardown(),n&&clearTimeout(n)}}function vt(t,e,n){if(S(t)){if(S(e))return bt(t,e,n);if(v(e)||w(e))return new Promise((function(n){bt(t,n,e)}))}}function mt(){return function(t){var e=A(t.state),n=console.info;t.subscribe("action",(function(t,e){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];n("%c [Herbx] Action: ".concat(JSON.stringify(e),", Payload: "),"color: #9E9E9E; font-weight: bold",o)}));t.subscribe("mutation",(function(t,r){for(var o=r,i=arguments.length,u=new Array(i>2?i-2:0),a=2;a<i;a++)u[a-2]=arguments[a];var s=u;"string"!=typeof r&&(o="Empty Mutation Name",s.unshift(r));var c=A(t.state);n("%c [Herbx] Prev State: ","color: #9E9E9E; font-weight: bold",e),n("%c [Herbx] Mutation: ".concat(JSON.stringify(o),", Payload: "),"color: #03A9F4; font-weight: bold",s),n("%c [Herbx] Next State: ","color: #4CAF50; font-weight: bold",c),e=c}))}}function gt(){return function(t){}}e.default=yt}])}));
!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=7)}([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(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e,n){var r=n(8),o=n(9),i=n(5),u=n(10);t.exports=function(t){return r(t)||o(t)||i(t)||u()}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}},function(t,e,n){var r=n(4);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}},function(t,e,n){var r=n(11),o=n(12),i=n(5),u=n(13);t.exports=function(t,e){return r(t)||o(t,e)||i(t,e)||u()}},function(t,e,n){t.exports=n(14)},function(t,e,n){var r=n(4);t.exports=function(t){if(Array.isArray(t))return r(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,o=!1,i=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e,n){"use strict";n.r(e),n.d(e,"when",(function(){return vt})),n.d(e,"findByKey",(function(){return E})),n.d(e,"findIndex",(function(){return F})),n.d(e,"eachObject",(function(){return I})),n.d(e,"lastIndexOf",(function(){return C})),n.d(e,"remove",(function(){return M})),n.d(e,"copyAugment",(function(){return N})),n.d(e,"protoAugment",(function(){return H})),n.d(e,"copyArrayFast",(function(){return W})),n.d(e,"mapArrayFast",(function(){return z})),n.d(e,"_Set",(function(){return o})),n.d(e,"hasProto",(function(){return q})),n.d(e,"Types",(function(){return r})),n.d(e,"is",(function(){return y})),n.d(e,"isNil",(function(){return b})),n.d(e,"isUndefined",(function(){return v})),n.d(e,"isArray",(function(){return m})),n.d(e,"isObject",(function(){return g})),n.d(e,"isPlainObject",(function(){return w})),n.d(e,"isString",(function(){return _})),n.d(e,"isSymbol",(function(){return $})),n.d(e,"isPromise",(function(){return x})),n.d(e,"isFunction",(function(){return S})),n.d(e,"isNative",(function(){return j})),n.d(e,"noop",(function(){return O})),n.d(e,"assert",(function(){return P})),n.d(e,"log",(function(){return k})),n.d(e,"deepCopy",(function(){return A})),n.d(e,"hasOwnProperty",(function(){return D})),n.d(e,"def",(function(){return T})),n.d(e,"LoggerPlugin",(function(){return mt})),n.d(e,"DevToolPlugin",(function(){return gt})),n.d(e,"Store",(function(){return yt})),n.d(e,"Watcher",(function(){return it}));var r,o,i=n(3),u=n.n(i),a=n(0),s=n.n(a),c=n(1),f=n.n(c),l=n(6),h=n.n(l),d=n(2),p=n.n(d);function y(t,e){return Object.prototype.toString.call(t)===r[e]}function b(t){return null==t}function v(t){return void 0===t}function m(t){return Array.isArray?Array.isArray(t):y(t,"array")}function g(t){return null!==t&&"object"===p()(t)}function w(t){return y(t,"object")}function _(t){return y(t,"string")}function $(t){return y(t,"symbol")}function x(t){return!!t&&"function"==typeof t.then}function S(t){return"function"==typeof t}function j(t){return"function"==typeof t&&/native code/.test(t.toString())}function O(){}function P(t,e){if(!t)throw new Error("[Herbx] "+e)}function k(t,e,n){0}function A(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(null===t||"object"!==p()(t))return t;var n=E(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=z(t,(function(t){return A(t,e)}))):o===r.set?(i.copy=new Set,t.forEach((function(t){i.copy.add(A(t,e))}))):o===r.map?(i.copy=new Map,t.forEach((function(t,n){i.copy.set(n,A(t,e))}))):o===r.date?i.copy=new Date(t):(i.copy={},I(t,(function(t,n){i.copy[n]=A(t,e)}))),i.copy}function D(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function T(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function E(t,e){for(var n=h()(e,2),r=n[0],o=n[1],i=0,u=t.length;i<u;i++)if(t[i][r]===o)return t[i]}function F(t,e){return t.indexOf(e)}function I(t,e){for(var n=Object.keys(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}function C(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 M(t,e){if(t.length){var n=F(t,e);n>-1&&t.splice(n,1)}}function N(t,e,n){for(var r=0,o=n.length;r<o;r++){var i=n[r];T(t,i,e[i])}}function H(t,e){t.__proto__=e}function W(t){for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e}function z(t,e){for(var n=[],r=0,o=t.length;r<o;r++)n[r]=e(t[r]);return n}!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={})),o="undefined"!=typeof Set&&j(Set)?Set:function(){function t(){s()(this,t),this.set=Object.create(null)}return f()(t,[{key:"has",value:function(t){return!0===this.set[t]}},{key:"add",value:function(t){this.set[t]=!0}},{key:"clear",value:function(){this.set=Object.create(null)}}]),t}();var q="__proto__"in{};function U(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 G(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return[this.state].concat(n)}function J(t){var e=this,n=!!e.root,r={};Object.defineProperties(r,{commit:{get:function(){return e.commit},enumerable:!0},dispatch:{get:function(){return e.dispatch},enumerable:!0},state:{get:function(){return e.state},enumerable:!0},rootState:{get:function(){return n?e.root.state:void 0},enumerable:!0},getters:{get:function(){return e.getters},enumerable:!0},rootGetters:{get:function(){return n?e.root.getters:void 0},enumerable:!0},dispatchRoot:{get:function(){return n?e.root.dispatch:O},enumerable:!0},commitRoot:{get:function(){return n?e.root.commit:O},enumerable:!0}});for(var o=arguments.length,i=new Array(o>1?o-1:0),u=1;u<o;u++)i[u-1]=arguments[u];return[r].concat(i)}var R=0,B=function(){function t(){s()(this,t),this.id=R++,this.subs=[]}return f()(t,[{key:"addSub",value:function(t){this.subs.push(t)}},{key:"removeSub",value:function(t){M(this.subs,t)}},{key:"depend",value:function(){t.target&&t.target.addDep(this)}},{key:"notify",value:function(){for(var t=this.subs.slice(),e=0,n=t.length;e<n;e++)t[e].update()}}]),t}();B.target=null;var K=[];var L=["push","pop","shift","unshift","splice","sort","reverse"],Q=Array.prototype,V=Object.create(Q);function X(t,e,n){var r=Object.getOwnPropertyDescriptor(t,e);if(!r||!1!==r.configurable){var o=new B,i=r&&r.get,u=r&&r.set;i&&!u||2!==arguments.length||(n=t[e]);var a=Z(n);Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var e=i?i.call(t):n;return B.target&&(o.depend(),a&&(a.dep.depend(),m(e)&&Y(e))),e},set:function(e){e!==(i?i.call(t):n)&&(i&&!u||(u?u.call(t,e):n=e,a=Z(e),o.notify()))}})}}function Y(t){for(var e,n=0,r=t.length;n<r;n++)(e=t[n])&&e.__ob__&&e.__ob__.dep.depend(),m(e)&&Y(e)}function Z(t){var e;if(g(t))return D(t,"__ob__")&&t.__ob__ instanceof tt?e=t.__ob__:(m(t)||w(t))&&Object.isExtensible(t)&&(e=new tt(t)),e}L.forEach((function(t){var e=Q[t];T(V,t,(function(){var n,r=W(arguments),o=e.apply(this,r),i=this.__ob__;switch(t){case"push":case"unshift":n=r;break;case"splice":n=r.slice(2)}return n&&i.observeArray(n),i.dep.notify(),o}))}));var tt=function(){function t(e){s()(this,t),this.value=e,this.dep=new B,T(e,"__ob__",this,!1),m(e)?(!function(t){q?H(t,V):N(t,V,L)}(e),this.observeArray(e)):this.walk(e)}return f()(t,[{key:"walk",value:function(t){for(var e=Object.keys(t),n=0;n<e.length;n++)X(t,e[n])}},{key:"observeArray",value:function(t){for(var e=0,n=t.length;e<n;e++)Z(t[e])}}]),t}(),et=new(function(){function t(){s()(this,t),this.ids={},this.queue=[],this.flushing=!1}return f()(t,[{key:"addWatcher",value:function(t){var e=t.id;this.ids[e]||(this.ids[e]=!0,this.queue.push(t))}},{key:"resetState",value:function(){this.queue.length=0,this.ids={},this.flushing=!1}},{key:"flush",value:function(){var t=this;this.flushing||(clearTimeout(this.timer),this.timer=setTimeout((function(){if(t){t.flushing=!0;for(var e=0;e<t.queue.length;e++)try{var n=t.queue[e];t.ids[n.id]=null,n.run()}catch(t){console.warn("[Herbx Flush Error] ",t)}t.resetState()}}),0))}}]),t}()),nt=new o;function rt(t){!function t(e,n){var r,o,i=m(e);if(!i&&!g(e)||Object.isFrozen(e))return;if(e.__ob__){var u=e.__ob__.dep.id;if(n.has(u))return;n.add(u)}if(i)for(r=e.length;r--;)t(e[r],n);else for(o=Object.keys(e),r=o.length;r--;)t(e[o[r]],n)}(t,nt),nt.clear()}var ot=0,it=function(){function t(e){s()(this,t),this.active=!0,this.deps=[],this.depIds=new Set,this.newDeps=[],this.newDepIds=new Set;var n=e.getter,r=e.notify,o=e.deep,i=e.sync,u=e.lazy;this.id=++ot,this.notify=r,this.getter="function"==typeof n?n:O,this.dirty=this.lazy=!!u,this.deep=!!o,this.sync=!!i,this.value=this.lazy?void 0:this.get()}return f()(t,[{key:"get",value:function(){var t,e;t=this,K.push(t),B.target=t;try{e=this.getter()}catch(t){throw t}finally{this.deep&&rt(e),K.pop(),B.target=K[K.length-1],this.cleanUpDeps()}return e}},{key:"evaluate",value:function(){this.value=this.get(),this.dirty=!this.deps||!this.deps.length}},{key:"addDep",value:function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))}},{key:"cleanUpDeps",value:function(){for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0}},{key:"update",value:function(){this.lazy?this.dirty=!0:this.sync?this.run():(et.addWatcher(this),et.flush())}},{key:"run",value:function(){if(this.active){var t=this.get();if(t!==this.value||g(t)||this.deep){var e=this.value;this.value=t;try{this.notify&&this.notify(t,e)}catch(t){console.error(t)}}}}},{key:"depend",value:function(){for(var t=this.deps.length;t--;)this.deps[t].depend()}},{key:"teardown",value:function(){if(this.active){for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}}}]),t}();function ut(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 ut(t.substr(o+e.length),i.$namespaceSep,i.modules)}}function at(t,e,n){var r=function(t,e){var n=C(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:ut(o,e,n),method:i}}}var st=/[^\w.$]/;function ct(t,e){if(!st.test(t)&&e){var n,r=t.split(".");if(r[0])if(D(e.state,r[0])?n=e.state:D(e.getters,r[0])&&(n=e.getters),n)return function(){for(var t=n,e=0;e<r.length;e++){if(!t)return;t=t[r[e]]}return t}}}function ft(t,e){if(!b(e)){var n=w(e);if(n){var r={},o={};return T(r,"__gw__",o,!1),I(e,(function(e,n){"function"==typeof e?(o[n]=new it({getter:function(){return function(t,e,n){var r=U.call(t,e);"function"==typeof t.$getterParamsTransformer&&(r=t.$getterParamsTransformer.call(null,r));return n.call(null,r)}(t,n,e)},lazy:!0}),Object.defineProperty(r,n,{enumerable:!0,get:lt(n)})):k()})),r}k()}}function lt(t){return function(){var e=this.__gw__&&this.__gw__[t];if(e)return e.dirty&&e.evaluate(),B.target&&e.depend(),e.value}}function ht(t,e,n){if("function"==typeof n)return new it({getter:ct(e,t),notify:function(e,r){return n.call(t.$actionFunctionContext||t,e,r)}});if("string"==typeof n)return new it({getter:ct(e,t),notify:function(n,r){return t.dispatch(e,n,r)}});if(w(n)){var r=n.sync,o=n.immediate,i=n.deep,u=n.handler;if("function"==typeof u){var a=new it({getter:ct(e,t),notify:function(e,n){return u.call(t.$actionFunctionContext||t,e,n)},deep:i,sync:r});return o&&u.call(t.$actionFunctionContext||t,a.value),a}}}function dt(t,e){m(t)&&t.forEach((function(t){try{e(null,t)}catch(t){console.error("[Herbx] ForEach Call Function Error: ",t)}}))}var pt=0,yt=function(){function t(e){var n=this;s()(this,t),this.$namespaceSep="/",this.$namespaced=!1,this.$uid=pt++,this.$subscribers={mutation:[],action:[]},this.$modules={},this.beforeDestory=function(){var t;(t=n).getters&&t.getters.__gw__&&I(t.getters.__gw__,(function(t){t.teardown()})),t.$watchers&&I(t.$watchers,(function(t){m(t)?t.forEach((function(t){return t.teardown()})):t.teardown()})),I(n.$modules,(function(t){t.beforeDestory()}))},this.notify=function(){n&&(n.$namespaced?n.root&&n.root.notify():(n.broadcast(),n.$renderWatcher&&n.$renderWatcher.update()))},this.broadcast=function(){I(n.$modules,(function(t,e){n&&!t.$namespaced&&t.notify()}))},this.subscribe=function(t,e){return n.$subscribers[t]?(F(n.$subscribers[t],e)<0&&n.$subscribers[t].push(e),function(){M(n.$subscribers[t],e)}):O},this.registerModule=function(e,r){D(n.$modules,e)&&P(!1,"namespace is exists: "+e),w(r)||P(!1,"options must be object: "+e);var o=Object.assign({},r,{root:n,namespace:e}),i=new t(o);return n.$modules[e]=i,o.namespaced&&(D(n.$state,e)&&P(!1,"module state namespace is exists: "+e),D(n.$getters,e)&&P(!1,"module getters namespace is exists: "+e),Object.defineProperty(n.state,e,{get:function(){return i.$state},enumerable:!0}),Object.defineProperty(n.getters,e,{get:function(){return i.$getters},enumerable:!0})),i},this.unregisterModule=function(t){D(n.$modules,t)&&(n.$modules[t].beforeDestory(),delete n.$modules[t])},this.dispatch=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var o=e[0],i=n.$actions[o];if("function"==typeof i){n.execSubcribers("action",e);var a=J.apply(n,e),s=i.apply(n.$actionFunctionContext,"function"==typeof n.$actionParamsTransformer?n.$actionParamsTransformer.apply(null,a):a);return s}var c,f=at(o,n.$namespaceSep,n.$modules);if(f&&f.module)return(c=f.module).dispatch.apply(c,[f.method].concat(u()(e.slice(1))));k()},this.commit=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var o=e[0];if(w(o)){var i=Object.assign(n.state,o);return n.execSubcribers("mutation",e),n.notify(),i}var a=n.$mutations[o];if("function"==typeof a){var s=G.apply(n,e),c=a.apply(n.$mutationFunctionContext,"function"==typeof n.$mutationParamsTransformer?n.$mutationParamsTransformer.apply(null,s.concat(o)):s);return n.execSubcribers("mutation",e),n.notify(),c}var f,l=at(o,n.$namespaceSep,n.$modules);if(l&&l.module)return(f=l.module).commit.apply(f,[l.method].concat(u()(e.slice(1))));k()};var r=e.state,o=e.getters,i=e.mutations,a=e.actions,c=e.watch,f=e.plugins,l=e.namespace,h=e.actionFunctionContext,d=e.mutationFunctionContext,p=e.actionParamsTransformer,y=e.getterParamsTransformer,v=e.mutationParamsTransformer,g=e.root,_=e.modules,$=e.namespaced,x=void 0!==$&&$,j=e.renderWatcher;this.$getterParamsTransformer=y,this.$actionParamsTransformer=p,this.$mutationParamsTransformer=v,this.$actionFunctionContext=h||null,this.$mutationFunctionContext=d||null,g&&g instanceof t&&(this.$root=g),this.$renderWatcher=j,this.$namespace=l,this.$namespaced=!!x,this.$state=function(t){if(!b(t)){var e=w(t);if(e)return Z(A(t)).value;k()}}(r)||{},this.$getters=ft(this,o)||{},this.$mutations=function(t){if(!b(t)){var e=w(t);if(e)return t;k()}}(i)||{},this.$actions=function(t){if(!b(t)){var e=w(t);if(e)return t;k()}}(a)||{},this.$watchers={},function(t,e){if(!b(e)){var n=w(e);n?I(e,(function(e,n){t.watch(n,e)})):k()}}(this,c),w(_)&&I(_,(function(t,e){n.registerModule(e,t)})),dt(f,(function(t,e){if(t)return k(0,t.message);S(e)&&e(n)}))}return f()(t,[{key:"execSubcribers",value:function(t,e){var n=this;dt(this.$subscribers[t],(function(t,r){if(t)return k(0,t.message);S(r)&&r.apply(void 0,[n].concat(u()(e)))}))}},{key:"watch",value:function(t,e){for(var n=[],r=this.$watchers[t],o=m(e)?e:[e],i=0;i<o.length;i++){var u=ht(this,t,o[i]);n.push(u)}r?m(r)?this.$watchers[t]=r.concat(n):(n.unshift(r),this.$watchers[t]=n):this.$watchers[t]=1===n.length?n[0]:n}},{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 bt(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=new it({getter:t,sync:!0,notify:function(t){t&&(o.teardown(),"number"==typeof r.timeout?n=setTimeout((function(){e()}),r.timeout):e())}});return o.value?(o.notify(o.value),O):function(){o.teardown(),n&&clearTimeout(n)}}function vt(t,e,n){if(S(t)){if(S(e))return bt(t,e,n);if(v(e)||w(e))return new Promise((function(n){bt(t,n,e)}))}}function mt(){return function(t){var e=A(t.state),n=console.info;t.subscribe("action",(function(t,e){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];n("%c [Herbx] Action: ".concat(JSON.stringify(e),", Payload: "),"color: #9E9E9E; font-weight: bold",o)}));t.subscribe("mutation",(function(t,r){for(var o=r,i=arguments.length,u=new Array(i>2?i-2:0),a=2;a<i;a++)u[a-2]=arguments[a];var s=u;"string"!=typeof r&&(o="Empty Mutation Name",s.unshift(r));var c=A(t.state);n("%c [Herbx] Prev State: ","color: #9E9E9E; font-weight: bold",e),n("%c [Herbx] Mutation: ".concat(JSON.stringify(o),", Payload: "),"color: #03A9F4; font-weight: bold",s),n("%c [Herbx] Next State: ","color: #4CAF50; font-weight: bold",c),e=c}))}}function gt(){return function(t){}}e.default=yt}])}));

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

import { IFunction, IHerbxStoreOptions, IHerbxSubscriber, IObject } from 'herb-core-include';
import { IFunction, IHerbxStoreOptions, IHerbxSubscriber, IHerbWatchOption, IObject } from 'herb-core-include';
import { Watcher } from './observer/watcher';

@@ -39,4 +39,5 @@ import { noop } from './utils';

execSubcribers(key: keyof IHerbxSubscriber<Mutations, Actions>, args: any[]): void;
watch(key: string, handler: IHerbWatchOption<IObject>): void;
}
export default Store;
//# sourceMappingURL=store.d.ts.map
{
"name": "herbx",
"version": "1.2.20",
"version": "1.2.21",
"main": "lib/index.js",

@@ -18,5 +18,5 @@ "files": [

"dependencies": {
"herb-core-include": "^1.1.0"
"herb-core-include": "^1.1.1"
},
"gitHead": "180d9fe78d2de86706f1666e33b8d236251672a3"
"gitHead": "d518749a2883d509134ed0489b797521d06866ac"
}

Sorry, the diff of this file is not supported yet

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