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

Function makePost

packages/shared/src/lib/feedHighlightColSpan.spec.ts:23–47  ·  view source on GitHub ↗
(
  overrides: Partial<Post> & {
    significance?: PostHeroSignificance | null;
  } = {},
)

Source from the content-addressed store, hash-verified

21};
22
23const makePost = (
24 overrides: Partial<Post> & {
25 significance?: PostHeroSignificance | null;
26 } = {},
27): Post => {
28 const { significance, ...rest } = overrides;
29 return {
30 id: rest.id ?? 'p1',
31 type: rest.type ?? PostType.Article,
32 image: 'https://example.com/img.jpg',
33 commentsPermalink: '',
34 ...(significance !== undefined && {
35 hero: significance
36 ? {
37 id: 'h1',
38 highlightedAt: '2026-05-25T00:00:00.000Z',
39 headline: 'h',
40 significance,
41 size: SIZE_BY_SIGNIFICANCE[significance],
42 }
43 : null,
44 }),
45 ...rest,
46 } as Post;
47};
48
49const makePostItem = (post: Post): FeedItem =>
50 ({ type: FeedItemType.Post, post }) as FeedItem;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected