Function
withoutCampaign
(
flags: T | undefined,
)
Source from the content-addressed store, hash-verified
| 35 | |
| 36 | /** The flags, minus the boost that just stopped */ |
| 37 | const withoutCampaign = <T extends { campaignId?: string | null }>( |
| 38 | flags: T | undefined, |
| 39 | ): T | undefined => { |
| 40 | if (!flags) { |
| 41 | return flags; |
| 42 | } |
| 43 | |
| 44 | const { campaignId, ...rest } = flags; |
| 45 | |
| 46 | return rest as T; |
| 47 | }; |
| 48 | |
| 49 | interface UseStopBoost { |
| 50 | /** Asks first, then stops the boost and refunds its unspent Cores */ |
Tested by
no test coverage detected