wechat-mini-program-extend
Advanced tools
Comparing version 1.4.9 to 1.4.10
@@ -1,1 +0,1 @@ | ||
"use strict";function _typeof(t){return(_typeof="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)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _OptionInstaller2=_interopRequireDefault(require("./OptionInstaller")),_common=require("../utils/common"),_Stream=require("../libs/Stream"),_object=require("../utils/object");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){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 _iterableToArrayLimit(t,e){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var n,r,i=[],a=!0,c=!1;try{for(o=o.call(t);!(a=(n=o.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){c=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(c)throw r}}return i}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _createForOfIteratorHelper(t,e){var o,n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length)return n&&(t=n),o=0,{s:e=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){a=!0,r=t},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw r}}}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _createClass(t,e,o){return e&&_defineProperties(t.prototype,e),o&&_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _createSuper(o){var n=_isNativeReflectConstruct();return function(){var t,e=_getPrototypeOf(o);return _possibleConstructorReturn(this,n?(t=_getPrototypeOf(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function _possibleConstructorReturn(t,e){if(e&&("object"===_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){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 _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(o="Object"===o&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,e):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o<e;o++)n[o]=t[o];return n}var CMPCLockSign=Symbol("__wxCMPCLock__"),CMPCRTCLockSign=Symbol("__wxCMPCRTCLock__"),CMPCSubmitSign=Symbol("__wxCMPCSubmit__"),LockInstallBehavior=Behavior({lifetimes:{created:function(){Object.defineProperty(this,CMPCLockSign,{value:new Set,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(this,CMPCSubmitSign,{value:new Set,writable:!1,enumerable:!1,configurable:!0})}}}),PropertyMonitor={lock:function(t,e){Reflect.get(t,CMPCLockSign).add(e)},unlock:function(t,e){Reflect.get(t,CMPCLockSign).delete(e)},isLocked:function(t,e){return Reflect.get(t,CMPCLockSign).has(e)}},RuntimeContextMonitor={lock:function(t){Object.defineProperty(t,CMPCRTCLockSign,{configurable:!0,value:!0,writable:!1,enumerable:!1})},unlock:function(t){Reflect.deleteProperty(t,CMPCRTCLockSign)},isLocked:function(t){return Reflect.has(t,CMPCRTCLockSign)}},PropertiesCollection={add:function(t,e){Reflect.get(t,CMPCSubmitSign).add(e)},delete:function(t,e){Reflect.get(t,CMPCSubmitSign).delete(e)},clear:function(t){Reflect.get(t,CMPCSubmitSign).clear()},size:function(t){return Reflect.get(t,CMPCSubmitSign).size},all:function(t){return _toConsumableArray(Reflect.get(t,CMPCSubmitSign))},slice:function(t,e){return this.all(t).slice(e)}},ComputedInstaller=function(){_inherits(e,_OptionInstaller2["default"]);var t=_createSuper(e);function e(){return _classCallCheck(this,e),t.apply(this,arguments)}return _createClass(e,[{key:"definitionFilter",value:function(t,e,o,n,r){n.behaviors=[LockInstallBehavior].concat(n.behaviors||[])}},{key:"lifetimes",value:function(e,a,t){return{created:function(){RuntimeContextMonitor.lock(this)},attached:function(){var r,i,t,o,n=this;!0!==e._initializationCompatibleContextEnabled&&(r=new Map,i=[],a.set("linkAge",r),t=e.getRuntimeContextSingleton(this).intercept(function(t,e,o){i.includes(t)||0!==o||i.push(t)},function(t,e,o){var n=(0,_object.selectPathRoot)(t);i.splice(0).map(function(t){return(0,_object.selectPathRoot)(t)}).filter(function(t){return t!==n}).forEach(function(t){r.has(t)||r.set(t,[]);t=r.get(t);t.includes(n)||t.push(n)})}),o=a.get("computed"),((0,_common.isPlainObject)(o)?Object.keys(o).filter(function(t){return(0,_common.isPlainObject)(o[t])&&(0,_common.isFunction)(o[t].get)||(0,_common.isFunction)(o[t])}):[]).forEach(function(t){var e=(0,_common.isFunction)(o[t].get)?o[t].get:o[t];(0,_common.isFunction)(e)&&(n[t]=e.call(n))}),t()),RuntimeContextMonitor.unlock(this)}}}},{key:"beforeUpdate",value:function(t,e,s,o,f){if(!RuntimeContextMonitor.isLocked(o)){var n,p=e.get("linkAge"),r=e.get("computed"),i=t.getRuntimeContextSingleton(o).get(),t=PropertiesCollection.size(o);for(n in f){var a=f[n],c=(0,_object.selectPathRoot)(n);if(PropertiesCollection.add(o,c),delete f[n],!PropertyMonitor.isLocked(o,c)){if(PropertyMonitor.lock(o,c),c!==n)(0,_object.getData)(o.data,n)!==a&&(0,_object.setData)(o.data,n,a);else{var l=r[c]&&(0,_common.isFunction)(r[c].set)?r[c].set:null;if(a!==o.data[c])if((0,_common.isFunction)(l)){l.call(i,a);l=r[c]&&(0,_common.isFunction)(r[c].get)?r[c].get:r[c];if(!(0,_common.isFunction)(l))throw new Error('Getter is missing for computed property "'.concat(c,'".'));o.data[c]=l.call(i)}else(0,_object.setData)(o.data,n,a)}l=p.get(c);l&&l.forEach(function(t){var e;PropertyMonitor.isLocked(o,t)||(e=r[t]&&(0,_common.isFunction)(r[t].get)?r[t].get:r[t],(0,_common.isFunction)(e)?i[t]=e.call(i):i[t]=o.data[t])}),PropertyMonitor.unlock(o,c)}}RuntimeContextMonitor.lock(o);var y,m={},u=_createForOfIteratorHelper(PropertiesCollection.slice(o,t));try{for(u.s();!(y=u.n()).done;){var b=y.value;m[b]=o.data[b],PropertiesCollection.delete(o,b)}}catch(t){u.e(t)}finally{u.f()}t=e.get("originalSetData")(o)||this.setData;(0,_common.isFunction)(t)&&t(m),RuntimeContextMonitor.unlock(o)}}},{key:"observers",value:function(t,a,e){var o,n=a.get("properties"),c=a.get("computed"),r={};for(o in n)!function(i){r[i]=function(){var t=a.get("linkAge");if(t){t=t.get(i);if(t){var e,o=_createForOfIteratorHelper(t);try{for(o.s();!(e=o.n()).done;){var n=e.value,r=c[n]&&(0,_common.isFunction)(c[n].get)?c[n].get:c[n];if(!(0,_common.isFunction)(r))throw new Error('Getter is missing for computed property "'.concat(n,'".'));this[n]=r.call(this)}}catch(t){o.e(t)}finally{o.f()}}}}}(o);return r}},{key:"install",value:function(t,e,o){var n=e.get("properties"),r=e.get("methods"),i=e.get("state"),a=e.has("constants")?e.get("constants"):t.createConstantsContext(o),c=e.get("beforeCreate"),o=o.computed,o=void 0===o?null:o;e.set("computed",_Stream.Stream.of(Object.entries(Object.assign.apply(void 0,[{}].concat(_toConsumableArray(t.installers.map(function(t){return t.computed()})),[o])))).map(function(t){var t=_slicedToArray(t,2),e=t[0],t=t[1],o={get:null,set:null};return t&&((0,_common.isFunction)(t)?o.get=t:(0,_common.isFunction)(t.get)&&(o.get=t.get),(0,_common.isFunction)(t.set)&&(o.set=t.set)),[e,o]}).collect(_Stream.Collectors.toMap())),(0,_common.isFunction)(c)&&(!0===t._initializationCompatibleContextEnabled?(o=t.createInitializationContextSingleton(),t=t.getComputedDependencies(i,n,e.get("computed"),r,a),e.set("linkAge",t),c.call(o.get(i,t,n,e.get("computed"),r,a)),o.release()):c.call(void 0))}}]),e}();exports.default=ComputedInstaller; | ||
"use strict";function _typeof(t){return(_typeof="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)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _OptionInstaller2=_interopRequireDefault(require("./OptionInstaller")),_common=require("../utils/common"),_Stream=require("../libs/Stream"),_object=require("../utils/object");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){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 _iterableToArrayLimit(t,e){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var n,r,i=[],a=!0,c=!1;try{for(o=o.call(t);!(a=(n=o.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){c=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(c)throw r}}return i}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _createForOfIteratorHelper(t,e){var o,n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length)return n&&(t=n),o=0,{s:e=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){a=!0,r=t},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw r}}}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _createClass(t,e,o){return e&&_defineProperties(t.prototype,e),o&&_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _createSuper(o){var n=_isNativeReflectConstruct();return function(){var t,e=_getPrototypeOf(o);return _possibleConstructorReturn(this,n?(t=_getPrototypeOf(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function _possibleConstructorReturn(t,e){if(e&&("object"===_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){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 _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(o="Object"===o&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,e):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o<e;o++)n[o]=t[o];return n}var CMPCLockSign=Symbol("__wxCMPCLock__"),CMPCRTCLockSign=Symbol("__wxCMPCRTCLock__"),CMPCSubmitSign=Symbol("__wxCMPCSubmit__"),LockInstallBehavior=Behavior({lifetimes:{created:function(){Object.defineProperty(this,CMPCLockSign,{value:new Set,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(this,CMPCSubmitSign,{value:new Set,writable:!1,enumerable:!1,configurable:!0})}}}),PropertyMonitor={lock:function(t,e){Reflect.get(t,CMPCLockSign).add(e)},unlock:function(t,e){Reflect.get(t,CMPCLockSign).delete(e)},isLocked:function(t,e){return Reflect.get(t,CMPCLockSign).has(e)}},RuntimeContextMonitor={lock:function(t){Object.defineProperty(t,CMPCRTCLockSign,{configurable:!0,value:!0,writable:!1,enumerable:!1})},unlock:function(t){Reflect.deleteProperty(t,CMPCRTCLockSign)},isLocked:function(t){return Reflect.has(t,CMPCRTCLockSign)}},PropertiesCollection={add:function(t,e){Reflect.get(t,CMPCSubmitSign).add(e)},delete:function(t,e){Reflect.get(t,CMPCSubmitSign).delete(e)},clear:function(t){Reflect.get(t,CMPCSubmitSign).clear()},size:function(t){return Reflect.get(t,CMPCSubmitSign).size},all:function(t){return _toConsumableArray(Reflect.get(t,CMPCSubmitSign))},slice:function(t,e){return this.all(t).slice(e)}},ComputedInstaller=function(){_inherits(e,_OptionInstaller2["default"]);var t=_createSuper(e);function e(){return _classCallCheck(this,e),t.apply(this,arguments)}return _createClass(e,[{key:"definitionFilter",value:function(t,e,o,n,r){n.behaviors=[LockInstallBehavior].concat(n.behaviors||[])}},{key:"lifetimes",value:function(e,a,t){return{created:function(){RuntimeContextMonitor.lock(this)},attached:function(){var r,i,t,o,n=this;!0!==e._initializationCompatibleContextEnabled&&(r=new Map,i=[],a.set("linkAge",r),t=e.getRuntimeContextSingleton(this).intercept(function(t,e,o){i.includes(t)||0!==o||i.push(t)},function(t,e,o){var n=(0,_object.selectPathRoot)(t);i.splice(0).map(function(t){return(0,_object.selectPathRoot)(t)}).filter(function(t){return t!==n}).forEach(function(t){r.has(t)||r.set(t,[]);t=r.get(t);t.includes(n)||t.push(n)})}),o=a.get("computed"),((0,_common.isPlainObject)(o)?Object.keys(o).filter(function(t){return(0,_common.isPlainObject)(o[t])&&(0,_common.isFunction)(o[t].get)||(0,_common.isFunction)(o[t])}):[]).forEach(function(t){var e=(0,_common.isFunction)(o[t].get)?o[t].get:o[t];(0,_common.isFunction)(e)&&(n[t]=e.call(n))}),t()),RuntimeContextMonitor.unlock(this)}}}},{key:"beforeUpdate",value:function(t,e,s,o,f){if(!RuntimeContextMonitor.isLocked(o)){var n,p=e.get("linkAge"),r=e.get("computed"),i=t.getRuntimeContextSingleton(o).get(),t=PropertiesCollection.size(o);for(n in f){var a=f[n],c=(0,_object.selectPathRoot)(n);if(PropertiesCollection.add(o,c),delete f[n],!PropertyMonitor.isLocked(o,c)){if(PropertyMonitor.lock(o,c),c!==n)(0,_object.getData)(o.data,n)!==a&&(0,_object.setData)(o.data,n,a);else{var l=r[c]&&(0,_common.isFunction)(r[c].set)?r[c].set:null;if(a!==o.data[c])if((0,_common.isFunction)(l)){l.call(i,a);l=r[c]&&(0,_common.isFunction)(r[c].get)?r[c].get:r[c];if(!(0,_common.isFunction)(l))throw new Error('Getter is missing for computed property "'.concat(c,'".'));o.data[c]=l.call(i)}else(0,_object.setData)(o.data,n,a)}l=p.get(c);l&&l.forEach(function(t){var e;PropertyMonitor.isLocked(o,t)||(e=r[t]&&(0,_common.isFunction)(r[t].get)?r[t].get:r[t],(0,_common.isFunction)(e)?i[t]=e.call(i):i[t]=o.data[t])}),PropertyMonitor.unlock(o,c)}}RuntimeContextMonitor.lock(o);var y,m={},u=_createForOfIteratorHelper(PropertiesCollection.slice(o,t));try{for(u.s();!(y=u.n()).done;){var b=y.value;m[b]=o.data[b],PropertiesCollection.delete(o,b)}}catch(t){u.e(t)}finally{u.f()}t=e.get("originalSetData"),e=t?t(o):o.setData.bind(o);(0,_common.isFunction)(e)&&e(m),RuntimeContextMonitor.unlock(o)}}},{key:"observers",value:function(t,a,e){var o,n=a.get("properties"),c=a.get("computed"),r={};for(o in n)!function(i){r[i]=function(){var t=a.get("linkAge");if(t){t=t.get(i);if(t){var e,o=_createForOfIteratorHelper(t);try{for(o.s();!(e=o.n()).done;){var n=e.value,r=c[n]&&(0,_common.isFunction)(c[n].get)?c[n].get:c[n];if(!(0,_common.isFunction)(r))throw new Error('Getter is missing for computed property "'.concat(n,'".'));this[n]=r.call(this)}}catch(t){o.e(t)}finally{o.f()}}}}}(o);return r}},{key:"install",value:function(t,e,o){var n=e.get("properties"),r=e.get("methods"),i=e.get("state"),a=e.has("constants")?e.get("constants"):t.createConstantsContext(o),c=e.get("beforeCreate"),o=o.computed,o=void 0===o?null:o;e.set("computed",_Stream.Stream.of(Object.entries(Object.assign.apply(void 0,[{}].concat(_toConsumableArray(t.installers.map(function(t){return t.computed()})),[o])))).map(function(t){var t=_slicedToArray(t,2),e=t[0],t=t[1],o={get:null,set:null};return t&&((0,_common.isFunction)(t)?o.get=t:(0,_common.isFunction)(t.get)&&(o.get=t.get),(0,_common.isFunction)(t.set)&&(o.set=t.set)),[e,o]}).collect(_Stream.Collectors.toMap())),(0,_common.isFunction)(c)&&(!0===t._initializationCompatibleContextEnabled?(o=t.createInitializationContextSingleton(),t=t.getComputedDependencies(i,n,e.get("computed"),r,a),e.set("linkAge",t),c.call(o.get(i,t,n,e.get("computed"),r,a)),o.release()):c.call(void 0))}}]),e}();exports.default=ComputedInstaller; |
@@ -1,1 +0,1 @@ | ||
"use strict";function _typeof(t){return(_typeof="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)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _OptionInstaller2=_interopRequireDefault(require("./OptionInstaller")),_common=require("../utils/common");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _createClass(t,e,r){return e&&_defineProperties(t.prototype,e),r&&_defineProperties(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _createSuper(r){var n=_isNativeReflectConstruct();return function(){var t,e=_getPrototypeOf(r);return _possibleConstructorReturn(this,n?(t=_getPrototypeOf(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function _possibleConstructorReturn(t,e){if(e&&("object"===_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var OrigSetDataSign=Symbol("__wxOrigSetData__"),SetDataSign=Symbol("__wxSetData__"),UpdateInstaller=function(){_inherits(e,_OptionInstaller2["default"]);var t=_createSuper(e);function e(){return _classCallCheck(this,e),t.apply(this,arguments)}return _createClass(e,[{key:"definitionFilter",value:function(n,o,i,t,e){var a=o.get("beforeUpdate"),u=o.get("updated");t.behaviors=[Behavior({lifetimes:{created:function(){var r=this,t=this.setData;Object.defineProperty(this,SetDataSign,{value:t.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this,OrigSetDataSign,{get:function(){return t},enumerable:!1,configurable:!0}),o.set("originalSetData",function(t){return Reflect.get(t,SetDataSign)}),this.setData=function(t,e){return a(n,o,i,r,t),Reflect.get(r,OrigSetDataSign).call(r,t,function(){u(n,o,i,this,t),(0,_common.isFunction)(e)&&e.call(this)})}},detached:function(){this.setData=Reflect.get(this,OrigSetDataSign),Reflect.deleteProperty(this,OrigSetDataSign),Reflect.deleteProperty(this,SetDataSign),o.delete("originalSetData")}}})].concat(t.behaviors||[])}},{key:"install",value:function(t,e,r){var a=t.installers.map(function(t){return t.beforeUpdate.bind(t)}).filter(function(t){return!!t}),u=t.installers.map(function(t){return t.updated.bind(t)}).filter(function(t){return!!t});e.set("beforeUpdate",function(e,r,n,o,i){a.forEach(function(t){return t(e,r,n,o,i)})}),e.set("updated",function(e,r,n,o,i){u.forEach(function(t){return t(e,r,n,o,i)})})}}]),e}();exports.default=UpdateInstaller; | ||
"use strict";function _typeof(t){return(_typeof="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)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _OptionInstaller2=_interopRequireDefault(require("./OptionInstaller")),_common=require("../utils/common");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _createClass(t,e,r){return e&&_defineProperties(t.prototype,e),r&&_defineProperties(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _createSuper(r){var n=_isNativeReflectConstruct();return function(){var t,e=_getPrototypeOf(r);return _possibleConstructorReturn(this,n?(t=_getPrototypeOf(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function _possibleConstructorReturn(t,e){if(e&&("object"===_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var OrigSetDataSign=Symbol("__wxOrigSetData__"),SetDataSign=Symbol("__wxSetData__"),UpdateInstaller=function(){_inherits(e,_OptionInstaller2["default"]);var t=_createSuper(e);function e(){return _classCallCheck(this,e),t.apply(this,arguments)}return _createClass(e,[{key:"definitionFilter",value:function(n,o,i,t,e){var a=o.get("beforeUpdate"),u=o.get("updated");t.behaviors=[Behavior({lifetimes:{created:function(){var r=this,e=this.setData;Object.defineProperty(this,SetDataSign,{value:e.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this,OrigSetDataSign,{get:function(){return e},enumerable:!1,configurable:!0}),o.set("originalSetData",function(t){return Reflect.get(t,SetDataSign)||e}),this.setData=function(t,e){return a(n,o,i,r,t),Reflect.get(r,OrigSetDataSign).call(r,t,function(){u(n,o,i,this,t),(0,_common.isFunction)(e)&&e.call(this)})}},detached:function(){this.setData=Reflect.get(this,OrigSetDataSign),Reflect.deleteProperty(this,OrigSetDataSign),Reflect.deleteProperty(this,SetDataSign),o.delete("originalSetData")}}})].concat(t.behaviors||[])}},{key:"install",value:function(t,e,r){var a=t.installers.map(function(t){return t.beforeUpdate.bind(t)}).filter(function(t){return!!t}),u=t.installers.map(function(t){return t.updated.bind(t)}).filter(function(t){return!!t});e.set("beforeUpdate",function(e,r,n,o,i){a.forEach(function(t){return t(e,r,n,o,i)})}),e.set("updated",function(e,r,n,o,i){u.forEach(function(t){return t(e,r,n,o,i)})})}}]),e}();exports.default=UpdateInstaller; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Connector=void 0;var _object=require("../utils/object"),_common=require("../utils/common"),_CompatibleWatcher=_interopRequireDefault(require("./CompatibleWatcher")),_index=_interopRequireDefault(require("./fast-deep-equal/index")),_default=_interopRequireDefault(require("./rfdc/default")),_Stream=require("./Stream");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(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)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _createForOfIteratorHelper(t,e){var n,r,o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length)return o&&(t=o),n=0,{s:e=function(){},n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:(r=function(t){throw t},i.toString=function(){return r.toString()},i),f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t){return r.apply(this,arguments)}var a,c,u=!0,l=!1;return{s:function(){o=o.call(t)},n:function(){var t=o.next();return u=t.done,t},e:(c=function(t){l=!0,a=t},s.toString=function(){return c.toString()},s),f:function(){try{u||null==o.return||o.return()}finally{if(l)throw a}}};function s(t){return c.apply(this,arguments)}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(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}var OriginalState=Symbol("__originalState__"),StateSign=Symbol("__state__"),InterceptorsSign=Symbol("__interceptors__"),WATSign=Symbol("__WAT__"),PLUGSign=Symbol("__PLUG__"),SUBSign=Symbol("__SUB__"),ACTSUBSign=Symbol("__ACT_SUB__"),GetterSign=Symbol("__getters__"),ActionSign=Symbol("__actions__"),MutationSign=Symbol("__mutations__"),ModulesSign=Symbol("__modules__"),RootModuleSign=Symbol("__root__"),Configuration={stores:[],getState:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,t=Reflect.get(t,StateSign);return null==e||e===RootModuleSign?t:(0,_object.getData)(t,e)},getOriginalState:function(t){return Reflect.get(t,OriginalState)},setOriginalState:function(t,e){Reflect.set(t,OriginalState,e)},getSpace:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,t=Reflect.get(t,e);return null==n||n===RootModuleSign?t.get(RootModuleSign):t.get(n)},defineSpace:function(t,e,n,l,s){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:null,o=6<arguments.length&&void 0!==arguments[6]?arguments[6]:null;if(e[n]){var i,a=null==r||r===RootModuleSign?RootModuleSign:r,c=Reflect.get(t,l),f=(c.has(a)||c.set(a,{}),c.get(a)),g=(c.has(RootModuleSign)||c.set(RootModuleSign,{}),c.get(RootModuleSign));for(i in e[n]){var p=s(e,a,i);Object.defineProperty(f,i,p),Object.defineProperty(g,"".concat(o?o+"/":"").concat(i),p)}}if(e.modules)for(var u in e.modules){var h="".concat(r?r+".":"").concat(u);this.defineSpace(t,e.modules[u],n,l,s,h,[o||"",e.modules[u].namespaced?u:""].filter(function(t){return!!t}).join("/"))}},deleteSpace:function(t,e,n){var t=Reflect.get(t,e),e=t.get(n),r=t.get(RootModuleSign);if(n&&n!==RootModuleSign&&t.delete(n),e!==r)for(var o=0,i=Object.keys(e);o<i.length;o++){var a=i[o];Reflect.deleteProperty(r,a)}},defineGetters:function(o,t){var i=this;this.defineSpace(o,t,"getters",GetterSign,function(e,n,r){return{enumerable:!0,configurable:!0,get:function(){var t=e.getters[r];if((0,_common.isFunction)(t))return t.call(o,i.getState(o,n),i.getSpace(o,GetterSign,n))},set:function(t){throw new Error("Cannot set property ".concat(r," of #<").concat(Object.prototype.toString.call(t),'> which has only a getter"'))}}})},defineMutations:function(i,t){var a=this;this.defineSpace(i,t,"mutations",MutationSign,function(n,r,o){return{enumerable:!0,configurable:!0,writable:!1,value:function(e){var t=n.mutations[o];(0,_common.isFunction)(t)&&(t.call(i,a.getState(i,r),e),a.getSubscribers(i).forEach(function(t){t.call(void 0,{type:o,payload:e},a.getOriginalState(i))}))}}})},defineActions:function(c,t){var u=this;this.defineSpace(c,t,"actions",ActionSign,function(r,i,a){return{enumerable:!0,configurable:!0,writable:!1,value:function(o){var t,n=r.actions[a];if((0,_common.isFunction)(n))return u.getActionSubscribers(c).forEach(function(t){t&&(0,_common.isFunction)(t.before)&&t.before.call(void 0,{type:"".concat((0,_common.isString)(i)&&i?i+"/":"").concat(a),payload:o},u.getOriginalState(c))}),t=n.call(c,{commit:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];u.commit.apply(u,[c,i].concat(e))},dispatch:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return u.dispatch.apply(u,[c,i].concat(e))},getters:u.getSpace(c,GetterSign,i),state:u.getState(c,i),rootGetters:u.getSpace(c,GetterSign),rootState:u.getState(c)},o),new Promise(function(e,n){function r(){u.getActionSubscribers(c).forEach(function(t){t&&(0,_common.isFunction)(t.after)&&t.after.call(void 0,{type:"".concat((0,_common.isString)(i)&&i?i+"/":"").concat(a),payload:o},u.getOriginalState(c))})}t&&!(0,_common.isPrimitive)(t)&&(0,_common.isFunction)(t.then)?t.then(function(t){e(t),r()},function(t){n(t)}):(e(t),r())}).catch(function(n){throw u.getActionSubscribers(c).forEach(function(t){t&&(0,_common.isFunction)(t.error)&&t.error.call(void 0,{type:"".concat((0,_common.isString)(i)&&i?i+"/":"").concat(a),payload:o},u.getOriginalState(c),n)}),e})}}})},commit:function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(!(0,_common.isString)(r[0])&&!r[0].type||!r[0])throw new Error("expects string as the type, but found ".concat(Object.prototype.toString.call(r[0])));var i=(0,_common.isString)(r[0])?r[0]:r[0].type,a=(0,_common.isString)(r[0])?r[1]:r[0],t=this.getSpace(t,MutationSign,e)[i];if(!(0,_common.isFunction)(t))throw new Error("unknown mutation type: ".concat(i));t(a)},dispatch:function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(!(0,_common.isString)(r[0])&&!r[0].type||!r[0])throw new Error("expects string as the type, but found ".concat(Object.prototype.toString.call(r[0])));var i=(0,_common.isString)(r[0])?r[0]:r[0].type,a=(0,_common.isString)(r[0])?r[1]:r[0],t=this.getSpace(t,ActionSign,e)[i];if((0,_common.isFunction)(t))return t(a);throw new Error("unknown action type: ".concat(i))},getInterceptors:function(t){return Reflect.get(t,InterceptorsSign)},intercept:function(t,e,n,r,o,i){var a=this;if(!(e||n||r||o||i))return null;var c=this.getInterceptors(t);return 0<=c.findIndex(function(t){return t.get===e&&t.set===n&&t.del===r&&t.before===o&&t.after===i})?null:(c.push({get:e,set:n,del:r,before:o,after:i}),function(){a.cancelIntercept(t,e,n)})},cancelIntercept:function(t,e,n,r,o,i){var t=this.getInterceptors(t),a=t.findIndex(function(t){return t.get===e&&t.set===n&&t.del===r&&t.before===o&&t.after===i});0<=a&&t.splice(a,1)},getWatchers:function(t){return Reflect.get(t,WATSign)},watch:function(t,e,n){var r=this,o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,i=this.getWatchers(t),a=new _CompatibleWatcher.default((0,_common.isFunction)(e)?void 0:e,function(t,e){a.deep?a.path?t===e&&(0,_index.default)(t,e)||n.call(this,t,e):(0,_index.default)(t,e)||n.call(this,t,e):t!==e&&n.call(this,t,e)},function(t,e){a.immediate&&n.call(r,t,e)},o&&!0===o.immediate,o&&!0===o.deep,void 0,(0,_common.isFunction)(e)?function(t){return e.call(void 0,t)}:null);return i.push(a),(0,_common.isFunction)(e)?a.once(t,[e.call(void 0,this.getState(t))]):a.once(t,[(0,_object.getData)(this.getState(t),e)]),function(){r.unwatch(t,a)}},unwatch:function(t,e){var t=this.getWatchers(t),n=t.findIndex(function(t){return t===e});0<=n&&t.splice(n,1)},getModules:function(t){return Reflect.get(t,ModulesSign)},registerModule:function(t,e,n){if(this.getModules(t).set(e,n),n.modules)for(var r in n.modules)this.registerModule(t,"".concat(e&&e!==RootModuleSign?e+".":"").concat(r),n.modules[r])},unregisterModule:function(t,e){this.getModules(t).delete(e)},registerInstance:function(t){this.stores.includes(t)||this.stores.push(t)},unregisterInstance:function(e){var t=this.stores.findIndex(function(t){return t===e});0<=t&&this.stores.splice(t,1)},mergeState:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(e.modules)for(var r in e.modules){var o=e.modules[r],i=o.state,r="".concat(n?n+".":"").concat(r),i=(0,_common.isFunction)(i)?i():i;console.log(r),console.log(i),(0,_object.setData)(t,r,i),console.log(t),this.mergeState(t,o,r)}return t},replaceState:function(p,t){var h=this,l=[],d=[];this.setOriginalState(p,t),Reflect.set(p,StateSign,(0,_object.createReactiveObject)(t,t,function(t,e){(0,_object.setData)(h.getOriginalState(p),t,e),l.splice(0).forEach(function(t){t.call(void 0,[(0,_object.getData)(h.getOriginalState(p),t.path)])});var n,r=_createForOfIteratorHelper(h.getWatchers(p));try{for(r.s();!(n=r.n()).done;){var o=n.value;(0,_common.isFunction)(o.getter)&&o.update(void 0,[p.state])}}catch(t){r.e(t)}finally{r.f()}},"",function(t,e,n){var r,o=_createForOfIteratorHelper(h.getInterceptors(p));try{for(o.s();!(r=o.n()).done;){var i=r.value.get;if(i&&!0===i(t,e,n))break}}catch(t){o.e(t)}finally{o.f()}},function(t,e,n){var r,o=_createForOfIteratorHelper(h.getInterceptors(p));try{for(o.s();!(r=o.n()).done;){var i=r.value.set;if(i&&!0===i(t,e,n))break}}catch(t){o.e(t)}finally{o.f()}var a,c=_createForOfIteratorHelper(h.getWatchers(p));try{for(c.s();!(a=c.n()).done;){var u=a.value;d.includes(u)||(u.deep?(u.oldValue=(0,_default.default)(u.oldValue),u.path&&t.startsWith(u.path)&&l.push(u)):u.path&&l.push(u))}}catch(t){c.e(t)}finally{c.f()}},function(t,e,n){var r,o=_createForOfIteratorHelper(h.getInterceptors(p));try{for(o.s();!(r=o.n()).done;){var i=r.value.del;if(i&&!0===i(t,e,n))break}}catch(t){o.e(t)}finally{o.f()}var a,c=_createForOfIteratorHelper(h.getWatchers(p));try{for(c.s();!(a=c.n()).done;){var u=a.value;u.deep&&(u.oldValue=(0,_default.default)(u.oldValue)),u.path?u.call(void 0,[(0,_object.getData)(h.getOriginalState(p),u.path)]):(0,_common.isFunction)(u.getter)&&u.update(void 0,[p.state])}}catch(t){c.e(t)}finally{c.f()}},function(t,e,n,s,f,g,r){var o,i=_createForOfIteratorHelper(h.getInterceptors(p));try{for(i.s();!(o=i.n()).done;){var a=o.value.before;if(a&&!0===a(t,e,n,s,f,g,r))break}}catch(t){i.e(t)}finally{i.f()}if(Array.isArray(r)&&["push","splice","shift","pop","fill","unshift","reverse","copyWithin"].includes(e)){var c,u=_createForOfIteratorHelper(h.getWatchers(p));try{for(u.s();!(c=u.n()).done;){var l=c.value;l.deep?(l.oldValue=(0,_default.default)(l.oldValue),(l.path&&t.startsWith(l.path)||(0,_common.isFunction)(l.getter))&&d.push(l)):l.path&&d.push(l)}}catch(t){u.e(t)}finally{u.f()}}},function(t,e,n,r){var o,i=_createForOfIteratorHelper(h.getInterceptors(p));try{for(i.s();!(o=i.n()).done;){var a=o.value.after;if(a&&!0===a(t,e,n,r))break}}catch(t){i.e(t)}finally{i.f()}d.splice(0).forEach(function(t){t.path&&t.call(void 0,[(0,_object.getData)(h.getOriginalState(p),t.path)])})}))},getPlugins:function(t){return Reflect.get(t,PLUGSign)},getSubscribers:function(t){return Reflect.get(t,SUBSign)},subscribe:function(t,e,n){var r=this,o=this.getSubscribers(t);return o.includes(e)||(n&&!0===n.prepend?o.unshift(e):o.push(e)),function(){r.unsubscribe(t,e)}},unsubscribe:function(t,e){t=this.getSubscribers(t),e=t.indexOf(e);0<=e&&t.splice(e,1)},getActionSubscribers:function(t){return Reflect.get(t,ACTSUBSign)},subscribeAction:function(t,e,n){var r=this,o=this.getActionSubscribers(t);return o.includes(e)||(n&&!0===n.prepend?o.unshift(e):o.push(e)),function(){r.unsubscribe(t,e)}},unsubscribeAction:function(t,e){t=this.getActionSubscribers(t),e=t.indexOf(e);0<=e&&t.splice(e,1)}},Connector={instances:function(){return Configuration.stores},intercept:function(t,e,n,r,o,i){return Configuration.intercept(t,e,n,r,o,i)},cancelIntercept:function(t,e,n,r,o,i){return Configuration.cancelIntercept(t,e,n,r,o,i)},mapState:function(t){var e=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=1?void 0:arguments[1]:null,n=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],r=Configuration.getState(t,e?e.replaceAll("/","."):null),o=Array.isArray(n)?_Stream.Stream.of(n).map(function(t){return[t,t]}).collect(_Stream.Collectors.toMap()):n;return _Stream.Stream.of(Object.keys(o)).map(function(t){var e=o[t];return(0,_common.isString)(e)?[t,function(){return r[e]}]:(0,_common.isFunction)(e)?[t,function(){return e(r)}]:[t,function(){}]}).collect(_Stream.Collectors.toMap())},mapGetters:function(t){var n=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=1?void 0:arguments[1]:"",e=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],r=Configuration.getSpace(t,GetterSign),o=Array.isArray(e)?_Stream.Stream.of(e).map(function(t){return[t,t]}).collect(_Stream.Collectors.toMap()):e;return _Stream.Stream.of(Object.keys(o)).map(function(t){var e=o[t];return[t,function(){return r["".concat(n?n+"/":"").concat(e)]}]}).collect(_Stream.Collectors.toMap())},mapActions:function(t){var n=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=1?void 0:arguments[1]:"",e=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],r=Configuration.getSpace(t,ActionSign),o=Array.isArray(e)?_Stream.Stream.of(e).map(function(t){return[t,t]}).collect(_Stream.Collectors.toMap()):e;return _Stream.Stream.of(Object.keys(o)).map(function(t){var e=o[t];return[t,function(t){return r["".concat(n?n+"/":"").concat(e)](t)}]}).collect(_Stream.Collectors.toMap())},mapMutations:function(t){var n=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=1?void 0:arguments[1]:"",e=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],r=Configuration.getSpace(t,MutationSign),o=Array.isArray(e)?_Stream.Stream.of(e).map(function(t){return[t,t]}).collect(_Stream.Collectors.toMap()):e;return _Stream.Stream.of(Object.keys(o)).map(function(t){var e=o[t];return[t,function(t){r["".concat(n?n+"/":"").concat(e)](t)}]}).collect(_Stream.Collectors.toMap())},createNamespacedHelpers:function(e,n){var r=this;return{mapState:function(t){return r.mapState(e,n,t)},mapGetters:function(t){return r.mapGetters(e,n,t)},mapMutations:function(t){return r.mapMutations(e,n,t)},mapActions:function(t){return r.mapActions(e,n,t)}}}},Store=(exports.Connector=Connector,function(){function r(t){var e=this,n=(_classCallCheck(this,r),_defineProperty(this,OriginalState,null),_defineProperty(this,StateSign,null),_defineProperty(this,InterceptorsSign,[]),_defineProperty(this,WATSign,[]),_defineProperty(this,PLUGSign,[]),_defineProperty(this,SUBSign,[]),_defineProperty(this,ACTSUBSign,[]),_defineProperty(this,GetterSign,new Map),_defineProperty(this,ModulesSign,new Map),_defineProperty(this,ActionSign,new Map),_defineProperty(this,MutationSign,new Map),Configuration.mergeState((0,_common.isFunction)(t.state)?t.state():t.state,t));Configuration.defineMutations(this,t),Configuration.defineGetters(this,t),Configuration.defineActions(this,t),Configuration.replaceState(this,n),Configuration.registerModule(this,RootModuleSign,t),Configuration.registerInstance(this),Configuration.getPlugins(this).forEach(function(t){(0,_common.isFunction)(t)&&t.call(void 0,e)})}return _createClass(r,[{key:"registerModule",value:function(t,e){var n=Array.isArray(t)?t.join("."):t;Configuration.mergeState(Configuration.getOriginalState(this),e,n),Configuration.defineMutations(this,e),Configuration.defineGetters(this,e),Configuration.defineActions(this,e),Configuration.registerModule(this,t,e)}},{key:"unregisterModule",value:function(t){if(Configuration.getModules(this).get(t)){var e,n,r=(0,_object.splitPath)(t);try{1<r.length?0<(e=(e=t.lastIndexOf("."))<0?t.lastIndexOf("["):e)&&((n=t.slice(0,e))&&Reflect.deleteProperty((0,_object.getData)(this.state,n),r[r.length-1])):Reflect.deleteProperty(this.state,t)}catch(t){throw t}finally{Configuration.deleteSpace(this,GetterSign,t),Configuration.deleteSpace(this,MutationSign,t),Configuration.deleteSpace(this,ActionSign,t),Configuration.unregisterModule(this,t)}}}},{key:"hasModule",value:function(t){t=Array.isArray(t)?t.join("."):t;return Configuration.getModules(this).has(t)}},{key:"hotUpdate",value:function(t){t&&(Configuration.defineMutations(this,t),Configuration.defineGetters(this,t),Configuration.defineActions(this,t))}},{key:"subscribe",value:function(t,e){return Configuration.subscribe(this,t,e)}},{key:"subscribeAction",value:function(t,e){return Configuration.subscribeAction(this,t,e)}},{key:"replaceState",value:function(t){Configuration.replaceState(this,t)}},{key:"watch",value:function(t,e){return Configuration.watch(this,t,e,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)}},{key:"commit",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Configuration.commit.apply(Configuration,[this,RootModuleSign].concat(e))}},{key:"dispatch",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Configuration.dispatch.apply(Configuration,[this,RootModuleSign].concat(e))}},{key:"state",get:function(){return Configuration.getState(this)}},{key:"getters",get:function(){return Configuration.getSpace(this,GetterSign)}},{key:"plugins",get:function(){return Configuration.getPlugins(this)}}]),r}());exports.default=Store; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Connector=void 0;var _object=require("../utils/object"),_common=require("../utils/common"),_CompatibleWatcher=_interopRequireDefault(require("./CompatibleWatcher")),_index=_interopRequireDefault(require("./fast-deep-equal/index")),_default=_interopRequireDefault(require("./rfdc/default")),_Stream=require("./Stream");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(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)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _createForOfIteratorHelper(t,e){var n,r,o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length)return o&&(t=o),n=0,{s:e=function(){},n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:(r=function(t){throw t},i.toString=function(){return r.toString()},i),f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t){return r.apply(this,arguments)}var a,c,u=!0,l=!1;return{s:function(){o=o.call(t)},n:function(){var t=o.next();return u=t.done,t},e:(c=function(t){l=!0,a=t},s.toString=function(){return c.toString()},s),f:function(){try{u||null==o.return||o.return()}finally{if(l)throw a}}};function s(t){return c.apply(this,arguments)}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(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}var OriginalState=Symbol("__originalState__"),StateSign=Symbol("__state__"),InterceptorsSign=Symbol("__interceptors__"),WATSign=Symbol("__WAT__"),PLUGSign=Symbol("__PLUG__"),SUBSign=Symbol("__SUB__"),ACTSUBSign=Symbol("__ACT_SUB__"),GetterSign=Symbol("__getters__"),ActionSign=Symbol("__actions__"),MutationSign=Symbol("__mutations__"),ModulesSign=Symbol("__modules__"),RootModuleSign=Symbol("__root__"),Configuration={stores:[],getState:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,t=Reflect.get(t,StateSign);return null==e||e===RootModuleSign?t:(0,_object.getData)(t,e)},getOriginalState:function(t){return Reflect.get(t,OriginalState)},setOriginalState:function(t,e){Reflect.set(t,OriginalState,e)},getSpace:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,t=Reflect.get(t,e);return null==n||n===RootModuleSign?t.get(RootModuleSign):t.get(n)},defineSpace:function(t,e,n,l,s){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:null,o=6<arguments.length&&void 0!==arguments[6]?arguments[6]:null;if(e[n]){var i,a=null==r||r===RootModuleSign?RootModuleSign:r,c=Reflect.get(t,l),f=(c.has(a)||c.set(a,{}),c.get(a)),g=(c.has(RootModuleSign)||c.set(RootModuleSign,{}),c.get(RootModuleSign));for(i in e[n]){var p=s(e,a,i);Object.defineProperty(f,i,p),Object.defineProperty(g,"".concat(o?o+"/":"").concat(i),p)}}if(e.modules)for(var u in e.modules){var h="".concat(r?r+".":"").concat(u);this.defineSpace(t,e.modules[u],n,l,s,h,[o||"",e.modules[u].namespaced?u:""].filter(function(t){return!!t}).join("/"))}},deleteSpace:function(t,e,n){var t=Reflect.get(t,e),e=t.get(n),r=t.get(RootModuleSign);if(n&&n!==RootModuleSign&&t.delete(n),e!==r)for(var o=0,i=Object.keys(e);o<i.length;o++){var a=i[o];Reflect.deleteProperty(r,a)}},defineGetters:function(o,t){var i=this;this.defineSpace(o,t,"getters",GetterSign,function(e,n,r){return{enumerable:!0,configurable:!0,get:function(){var t=e.getters[r];if((0,_common.isFunction)(t))return t.call(o,i.getState(o,n),i.getSpace(o,GetterSign,n))},set:function(t){throw new Error("Cannot set property ".concat(r," of #<").concat(Object.prototype.toString.call(t),'> which has only a getter"'))}}})},defineMutations:function(i,t){var a=this;this.defineSpace(i,t,"mutations",MutationSign,function(n,r,o){return{enumerable:!0,configurable:!0,writable:!1,value:function(e){var t=n.mutations[o];(0,_common.isFunction)(t)&&(t.call(i,a.getState(i,r),e),a.getSubscribers(i).forEach(function(t){t.call(void 0,{type:o,payload:e},a.getOriginalState(i))}))}}})},defineActions:function(c,t){var u=this;this.defineSpace(c,t,"actions",ActionSign,function(r,i,a){return{enumerable:!0,configurable:!0,writable:!1,value:function(o){var t,n=r.actions[a];if((0,_common.isFunction)(n))return u.getActionSubscribers(c).forEach(function(t){t&&(0,_common.isFunction)(t.before)&&t.before.call(void 0,{type:"".concat((0,_common.isString)(i)&&i?i+"/":"").concat(a),payload:o},u.getOriginalState(c))}),t=n.call(c,{commit:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];u.commit.apply(u,[c,i].concat(e))},dispatch:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return u.dispatch.apply(u,[c,i].concat(e))},getters:u.getSpace(c,GetterSign,i),state:u.getState(c,i),rootGetters:u.getSpace(c,GetterSign),rootState:u.getState(c)},o),new Promise(function(e,n){function r(){u.getActionSubscribers(c).forEach(function(t){t&&(0,_common.isFunction)(t.after)&&t.after.call(void 0,{type:"".concat((0,_common.isString)(i)&&i?i+"/":"").concat(a),payload:o},u.getOriginalState(c))})}t&&!(0,_common.isPrimitive)(t)&&(0,_common.isFunction)(t.then)?t.then(function(t){e(t),r()},function(t){n(t)}):(e(t),r())}).catch(function(n){throw u.getActionSubscribers(c).forEach(function(t){t&&(0,_common.isFunction)(t.error)&&t.error.call(void 0,{type:"".concat((0,_common.isString)(i)&&i?i+"/":"").concat(a),payload:o},u.getOriginalState(c),n)}),e})}}})},commit:function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(!(0,_common.isString)(r[0])&&!r[0].type||!r[0])throw new Error("expects string as the type, but found ".concat(Object.prototype.toString.call(r[0])));var i=(0,_common.isString)(r[0])?r[0]:r[0].type,a=(0,_common.isString)(r[0])?r[1]:r[0],t=this.getSpace(t,MutationSign,e)[i];if(!(0,_common.isFunction)(t))throw new Error("unknown mutation type: ".concat(i));t(a)},dispatch:function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(!(0,_common.isString)(r[0])&&!r[0].type||!r[0])throw new Error("expects string as the type, but found ".concat(Object.prototype.toString.call(r[0])));var i=(0,_common.isString)(r[0])?r[0]:r[0].type,a=(0,_common.isString)(r[0])?r[1]:r[0],t=this.getSpace(t,ActionSign,e)[i];if((0,_common.isFunction)(t))return t(a);throw new Error("unknown action type: ".concat(i))},getInterceptors:function(t){return Reflect.get(t,InterceptorsSign)},intercept:function(t,e,n,r,o,i){var a=this;if(!(e||n||r||o||i))return null;var c=this.getInterceptors(t);return 0<=c.findIndex(function(t){return t.get===e&&t.set===n&&t.del===r&&t.before===o&&t.after===i})?null:(c.push({get:e,set:n,del:r,before:o,after:i}),function(){a.cancelIntercept(t,e,n)})},cancelIntercept:function(t,e,n,r,o,i){var t=this.getInterceptors(t),a=t.findIndex(function(t){return t.get===e&&t.set===n&&t.del===r&&t.before===o&&t.after===i});0<=a&&t.splice(a,1)},getWatchers:function(t){return Reflect.get(t,WATSign)},watch:function(t,e,n){var r=this,o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,i=this.getWatchers(t),a=new _CompatibleWatcher.default((0,_common.isFunction)(e)?void 0:e,function(t,e){a.deep?a.path?t===e&&(0,_index.default)(t,e)||n.call(this,t,e):(0,_index.default)(t,e)||n.call(this,t,e):t!==e&&n.call(this,t,e)},function(t,e){a.immediate&&n.call(r,t,e)},o&&!0===o.immediate,o&&!0===o.deep,void 0,(0,_common.isFunction)(e)?function(t){return e.call(void 0,t)}:null);return i.push(a),(0,_common.isFunction)(e)?a.once(t,[e.call(void 0,this.getState(t))]):a.once(t,[(0,_object.getData)(this.getState(t),e)]),function(){r.unwatch(t,a)}},unwatch:function(t,e){var t=this.getWatchers(t),n=t.findIndex(function(t){return t===e});0<=n&&t.splice(n,1)},getModules:function(t){return Reflect.get(t,ModulesSign)},registerModule:function(t,e,n){if(this.getModules(t).set(e,n),n.modules)for(var r in n.modules)this.registerModule(t,"".concat(e&&e!==RootModuleSign?e+".":"").concat(r),n.modules[r])},unregisterModule:function(t,e){this.getModules(t).delete(e)},registerInstance:function(t){this.stores.includes(t)||this.stores.push(t)},unregisterInstance:function(e){var t=this.stores.findIndex(function(t){return t===e});0<=t&&this.stores.splice(t,1)},mergeState:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(e.modules)for(var r in e.modules){var o=e.modules[r],i=o.state,r="".concat(n?n+".":"").concat(r);(0,_object.setData)(t,r,(0,_common.isFunction)(i)?i():i),this.mergeState(t,o,r)}return t},replaceState:function(p,t){var h=this,l=[],d=[];this.setOriginalState(p,t),Reflect.set(p,StateSign,(0,_object.createReactiveObject)(t,t,function(t,e){(0,_object.setData)(h.getOriginalState(p),t,e),l.splice(0).forEach(function(t){t.call(void 0,[(0,_object.getData)(h.getOriginalState(p),t.path)])});var n,r=_createForOfIteratorHelper(h.getWatchers(p));try{for(r.s();!(n=r.n()).done;){var o=n.value;(0,_common.isFunction)(o.getter)&&o.update(void 0,[p.state])}}catch(t){r.e(t)}finally{r.f()}},"",function(t,e,n){var r,o=_createForOfIteratorHelper(h.getInterceptors(p));try{for(o.s();!(r=o.n()).done;){var i=r.value.get;if(i&&!0===i(t,e,n))break}}catch(t){o.e(t)}finally{o.f()}},function(t,e,n){var r,o=_createForOfIteratorHelper(h.getInterceptors(p));try{for(o.s();!(r=o.n()).done;){var i=r.value.set;if(i&&!0===i(t,e,n))break}}catch(t){o.e(t)}finally{o.f()}var a,c=_createForOfIteratorHelper(h.getWatchers(p));try{for(c.s();!(a=c.n()).done;){var u=a.value;d.includes(u)||(u.deep?(u.oldValue=(0,_default.default)(u.oldValue),u.path&&t.startsWith(u.path)&&l.push(u)):u.path&&l.push(u))}}catch(t){c.e(t)}finally{c.f()}},function(t,e,n){var r,o=_createForOfIteratorHelper(h.getInterceptors(p));try{for(o.s();!(r=o.n()).done;){var i=r.value.del;if(i&&!0===i(t,e,n))break}}catch(t){o.e(t)}finally{o.f()}var a,c=_createForOfIteratorHelper(h.getWatchers(p));try{for(c.s();!(a=c.n()).done;){var u=a.value;u.deep&&(u.oldValue=(0,_default.default)(u.oldValue)),u.path?u.call(void 0,[(0,_object.getData)(h.getOriginalState(p),u.path)]):(0,_common.isFunction)(u.getter)&&u.update(void 0,[p.state])}}catch(t){c.e(t)}finally{c.f()}},function(t,e,n,s,f,g,r){var o,i=_createForOfIteratorHelper(h.getInterceptors(p));try{for(i.s();!(o=i.n()).done;){var a=o.value.before;if(a&&!0===a(t,e,n,s,f,g,r))break}}catch(t){i.e(t)}finally{i.f()}if(Array.isArray(r)&&["push","splice","shift","pop","fill","unshift","reverse","copyWithin"].includes(e)){var c,u=_createForOfIteratorHelper(h.getWatchers(p));try{for(u.s();!(c=u.n()).done;){var l=c.value;l.deep?(l.oldValue=(0,_default.default)(l.oldValue),(l.path&&t.startsWith(l.path)||(0,_common.isFunction)(l.getter))&&d.push(l)):l.path&&d.push(l)}}catch(t){u.e(t)}finally{u.f()}}},function(t,e,n,r){var o,i=_createForOfIteratorHelper(h.getInterceptors(p));try{for(i.s();!(o=i.n()).done;){var a=o.value.after;if(a&&!0===a(t,e,n,r))break}}catch(t){i.e(t)}finally{i.f()}d.splice(0).forEach(function(t){t.path&&t.call(void 0,[(0,_object.getData)(h.getOriginalState(p),t.path)])})}))},getPlugins:function(t){return Reflect.get(t,PLUGSign)},getSubscribers:function(t){return Reflect.get(t,SUBSign)},subscribe:function(t,e,n){var r=this,o=this.getSubscribers(t);return o.includes(e)||(n&&!0===n.prepend?o.unshift(e):o.push(e)),function(){r.unsubscribe(t,e)}},unsubscribe:function(t,e){t=this.getSubscribers(t),e=t.indexOf(e);0<=e&&t.splice(e,1)},getActionSubscribers:function(t){return Reflect.get(t,ACTSUBSign)},subscribeAction:function(t,e,n){var r=this,o=this.getActionSubscribers(t);return o.includes(e)||(n&&!0===n.prepend?o.unshift(e):o.push(e)),function(){r.unsubscribe(t,e)}},unsubscribeAction:function(t,e){t=this.getActionSubscribers(t),e=t.indexOf(e);0<=e&&t.splice(e,1)}},Connector={instances:function(){return Configuration.stores},intercept:function(t,e,n,r,o,i){return Configuration.intercept(t,e,n,r,o,i)},cancelIntercept:function(t,e,n,r,o,i){return Configuration.cancelIntercept(t,e,n,r,o,i)},mapState:function(t){var e=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=1?void 0:arguments[1]:null,n=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],r=Configuration.getState(t,e?e.replaceAll("/","."):null),o=Array.isArray(n)?_Stream.Stream.of(n).map(function(t){return[t,t]}).collect(_Stream.Collectors.toMap()):n;return _Stream.Stream.of(Object.keys(o)).map(function(t){var e=o[t];return(0,_common.isString)(e)?[t,function(){return r[e]}]:(0,_common.isFunction)(e)?[t,function(){return e(r)}]:[t,function(){}]}).collect(_Stream.Collectors.toMap())},mapGetters:function(t){var n=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=1?void 0:arguments[1]:"",e=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],r=Configuration.getSpace(t,GetterSign),o=Array.isArray(e)?_Stream.Stream.of(e).map(function(t){return[t,t]}).collect(_Stream.Collectors.toMap()):e;return _Stream.Stream.of(Object.keys(o)).map(function(t){var e=o[t];return[t,function(){return r["".concat(n?n+"/":"").concat(e)]}]}).collect(_Stream.Collectors.toMap())},mapActions:function(t){var n=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=1?void 0:arguments[1]:"",e=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],r=Configuration.getSpace(t,ActionSign),o=Array.isArray(e)?_Stream.Stream.of(e).map(function(t){return[t,t]}).collect(_Stream.Collectors.toMap()):e;return _Stream.Stream.of(Object.keys(o)).map(function(t){var e=o[t];return[t,function(t){return r["".concat(n?n+"/":"").concat(e)](t)}]}).collect(_Stream.Collectors.toMap())},mapMutations:function(t){var n=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=1?void 0:arguments[1]:"",e=1<(arguments.length<=1?0:arguments.length-1)?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],r=Configuration.getSpace(t,MutationSign),o=Array.isArray(e)?_Stream.Stream.of(e).map(function(t){return[t,t]}).collect(_Stream.Collectors.toMap()):e;return _Stream.Stream.of(Object.keys(o)).map(function(t){var e=o[t];return[t,function(t){r["".concat(n?n+"/":"").concat(e)](t)}]}).collect(_Stream.Collectors.toMap())},createNamespacedHelpers:function(e,n){var r=this;return{mapState:function(t){return r.mapState(e,n,t)},mapGetters:function(t){return r.mapGetters(e,n,t)},mapMutations:function(t){return r.mapMutations(e,n,t)},mapActions:function(t){return r.mapActions(e,n,t)}}}},Store=(exports.Connector=Connector,function(){function r(t){var e=this,n=(_classCallCheck(this,r),_defineProperty(this,OriginalState,null),_defineProperty(this,StateSign,null),_defineProperty(this,InterceptorsSign,[]),_defineProperty(this,WATSign,[]),_defineProperty(this,PLUGSign,[]),_defineProperty(this,SUBSign,[]),_defineProperty(this,ACTSUBSign,[]),_defineProperty(this,GetterSign,new Map),_defineProperty(this,ModulesSign,new Map),_defineProperty(this,ActionSign,new Map),_defineProperty(this,MutationSign,new Map),Configuration.mergeState((0,_common.isFunction)(t.state)?t.state():t.state,t));Configuration.defineMutations(this,t),Configuration.defineGetters(this,t),Configuration.defineActions(this,t),Configuration.replaceState(this,n),Configuration.registerModule(this,RootModuleSign,t),Configuration.registerInstance(this),Configuration.getPlugins(this).forEach(function(t){(0,_common.isFunction)(t)&&t.call(void 0,e)})}return _createClass(r,[{key:"registerModule",value:function(t,e){var n=Array.isArray(t)?t.join("."):t;Configuration.mergeState(Configuration.getOriginalState(this),e,n),Configuration.defineMutations(this,e),Configuration.defineGetters(this,e),Configuration.defineActions(this,e),Configuration.registerModule(this,t,e)}},{key:"unregisterModule",value:function(t){if(Configuration.getModules(this).get(t)){var e,n,r=(0,_object.splitPath)(t);try{1<r.length?0<(e=(e=t.lastIndexOf("."))<0?t.lastIndexOf("["):e)&&((n=t.slice(0,e))&&Reflect.deleteProperty((0,_object.getData)(this.state,n),r[r.length-1])):Reflect.deleteProperty(this.state,t)}catch(t){throw t}finally{Configuration.deleteSpace(this,GetterSign,t),Configuration.deleteSpace(this,MutationSign,t),Configuration.deleteSpace(this,ActionSign,t),Configuration.unregisterModule(this,t)}}}},{key:"hasModule",value:function(t){t=Array.isArray(t)?t.join("."):t;return Configuration.getModules(this).has(t)}},{key:"hotUpdate",value:function(t){t&&(Configuration.defineMutations(this,t),Configuration.defineGetters(this,t),Configuration.defineActions(this,t))}},{key:"subscribe",value:function(t,e){return Configuration.subscribe(this,t,e)}},{key:"subscribeAction",value:function(t,e){return Configuration.subscribeAction(this,t,e)}},{key:"replaceState",value:function(t){Configuration.replaceState(this,t)}},{key:"watch",value:function(t,e){return Configuration.watch(this,t,e,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)}},{key:"commit",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Configuration.commit.apply(Configuration,[this,RootModuleSign].concat(e))}},{key:"dispatch",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Configuration.dispatch.apply(Configuration,[this,RootModuleSign].concat(e))}},{key:"state",get:function(){return Configuration.getState(this)}},{key:"getters",get:function(){return Configuration.getSpace(this,GetterSign)}},{key:"plugins",get:function(){return Configuration.getPlugins(this)}}]),r}());exports.default=Store; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createReactiveObject=createReactiveObject,exports.getData=getData,exports.selectPathParent=selectPathParent,exports.selectPathRoot=selectPathRoot,exports.setData=setData,exports.splitPath=splitPath,exports.traceObject=traceObject;var _common=require("./common");function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function selectPathRoot(e){var t=/^\$?[\w]+/.exec(e);if(t)return t[0];t=/^\[(\d+)\]+/.exec(e);if(t)return t[1];t=/^\.(\d+)/.exec(e);return t?t[1]:null}function selectPathParent(e){var t=e.lastIndexOf("[");return 0<=(t=t<0?e.lastIndexOf("."):t)?e.substring(0,t):e}function splitPath(e){for(var t=[],r=e;r;){var n=selectPathRoot(r),o=Number.parseInt(n),r=(Number.isSafeInteger(o)?"."===r[0]?r.substring(n.length+1):r.substring(n.length+2):r.substring(n.length)).replace(/^\./,"");t.push(n)}return t}function traceObject(e,t,r,n,o){if(!e||(0,_common.isPrimitive)(e))return e;for(var c=splitPath(t),t={},i=e,a=t,s=0;s<c.length;++s){var l=c[s],i=Reflect.get(i,l),u=!r||!i||(0,_common.isPrimitive)(i)?i:Array.isArray(i)?_toConsumableArray(i):_objectSpread({},i);if(Reflect.set(a,l,s===c.length-1&&n?o:u),a=Reflect.get(a,l),!i||(0,_common.isPrimitive)(i))break}return t}var OBSign=Symbol("_ob_");function signObject(e){return Object.defineProperty(e,OBSign,{enumerable:!1,value:!0,configurable:!0}),e}function unSignObject(e){if((0,_common.isPrimitive)(e)||(0,_common.isNullOrEmpty)(e))return e;for(var t in e){var r=Reflect.get(e,t);e[t]=unSignObject(r)}var n;return Reflect.has(e,OBSign)?(n=Array.isArray(e)?e.map(function(e){return unSignObject(e)}):_objectSpread({},e),Reflect.deleteProperty(e,OBSign),n):e}var ProxyReaderWriterLock=function(){function e(){_classCallCheck(this,e),_defineProperty(this,"_locked",0)}return _createClass(e,[{key:"isLocked",value:function(){return 0<this._locked}},{key:"lock",value:function(){this._locked++}},{key:"unlock",value:function(){this._locked--}}]),e}(),__rw__=new ProxyReaderWriterLock;function createReactiveObject(p,e){var a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,s=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"",i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:null,l=5<arguments.length&&void 0!==arguments[5]?arguments[5]:null,u=6<arguments.length&&void 0!==arguments[6]?arguments[6]:null,f=7<arguments.length&&void 0!==arguments[7]?arguments[7]:null,m=8<arguments.length&&void 0!==arguments[8]?arguments[8]:null,y=9<arguments.length&&void 0!==arguments[9]?arguments[9]:0,b=10<arguments.length&&void 0!==arguments[10]?arguments[10]:__rw__;return new Proxy(e,{get:function(o,n,e){var c=Reflect.get(o,n,e);return b.isLocked()?c:(0,_common.isFunction)(c)||(0,_common.isPrimitive)(c)||!c||(0,_common.isSymbol)(n)?!b.isLocked()&&(0,_common.isFunction)(i)&&((0,_common.isSymbol)(n)||i("".concat(s?s+".":"").concat(n),c,y,o),"constructor"!==n&&Array.isArray(o)&&(0,_common.isFunction)(c))?function(){var e=c,t=(Array.isArray(o)&&"forEach"===n&&(e=function(e){if(!(0,_common.isFunction)(e))throw new Error("".concat(e," is not a function"));for(var t=0,r=o.length;t<r;++t){var n="".concat(s,"[").concat(t,"]");e(createReactiveObject(p,o[t],a,n,i,l,u,f,m,y+1,b),t)}}),o),r=Array.prototype.slice.call(arguments),e=(!b.isLocked()&&(0,_common.isFunction)(f)&&f(s,n,e,t,r,y,o),e.apply(t,r));return!b.isLocked()&&(0,_common.isFunction)(m)&&m(s,e,y,o),e}.bind(o):c:(e=Number.isSafeInteger(Number.parseInt(n))?"".concat(s,"[").concat(n,"]"):"".concat(s?s+".":"").concat(n),!b.isLocked()&&(0,_common.isFunction)(i)&&i(e,c,y,o),signObject(createReactiveObject(p,c,a,e,i,l,u,f,m,y+1,b)))},set:function(e,t,r,n){if(t!==OBSign&&(b.lock(),r=unSignObject(r),b.unlock()),(0,_common.isSymbol)(t))return Reflect.set(e,t,r,n);var o=Number.parseInt(t);if(Number.isSafeInteger(o)){if(Array.isArray(e))return!b.isLocked()&&(0,_common.isFunction)(a)?((o=Reflect.set(e,t,r,n))&&(c=selectPathRoot(s),i=Reflect.get(p,c),!b.isLocked()&&(0,_common.isFunction)(l)&&l(c,i,y,e),a(c,i)),o):Reflect.set(e,t,r,n);if(b.isLocked()||!(0,_common.isFunction)(a))return Reflect.set(e,t,r,n);var c="".concat(s,"[").concat(t,"]");!b.isLocked()&&(0,_common.isFunction)(l)&&l(c,r,y,e),a(c,r)}else{if(Array.isArray(e)&&"length"===t)return Reflect.set(e,t,r,n);if(b.isLocked()||!(0,_common.isFunction)(a))return Reflect.set(e,t,r,n);var i="".concat(s?s+".":"").concat(t);!b.isLocked()&&(0,_common.isFunction)(l)&&l(i,r,y,e),a(i,r)}return!0},deleteProperty:function(e,t){var r;if((t!==OBSign&&(b.lock(),unSignObject(Reflect.get(e,t)),b.unlock()),!(0,_common.isSymbol)(t)&&/^\d+$/.test(t))&&Array.isArray(e))return r=Number.parseInt(t),!!Reflect.deleteProperty(e,r)&&(r="".concat(s,"[").concat(r,"]"),!b.isLocked()&&(0,_common.isFunction)(u)&&u(r,y,e),!0);return!!Reflect.deleteProperty(e,t)&&((0,_common.isSymbol)(t)||(r="".concat(s?s+".":"").concat(t),!b.isLocked()&&(0,_common.isFunction)(u)&&u(r,y,e)),!0)}})}function getData(e,t){var t=splitPath(t),r=e,n=void 0;return t.forEach(function(e){if(/\d+/.test(e))if(Array.isArray(r)){var t=parseInt(e);if(!Number.isSafeInteger(t))throw new Error('Unexpected range index "'.concat(t,'".'));n=r[t]}else n=r[e];else n=r[e];r=n}),n}function setData(e,t,r){for(var n,o=(0,_common.isSymbol)(t)||(0,_common.isNumber)(t)?[t]:Array.isArray(t)?t:splitPath(t),c=e||{},i=0;i<=o.length-1;++i){var a,s=!Number.isInteger(o[i])&&/^\d+$/.test(o[i])?parseInt(o[i]):o[i];i+1<o.length&&(n=!Number.isInteger(o[i+1])&&/^\d+$/.test(o[i+1])?parseInt(o[i+1]):o[i+1]),i+1<o.length&&(c[s]||(Number.isInteger(n)?(c[s]=[],c[s].length-1<n&&(a=c[s]).push.apply(a,_toConsumableArray(new Array(n-c[s].length+1).fill(void 0)))):c[s]={}),c=c[s])}return c[s]=r,c} | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createReactiveObject=createReactiveObject,exports.dissociateObject=dissociateObject,exports.getData=getData,exports.selectPathParent=selectPathParent,exports.selectPathRoot=selectPathRoot,exports.setData=setData,exports.splitPath=splitPath,exports.traceObject=traceObject;var _common=require("./common");function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function selectPathRoot(e){var t=/^\$?[\w]+/.exec(e);if(t)return t[0];t=/^\[(\d+)\]+/.exec(e);if(t)return t[1];t=/^\.(\d+)/.exec(e);return t?t[1]:null}function selectPathParent(e){var t=e.lastIndexOf("[");return 0<=(t=t<0?e.lastIndexOf("."):t)?e.substring(0,t):e}function splitPath(e){for(var t=[],r=e;r;){var n=selectPathRoot(r),o=Number.parseInt(n),r=(Number.isSafeInteger(o)?"."===r[0]?r.substring(n.length+1):r.substring(n.length+2):r.substring(n.length)).replace(/^\./,"");t.push(n)}return t}function traceObject(e,t,r,n,o){if(!e||(0,_common.isPrimitive)(e))return e;for(var c=splitPath(t),t={},i=e,a=t,s=0;s<c.length;++s){var l=c[s],i=Reflect.get(i,l),u=!r||!i||(0,_common.isPrimitive)(i)?i:Array.isArray(i)?_toConsumableArray(i):_objectSpread({},i);if(Reflect.set(a,l,s===c.length-1&&n?o:u),a=Reflect.get(a,l),!i||(0,_common.isPrimitive)(i))break}return t}var OBSign=Symbol("_ob_");function incorporateObject(e){return Object.defineProperty(e,OBSign,{enumerable:!1,value:!0,configurable:!0}),e}function dissociateObject(e){if((0,_common.isPrimitive)(e)||(0,_common.isNullOrEmpty)(e))return e;for(var t in e){var r=Reflect.get(e,t);e[t]=dissociateObject(r)}var n;return Reflect.has(e,OBSign)?(n=Array.isArray(e)?e.map(function(e){return dissociateObject(e)}):_objectSpread({},e),Reflect.deleteProperty(e,OBSign),n):e}var ProxyReaderWriterLock=function(){function e(){_classCallCheck(this,e),_defineProperty(this,"_locked",0)}return _createClass(e,[{key:"isLocked",value:function(){return 0<this._locked}},{key:"lock",value:function(){this._locked++}},{key:"unlock",value:function(){this._locked--}}]),e}(),__rw__=new ProxyReaderWriterLock;function createReactiveObject(p,e){var a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,s=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"",i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:null,l=5<arguments.length&&void 0!==arguments[5]?arguments[5]:null,u=6<arguments.length&&void 0!==arguments[6]?arguments[6]:null,f=7<arguments.length&&void 0!==arguments[7]?arguments[7]:null,m=8<arguments.length&&void 0!==arguments[8]?arguments[8]:null,y=9<arguments.length&&void 0!==arguments[9]?arguments[9]:0,b=10<arguments.length&&void 0!==arguments[10]?arguments[10]:__rw__;return new Proxy(e,{get:function(o,n,e){var c=Reflect.get(o,n,e);return b.isLocked()?c:(0,_common.isFunction)(c)||(0,_common.isPrimitive)(c)||!c||(0,_common.isSymbol)(n)?!b.isLocked()&&(0,_common.isFunction)(i)&&((0,_common.isSymbol)(n)||i("".concat(s?s+".":"").concat(n),c,y,o),"constructor"!==n&&Array.isArray(o)&&(0,_common.isFunction)(c))?function(){var e=c,t=(Array.isArray(o)&&"forEach"===n&&(e=function(e){if(!(0,_common.isFunction)(e))throw new Error("".concat(e," is not a function"));for(var t=0,r=o.length;t<r;++t){var n="".concat(s,"[").concat(t,"]");e(createReactiveObject(p,o[t],a,n,i,l,u,f,m,y+1,b),t)}}),o),r=Array.prototype.slice.call(arguments),e=(!b.isLocked()&&(0,_common.isFunction)(f)&&f(s,n,e,t,r,y,o),e.apply(t,r));return!b.isLocked()&&(0,_common.isFunction)(m)&&m(s,e,y,o),e}.bind(o):c:(e=Number.isSafeInteger(Number.parseInt(n))?"".concat(s,"[").concat(n,"]"):"".concat(s?s+".":"").concat(n),!b.isLocked()&&(0,_common.isFunction)(i)&&i(e,c,y,o),incorporateObject(createReactiveObject(p,c,a,e,i,l,u,f,m,y+1,b)))},set:function(e,t,r,n){if(t!==OBSign&&(b.lock(),r=dissociateObject(r),b.unlock()),(0,_common.isSymbol)(t))return Reflect.set(e,t,r,n);var o=Number.parseInt(t);if(Number.isSafeInteger(o)){if(Array.isArray(e))return!b.isLocked()&&(0,_common.isFunction)(a)?((o=Reflect.set(e,t,r,n))&&(c=selectPathRoot(s),i=Reflect.get(p,c),!b.isLocked()&&(0,_common.isFunction)(l)&&l(c,i,y,e),a(c,i)),o):Reflect.set(e,t,r,n);if(b.isLocked()||!(0,_common.isFunction)(a))return Reflect.set(e,t,r,n);var c="".concat(s,"[").concat(t,"]");!b.isLocked()&&(0,_common.isFunction)(l)&&l(c,r,y,e),a(c,r)}else{if(Array.isArray(e)&&"length"===t)return Reflect.set(e,t,r,n);if(b.isLocked()||!(0,_common.isFunction)(a))return Reflect.set(e,t,r,n);var i="".concat(s?s+".":"").concat(t);!b.isLocked()&&(0,_common.isFunction)(l)&&l(i,r,y,e),a(i,r)}return!0},deleteProperty:function(e,t){var r;if((t!==OBSign&&(b.lock(),dissociateObject(Reflect.get(e,t)),b.unlock()),!(0,_common.isSymbol)(t)&&/^\d+$/.test(t))&&Array.isArray(e))return r=Number.parseInt(t),!!Reflect.deleteProperty(e,r)&&(r="".concat(s,"[").concat(r,"]"),!b.isLocked()&&(0,_common.isFunction)(u)&&u(r,y,e),!0);return!!Reflect.deleteProperty(e,t)&&((0,_common.isSymbol)(t)||(r="".concat(s?s+".":"").concat(t),!b.isLocked()&&(0,_common.isFunction)(u)&&u(r,y,e)),!0)}})}function getData(e,t){var t=splitPath(t),r=e,n=void 0;return t.forEach(function(e){if(/\d+/.test(e))if(Array.isArray(r)){var t=parseInt(e);if(!Number.isSafeInteger(t))throw new Error('Unexpected range index "'.concat(t,'".'));n=r[t]}else n=r[e];else n=r[e];r=n}),n}function setData(e,t,r){for(var n,o=(0,_common.isSymbol)(t)||(0,_common.isNumber)(t)?[t]:Array.isArray(t)?t:splitPath(t),c=e||{},i=0;i<=o.length-1;++i){var a,s=!Number.isInteger(o[i])&&/^\d+$/.test(o[i])?parseInt(o[i]):o[i];i+1<o.length&&(n=!Number.isInteger(o[i+1])&&/^\d+$/.test(o[i+1])?parseInt(o[i+1]):o[i+1]),i+1<o.length&&(c[s]||(Number.isInteger(n)?(c[s]=[],c[s].length-1<n&&(a=c[s]).push.apply(a,_toConsumableArray(new Array(n-c[s].length+1).fill(void 0)))):c[s]={}),c=c[s])}return c[s]=r,c} |
{ | ||
"name": "wechat-mini-program-extend", | ||
"version": "1.4.9", | ||
"version": "1.4.10", | ||
"repository": "git@github.com:sitorhy/wechat-mini-program-extend.git", | ||
@@ -5,0 +5,0 @@ "author": "sitorhy <sitorhy>", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
239550
0