```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")) {
    if (line.trim() === "" || line.trim().startsWith("#")) {
      continue;
    }

    const parts = line.split("=");
    if (parts.length !== 2) {
      throw new Error(`Invalid line: ${line}`);
    }

    const key = parts[0].trim();
    const value = parts[1].trim();

    if (key === "__proto__" || key === "") {
      throw new Error("Invalid key");
    }
    config[key] = value;
  }
  return config;
}
```