Skip to content

Commit 5f3a8b7

Browse files
committed
deburr
1 parent e00c448 commit 5f3a8b7

File tree

1 file changed

+31
-34
lines changed

1 file changed

+31
-34
lines changed

src/string/deburr.ts

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
1-
const deburrMap = new Map<string, string>(
2-
// eslint-disable-next-line no-restricted-syntax
3-
Object.entries({
4-
Æ: 'Ae',
5-
Ð: 'D',
6-
Ø: 'O',
7-
Þ: 'Th',
8-
ß: 'ss',
9-
æ: 'ae',
10-
ð: 'd',
11-
ø: 'o',
12-
þ: 'th',
13-
Đ: 'D',
14-
đ: 'd',
15-
Ħ: 'H',
16-
ħ: 'h',
17-
ı: 'i',
18-
IJ: 'IJ',
19-
ij: 'ij',
20-
ĸ: 'k',
21-
Ŀ: 'L',
22-
ŀ: 'l',
23-
Ł: 'L',
24-
ł: 'l',
25-
ʼn: "'n",
26-
Ŋ: 'N',
27-
ŋ: 'n',
28-
Œ: 'Oe',
29-
œ: 'oe',
30-
Ŧ: 'T',
31-
ŧ: 't',
32-
ſ: 's',
33-
})
34-
);
1+
const deburrMap = new Map<string, string>([
2+
['Æ', 'Ae'],
3+
['Ð', 'D'],
4+
['Ø', 'O'],
5+
['Þ', 'Th'],
6+
['ß', 'ss'],
7+
['æ', 'ae'],
8+
['ð', 'd'],
9+
['ø', 'o'],
10+
['þ', 'th'],
11+
['Đ', 'D'],
12+
['đ', 'd'],
13+
['Ħ', 'H'],
14+
['ħ', 'h'],
15+
['ı', 'i'],
16+
['IJ', 'IJ'],
17+
['ij', 'ij'],
18+
['ĸ', 'k'],
19+
['Ŀ', 'L'],
20+
['ŀ', 'l'],
21+
['Ł', 'L'],
22+
['ł', 'l'],
23+
['ʼn', "'n"],
24+
['Ŋ', 'N'],
25+
['ŋ', 'n'],
26+
['Œ', 'Oe'],
27+
['œ', 'oe'],
28+
['Ŧ', 'T'],
29+
['ŧ', 't'],
30+
['ſ', 's'],
31+
]);
3532

3633
/**
3734
* Converts a string by replacing special characters and diacritical marks with their ASCII equivalents.

0 commit comments

Comments
 (0)