Socket
Socket
Sign inDemoInstall

wechat-mini-program-extend

Package Overview
Dependencies
0
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.4.5 to 1.4.6

2

dist/utils/object.js

@@ -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))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(a,e){var s=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,l=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"",i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:null,u=5<arguments.length&&void 0!==arguments[5]?arguments[5]:null,f=6<arguments.length&&void 0!==arguments[6]?arguments[6]:null,m=7<arguments.length&&void 0!==arguments[7]?arguments[7]:null,y=8<arguments.length&&void 0!==arguments[8]?arguments[8]:null,b=9<arguments.length&&void 0!==arguments[9]?arguments[9]:0,p=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 p.isLocked()?c:(0,_common.isFunction)(c)||(0,_common.isPrimitive)(c)||!c||(0,_common.isSymbol)(n)?!p.isLocked()&&(0,_common.isFunction)(i)&&((0,_common.isSymbol)(n)||i("".concat(l?l+".":"").concat(n),c,b,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(l,"[").concat(t,"]");e(createReactiveObject(a,o[t],s,n,i,u,f,m,y,b+1,p),t)}}),o),r=Array.prototype.slice.call(arguments),e=(!p.isLocked()&&(0,_common.isFunction)(m)&&m(l,n,e,t,r,b,o),e.apply(t,r));return!p.isLocked()&&(0,_common.isFunction)(y)&&y(l,e,b,o),e}.bind(o):c:(e=Number.isSafeInteger(Number.parseInt(n))?"".concat(l,"[").concat(n,"]"):"".concat(l?l+".":"").concat(n),!p.isLocked()&&(0,_common.isFunction)(i)&&i(e,c,b,o),signObject(createReactiveObject(a,c,s,e,i,u,f,m,y,b+1,p)))},set:function(e,t,r,n){if(t!==OBSign&&(p.lock(),r=unSignObject(r),p.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!p.isLocked()&&(0,_common.isFunction)(s)?((o=Reflect.set(e,t,r,n))&&(c=selectPathRoot(l),i=Reflect.get(a,c),!p.isLocked()&&(0,_common.isFunction)(u)&&u(c,i,b,e),s(c,i)),o):Reflect.set(e,t,r,n);if(p.isLocked()||!(0,_common.isFunction)(s))return Reflect.set(e,t,r,n);var c="".concat(l,"[").concat(t,"]");!p.isLocked()&&(0,_common.isFunction)(u)&&u(c,r,b,e),s(c,r)}else{if(Array.isArray(e)&&"length"===t)return Reflect.set(e,t,r,n);if(p.isLocked()||!(0,_common.isFunction)(s))return Reflect.set(e,t,r,n);var i="".concat(l?l+".":"").concat(t);!p.isLocked()&&(0,_common.isFunction)(u)&&u(i,r,b,e),s(i,r)}return!0},deleteProperty:function(e,t){var r;if((t!==OBSign&&(p.lock(),unSignObject(Reflect.get(e,t)),p.unlock()),!(0,_common.isSymbol)(t)&&/^\d+$/.test(t))&&Array.isArray(e))return r=Number.parseInt(t),!!Reflect.deleteProperty(e,r)&&(r="".concat(l,"[").concat(r,"]"),!p.isLocked()&&(0,_common.isFunction)(f)&&f(r,b,e),!0);return!!Reflect.deleteProperty(e,t)&&((0,_common.isSymbol)(t)||(r="".concat(l?l+".":"").concat(t),!p.isLocked()&&(0,_common.isFunction)(f)&&f(r,b,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(t,c){Object.keys(c).forEach(function(e){var r=splitPath(e),n=c[e],o=t;r.forEach(function(e,t){if(t===r.length-1)o[e]=n;else if(/\d+/.test(e))if(Array.isArray(o)){t=parseInt(e);if(!Number.isSafeInteger(t))throw new Error('Unexpected range index "'.concat(t,'".'));o=o[t]}else o=o[e];else o=o[e]})})}
"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(a,e){var s=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,l=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"",i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:null,u=5<arguments.length&&void 0!==arguments[5]?arguments[5]:null,f=6<arguments.length&&void 0!==arguments[6]?arguments[6]:null,m=7<arguments.length&&void 0!==arguments[7]?arguments[7]:null,y=8<arguments.length&&void 0!==arguments[8]?arguments[8]:null,b=9<arguments.length&&void 0!==arguments[9]?arguments[9]:0,p=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 p.isLocked()?c:(0,_common.isFunction)(c)||(0,_common.isPrimitive)(c)||!c||(0,_common.isSymbol)(n)?!p.isLocked()&&(0,_common.isFunction)(i)&&((0,_common.isSymbol)(n)||i("".concat(l?l+".":"").concat(n),c,b,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(l,"[").concat(t,"]");e(createReactiveObject(a,o[t],s,n,i,u,f,m,y,b+1,p),t)}}),o),r=Array.prototype.slice.call(arguments),e=(!p.isLocked()&&(0,_common.isFunction)(m)&&m(l,n,e,t,r,b,o),e.apply(t,r));return!p.isLocked()&&(0,_common.isFunction)(y)&&y(l,e,b,o),e}.bind(o):c:(e=Number.isSafeInteger(Number.parseInt(n))?"".concat(l,"[").concat(n,"]"):"".concat(l?l+".":"").concat(n),!p.isLocked()&&(0,_common.isFunction)(i)&&i(e,c,b,o),signObject(createReactiveObject(a,c,s,e,i,u,f,m,y,b+1,p)))},set:function(e,t,r,n){if(t!==OBSign&&(p.lock(),r=unSignObject(r),p.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!p.isLocked()&&(0,_common.isFunction)(s)?((o=Reflect.set(e,t,r,n))&&(c=selectPathRoot(l),i=Reflect.get(a,c),!p.isLocked()&&(0,_common.isFunction)(u)&&u(c,i,b,e),s(c,i)),o):Reflect.set(e,t,r,n);if(p.isLocked()||!(0,_common.isFunction)(s))return Reflect.set(e,t,r,n);var c="".concat(l,"[").concat(t,"]");!p.isLocked()&&(0,_common.isFunction)(u)&&u(c,r,b,e),s(c,r)}else{if(Array.isArray(e)&&"length"===t)return Reflect.set(e,t,r,n);if(p.isLocked()||!(0,_common.isFunction)(s))return Reflect.set(e,t,r,n);var i="".concat(l?l+".":"").concat(t);!p.isLocked()&&(0,_common.isFunction)(u)&&u(i,r,b,e),s(i,r)}return!0},deleteProperty:function(e,t){var r;if((t!==OBSign&&(p.lock(),unSignObject(Reflect.get(e,t)),p.unlock()),!(0,_common.isSymbol)(t)&&/^\d+$/.test(t))&&Array.isArray(e))return r=Number.parseInt(t),!!Reflect.deleteProperty(e,r)&&(r="".concat(l,"[").concat(r,"]"),!p.isLocked()&&(0,_common.isFunction)(f)&&f(r,b,e),!0);return!!Reflect.deleteProperty(e,t)&&((0,_common.isSymbol)(t)||(r="".concat(l?l+".":"").concat(t),!p.isLocked()&&(0,_common.isFunction)(f)&&f(r,b,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(t,c){Object.keys(c).forEach(function(e){var r=splitPath(e),n=c[e],o=t;r.forEach(function(e,t){if(t===r.length-1)o[e]=n;else if(/\d+/.test(e))if(Array.isArray(o)){t=parseInt(e);if(!Number.isSafeInteger(t))throw new Error('Unexpected range index "'.concat(t,'".'));o=o[t]}else o=o[e];else o=o[e]})})}
{
"name": "wechat-mini-program-extend",
"version": "1.4.5",
"version": "1.4.6",
"repository": "git@github.com:sitorhy/wechat-mini-program-extend.git",

@@ -5,0 +5,0 @@ "author": "sitorhy <sitorhy>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc