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

@arms/rum-miniapp

Package Overview
Dependencies
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arms/rum-miniapp - npm Package Compare versions

Comparing version 0.0.30 to 0.0.31

3

lib/collector/application/index.js

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

"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_rumCore=require("@arms/rum-core"),_platform=require("../../utils/platform"),ApplicationCollector=exports["default"]=/*#__PURE__*/function(){function a(){var a=this;this.name="application-collector",this.ctx=void 0,this.sendEvent=void 0,this.perfObserver=void 0,this.observerHandler=function(b){console.log("observerHandler",b);var c=(0,_rumCore.isArray)(b)?b:b.getEntries();if(Array.isArray(c)&&0<c.length)for(var d,e=0;e<c.length;e++)if(d=c[e],"number"==typeof d.duration&&0<d.duration){var f=a.ctx.session.getBaseEvent(),g=(0,_extends2["default"])({},f,{event_type:_rumCore.RumEventType.APPLICATION,type:"launch",name:"",duration:0,snapshots:JSON.stringify(d)});switch(d.name){case"appLaunch":case"app-click":g.name="cold_lunch",g.duration=d.duration;break;case"downloadPackage":case"miniprogram-package":g.name="download_package",g.duration=d.duration;break;case"evaluateScript":case"app-service":var h=d.moduleName||d.packageName;"__APP__"===h&&(g.name="evaluate_script",g.duration=d.duration);break;default:}g.name&&0<g.duration&&6e5>g.duration&&a.sendEvent(g)}}}var b=a.prototype;return b.setup=function setup(a,b){var c=this,d=a.getConfig(),e=d.collectors,f=void 0===e?{}:e;if(!1!==f.application){this.ctx=a,this.sendEvent=b;var g=(0,_platform.getPerformance)();if(g&&g.createObserver){var h=[];if("wechat"===_platform.appName||"alipay"===_platform.appName)h=["navigation","script","loadPackage"];else if("bytedance"===_platform.appName)h=["launch","evaluate","resource"];else return;(0,_rumCore.delay)(function(){c.observerHandler(g.getEntries().filter(function(a){return h.includes(a.entryType)})),c.perfObserver=g.createObserver(c.observerHandler),c.perfObserver.observe({entryTypes:h})},1e3)}}},b.destroy=function destroy(){this.perfObserver&&this.perfObserver.disconnect()},a}();/*
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_rumCore=require("@arms/rum-core"),_platform=require("../../utils/platform"),ApplicationCollector=exports["default"]=/*#__PURE__*/function(){function a(){var a=this;this.name="application-collector",this.ctx=void 0,this.sendEvent=void 0,this.perfObserver=void 0,this.observerHandler=function(b){console.log("observerHandler",b);var c=(0,_rumCore.isArray)(b)?b:b.getEntries();if(Array.isArray(c)&&0<c.length)for(var d,e=0;e<c.length;e++)if(d=c[e],"number"==typeof d.duration&&0<d.duration){var f=a.ctx.session.getBaseEvent(),g=(0,_extends2["default"])({},f,{event_type:_rumCore.RumEventType.APPLICATION,// type: 'launch',
state:"",duration:0,snapshots:JSON.stringify(d)});switch(d.name){case"appLaunch":case"app-click":g.state="cold_lunch",g.duration=d.duration;break;case"downloadPackage":case"miniprogram-package":g.state="download_package",g.duration=d.duration;break;case"evaluateScript":case"app-service":var h=d.moduleName||d.packageName;"__APP__"===h&&(g.state="evaluate_script",g.duration=d.duration);break;default:}g.name&&0<g.duration&&6e5>g.duration&&a.sendEvent(g)}}}var b=a.prototype;return b.setup=function setup(a,b){var c=this,d=a.getConfig(),e=d.collectors,f=void 0===e?{}:e;if(!1!==f.application){this.ctx=a,this.sendEvent=b;var g=(0,_platform.getPerformance)();if(g&&g.createObserver){var h=[];if("wechat"===_platform.appName||"alipay"===_platform.appName)h=["navigation","script","loadPackage"];else if("bytedance"===_platform.appName)h=["launch","evaluate","resource"];else return;(0,_rumCore.delay)(function(){c.observerHandler(g.getEntries().filter(function(a){return h.includes(a.entryType)})),c.perfObserver=g.createObserver(c.observerHandler),c.perfObserver.observe({entryTypes:h})},1e3)}}},b.destroy=function destroy(){this.perfObserver&&this.perfObserver.disconnect()},a}();/*
* 参考资料:

@@ -3,0 +4,0 @@ * https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceEntry.html

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

"use strict";exports.__esModule=!0,exports["default"]=exports.appName=exports.VERSION=exports.HEADER_KEY=void 0,exports.getPerformance=getPerformance,exports.getStorageSync=getStorageSync,exports.sdk=void 0,exports.setStorageSync=setStorageSync;var VERSION=exports.VERSION='npm-0.0.30',OBJ="object",qqName="qq",bytedanceName="bytedance",wechatName="wechat",dingtalkName="dingtalk",alipayName="alipay",swanName="swan",jdName="jd";/**
"use strict";exports.__esModule=!0,exports["default"]=exports.appName=exports.VERSION=exports.HEADER_KEY=void 0,exports.getPerformance=getPerformance,exports.getStorageSync=getStorageSync,exports.sdk=void 0,exports.setStorageSync=setStorageSync;var VERSION=exports.VERSION='npm-0.0.31',OBJ="object",qqName="qq",bytedanceName="bytedance",wechatName="wechat",dingtalkName="dingtalk",alipayName="alipay",swanName="swan",jdName="jd";/**
* 获取跨平台的 SDK

@@ -3,0 +3,0 @@ */function getSDK(){var a,b="unknown";if(typeof swan===OBJ)a=swan,b=swanName;else if(typeof qq===OBJ)// qq的全局也有wx命名空间,和qq等效,这会导致判断AppName失效

{
"name": "@arms/rum-miniapp",
"version": "0.0.30",
"version": "0.0.31",
"description": "arms rum javascript sdk for miniapp",

@@ -26,3 +26,3 @@ "author": "guangli.fj <guangli.fj@alibaba-inc.com>",

"dependencies": {
"@arms/rum-core": "0.0.30"
"@arms/rum-core": "0.0.31"
},

@@ -29,0 +29,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

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