MCPcopy Create free account
hub / github.com/dailydotdev/apps / addGenerationIdHeader

Function addGenerationIdHeader

packages/shared/src/lib/ads.ts:26–47  ·  view source on GitHub ↗
({
  ad,
  res,
}: {
  ad: Ad | null;
  res: Response;
})

Source from the content-addressed store, hash-verified

24const skadiGenerationIdHeader = 'x-generation-id';
25
26const addGenerationIdHeader = ({
27 ad,
28 res,
29}: {
30 ad: Ad | null;
31 res: Response;
32}): Ad | null => {
33 if (!ad) {
34 return ad;
35 }
36
37 const generationId = res.headers.get(skadiGenerationIdHeader);
38
39 if (!generationId) {
40 return ad;
41 }
42
43 return {
44 ...ad,
45 generationId,
46 };
47};
48
49const fetchAdRequest = async ({
50 path,

Callers 1

fetchAdRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected