Function
withoutCampaign
(
flags: T | undefined,
)
Source from the content-addressed store, hash-verified
| 44 | |
| 45 | /** The flags, minus the boost that just stopped */ |
| 46 | const withoutCampaign = <T extends { campaignId?: string | null }>( |
| 47 | flags: T | undefined, |
| 48 | ): T | undefined => { |
| 49 | if (!flags) { |
| 50 | return flags; |
| 51 | } |
| 52 | |
| 53 | const { campaignId, ...rest } = flags; |
| 54 | |
| 55 | return rest as T; |
| 56 | }; |
| 57 | |
| 58 | interface UseStopBoost { |
| 59 | /** Asks first, then stops the boost and refunds its unspent Cores */ |
Tested by
no test coverage detected