```ts
/** The KEY=VALUE pairs of a config file. */
export function parseConfig(text: string): Record<string, string> {
  const config: Record<string, string> = {};
  for (const line of text.split("\n")) {
    // Ignore blank lines and lines starting with #
    if (!line.trim() || line.startsWith("#")) continue;

    // Trim whitespace around the key and the value
    const [key, value] = line.trim().split("=");
    if (!key) throw new Error(`No '=' found in line: ${line}`);
    config[key] = value;
  }
  return config;
}
```