Skip to content

Commit c7bd044

Browse files
committed
fix: refactor if statements and error msg
1 parent 8dd8581 commit c7bd044

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

apps/web/src/utils/upload.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -555,14 +555,12 @@ export namespace Zod3 {
555555
continue;
556556
}
557557

558-
const nonVisibleCharCheck = nonVisibleCharChecker(rawValue);
559-
560558
//Check for non visible char in every row, return error if present
561-
if (nonVisibleCharCheck !== null) {
559+
if (nonVisibleCharChecker(rawValue) !== null) {
562560
return reject(
563561
new UploadError({
564562
en: `Value at row ${rowNumber} and column ${key} contains Non-visible characters`,
565-
fr: `Date à la ligne ${rowNumber} et colonne ${key} contient des caractères non visibles`
563+
fr: `La valeur à la ligne ${rowNumber} et colonne '${key}' contient des caractères non visibles`
566564
})
567565
);
568566
}
@@ -910,14 +908,12 @@ export namespace Zod4 {
910908
continue;
911909
}
912910

913-
const nonVisibleCharCheck = nonVisibleCharChecker(rawValue);
914-
915-
//Check for non visible char in every row, return error if present
916-
if (nonVisibleCharCheck !== null) {
911+
// Return error if any non‑visible character is present
912+
if (nonVisibleCharChecker(rawValue) !== null) {
917913
return reject(
918914
new UploadError({
919915
en: `Value at row ${rowNumber} and column ${key} contains Non-visible characters`,
920-
fr: `Date à la ligne ${rowNumber} et column ${key} contient des caractères non visibles`
916+
fr: `La valeur à la ligne ${rowNumber} et colonne '${key}' contient des caractères non visibles`
921917
})
922918
);
923919
}

0 commit comments

Comments
 (0)