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

@any-touch/tap

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@any-touch/tap - npm Package Compare versions

Comparing version 2.0.2-alpha.1 to 2.0.2

dist/index.js.map

1

dist/index.js
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@any-touch/shared"),t=require("@any-touch/vector"),a=require("@any-touch/compute"),i={name:"tap",pointLength:1,tapTimes:1,waitNextTapTime:300,maxDistance:2,maxDistanceFromPrevTap:9,maxPressTime:250};exports.default=function(n,r){var o,m,s,u=e.createPluginContext(i,r),c=0;function p(){c=0,o=void 0,m=void 0}return n.compute([a.ComputeDistance,a.ComputeMaxLength],(function(a){if(!e.isDisabled(u)){var i,r,x,T,v=a.phase,f=a.x,h=a.y;if(e.TYPE_END===v)u.state=0,i=a.startInput,r=a.pointLength,x=a.timestamp-i.timestamp,T=a.distance,a.maxPointLength===u.pointLength&&0===r&&u.maxDistance>=T&&u.maxPressTime>x?(clearTimeout(s),function(e,a){if(void 0!==o){var i=t.getVLength({x:e.x-o.x,y:e.y-o.y});return o=e,a.maxDistanceFromPrevTap>=i}return o=e,!0}({x:f,y:h},u)&&function(e){var t=performance.now();if(void 0===m)return m=t,!0;var a=t-m;return m=t,a<e}(u.waitNextTapTime)?c++:c=1,0==c%u.tapTimes?(u.state=1,n.emit2(u.name,a,u),p()):s=setTimeout((function(){u.state=2,p()}),u.waitNextTapTime)):(p(),u.state=2)}})),u};
//# sourceMappingURL=index.js.map

10

package.json
{
"name": "@any-touch/tap",
"version": "2.0.2-alpha.1",
"version": "2.0.2",
"description": "any-touch的识别器, 用来识别点击手势.",

@@ -11,5 +11,5 @@ "main": "./dist/index",

"dependencies": {
"@any-touch/compute": "^2.0.2-alpha.1",
"@any-touch/shared": "^2.0.2-alpha.1",
"@any-touch/vector": "^2.0.2-alpha.1"
"@any-touch/compute": "^2.0.2",
"@any-touch/shared": "^2.0.2",
"@any-touch/vector": "^2.0.2"
},

@@ -23,3 +23,3 @@ "files": [

"sideEffects": false,
"gitHead": "6448e271ecbc59ba49d220264ff4f5ab19950b87"
"gitHead": "7df4617ecb8b89c720ce9747cdd77554c4966a88"
}
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