({
placement = AdPlacement.Feed,
active,
boostsEnabled = false,
}: {
placement?: AdPlacement;
active?: boolean;
boostsEnabled?: boolean;
})
| 63 | }; |
| 64 | |
| 65 | export const resolveAdFetchOptions = ({ |
| 66 | placement = AdPlacement.Feed, |
| 67 | active, |
| 68 | boostsEnabled = false, |
| 69 | }: { |
| 70 | placement?: AdPlacement; |
| 71 | active?: boolean; |
| 72 | boostsEnabled?: boolean; |
| 73 | }): FetchAdByPlacementOptions => { |
| 74 | switch (placement) { |
| 75 | case AdPlacement.PostComment: |
| 76 | return { placement }; |
| 77 | case AdPlacement.SquadDirectory: |
| 78 | return { |
| 79 | placement, |
| 80 | allowSquadBoost: true, |
| 81 | }; |
| 82 | case AdPlacement.PostSidebar: |
| 83 | case AdPlacement.Feed: |
| 84 | default: |
| 85 | return { |
| 86 | placement, |
| 87 | active, |
| 88 | allowPostBoost: boostsEnabled, |
| 89 | allowSquadBoost: boostsEnabled, |
| 90 | }; |
| 91 | } |
| 92 | }; |
| 93 | |
| 94 | export const fetchAdByPlacement = async ({ |
| 95 | placement, |
no outgoing calls
no test coverage detected