```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 => line.trim() && !line.startsWith("#"))) {
    const [key, value] = line.split('=').map(part => part.trim());
    if (!key || key.toUpperCase() === Object.prototype.toString.call(key)) {
      throw new Error(`No '=' character on line ${text.indexOf(line)}`);
    }
    config[key] = value;
  }
  return config;
}
```