```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")) {
    // Trim whitespace from the start and end of the line
    let trimmedLine = line.trim();
    // Skip empty lines or lines starting with '#'
    if (!trimmedLine || trimmedLine.startsWith('#')) {
      continue;
    }
    const [key, value] = trimmedLine.split("=", 2);
    // Trim whitespace around the key and value
    config[key.trim()] = value?.trim() ?? "";
  }
  return config;
}
```