1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-01 13:47:27 +02:00

feat: minor comment updates

This commit is contained in:
Thomas Heartman 2023-11-23 14:11:47 +01:00
parent 8425fd48e9
commit 2b46a21f21
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -1,4 +1,3 @@
// use generics here to make it easier to test
export const sortStrategiesByFeature = < export const sortStrategiesByFeature = <
ExistingStrategy extends { id: string; featureName?: string }, ExistingStrategy extends { id: string; featureName?: string },
UpdatedStrategy extends { UpdatedStrategy extends {
@ -17,9 +16,9 @@ export const sortStrategiesByFeature = <
const collected = [...strategies, ...changeRequestStrategies].reduce( const collected = [...strategies, ...changeRequestStrategies].reduce(
(acc, strategy) => { (acc, strategy) => {
if (!strategy.featureName) { if (!strategy.featureName) {
// this shouldn't ever happen here, but if it does, // this shouldn't ever happen here, but because the
// we'll remove it because we don't know what to do // type system allows it to, we need to handle it. If
// with it. // a strategy doesn't have a feature name, discard it.
return acc; return acc;
} }
const registered = acc[strategy.featureName]; const registered = acc[strategy.featureName];