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

Function buildSwipePrompt

packages/webapp/lib/buildSwipePrompt.ts:14–39  ·  view source on GitHub ↗
({
  personas,
  experienceLevel,
}: BuildSwipePromptArgs)

Source from the content-addressed store, hash-verified

12 role.toLowerCase().replace(/\s+engineer$/, '');
13
14export function buildSwipePrompt({
15 personas,
16 experienceLevel,
17}: BuildSwipePromptArgs): string {
18 if (!personas?.length) {
19 return '';
20 }
21
22 const roleClause =
23 personas.length === 1
24 ? `I'm a ${normalizeRoleLabel(personas[0].title)} engineer`
25 : `I work across ${personas
26 .map((p) => p.title.toLowerCase())
27 .join(' and ')}`;
28
29 const experienceLabel =
30 experienceLevel && UserExperienceLevel[experienceLevel];
31 const experienceClause = experienceLabel ? ` (${experienceLabel})` : '';
32
33 const tags = dedupe(personas.flatMap((p) => p.tags));
34 const interestsClause = tags.length
35 ? ` I'm interested in: ${tags.join(', ')}.`
36 : '';
37
38 return `${roleClause}${experienceClause}.${interestsClause}`.trim();
39}

Calls 2

normalizeRoleLabelFunction · 0.85
dedupeFunction · 0.85

Tested by

no test coverage detected