input-validator.d.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. *
  3. * @param {String} input of space separated URL/URI passed by
  4. * user for redirect URIs
  5. * @returns { String | Boolean } complying with enquirer return values, the function
  6. * separates the string on space and validates each to see
  7. * if a valid URL/URI. Return a string if invalid and
  8. * boolean true if valid
  9. */
  10. export declare function validateAllURL(input: string): string | boolean;
  11. /**
  12. * Custom validation logic which takes in consideration
  13. * creation of Snyk Apps and thus allows localhost.com
  14. * as a valid URL.
  15. * @param {String} input of URI/URL value to validate using
  16. * regex
  17. * @returns {String | Boolean } string message is not valid
  18. * and boolean true if valid
  19. */
  20. export declare function validURL(input: string): boolean | string;
  21. /**
  22. * Function validates if a valid UUID (version of UUID not tacken into account)
  23. * @param {String} input UUID to be validated
  24. * @returns {String | Boolean } string message is not valid
  25. * and boolean true if valid
  26. */
  27. export declare function validateUUID(input: string): boolean | string;
  28. /**
  29. * @param {String} input
  30. * @returns {String | Boolean } string message is not valid
  31. * and boolean true if valid
  32. */
  33. export declare function validInput(input: string): string | boolean;