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

Function buildAnsweredQuestions

packages/webapp/lib/postMarkdown.ts:320–343  ·  view source on GitHub ↗
(post: PostMarkdownPost)

Source from the content-addressed store, hash-verified

318 * post anonymously.
319 */
320const buildAnsweredQuestions = (post: PostMarkdownPost): string[] => {
321 const questions = post.answeredQuestions;
322
323 if (!questions?.length) {
324 return [];
325 }
326
327 const lines = ['## Questions this post answers', ''];
328
329 questions.forEach(({ question, answer, cta }) => {
330 lines.push(`### ${question}`);
331 lines.push('');
332 lines.push(answer);
333
334 if (cta?.trim()) {
335 lines.push('');
336 lines.push(`_${cta.trim()}_`);
337 }
338
339 lines.push('');
340 });
341
342 return lines;
343};
344
345const buildCommunityTake = (post: PostMarkdownPost): string[] => {
346 const take = post.communitySentiment;

Callers 1

buildPostMarkdownFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected