|
|
|
@ -10,9 +10,14 @@ console.log(validateValue("bar", [ isURL() ])); /*
|
|
|
|
|
- At (root): Must be a valid URL
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
console.log(validateValue("https://example.com/", [ isURL([ "http", "https" ]) ])); // Url { ... }
|
|
|
|
|
console.log(validateValue("https://example.com/", [ isURL([ "http://", "https://" ]) ])); // Url { ... }
|
|
|
|
|
|
|
|
|
|
console.log(validateValue("ftp://example.com/", [ isURL([ "http", "https" ]) ])); /*
|
|
|
|
|
console.log(validateValue("https:example.com/", [ isURL([ "http://", "https://" ]) ])); /*
|
|
|
|
|
AggregrateValidationError: One or more validation errors occurred:
|
|
|
|
|
- At (root): Must be a URL with one of the following protocols: HTTP, HTTPS - but got FTP instead
|
|
|
|
|
- At (root): Must be a URL with one of the following protocols: HTTP://, HTTPS:// - but got HTTPS: instead
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
console.log(validateValue("ftp://example.com/", [ isURL([ "http://", "https://" ]) ])); /*
|
|
|
|
|
AggregrateValidationError: One or more validation errors occurred:
|
|
|
|
|
- At (root): Must be a URL with one of the following protocols: HTTP://, HTTPS:// - but got FTP:// instead
|
|
|
|
|
*/
|
|
|
|
|