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

@iroomit/page-interaction-listener

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iroomit/page-interaction-listener - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

babel.config.json

14

package.json
{
"name": "@iroomit/page-interaction-listener",
"version": "1.1.0",
"version": "1.1.1",
"description": "Takes a function (or several functions) as an argument and only executes them once the user has interacted with the page via mouse, keyboard or touch.",

@@ -8,3 +8,4 @@ "main": "lib/index.min.js",

"scripts": {
"build": "npx tsc && npx minify ./lib/index.js > ./lib/index.min.js"
"build": "npx tsc && npx minify ./lib/index.js > ./lib/index.min.js",
"test": "yarn build && jest"
},

@@ -32,4 +33,13 @@ "repository": {

"devDependencies": {
"@babel/core": "^7.22.5",
"@babel/preset-env": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@jest/globals": "^29.5.0",
"babel-jest": "^29.5.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.3"
}
}
# Page Interaction Listener (@iroomit/page-interaction-listener)
[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
![Version](https://img.shields.io/badge/Version-1.1.1-blue)
The purpose of this package is to easily delay code from running in the browser until the user has interacted with the page in some way (mouse-over, click, touch, scroll or keypress).

@@ -4,0 +7,0 @@

8

src/index.ts

@@ -32,7 +32,7 @@ /**

if (func instanceof Array<Function>) { // if it's an array, add all the functions to listeners variable
if (Array.isArray(func)) { // if it's an array, add all the functions to listeners variable
for (var i: number = 0; i < func.length; i++) {
_listeners.push(func[i]);
}
} else if (func instanceof Function) { // otherwise, push the function
} else if (typeof func === 'function') { // otherwise, push the function
_listeners.push(func);

@@ -56,3 +56,3 @@ }

if (func instanceof Array<Function>) { // if it's an array, remove all the functions found in listeners variable
if (Array.isArray(func)) { // if it's an array, remove all the functions found in listeners variable
for (var i: number = 0; i < func.length; i++) {

@@ -67,3 +67,3 @@ let foundIndex: number = _listeners.indexOf(func[i]);

}
} else if (func instanceof Function) { // otherwise, remove the single function if found
} else if (typeof func === 'function') { // otherwise, remove the single function if found
let foundIndex: number = _listeners.indexOf(func);

@@ -70,0 +70,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