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

@mpxjs/api-proxy

Package Overview
Dependencies
Maintainers
13
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mpxjs/api-proxy - npm Package Compare versions

Comparing version 2.9.6 to 2.9.9

4

package.json
{
"name": "@mpxjs/api-proxy",
"version": "2.9.6",
"version": "2.9.9",
"description": "convert miniprogram API at each end",

@@ -42,3 +42,3 @@ "module": "src/index.js",

},
"gitHead": "9034343edacc95da66b6e8ddb5c2f64a4be97231"
"gitHead": "7ec6526f024c00f9c6b935c631bfdc61be27b69b"
}

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

import { isBrowser } from './utils'
function webHandleSuccess (result, success, complete) {

@@ -36,19 +38,27 @@ typeof success === 'function' && success(result)

function bindTap (dom, handler) {
let startTime = 0; let x = 0; let y = 0
const touchStart = (e) => {
startTime = Date.now()
x = e.touches[0].pageX
y = e.touches[0].pageY
}
const touchEnd = (e) => {
if (Date.now() - startTime < 300 && Math.abs(e.changedTouches[0].pageX - x) < 10 && Math.abs(e.changedTouches[0].pageY - y) < 10) {
handler(e)
const isTouchDevice = isBrowser && document && ('ontouchstart' in document.documentElement)
if (isTouchDevice) {
let startTime = 0; let x = 0; let y = 0
const touchStart = (e) => {
startTime = Date.now()
x = e.touches[0].pageX
y = e.touches[0].pageY
}
const touchEnd = (e) => {
if (Date.now() - startTime < 300 && Math.abs(e.changedTouches[0].pageX - x) < 10 && Math.abs(e.changedTouches[0].pageY - y) < 10) {
handler(e)
}
}
dom.addEventListener('touchstart', touchStart)
dom.addEventListener('touchend', touchEnd)
return () => {
dom.removeEventListener('touchstart', touchStart)
dom.removeEventListener('touchend', touchEnd)
}
} else {
dom.addEventListener('click', handler)
return () => {
dom.removeEventListener('click', handler)
}
}
dom.addEventListener('touchstart', touchStart)
dom.addEventListener('touchend', touchEnd)
return () => {
dom.removeEventListener('touchstart', touchStart)
dom.removeEventListener('touchend', touchEnd)
}
}

@@ -55,0 +65,0 @@

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