Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wechat-mini-program-extend

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wechat-mini-program-extend - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

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 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 u=c[s],i=Reflect.get(i,u),l=!r||!i||(0,_common.isPrimitive)(i)?i:Array.isArray(i)?_toConsumableArray(i):_objectSpread({},i);if(Reflect.set(a,u,s===c.length-1&&n?o:l),a=Reflect.get(a,u),!i||(0,_common.isPrimitive)(i))break}return t}var ProxySign=Symbol("__proxy__");function sign(e,t){if((0,_common.isPrimitive)(e)||Object.hasOwnProperty.call(e,ProxySign))return e;t=t(e);return Object.defineProperty(t,ProxySign,{value:!0}),t}function createReactiveObject(a,e){var s=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,u=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,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,p=9<arguments.length&&void 0!==arguments[9]?arguments[9]:0;return new Proxy(e,{get:function(n,o,e){var t,r,c=Reflect.get(n,o,e);return(0,_common.isFunction)(c)||(0,_common.isPrimitive)(c)||!c||(0,_common.isSymbol)(o)?(0,_common.isFunction)(i)&&(i("".concat(u?u+".":"").concat(o),c,p,n),"constructor"!==o&&Array.isArray(n)&&(0,_common.isFunction)(c))?function(){var e=c,t=n,r=Array.prototype.slice.call(arguments),e=((0,_common.isFunction)(m)&&m(u,o,e,t,r,p,n),e.apply(t,r));return(0,_common.isFunction)(y)&&y(u,e,p,n),e}.bind(n):c:Number.isSafeInteger(Number.parseInt(o))?(t="".concat(u,"[").concat(o,"]"),(0,_common.isFunction)(i)&&i(t,c,p,n),sign(c,function(e){return createReactiveObject(a,e,s,t,i,l,f,m,y,p+1)})):(r="".concat(u?u+".":"").concat(o),(0,_common.isFunction)(i)&&i(r,c,p,n),sign(c,function(e){return createReactiveObject(a,e,s,r,i,l,f,m,y,p+1)}))},set:function(e,t,r,n){if((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(0,_common.isFunction)(s)?((o=Reflect.set(e,t,r,n))&&(c=selectPathRoot(u),i=Reflect.get(a,c),(0,_common.isFunction)(l)&&l(c,i,p,e),s(c,i)),o):Reflect.set(e,t,r,n);if(!(0,_common.isFunction)(s))return Reflect.set(e,t,r,n);var c="".concat(u,"[").concat(t,"]");(0,_common.isFunction)(l)&&l(c,r,p,e),s(c,r)}else{if(Array.isArray(e)&&"length"===t)return Reflect.set(e,t,r,n);if(!(0,_common.isFunction)(s))return Reflect.set(e,t,r,n);var i="".concat(u?u+".":"").concat(t);(0,_common.isFunction)(l)&&l(i,r,p,e),s(i,r)}return!0},deleteProperty:function(e,t){var r;if(/^\d+$/.test(t)&&Array.isArray(e))return r=Number.parseInt(t),!!Reflect.deleteProperty(e,r)&&(r="".concat(u,"[").concat(r,"]"),(0,_common.isFunction)(f)&&f(r,p,e),!0);return!!Reflect.deleteProperty(e,t)&&(r="".concat(u?u+".":"").concat(t),(0,_common.isFunction)(f)&&f(r,p,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 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={},a=e,i=t,s=0;s<c.length;++s){var u=c[s],a=Reflect.get(a,u),l=!r||!a||(0,_common.isPrimitive)(a)?a:Array.isArray(a)?_toConsumableArray(a):_objectSpread({},a);if(Reflect.set(i,u,s===c.length-1&&n?o:l),i=Reflect.get(i,u),!a||(0,_common.isPrimitive)(a))break}return t}function createReactiveObject(i,e){var s=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,u=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"",a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:null,l=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,p=9<arguments.length&&void 0!==arguments[9]?arguments[9]:0;return new Proxy(e,{get:function(o,n,e){var c=Reflect.get(o,n,e);return(0,_common.isFunction)(c)||(0,_common.isPrimitive)(c)||!c||(0,_common.isSymbol)(n)?(0,_common.isFunction)(a)&&(a("".concat(u?u+".":"").concat(n),c,p,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(u,"[").concat(t,"]");e(createReactiveObject(i,o[t],s,n,a,l,f,m,y,p+1),t)}}),o),r=Array.prototype.slice.call(arguments),e=((0,_common.isFunction)(m)&&m(u,n,e,t,r,p,o),e.apply(t,r));return(0,_common.isFunction)(y)&&y(u,e,p,o),e}.bind(o):c:Number.isSafeInteger(Number.parseInt(n))?(e="".concat(u,"[").concat(n,"]"),(0,_common.isFunction)(a)&&a(e,c,p,o),createReactiveObject(i,c,s,e,a,l,f,m,y,p+1)):(e="".concat(u?u+".":"").concat(n),(0,_common.isFunction)(a)&&a(e,c,p,o),createReactiveObject(i,c,s,e,a,l,f,m,y,p+1))},set:function(e,t,r,n){if((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(0,_common.isFunction)(s)?((o=Reflect.set(e,t,r,n))&&(c=selectPathRoot(u),a=Reflect.get(i,c),(0,_common.isFunction)(l)&&l(c,a,p,e),s(c,a)),o):Reflect.set(e,t,r,n);if(!(0,_common.isFunction)(s))return Reflect.set(e,t,r,n);var c="".concat(u,"[").concat(t,"]");(0,_common.isFunction)(l)&&l(c,r,p,e),s(c,r)}else{if(Array.isArray(e)&&"length"===t)return Reflect.set(e,t,r,n);if(!(0,_common.isFunction)(s))return Reflect.set(e,t,r,n);var a="".concat(u?u+".":"").concat(t);(0,_common.isFunction)(l)&&l(a,r,p,e),s(a,r)}return!0},deleteProperty:function(e,t){var r;if(/^\d+$/.test(t)&&Array.isArray(e))return r=Number.parseInt(t),!!Reflect.deleteProperty(e,r)&&(r="".concat(u,"[").concat(r,"]"),(0,_common.isFunction)(f)&&f(r,p,e),!0);return!!Reflect.deleteProperty(e,t)&&(r="".concat(u?u+".":"").concat(t),(0,_common.isFunction)(f)&&f(r,p,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.0",
"version": "1.4.1",
"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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc