Skip to content

Commit f3c4266

Browse files
committed
Fix check for trailing "-" in domain names
1 parent 09954f7 commit f3c4266

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function findDomainNamesMatchingPattern(pattern: string): string[] {
5454
(domainName) =>
5555
// Domain names cannot start or end with a hyphen ("-")
5656
domainName.at(0) !== "-" &&
57-
domainName.at(-1) !== "-" &&
57+
domainName.at(domainName.indexOf(".") - 1) !== "-" &&
5858
// Domain names cannot contain consecutive hyphens ("-")
5959
!domainName.includes("--") &&
6060
// Domain names must only consist of the 26 letters of the ISO basic Latin alphabet

0 commit comments

Comments
 (0)