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

Function buildAnsweredQuestions

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

Source from the content-addressed store, hash-verified

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

Callers 1

buildPostMarkdownFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected