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

@domql/event

Package Overview
Dependencies
Maintainers
0
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@domql/event - npm Package Compare versions

Comparing version 2.5.168 to 2.5.169

21

dist/cjs/on.js

@@ -30,2 +30,8 @@ "use strict";

var import_utils = require("@domql/utils");
const getOnOrPropsEvent = (param, element) => {
var _a, _b;
const onEvent = (_a = element.on) == null ? void 0 : _a[param];
const onPropEvent = (_b = element.props) == null ? void 0 : _b["on" + param.slice(0, 1).toUpperCase() + param.slice(1)];
return onEvent || onPropEvent;
};
const applyEvent = (param, element, state, context, options) => {

@@ -35,6 +41,6 @@ return param.call(element, element, state || element.state, context || element.context, options);

const triggerEventOn = (param, element, options) => {
var _a;
if (element.on && (0, import_utils.isFunction)(element.on[param])) {
const appliedFunction = getOnOrPropsEvent(param, element);
if (appliedFunction) {
const { state, context } = element;
return applyEvent(element.on[param] || ((_a = element.props) == null ? void 0 : _a[param]), element, state, context, options);
return applyEvent(appliedFunction, element, state, context, options);
}

@@ -46,6 +52,6 @@ };

const triggerEventOnUpdate = (param, updatedObj, element, options) => {
var _a;
if (element.on && (0, import_utils.isFunction)(element.on[param])) {
const appliedFunction = getOnOrPropsEvent(param, element);
if (appliedFunction) {
const { state, context } = element;
return applyEventUpdate(element.on[param] || ((_a = element.props) == null ? void 0 : _a[param]), updatedObj, element, state, context, options);
return applyEventUpdate(appliedFunction, updatedObj, element, state, context, options);
}

@@ -63,3 +69,2 @@ };

const applyEventsOnNode = (element, options) => {
var _a;
const { node, on } = element;

@@ -69,3 +74,3 @@ for (const param in on) {

continue;
const appliedFunction = element.on[param] || ((_a = element.props) == null ? void 0 : _a[param]);
const appliedFunction = getOnOrPropsEvent(param, element);
if ((0, import_utils.isFunction)(appliedFunction)) {

@@ -72,0 +77,0 @@ node.addEventListener(param, (event) => {

@@ -5,2 +5,8 @@ 'use strict'

const getOnOrPropsEvent = (param, element) => {
const onEvent = element.on?.[param]
const onPropEvent = element.props?.['on' + param.slice(0, 1).toUpperCase() + param.slice(1)]
return onEvent || onPropEvent
}
export const applyEvent = (param, element, state, context, options) => {

@@ -11,5 +17,6 @@ return param.call(element, element, state || element.state, context || element.context, options)

export const triggerEventOn = (param, element, options) => {
if (element.on && isFunction(element.on[param])) {
const appliedFunction = getOnOrPropsEvent(param, element)
if (appliedFunction) {
const { state, context } = element
return applyEvent(element.on[param] || element.props?.[param], element, state, context, options)
return applyEvent(appliedFunction, element, state, context, options)
}

@@ -23,5 +30,6 @@ }

export const triggerEventOnUpdate = (param, updatedObj, element, options) => {
if (element.on && isFunction(element.on[param])) {
const appliedFunction = getOnOrPropsEvent(param, element)
if (appliedFunction) {
const { state, context } = element
return applyEventUpdate(element.on[param] || element.props?.[param], updatedObj, element, state, context, options)
return applyEventUpdate(appliedFunction, updatedObj, element, state, context, options)
}

@@ -60,3 +68,3 @@ }

const appliedFunction = element.on[param] || element.props?.[param]
const appliedFunction = getOnOrPropsEvent(param, element)
if (isFunction(appliedFunction)) {

@@ -63,0 +71,0 @@ node.addEventListener(param, event => {

{
"name": "@domql/event",
"version": "2.5.168",
"version": "2.5.169",
"license": "MIT",

@@ -31,5 +31,5 @@ "type": "module",

"@domql/report": "^2.5.162",
"@domql/utils": "^2.5.168"
"@domql/utils": "^2.5.169"
},
"gitHead": "6c935c3d1ff70096bb532e9c5426ffc5af0677dc"
"gitHead": "ae523f95551eac614ee00baf3c425cb6c4271a2c"
}
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