feat(WIP): 장비매매

- 초성 검색을 일원화
This commit is contained in:
2021-12-23 00:48:53 +09:00
parent cfbaf60989
commit 41d5df60f4
12 changed files with 442 additions and 117 deletions
+9
View File
@@ -0,0 +1,9 @@
import { automata초성All } from "./automata초성";
import { filter초성withAlphabet } from "./filter초성withAlphabet";
export function convertSearch초성(text: string): string[]{
const [filteredTextH, filteredTextA] = filter초성withAlphabet(text.replace(/\s+/g, ""));
const [filteredTextHL1, filteredTextHL2] = automata초성All(filteredTextH);
return [text, filteredTextA, filteredTextH, filteredTextHL1, filteredTextHL2];
}
+7
View File
@@ -0,0 +1,7 @@
type Entries<T> = {
[K in keyof T]: [K, T[K]];
}[keyof T][];
export function entriesWithType<T>(value: T): Entries<T>{
return Object.entries(value) as unknown as Entries<T>;
}