Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Aug 8, 2023
1 parent 1d33eb5 commit 2878484
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/support/metricsFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,20 @@ export function filterMetrics(json, metricPaths) {
result
);
} else {
let branch = get(json, branchPath);
let branchPath = path.slice(0, Math.max(0, firstWildcard));
if (branchPath.endsWith('.')) branchPath = branchPath.slice(0, -1);

let branch = get(json, branchPath);
if (!branch) {
// error(
// 'Metricsfilter: The ' +
// branchPath +
// ' is missing from the metrics ' +
// metricPaths
//);
return result;
}

const leafPath = path.slice(Math.max(0, firstWildcard + 2));
const leafs = Object.keys(branch).reduce((result, key) => {
const leaf = filterMetrics(branch[key], leafPath);
Expand Down

0 comments on commit 2878484

Please sign in to comment.