```ts
function inQuote(ch: string): boolean {
  return ch === '\'' || ch === '"';
}

function quoteSplit(line: string): string[] {
  let result: string[] = [];
  let currentQuotationMark = null;
  let currentIndex = 0;

  for (let i = 0; i < line.length; i++) {
    const char = line[i];
    if (currentQuotationMark === null) {
      if (char === inQuote(char)) {
        currentQuotationMark = char;
        currentIndex++;
      }
    } else {
      if (char === currentQuotationMark && line[i + 1] !== ',') {
        result.push(line.substring(currentIndex, i + 1));
        currentIndex = i + 2;
        currentQuotationMark = null;
      } else if (char === ',' && currentQuotationMark !== char) {
        currentIndex++;
      }
    }
  }

  if (currentQuotationMark !== null) {
    result.push(line.substring(currentIndex));
  }

  return result;
}
```