visuddhinanda 3 лет назад
Родитель
Сommit
6f1339b393

+ 4 - 4
dashboard/src/components/code/my.ts

@@ -349,8 +349,8 @@ const char_myn_to_roman_1 = [
   { id: "၊", value: "," },
 ];
 
-export const roman_to_my = (input: string | null): string | null => {
-  if (input === null) {
+export const roman_to_my = (input: string | undefined): string | undefined => {
+  if (typeof input === "undefined") {
     return input;
   }
   let txt = input.toLowerCase();
@@ -366,8 +366,8 @@ export const roman_to_my = (input: string | null): string | null => {
   return txt;
 };
 
-export const my_to_roman = (input: string | null): string | null => {
-  if (input === null) {
+export const my_to_roman = (input: string | undefined): string | undefined => {
+  if (typeof input === "undefined") {
     return input;
   }
   let txt = input.toLowerCase();

+ 2 - 2
dashboard/src/components/code/si.ts

@@ -319,8 +319,8 @@ const char_unicode_to_si = [
   { id: "o", value: "ඔ" },
 ];
 
-export const roman_to_si = (input: string | null): string | null => {
-  if (input === null) {
+export const roman_to_si = (input: string | undefined): string | undefined => {
+  if (typeof input === "undefined") {
     return input;
   }
   let txt = input.toLowerCase();

+ 4 - 2
dashboard/src/components/code/tai-tham.ts

@@ -659,8 +659,10 @@ const char_tai_old_to_r = [
   { id: "aฺ", value: "" },
 ];
 */
-export const roman_to_taitham = (input: string | null): string | null => {
-  if (input === null) {
+export const roman_to_taitham = (
+  input: string | undefined
+): string | undefined => {
+  if (typeof input === "undefined") {
     return input;
   }
   let txt = input.toLowerCase();

+ 4 - 2
dashboard/src/components/code/thai.ts

@@ -117,8 +117,10 @@ const char_roman_to_thai = [
   { id: "ฺอ", value: "" },
 ];
 
-export const roman_to_thai = (input: string | null): string | null => {
-  if (input === null) {
+export const roman_to_thai = (
+  input: string | undefined
+): string | undefined => {
+  if (typeof input === "undefined") {
     return input;
   }
   let txt = input.toLowerCase();