({
placement = AdPlacement.Feed,
active,
boostsEnabled = false,
consent,
}: {
placement?: AdPlacement;
active?: boolean;
boostsEnabled?: boolean;
consent?: AdMacroContext;
})
| 90 | }; |
| 91 | |
| 92 | export const resolveAdFetchOptions = ({ |
| 93 | placement = AdPlacement.Feed, |
| 94 | active, |
| 95 | boostsEnabled = false, |
| 96 | consent, |
| 97 | }: { |
| 98 | placement?: AdPlacement; |
| 99 | active?: boolean; |
| 100 | boostsEnabled?: boolean; |
| 101 | consent?: AdMacroContext; |
| 102 | }): FetchAdByPlacementOptions => { |
| 103 | switch (placement) { |
| 104 | case AdPlacement.PostComment: |
| 105 | return { placement, consent }; |
| 106 | case AdPlacement.SquadDirectory: |
| 107 | return { |
| 108 | placement, |
| 109 | allowSquadBoost: true, |
| 110 | consent, |
| 111 | }; |
| 112 | case AdPlacement.PostSidebar: |
| 113 | case AdPlacement.Feed: |
| 114 | default: |
| 115 | return { |
| 116 | placement, |
| 117 | active, |
| 118 | allowPostBoost: boostsEnabled, |
| 119 | allowSquadBoost: boostsEnabled, |
| 120 | consent, |
| 121 | }; |
| 122 | } |
| 123 | }; |
| 124 | |
| 125 | export const fetchAdByPlacement = async ({ |
| 126 | placement, |
no outgoing calls
no test coverage detected