Skip to content

Commit 4f9f4a9

Browse files
committed
chore: remove unreachable code
1 parent 1bd1c6d commit 4f9f4a9

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/validator/is-url.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@ export class IsUrlConstraint implements ValidatorConstraintInterface {
1313
return false
1414
}
1515

16-
try {
17-
// `url` is an absolute URI without host and protocol. Validating it by
18-
// by using any base URL
19-
const parsedUrl = new URL(url, 'https://example.com')
16+
// `url` is an absolute URI without host and protocol. Validating it by
17+
// by using any base URL
18+
const parsedUrl = new URL(url, 'https://example.com')
2019

21-
return !/^\/+$/.test(parsedUrl.pathname)
22-
} catch {
23-
return false
24-
}
20+
return !/^\/+$/.test(parsedUrl.pathname)
2521
}
2622
}
2723

0 commit comments

Comments
 (0)