@domql/utils 2.28.28 → 2.28.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,7 +64,8 @@ var import_array = require("./array.js");
64
64
  var import_string = require("./string.js");
65
65
  var import_node = require("./node.js");
66
66
  var import_env = require("./env.js");
67
- const exec = (param, element, state, context) => {
67
+ function exec(param, element, state, context) {
68
+ if (!element) element = this;
68
69
  if ((0, import_types.isFunction)(param)) {
69
70
  try {
70
71
  const result = param.call(
@@ -85,7 +86,7 @@ const exec = (param, element, state, context) => {
85
86
  }
86
87
  }
87
88
  return param;
88
- };
89
+ }
89
90
  const map = (obj, extention, element) => {
90
91
  for (const e in extention) {
91
92
  obj[e] = exec(extention[e], element);
@@ -33,7 +33,8 @@ import { mergeAndCloneIfArray, mergeArray } from "./array.js";
33
33
  import { stringIncludesAny } from "./string.js";
34
34
  import { isDOMNode } from "./node.js";
35
35
  import { isNotProduction } from "./env.js";
36
- const exec = (param, element, state, context) => {
36
+ function exec(param, element, state, context) {
37
+ if (!element) element = this;
37
38
  if (isFunction(param)) {
38
39
  try {
39
40
  const result = param.call(
@@ -54,7 +55,7 @@ const exec = (param, element, state, context) => {
54
55
  }
55
56
  }
56
57
  return param;
57
- };
58
+ }
58
59
  const map = (obj, extention, element) => {
59
60
  for (const e in extention) {
60
61
  obj[e] = exec(extention[e], element);
package/object.js CHANGED
@@ -30,7 +30,8 @@ import { isNotProduction } from './env.js'
30
30
  * @param {Object} context - The context to pass to the function
31
31
  * @returns {any|Promise} - The result or a Promise to the result
32
32
  */
33
- export const exec = (param, element, state, context) => {
33
+ export function exec (param, element, state, context) {
34
+ if (!element) element = this
34
35
  if (isFunction(param)) {
35
36
  try {
36
37
  // Call the function with the specified context and parameters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.28.28",
3
+ "version": "2.28.30",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -24,7 +24,7 @@
24
24
  "build": "npx rimraf -I dist; npm run build:cjs; npm run build:esm",
25
25
  "prepublish": "npm run build; npm run copy:package:cjs"
26
26
  },
27
- "gitHead": "1d73e6b00310123bed4c162e08cd2a689a612dbf",
27
+ "gitHead": "e8a66472ec1d33335229b756ff3796c03cfa6e5e",
28
28
  "devDependencies": {
29
29
  "@babel/core": "^7.26.0"
30
30
  }