Shell_Casing

validateInputField

Nov 18th, 2020
333
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export default function validateInputField(input) {
  2.  
  3.     if(input.length > 0 && input?.includes('(')) return false;
  4.  
  5.     if(input.length > 0 && input?.includes(')')) return false;
  6.  
  7.     if(input.length > 0 && input?.includes(';')) return false;
  8.  
  9.     if(input.length > 0 && input?.includes('{')) return false;
  10.  
  11.     if(input.length > 0 && input?.includes('}')) return false;
  12.  
  13.     if(input.length > 0 && input?.includes('-r')) return false;
  14.  
  15.     if(input.length > 0 && input?.includes('-f')) return false;
  16.  
  17.     if(input.length > 0 && input?.includes(" ' ")) return false;
  18.  
  19.     return true;
  20.  
  21. };
  22.  
RAW Paste Data