mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +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(
|
||||
s =>
|
||||
regExp.test(s.name) ||
|
||||
// @ts-expect-error
|
||||
s.constraints.some(c => c.values.some(v => regExp.test(v)))
|
||||
strategy =>
|
||||
regExp.test(strategy.name) ||
|
||||
strategy.constraints.some(constraint =>
|
||||
constraint.values?.some(value => regExp.test(value))
|
||||
)
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user