-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
2 lines (2 loc) · 2.42 KB
/
index.js
1
2
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("lodash"),require("path-to-regexp"),require("mobx-state-tree")):"function"==typeof define&&define.amd?define(["exports","lodash","path-to-regexp","mobx-state-tree"],e):e(t["k-mst-onaction"]={},t.lodash,t.pathToRegexp,t.mobxStateTree)}(this,function(t,e,n,r){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var o=function(t,r){return function(o,u){return!!(e.isString(t)&&null!==n(t,[],{sensitive:!0}).exec(o.fullpath)||e.isFunction(t)&&t(o,u)||e.isRegExp(t)&&o.fullpath.match(t))&&r(o,u)}};o.ended=function(t,e){return function(n,r){return!!n.ended&&o(t,e)(n,r)}};var u=function(t,e,n){t.forEach(function(t){return t(e,n)})},i=function(t,n,r){var o=t(n,r);o&&e.isArray(o)&&o.forEach(function(t){return t(n,r)})},a=(function(){function t(t){this.value=t}function e(e){function n(o,u){try{var i=e[o](u),a=i.value;a instanceof t?Promise.resolve(a.value).then(function(t){n("next",t)},function(t){n("throw",t)}):r(i.done?"return":"normal",i.value)}catch(t){r("throw",t)}}function r(t,e){switch(t){case"return":o.resolve({value:e,done:!0});break;case"throw":o.reject(e);break;default:o.resolve({value:e,done:!1})}(o=o.next)?n(o.key,o.arg):u=null}var o,u;this._invoke=function(t,e){return new Promise(function(r,i){var a={key:t,arg:e,resolve:r,reject:i,next:null};u?u=u.next=a:(o=u=a,n(t,e))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(e.prototype[Symbol.asyncIterator]=function(){return this}),e.prototype.next=function(t){return this._invoke("next",t)},e.prototype.throw=function(t){return this._invoke("throw",t)},e.prototype.return=function(t){return this._invoke("return",t)}}(),Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}),c=function(t){var e=t.name,n=t.type,o=t.context,u=t.args,i=r.getPath(o),c={fullpath:i+"/"+e,path:i,name:e,args:u};switch(n){case"process_return":case"flow_return":return a({},c,{ended:!0});case"action":return c;default:return}},f=function(t){return function(n,r){if(e.isFunction(t))return i(t,n,r);if(e.isArray(t))return u(t,n,r);throw new Error("[k-mst-onaction] unknow dispatch type")}};t.default=function(t){var e=f(t);return function(t,n){var r=c(t);return r&&e(r,t.tree),n(t)}},t.take=o,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=index.js.map