@domql/element 2.31.0 → 2.31.1
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.
|
@@ -309,8 +309,7 @@ function variables(obj = {}) {
|
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
311
|
function call(fnKey, ...args) {
|
|
312
|
-
|
|
313
|
-
const fn = ((_a = this.context.utils) == null ? void 0 : _a[fnKey]) || ((_b = this.context.functions) == null ? void 0 : _b[fnKey]) || ((_c = this.context.methods) == null ? void 0 : _c[fnKey]) || ((_d = this.context.snippets) == null ? void 0 : _d[fnKey]);
|
|
312
|
+
const fn = import_utils.getContextFunction.call(this, fnKey);
|
|
314
313
|
if (!fn) return void 0;
|
|
315
314
|
try {
|
|
316
315
|
const result = fn.call(this, ...args);
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
isObjectLike,
|
|
7
7
|
isProduction,
|
|
8
8
|
removeValueFromArray,
|
|
9
|
-
deepClone
|
|
9
|
+
deepClone,
|
|
10
|
+
getContextFunction
|
|
10
11
|
} from "@domql/utils";
|
|
11
12
|
import { TREE } from "../tree.js";
|
|
12
13
|
import { parseFilters, REGISTRY } from "../mixins/index.js";
|
|
@@ -267,8 +268,7 @@ function variables(obj = {}) {
|
|
|
267
268
|
};
|
|
268
269
|
}
|
|
269
270
|
function call(fnKey, ...args) {
|
|
270
|
-
|
|
271
|
-
const fn = ((_a = this.context.utils) == null ? void 0 : _a[fnKey]) || ((_b = this.context.functions) == null ? void 0 : _b[fnKey]) || ((_c = this.context.methods) == null ? void 0 : _c[fnKey]) || ((_d = this.context.snippets) == null ? void 0 : _d[fnKey]);
|
|
271
|
+
const fn = getContextFunction.call(this, fnKey);
|
|
272
272
|
if (!fn) return void 0;
|
|
273
273
|
try {
|
|
274
274
|
const result = fn.call(this, ...args);
|
package/methods/index.js
CHANGED
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
isObjectLike,
|
|
9
9
|
isProduction,
|
|
10
10
|
removeValueFromArray,
|
|
11
|
-
deepClone
|
|
11
|
+
deepClone,
|
|
12
|
+
getContextFunction
|
|
12
13
|
} from '@domql/utils'
|
|
13
14
|
import { TREE } from '../tree.js'
|
|
14
15
|
import { parseFilters, REGISTRY } from '../mixins/index.js'
|
|
@@ -345,12 +346,7 @@ export function variables(obj = {}) {
|
|
|
345
346
|
* @returns {any|Promise} - The result or a Promise to the result
|
|
346
347
|
*/
|
|
347
348
|
export function call(fnKey, ...args) {
|
|
348
|
-
const fn =
|
|
349
|
-
this.context.utils?.[fnKey] ||
|
|
350
|
-
this.context.functions?.[fnKey] ||
|
|
351
|
-
this.context.methods?.[fnKey] ||
|
|
352
|
-
this.context.snippets?.[fnKey]
|
|
353
|
-
|
|
349
|
+
const fn = getContextFunction.call(this, fnKey)
|
|
354
350
|
if (!fn) return undefined
|
|
355
351
|
|
|
356
352
|
try {
|
package/mixins/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.31.
|
|
3
|
+
"version": "2.31.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"prepublish": "npx rimraf -I dist && npm run build && npm run copy:package:cjs"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@domql/event": "^2.31.
|
|
31
|
-
"@domql/render": "^2.31.
|
|
32
|
-
"@domql/state": "^2.31.
|
|
33
|
-
"@domql/utils": "^2.31.
|
|
30
|
+
"@domql/event": "^2.31.1",
|
|
31
|
+
"@domql/render": "^2.31.1",
|
|
32
|
+
"@domql/state": "^2.31.1",
|
|
33
|
+
"@domql/utils": "^2.31.1"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "6ac409576cc3b2ac653e9601d5a8c2bed90b83de",
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@babel/core": "^7.27.1"
|
|
38
38
|
}
|