File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ const max_char_length = 3;
28
28
/** @type {TUnicodeMap } */
29
29
const latin_convert = { }
30
30
31
+ /** @type {TUnicodeMap } */
31
32
const latin_condensed = {
32
33
'/' : '⁄∕' ,
33
34
'0' : '߀' ,
@@ -74,9 +75,10 @@ const latin_condensed = {
74
75
75
76
76
77
for ( let latin in latin_condensed ) {
77
- let unicode = latin_condensed [ latin ] ;
78
+ let unicode = latin_condensed [ latin ] || '' ;
78
79
for ( let i = 0 ; i < unicode . length ; i ++ ) {
79
- latin_convert [ unicode [ i ] ] = latin ;
80
+ let char = unicode . substring ( i , i + 1 ) ;
81
+ latin_convert [ char ] = latin ;
80
82
}
81
83
}
82
84
@@ -230,10 +232,6 @@ export const generateSets = (code_points) => {
230
232
addMatching ( value . folded , value . composed ) ;
231
233
}
232
234
233
- for ( let unicode in latin_convert ) {
234
- addMatching ( latin_convert [ unicode ] , unicode ) ;
235
- }
236
-
237
235
return unicode_sets ;
238
236
}
239
237
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @orchidjs/unicode-variants" ,
3
- "version" : " 1.0.2 " ,
3
+ "version" : " 1.0.3 " ,
4
4
"description" : " Unicode variant string matching" ,
5
5
"main" : " dist/umd/index.js" ,
6
6
"browser" : " dist/umd/index.js" ,
You can’t perform that action at this time.
0 commit comments