1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-17 04:30:31 +09:00

fix: make domain hack suggestion lower case

This commit is contained in:
uetchy 2020-02-08 19:00:01 +09:00
parent d951652f85
commit e923f80a47

View File

@ -10,9 +10,12 @@ const DomainCard: React.FC<{query: string}> = ({query}) => {
const lowerCase = query.toLowerCase();
const domainHackSuggestions = zones
.map((zone) => new RegExp(`${zone}$`).exec(query))
.map((zone) => new RegExp(`${zone}$`).exec(lowerCase))
.filter((s): s is RegExpExecArray => s !== null)
.map((m) => query.substring(0, m.index) + '.' + query.substring(m.index));
.map(
(m) =>
lowerCase.substring(0, m.index) + '.' + lowerCase.substring(m.index),
);
const names = [
`${lowerCase}.com`,