mirror of
https://github.com/uetchy/namae.git
synced 2025-03-17 04:30:31 +09:00
fix: not to match exact tld
This commit is contained in:
parent
df998838f0
commit
73f39dd615
@ -10,11 +10,13 @@ const DomainCard: React.FC<{query: string}> = ({query}) => {
|
||||
const lowerCase = query.toLowerCase();
|
||||
|
||||
const domainHackSuggestions = zones
|
||||
.map((zone) => new RegExp(`${zone}$`).exec(lowerCase))
|
||||
.map((zone) => new RegExp(`${zone}$`).exec(lowerCase.slice(1)))
|
||||
.filter((s): s is RegExpExecArray => s !== null)
|
||||
.map(
|
||||
(m) =>
|
||||
lowerCase.substring(0, m.index) + '.' + lowerCase.substring(m.index),
|
||||
lowerCase.substring(0, m.index + 1) +
|
||||
'.' +
|
||||
lowerCase.substring(m.index + 1),
|
||||
);
|
||||
|
||||
const names = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user