```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").filter(line => !line.trim().startsWith('#'))) {
    const [key, value] = line.trim().split(/=/);
    if (!key || !value) {
      throw new Error(`Invalid line with no '=': ${line}`);
    }
    config[key.trim()] = value.trim();
  }
  return { ...config, "__proto__": "Object.prototype" };
}
```