{"record":{"id":"aba5e1cebe2553e7","repo":"santifer/career-ops","slug":"unknown-template-format-format","errorCode":null,"errorMessage":"Unknown template format: ${format}","messagePattern":"Unknown template format: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cv-sections-core.mjs","lineNumber":111,"sourceCode":"    projects: new RegExp(String.raw`%{4,}\\s+PROJECTS\\s+%{4,}[\\s\\S]*?` + TEX_BOUNDARY),\n    education: new RegExp(String.raw`%{4,}\\s+Education\\s+%{4,}[\\s\\S]*?` + TEX_BOUNDARY),\n    awards: new RegExp(String.raw`%{4,}\\s+AWARDS\\s+%{4,}[\\s\\S]*?` + TEX_BOUNDARY),\n    skills: new RegExp(String.raw`%{4,}\\s+Technical Skills\\s+%{4,}[\\s\\S]*?` + TEX_END_SENTINEL),\n  },\n};\n\nexport const OPTIONAL_SECTIONS = ['competencies', 'projects', 'education', 'certifications', 'awards', 'skills'];\n\nexport function isEmptySection(payload, section) {\n  const entries = payload?.[section];\n  return !Array.isArray(entries) || entries.length === 0;\n}\n\n// Remove every optional section that has no entries in `payload`. Returns the\n// template unchanged when both are populated.\nexport function stripEmptySections(template, payload, format) {\n  const patterns = PATTERNS[format];\n  if (!patterns) throw new Error(`Unknown template format: ${format}`);\n\n  let out = template;\n  for (const section of OPTIONAL_SECTIONS) {\n    const pattern = patterns[section];\n    if (!pattern) continue; // this format's template has no marker for this section\n    if (isEmptySection(payload, section)) {\n      // A non-matching pattern is a no-op here by design — see the Skills\n      // sentinel note above: no sentinel means no strip, never a fallback to\n      // a looser boundary.\n      out = out.replace(pattern, '');\n    }\n  }\n  return out;\n}\n","sourceCodeStart":93,"sourceCodeEnd":126,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/cv-sections-core.mjs#L93-L126","documentation":"Error \"Unknown template format: ${format}\" thrown in santifer/career-ops.","triggerScenarios":"Thrown at cv-sections-core.mjs:111 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported template format (html or tex).","Check for a typo in the format name passed to the template loader."],"exampleFix":"format: html","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}