1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-27 13:49:10 +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 = <
ExistingStrategy extends { id: string; featureName?: string },
UpdatedStrategy extends {
@ -17,9 +16,9 @@ export const sortStrategiesByFeature = <
const collected = [...strategies, ...changeRequestStrategies].reduce(
(acc, strategy) => {
if (!strategy.featureName) {
// this shouldn't ever happen here, but if it does,
// we'll remove it because we don't know what to do
// with it.
// this shouldn't ever happen here, but because the
// type system allows it to, we need to handle it. If
// a strategy doesn't have a feature name, discard it.
return acc;
}
const registered = acc[strategy.featureName];