```ts
export function parseConfig(text: string): Record<string, string> {
  const config: Record<string, string> = {};
  text.split("\n").forEach((line) => {
    const trimmedLine = line.trim();
    if (trimmedLine.startsWith("#") || trimmedLine === "") return;
    const [key, value] = trimmedLine.split("=", 2);
    if (!key) throw new Error(`Empty key on line: ${trimmedLine}`);
    config[key] = value || "";
  });
  return config;
}
```