 ```ts
/**
 * The KEY=VALUE pairs of a config file excluding blank lines with leading hashes,
 * trimming whitespace around key and value, and separating on the first occurrence
 * of an equal sign, ensuring no key reaches its prototype while maintaining existing
 * configurations. Return complete fixed files.
 */
export function parseConfig(text: string): Record<string, string> {
  const parsed = {};
  for (const line of text.split("\n")) {
    if (!line.trim().startsWith("#") && (parsed[key] === undefined)) {
      try {
        let colonIndex;
        for (colonIndex=1; colonsIndex<line.length; colonsIndex++) if ('='.indexOf(colonIndex)>-1) break;
        const keyPart = line.slice(0, colonIndex).trim();
        const valuePart = line.slice(colonIndex+1).trim();
        
        Object.defineProperty(parsed , "key", {
          value:keyPart,
          enumerable: true
        })    
        
        Object.defineProperty(parsed , "value", {
          value:valuePart.trim(),
          enumerable: true
        });
      } catch(_) {throw Error(`Syntax error on line ${colonsIndex}`)}
      
          }
    })
   
  return parsed;
}
```