```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")) {
    // Skip blank lines and comment lines starting with '#'
    if (!line.trim() || line.startsWith("#")) continue;

    const [key, value] = line.trim().split("=", 1);
    if (!key) throw new Error(`No = found on line: ${line}`);
    if (value === "") throw new Error(`Empty key on line: ${line}`);

    config[key] = value;
  }
  return config;
}
```