Skip to the content

Capsid menu

app/lib/cv/parse.mjs

36 lines and 3 functions in DrDustinEdwards/dustinedwards-info, at commit 1590ba4 on 2026-10-24. This file on GitHub.

Functions

The functions of parse.mjs
FunctionLinesComplexityCoveredCRAPMutation
cvSourcePath28 to 301100%OkCRAP 1Ok100%
cvFileFor38 to 401100%OkCRAP 1Ok100%
<anonymous:39>39 to 391100%OkCRAP 1Ok100%

Imports

It imports no other module of this repo. Imported by app/lib/carrel/cv-handler.server.ts, app/lib/cv/compile.mjs, app/lib/cv/save.server.ts, app/lib/health/checks.server.ts, app/lib/operator/sync-tools.server.ts.

Source

// Where the CV's files are and what each holds (docs/CV.md). Pure: the registry the save, the sync, the build
// and the drift check share, so none of them names a file the others do not.

/** The repository directory the CV lives in, one markdown file per section plus the profile. */
export const CV_DIR = "content/cv";

/**
 * The files, in the order their entries make the CV's flat list (traditional CV order, which is also the
 * page's "by type" sort). `type` is the entry type a section file holds; the profile holds none.
 *
 * @type {ReadonlyArray<{ slug: string, type: import("./types.ts").CvType | "profile" }>}
 */
export const CV_FILES = [
  { slug: "profile", type: "profile" },
  { slug: "appointments", type: "appointment" },
  { slug: "education", type: "education" },
  { slug: "publications", type: "publication" },
  { slug: "grants", type: "grant" },
  { slug: "honors", type: "award" },
  { slug: "talks", type: "talk" },
  { slug: "courses", type: "course" },
  { slug: "mentoring", type: "mentoring" },
  { slug: "service", type: "service" },
  { slug: "development", type: "development" },
];

/** @param {string} slug */
export function cvSourcePath(slug) {
  return `${CV_DIR}/${slug}.md`;
}

/**
 * The file a slug names, or undefined. A save cannot create a file: the set of files is structure, so a
 * new one is a change to CV_FILES and to the code that reads it.
 *
 * @param {string} slug
 */
export function cvFileFor(slug) {
  return CV_FILES.find((file) => file.slug === slug);
}