Skip to content

Commit abcbcac

Browse files
committed
feat: remove mongolian vowel separator from zod3 code
1 parent fb29ae3 commit abcbcac

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

apps/web/src/utils/upload.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,10 @@ export namespace Zod3 {
504504
);
505505
}
506506

507-
//remove sample data if included
507+
//remove sample data if included remove any mongolian vowel separators
508508
if (
509-
dataLines[0][0] === INTERNAL_HEADERS_SAMPLE_DATA[0] &&
510-
dataLines[0][1] === INTERNAL_HEADERS_SAMPLE_DATA[1]
509+
dataLines[0][0]?.replace(/[\u200B-\u200D\uFEFF\u180E]/g, '').trim() === INTERNAL_HEADERS_SAMPLE_DATA[0] &&
510+
dataLines[0][1]?.replace(/[\u200B-\u200D\uFEFF\u180E]/g, '').trim() === INTERNAL_HEADERS_SAMPLE_DATA[1]
511511
) {
512512
dataLines.shift();
513513
}
@@ -821,10 +821,11 @@ export namespace Zod4 {
821821
);
822822
}
823823

824-
//remove sample data if included
824+
//remove sample data if included (account for old mongolian vowel separator templates)
825+
825826
if (
826-
dataLines[0][0] === INTERNAL_HEADERS_SAMPLE_DATA[0] &&
827-
dataLines[0][1] === INTERNAL_HEADERS_SAMPLE_DATA[1]
827+
dataLines[0][0]?.replace(/[\u200B-\u200D\uFEFF\u180E]/g, '').trim() === INTERNAL_HEADERS_SAMPLE_DATA[0] &&
828+
dataLines[0][1]?.replace(/[\u200B-\u200D\uFEFF\u180E]/g, '').trim() === INTERNAL_HEADERS_SAMPLE_DATA[1]
828829
) {
829830
dataLines.shift();
830831
}

0 commit comments

Comments
 (0)