mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-23 23:02:17 +10:00
refactor(utils→import): move single-consumer date/html/level helpers, inline field into fonts
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
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 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>`;
|
||||
}
|
||||
Reference in New Issue
Block a user