mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-11 13:35:13 +10:00
493ef12a9a
Finding 4 — consumer-count verification: @reactive-resume/utils/date → 1 consumer (packages/import/src/json-resume.tsx) @reactive-resume/utils/html → 1 consumer (packages/import/src/json-resume.tsx) @reactive-resume/utils/level → 1 consumer (packages/import/src/json-resume.tsx) @reactive-resume/utils/url → 4 consumers (auth, api/ai, import, server) — SKIPPED, stays in utils @reactive-resume/utils/field → 1 consumer (packages/fonts/src/index.ts) Move date/html/level source + test files into packages/import and update json-resume.tsx imports. Inline the two-line unique() helper into fonts/src/index.ts and drop the ./field subpath. Drop the three moved subpaths from packages/utils exports. Claude-Session: https://claude.ai/code/session_012Bnvt1MghwHj4qQRxuQUGa
32 lines
768 B
TypeScript
32 lines
768 B
TypeScript
/**
|
|
* Converts a summary string and optional highlights array into an HTML description.
|
|
* Summary becomes a <p> tag, highlights become a <ul> list.
|
|
*/
|
|
export function toHtmlDescription(summary?: string, highlights?: string[]): string {
|
|
const parts: string[] = [];
|
|
|
|
if (summary) {
|
|
parts.push(`<p>${summary}</p>`);
|
|
}
|
|
|
|
if (highlights && highlights.length > 0) {
|
|
parts.push("<ul>");
|
|
|
|
for (const highlight of highlights) {
|
|
parts.push(`<li>${highlight}</li>`);
|
|
}
|
|
|
|
parts.push("</ul>");
|
|
}
|
|
|
|
return parts.join("");
|
|
}
|
|
|
|
/**
|
|
* Converts an array of strings into an HTML unordered list.
|
|
*/
|
|
export function arrayToHtmlList(items: string[]): string {
|
|
if (items.length === 0) return "";
|
|
return `<ul>${items.map((item) => `<li>${item}</li>`).join("")}</ul>`;
|
|
}
|