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

@xm-fe/xm-mp-log

Package Overview
Dependencies
Maintainers
3
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xm-fe/xm-mp-log - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

4

lib/xm-mp-log.es5.min.js

@@ -1,2 +0,2 @@

/*! @xm-fe/xm-mp-log 0.0.4 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).monitor={})}(this,(function(t){"use strict";function e(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,r)}return o}function o(t){return o="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},o(t)}function r(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var n={uid:"",phone:"",cid:"",logUrl:"",logstores:"fe-test",env:2,isDev:!1,set:function(t){t.logUrl&&(this.logUrl=t.logUrl),t.logstores&&(this.logstores=t.logstores),t.uid&&(this.uid=t.uid),t.isDev&&(this.isDev=t.isDev)},customLog:function(t,e){this.log(this.level.log,this.type.custom,{msg:t,ext:e})},warn:function(t,e){this.log(this.level.warn,this.type.custom,{msg:t,ext:e})},onResponse:function(t,e){try{if(200!=t.statusCode){var o={ap:e.apiPath,code:t.statusCode,msg:t.data.message||t.data.error,ai:JSON.stringify({data:e.data,method:e.method||"get",header:e.header})};n.log(this.level.error,this.type.api,o)}}catch(t){console.log(t)}},onError:function(t){this.log(this.level.error,this.type.js,{msg:t})},onFail:function(t,e){try{var o={};o=t&&(t.errMsg||t.errno||t.errCode)?{msg:t.errMsg,eno:t.errno,eco:t.errCode}:{ext:t},e&&e.apiPath?(o.ap=e.apiPath,o.ai=JSON.stringify({data:e.data,method:e.method||"get",header:e.header})):e&&(o.extt=e),this.log(this.level.error,this.type.fail,o)}catch(t){console.log(t)}},log:function(t,o,i){try{var c=wx.getAccountInfoSync().miniProgram;if(!n.isDev&&"develop"==c.envVersion)return;var s=function(t){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?e(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({url:getCurrentPages().map((function(t){return t.route})).join("_"),mpv:JSON.stringify({v:c.version,e:c.envVersion}),cid:n.cid,uid:n.uid,en:n.env,le:t,tp:o},i);s.ext&&(s.ext=n._toStr(s.ext));var a=n.logUrl+(n.isDev?"fe-test":n.logstores)+"/track_ua.gif";wx.request({url:"".concat(a,"?APIVersion=0.6.0&").concat(n.objectToQuery(s))})}catch(t){console.log(t)}},jsError:function(t,e,o){this.log(this.level.error,this.type.js,{msg:t,stack:e,ext:o})},level:{log:"l",error:"e",warn:"w"},type:{click:"cl",pv:"pv",custom:"c",api:"a",js:"j",src:"s",promise:"p",fail:"f"},_toStr:function(t){return"object"===o(t)?JSON.stringify(t):t},_getStr:function(t,e,o){if("[object Object]"==Object.prototype.toString.call(t))for(var r in t)this._getStr(t[r],e+"."+r,o);else"[object Array]"==Object.prototype.toString.call(t)?t.forEach((function(t){o.push("".concat(e,"=").concat(encodeURIComponent(t)))})):o.push("".concat(e,"=").concat(encodeURIComponent(t)))},objectToQuery:function(t){var e=[];for(var o in t)void 0!==t[o]&&this._getStr(t[o],o,e);return e.join("&")},getCRId:function(){var t=Date.now()+"-"+Math.random().toString().slice(2);return this.phone?this.phone+"-"+t:"000-"+t}};try{var i=wx.getStorageSync("_xm_log_cid");i?n.cid=i:(n.cid=Date.now()+"-"+Math.random().toString().slice(2),wx.setStorage({key:"_xm_log_cid",data:n.cid}))}catch(t){console.log(t)}t._xmLog=n,Object.defineProperty(t,"__esModule",{value:!0})}));
/*! @xm-fe/xm-mp-log 0.0.3 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).monitor={})}(this,(function(e){"use strict";function t(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var n={uid:"",cid:"",logUrl:"",logstores:"fe-test",env:2,isDev:!1,set:function(e){e.logUrl&&(this.logUrl=e.logUrl),e.logstores&&(this.logstores=e.logstores),e.uid&&(this.uid=e.uid),e.isDev&&(this.isDev=e.isDev)},customLog:function(e,t){this.log(this.level.log,this.type.custom,{msg:e,ext:t})},warn:function(e,t){this.log(this.level.warn,this.type.custom,{msg:e,ext:t})},onResponse:function(e,t){try{if(200!=e.statusCode){var o={ap:t.apiPath,code:e.statusCode,msg:e.data.message||e.data.error,ai:JSON.stringify({data:t.data,method:t.method||"get",header:t.header})};n.log(this.level.error,this.type.api,o)}}catch(e){console.log(e)}},onError:function(e){this.log(this.level.error,this.type.js,{msg:e})},onFail:function(e,t){try{var o={};o=e&&(e.errMsg||e.errno||e.errCode)?{msg:e.errMsg,eno:e.errno,eco:e.errCode}:{ext:e},t&&t.apiPath?(o.ap=t.apiPath,o.ai=JSON.stringify({data:t.data,method:t.method||"get",header:t.header})):t&&(o.extt=t),this.log(this.level.error,this.type.fail,o)}catch(e){console.log(e)}},log:function(e,o,i){try{var c=wx.getAccountInfoSync().miniProgram;if(!n.isDev&&"develop"==c.envVersion)return;var s=function(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?t(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({url:getCurrentPages().map((function(e){return e.route})).join("_"),mpv:JSON.stringify({v:c.version,e:c.envVersion}),cid:n.cid,uid:n.uid,en:n.env,le:e,tp:o},i);s.ext&&(s.ext=n._toStr(s.ext));var a=n.logUrl+(n.isDev?"fe-test":n.logstores)+"/track_ua.gif";wx.request({url:"".concat(a,"?APIVersion=0.6.0&").concat(n.objectToQuery(s))})}catch(e){console.log(e)}},jsError:function(e,t,o){this.log(this.level.error,this.type.js,{msg:e,stack:t,ext:o})},level:{log:"l",error:"e",warn:"w"},type:{click:"cl",pv:"pv",custom:"c",api:"a",js:"j",src:"s",promise:"p",fail:"f"},_toStr:function(e){return"object"===o(e)?JSON.stringify(e):e},_getStr:function(e,t,o){if("[object Object]"==Object.prototype.toString.call(e))for(var r in e)this._getStr(e[r],t+"."+r,o);else"[object Array]"==Object.prototype.toString.call(e)?e.forEach((function(e){o.push("".concat(t,"=").concat(encodeURIComponent(e)))})):o.push("".concat(t,"=").concat(encodeURIComponent(e)))},objectToQuery:function(e){var t=[];for(var o in e)void 0!==e[o]&&this._getStr(e[o],o,t);return t.join("&")}};try{var i=wx.getStorageSync("_xm_log_cid");i?n.cid=i:(n.cid=Date.now()+"-"+Math.ceil(1e6*Math.random()),wx.setStorage({key:"_xm_log_cid",data:n.cid}))}catch(e){console.log(e)}e._xmLog=n,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "@xm-fe/xm-mp-log",
"version": "0.0.4",
"version": "0.0.5",
"description": "xm-mp-log",

@@ -5,0 +5,0 @@ "keywords": [

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