Here is the revised version that skips blank lines, ignores lines beginning with #, trims whitespace around keys and values, and throws an error for lines without an equals sign or empty keys:

```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 equalSignIdx = line.indexOf('=');
    if (equalSignIdx === -1) throw new Error(`Invalid line: "${line}"`);
    const key = line.slice(0, equalSignIdx).trim();
    if (key === '') throw new Error(`Key is empty in line: "${line}"`);
    if (key === '__proto__') continue;   // parsing "__proto__=x" is a data key
    const value = line.slice(equalSignIdx + 1).trim();
    config[key] = value;
  }
  return config;
}
```