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

    // Trim whitespace around key and value
    let [key, value] = line.trim().split("=");

    // Handle the case where there's no '='
    if (key === undefined) {
      throw new Error(`Invalid config line: ${line}`);
    }

    // Split only on the first '='
    key = key.trim();
    value = value ? value.trim() : "";

    // Prevent keys from reaching Object.prototype
    if (Object.getOwnPropertyDescriptor(config, key)) {
      throw new Error(`Key "${key}" would reach Object.prototype`);
    }

    // Assign the key-value pair to the config object
    config[key] = value;
  }
  return config;
}
```