{"record":{"id":"47826fd00e34c472","repo":"santifer/career-ops","slug":"unsupported-template-format-format-expected-h","errorCode":null,"errorMessage":"Unsupported template format: ${format} (expected html or tex)","messagePattern":"Unsupported template format: (.+?) \\(expected html or tex\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cv-templates.mjs","lineNumber":52,"sourceCode":"    .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n    .join(' ');\n}\n\nexport function kebab(display) {\n  return String(display)\n    .trim()\n    .toLowerCase()\n    .replace(/[^a-z0-9]+/g, '-')\n    .replace(/^-+|-+$/g, '');\n}\n\n// The only template formats the resolver recognizes. `format` reaches path\n// construction (fileFor) unmodified, so it must be allowlisted or a value like\n// `--format=../../etc/passwd` would traverse out of the templates dir.\nconst VALID_FORMATS = new Set(['html', 'tex']);\nfunction assertFormat(format) {\n  if (!VALID_FORMATS.has(format)) {\n    throw new Error(`Unsupported template format: ${format} (expected html or tex)`);\n  }\n}\n\n// filename → {name, format} | null. Base \"cv-template.html\" → name \"standard\";\n// \"cv-template.<name>.html\" → that name. Only html/tex are recognized.\nfunction parseFilename(prefix, file) {\n  const m = file.match(new RegExp(`^${prefix}(?:\\\\.([a-z0-9-]+))?\\\\.(html|tex)$`));\n  if (!m) return null;\n  return { name: m[1] || 'standard', format: m[2] };\n}\n\nexport function parseMeta(path) {\n  let text;\n  try {\n    text = readFileSync(path, 'utf-8');\n  } catch {\n    return {};\n  }","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/cv-templates.mjs#L34-L70","documentation":"Error \"Unsupported template format: ${format} (expected html or tex)\" thrown in santifer/career-ops.","triggerScenarios":"Thrown at cv-templates.mjs:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use html or tex as the template format."],"exampleFix":"node generate-pdf.mjs --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"}