@airma/core
Advanced tools
Comparing version 17.2.3 to 17.2.4
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@airma/core"]=e():t["@airma/core"]=e()}(self,(function(){return function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},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},n(t)}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(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 c(t,e){if(t){if("string"==typeof t)return o(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)?o(t,e):void 0}}function u(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||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 i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,c=[],u=!0,i=!1;try{for(n=n.call(t);!(u=(r=n.next()).done)&&(c.push(r.value),!e||c.length!==e);u=!0);}catch(t){i=!0,o=t}finally{try{u||null==n.return||n.return()}finally{if(i)throw o}}return c}}(t,e)||c(t,e)||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 a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n,r){var o=Object.keys(n),c={};return o.forEach((function(n){c[n]={get:function(){return r.get?r.get(t,n,e):t[n]},set:function(o){if(r.set){if(!r.set(t,n,o,e))throw new Error("".concat(n," in proxy target is not mutable"))}else t[n]=o}}})),c}t.r(e),t.d(e,{createModel:function(){return O},createProxy:function(){return y},createStore:function(){return j},factory:function(){return g},shallowEqual:function(){return p}});var y=function(t,e){return"function"!=typeof Proxy?function(t,e){var n={},r=s(t,n,t,e),o=s(t,n,Object.getPrototypeOf(t),e);return Object.defineProperties(n,f(f({},o),r)),n}(t,e):new Proxy(t,e)};function l(t){return t&&"object"===n(t)}function p(t,e){if(Object.is(t,e))return!0;if(!l(t)||!l(e))return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;var o=t,c=e;return!n.some((function(t){return!Object.prototype.hasOwnProperty.call(c,t)}))&&!r.some((function(t){var e=c[t],n=o[t];return!Object.is(e,n)}))}function b(t){var e={};return t.forEach((function(t){var n=i(t,2),r=n[0],o=n[1];e[r]=o})),{get:function(t){return e[t]}}}function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function v(t){return function(e){u(t.dispatches).forEach((function(t){t(e)}))}}function O(t,e,n){var r=t(e),o={current:r,reducer:t,dispatch:null,dispatches:[],cacheMethods:{},state:e,cacheState:null,controlled:!!n};function c(t,e){var n=o.state,r=!(!e||!e.isDefault),c=!(!e||!e.ignoreDispatch);if(!r||!o.cacheState){var u=e?e.state:n;o.reducer=t,o.state=u,o.cacheState=e&&e.cache?{state:e.state}:o.cacheState,o.current=t(o.state),n===o.state||r||c||v(o)({state:o.state,type:""})}}var i=y(r,{get:function(t,e){var n=o.current[e];return Object.prototype.hasOwnProperty.call(o.current,e)&&"function"==typeof n?function(t,e){if(t.cacheMethods[e])return t.cacheMethods[e];var n=function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];function c(e){v(t)(e)}var u=t.current[e].apply(void 0,r),i=t.reducer;return t.controlled?(c({type:e,state:u}),u):(t.current=i(u),t.state=u,t.cacheState={state:u},c({type:e,state:u}),u)};return t.cacheMethods[e]=n,n}(o,e):n}});return{agent:i,getCacheState:function(){return o.cacheState},getState:function(){return o.state},getCurrent:function(){if(Array.isArray(o.current))return o.current.map((function(t,e){return"function"==typeof t?i[e]:t}));var t=Object.keys(o.current),e=h({},o.current);return t.forEach((function(t){"function"==typeof e[t]&&(e[t]=i[t])})),e},getListeners:function(){return o.dispatches},update:c,updateState:function(t){c(o.reducer,{state:t,cache:!0})},notice:function(){v(o)({state:o.state,type:""})},connect:function(t,e){var n=u(o.dispatches);!t||n.indexOf(t)>=0||(e&&(t.confirmed=!0),o.dispatches=n.concat(t))},disconnect:function(t){if(t){var e=u(o.dispatches);o.dispatches=e.filter((function(e){return e!==t&&e.confirmed}))}else o.dispatches=[]}}}function g(t,e){var n=function(e){return t(e)};return n.creation=function(){return O(n,e)},n.pipe=function(t){var e=function(e){return t(e)};return e.getSourceFrom=function(){return n},e},n}function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if("function"==typeof t&&"function"==typeof t.creation)return[{key:e.join("."),keys:e,factory:t,connection:t.creation()}];if(!t||"object"!==n(t))return[];var r=[],o=t,c=Object.keys(o);return c.forEach((function(t){var n=m(o[t],e.concat(t));r.push.apply(r,u(n))})),r}function j(t){var e=t;function n(t){var e=t.map((function(t){return t.connection})),n=function(t){return{get:function(e){var n=t.find((function(t){return t.factory===e||t.sourceFactory===e}));return n?n.connection:void 0}}}(t);return{collections:t,connections:e,instances:n}}var r=m(t),o=n(r),c={update:function(e){if(e===t)return h({},c);var i=m(e),a=n(function(t,e){var n=b(e.map((function(t){return[t.key,{connection:t.connection,factory:t.factory}]}))),r=b(t.map((function(t){return[t.key,{connection:t.connection,factory:t.factory}]}))),o=e.filter((function(t){var e=t.key;return!r.get(e)})),c=t.filter((function(t){var e=t.key;return!n.get(e)})),i=t.map((function(t){var e=t.key,r=t.connection,o=n.get(e);if(o){var c=o.connection,u=null==r.getCacheState()?c.getState():r.getState();return r.update(o.factory,{state:u}),h(h({},t),{},{factory:o.factory,sourceFactory:t.factory})}})).filter((function(t){return!!t}));return c.forEach((function(t){return t.connection.disconnect()})),[].concat(u(o),u(i))}(r,i)),f=a.instances,s=a.connections,y=a.collections;return o.instances=f,o.connections=s,o.collections=y,h({},c)},get:function(t){return o.instances.get(t)},equal:function(t){return t===e},destroy:function(){o.connections.forEach((function(t){return t.disconnect()}))}};return h({},c)}return e}()})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@airma/core"]=e():t["@airma/core"]=e()}(self,(function(){return function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},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},n(t)}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(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 c(t,e){if(t){if("string"==typeof t)return o(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)?o(t,e):void 0}}function u(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||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 i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,c=[],u=!0,i=!1;try{for(n=n.call(t);!(u=(r=n.next()).done)&&(c.push(r.value),!e||c.length!==e);u=!0);}catch(t){i=!0,o=t}finally{try{u||null==n.return||n.return()}finally{if(i)throw o}}return c}}(t,e)||c(t,e)||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 a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n,r){var o=Object.keys(n),c={};return o.forEach((function(n){c[n]={get:function(){return r.get?r.get(t,n,e):t[n]},set:function(o){if(r.set){if(!r.set(t,n,o,e))throw new Error("".concat(n," in proxy target is not mutable"))}else t[n]=o}}})),c}t.r(e),t.d(e,{createModel:function(){return O},createProxy:function(){return y},createStore:function(){return j},factory:function(){return g},shallowEqual:function(){return p}});var y=function(t,e){return"function"!=typeof Proxy?function(t,e){var n={},r=s(t,n,t,e),o=s(t,n,Object.getPrototypeOf(t),e);return Object.defineProperties(n,f(f({},o),r)),n}(t,e):new Proxy(t,e)};function l(t){return t&&"object"===n(t)}function p(t,e){if(Object.is(t,e))return!0;if(!l(t)||!l(e))return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;var o=t,c=e;return!n.some((function(t){return!Object.prototype.hasOwnProperty.call(c,t)}))&&!r.some((function(t){var e=c[t],n=o[t];return!Object.is(e,n)}))}function b(t){var e={};return t.forEach((function(t){var n=i(t,2),r=n[0],o=n[1];e[r]=o})),{get:function(t){return e[t]}}}function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function v(t){return function(e){u(t.dispatches).forEach((function(t){t(e)}))}}function O(t,e,n){var r=t(e),o={current:r,reducer:t,dispatch:null,dispatches:[],cacheMethods:{},state:e,cacheState:null,controlled:!!n};function c(t,e){var n=o.state,r=!(!e||!e.isDefault),c=!(!e||!e.ignoreDispatch);if(!r||!o.cacheState){var u=e?e.state:n;o.reducer=t,o.state=u,o.cacheState=e&&e.cache?{state:e.state}:o.cacheState,o.current=t(o.state),n===o.state||r||c||v(o)({state:o.state,type:""})}}var i=y(r,{get:function(t,e){var n=o.current[e];return Object.prototype.hasOwnProperty.call(o.current,e)&&"function"==typeof n?function(t,e){if(t.cacheMethods[e])return t.cacheMethods[e];var n=function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];function c(e){v(t)(e)}var u=t.current[e].apply(void 0,r),i=t.reducer;return t.controlled?(c({type:e,state:u}),u):(t.current=i(u),t.state=u,t.cacheState={state:u},c({type:e,state:u}),u)};return t.cacheMethods[e]=n,n}(o,e):n}});return{agent:i,getCacheState:function(){return o.cacheState},getState:function(){return o.state},getCurrent:function(){if(Array.isArray(o.current))return o.current.map((function(t,e){return"function"==typeof t?i[e]:t}));var t=Object.keys(o.current),e=h({},o.current);return t.forEach((function(t){"function"==typeof e[t]&&(e[t]=i[t])})),e},getListeners:function(){return o.dispatches},update:c,updateState:function(t){c(o.reducer,{state:t,cache:!0})},notice:function(){v(o)({state:o.state,type:""})},connect:function(t){var e=u(o.dispatches);e.indexOf(t)>=0||(o.dispatches=e.concat(t))},disconnect:function(t){if(t){var e=u(o.dispatches);o.dispatches=e.filter((function(e){return e!==t}))}else o.dispatches=[]}}}function g(t,e){var n=function(e){return t(e)};return n.creation=function(){return O(n,e)},n.pipe=function(t){var e=function(e){return t(e)};return e.getSourceFrom=function(){return n},e},n}function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if("function"==typeof t&&"function"==typeof t.creation)return[{key:e.join("."),keys:e,factory:t,connection:t.creation()}];if(!t||"object"!==n(t))return[];var r=[],o=t,c=Object.keys(o);return c.forEach((function(t){var n=m(o[t],e.concat(t));r.push.apply(r,u(n))})),r}function j(t){var e=t;function n(t){var e=t.map((function(t){return t.connection})),n=function(t){return{get:function(e){var n=t.find((function(t){return t.factory===e||t.sourceFactory===e}));return n?n.connection:void 0}}}(t);return{collections:t,connections:e,instances:n}}var r=m(t),o=n(r),c={update:function(e){if(e===t)return h({},c);var i=m(e),a=n(function(t,e){var n=b(e.map((function(t){return[t.key,{connection:t.connection,factory:t.factory}]}))),r=b(t.map((function(t){return[t.key,{connection:t.connection,factory:t.factory}]}))),o=e.filter((function(t){var e=t.key;return!r.get(e)})),c=t.filter((function(t){var e=t.key;return!n.get(e)})),i=t.map((function(t){var e=t.key,r=t.connection,o=n.get(e);if(o){var c=o.connection,u=null==r.getCacheState()?c.getState():r.getState();return r.update(o.factory,{state:u}),h(h({},t),{},{factory:o.factory,sourceFactory:t.factory})}})).filter((function(t){return!!t}));return c.forEach((function(t){return t.connection.disconnect()})),[].concat(u(o),u(i))}(r,i)),f=a.instances,s=a.connections,y=a.collections;return o.instances=f,o.connections=s,o.collections=y,h({},c)},get:function(t){return o.instances.get(t)},equal:function(t){return t===e},destroy:function(){o.connections.forEach((function(t){return t.disconnect()}))}};return h({},c)}return e}()})); |
@@ -52,3 +52,3 @@ export declare type Action = { | ||
notice: () => void; | ||
connect: (dispatch?: Dispatch, confirmed?: boolean) => void; | ||
connect: (dispatch: Dispatch) => void; | ||
disconnect: (dispatch?: Dispatch) => void; | ||
@@ -55,0 +55,0 @@ } |
@@ -8,3 +8,3 @@ { | ||
"name": "@airma/core", | ||
"version": "17.2.3", | ||
"version": "17.2.4", | ||
"description": "This is the core for agent-reducer and airma", | ||
@@ -11,0 +11,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12238