Skip to content

Commit

Permalink
Updated STT processor function to check for valid identifier.
Browse files Browse the repository at this point in the history
  • Loading branch information
Amruth-Vamshi committed Nov 26, 2024
1 parent a5c32b8 commit 14c975a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,20 @@ export class AppController {
prompt.inputTextInEnglish,
isOTP ? "otp" : "benId"
);
if (
((/^[6-9]\d{9}$/.test(number)) ||
(number.length == 14 && /^[6-9]\d{9}$/.test(number.substring(0, 10))) ||
(number.length == 12 && /^\d+$/.test(number)) ||
(number.length == 11)) ||
(isOTP && number.length==4)
) {
prompt.inputTextInEnglish = number.toUpperCase();
if (prompt.inputTextInEnglish == "")
prompt.inputTextInEnglish = isOTP ? "1111" : "AB123123123";
isNumber = true;
}
// let number = prompt.inputTextInEnglish.replace(/\s/g, '')
prompt.inputTextInEnglish = number.toUpperCase();
if (prompt.inputTextInEnglish == "")
prompt.inputTextInEnglish = isOTP ? "1111" : "AB123123123";
isNumber = true;

// if(/\d/.test(number)){
// isNumber = true
// prompt.inputTextInEnglish = number.toUpperCase()
Expand Down

0 comments on commit 14c975a

Please sign in to comment.