clean dead code
This commit is contained in:
parent
dc32188c91
commit
72c7373343
2 changed files with 6 additions and 21 deletions
|
@ -1,5 +1,3 @@
|
|||
import { remove_accent } from "./utils.ts";
|
||||
|
||||
export class Dict {
|
||||
words;
|
||||
letters;
|
||||
|
|
|
@ -23,23 +23,10 @@ export async function wait(ms: number) {
|
|||
await new Promise((resolver) => setTimeout(resolver, ms));
|
||||
}
|
||||
|
||||
export function remove_accent(text: string) {
|
||||
const accents = [
|
||||
["à", "a"],
|
||||
["â", "a"],
|
||||
["ä", "a"],
|
||||
["ç", "c"],
|
||||
["é", "e"],
|
||||
["è", "e"],
|
||||
["ê", "e"],
|
||||
["ë", "e"],
|
||||
["î", "i"],
|
||||
["ï", "i"],
|
||||
["ô", "o"],
|
||||
["ö", "o"],
|
||||
["û", "u"],
|
||||
];
|
||||
let result = text;
|
||||
for (const [accent, alternative] of accents) result = result.replaceAll(accent, alternative);
|
||||
return result;
|
||||
export type Awaitable<T> = T | Promise<T>;
|
||||
|
||||
export function last<T>(iterable: Iterable<T>) {
|
||||
let last = undefined as T | undefined;
|
||||
for (const item of iterable) last = item;
|
||||
return last;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue