```typescript
/** 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").filter(line => !/^\s*$|^#/.test(line))) {
    const [key, value] = line.trim().split("=", 2);
    if (!key) throw new Error(`Empty key at line ${lineNumber}`);
    config[key] = value || "";
    lineNumber++;
  }
  return config;
}
```