mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
refactor: fix search crash on missing values (#794)
* refactor: fix search crash on missing values * Update src/hooks/useFeaturesFilter.ts * Update src/hooks/useFeaturesFilter.ts * fix: update regex Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
This commit is contained in:
parent
268d586b52
commit
9798cfd888
@ -109,9 +109,10 @@ const filterFeatureByRegExp = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
return feature.strategies.some(
|
return feature.strategies.some(
|
||||||
s =>
|
strategy =>
|
||||||
regExp.test(s.name) ||
|
regExp.test(strategy.name) ||
|
||||||
// @ts-expect-error
|
strategy.constraints.some(constraint =>
|
||||||
s.constraints.some(c => c.values.some(v => regExp.test(v)))
|
constraint.values?.some(value => regExp.test(value))
|
||||||
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user