We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3220e48 commit 4d5cf90Copy full SHA for 4d5cf90
lib/utils/url.value-object.ts
@@ -30,7 +30,12 @@ class UrlValueObject extends ValueObject<Prop> {
30
* @returns true if value is a valid url and false if does not
31
*/
32
public static isValidProps(value: string): boolean {
33
- return this.validator.string(value).match(UrlValueObject.REGEX);
+ try {
34
+ new URL(value);
35
+ return true;
36
+ } catch (error) {
37
+ return false;
38
+ }
39
}
40
41
validation(value: string): boolean {
0 commit comments