From 41ce93926a44afa8d584d2a6836a27b676e32701 Mon Sep 17 00:00:00 2001 From: vvepretskiy Date: Sun, 28 Sep 2025 02:56:08 +0200 Subject: [PATCH] Update core.config.js change filter to find, because we take only the first element --- src/core/core.config.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/core.config.js b/src/core/core.config.js index 6e83d5de327..9936fe815d8 100644 --- a/src/core/core.config.js +++ b/src/core/core.config.js @@ -59,10 +59,10 @@ function getAxisFromDataset(id, axis, dataset) { } function retrieveAxisFromDatasets(id, config) { - if (config.data && config.data.datasets) { - const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id); - if (boundDs.length) { - return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]); + if (config.data && config.data.datasets) { + const boundDs = config.data.datasets.find((d) => d.xAxisID === id || d.yAxisID === id); + if (boundDs) { + return getAxisFromDataset(id, 'x', boundDs) || getAxisFromDataset(id, 'y', boundDs); } } return {}; @@ -399,7 +399,7 @@ function getResolver(resolverCache, scopes, prefixes) { return cached; } -const hasFunction = value => isObject(value) +var hasFunction = value => isObject(value) && Object.getOwnPropertyNames(value).some((key) => isFunction(value[key])); function needContext(proxy, names) {