Skip to content

Commit 687da50

Browse files
sadmann7cursoragent
andcommitted
refactor(data-grid): inline hasQuotedFields check
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 38f927f commit 687da50

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/lib/data-grid.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -262,20 +262,11 @@ function countTabs(s: string): number {
262262
return n;
263263
}
264264

265-
function hasQuotedFields(text: string): boolean {
266-
const lines = text.split("\n", 5);
267-
for (const line of lines) {
268-
if (line.startsWith('"')) return true;
269-
if (line.includes('\t"')) return true;
270-
}
271-
return false;
272-
}
273-
274265
export function parseTsv(
275266
text: string,
276267
fallbackColumnCount: number,
277268
): string[][] {
278-
if (hasQuotedFields(text)) {
269+
if (text.startsWith('"') || text.includes('\t"')) {
279270
const rows: string[][] = [];
280271
let currentRow: string[] = [];
281272
let currentField = "";

0 commit comments

Comments
 (0)