@@ -21,12 +21,12 @@ test('graphemeSegments', async t => {
21
21
assert . deepEqual (
22
22
[ ...graphemeSegments ( 'abc123' ) ] ,
23
23
[
24
- { segment : 'a' , index : 0 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
25
- { segment : 'b' , index : 1 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
26
- { segment : 'c' , index : 2 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
27
- { segment : '1' , index : 3 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
28
- { segment : '2' , index : 4 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
29
- { segment : '3' , index : 5 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
24
+ { segment : 'a' , index : 0 , input : 'abc123' , _hd : 'a' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
25
+ { segment : 'b' , index : 1 , input : 'abc123' , _hd : 'b' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
26
+ { segment : 'c' , index : 2 , input : 'abc123' , _hd : 'c' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
27
+ { segment : '1' , index : 3 , input : 'abc123' , _hd : '1' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
28
+ { segment : '2' , index : 4 , input : 'abc123' , _hd : '2' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
29
+ { segment : '3' , index : 5 , input : 'abc123' , _hd : '3' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
30
30
] ,
31
31
) ;
32
32
} ) ;
@@ -35,10 +35,10 @@ test('graphemeSegments', async t => {
35
35
assert . deepEqual (
36
36
[ ...graphemeSegments ( 'a̐éö̲\r\n' ) ] ,
37
37
[
38
- { segment : 'a̐' , index : 0 , input : 'a̐éö̲\r\n' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
39
- { segment : 'é' , index : 2 , input : 'a̐éö̲\r\n' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
40
- { segment : 'ö̲' , index : 4 , input : 'a̐éö̲\r\n' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
41
- { segment : '\r\n' , index : 7 , input : 'a̐éö̲\r\n' , _catBegin : GraphemeCategory . CR , _catEnd : GraphemeCategory . LF } ,
38
+ { segment : 'a̐' , index : 0 , input : 'a̐éö̲\r\n' , _hd : 'a̐' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
39
+ { segment : 'é' , index : 2 , input : 'a̐éö̲\r\n' , _hd : 'é' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
40
+ { segment : 'ö̲' , index : 4 , input : 'a̐éö̲\r\n' , _hd : 'ö̲' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
41
+ { segment : '\r\n' , index : 7 , input : 'a̐éö̲\r\n' , _hd : '\r\n' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . CR , _catEnd : GraphemeCategory . LF } ,
42
42
] ,
43
43
) ;
44
44
} ) ;
@@ -47,8 +47,8 @@ test('graphemeSegments', async t => {
47
47
assert . deepEqual (
48
48
[ ...graphemeSegments ( '🇷🇸🇮🇴' ) ] ,
49
49
[
50
- { segment : '🇷🇸' , index : 0 , input : '🇷🇸🇮🇴' , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
51
- { segment : '🇮🇴' , index : 4 , input : '🇷🇸🇮🇴' , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
50
+ { segment : '🇷🇸' , index : 0 , input : '🇷🇸🇮🇴' , _hd : '🇷🇸' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
51
+ { segment : '🇮🇴' , index : 4 , input : '🇷🇸🇮🇴' , _hd : '🇮🇴' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
52
52
] ,
53
53
) ;
54
54
} ) ;
@@ -57,8 +57,8 @@ test('graphemeSegments', async t => {
57
57
assert . deepEqual (
58
58
[ ...graphemeSegments ( '🇷🇸🇮' ) ] ,
59
59
[
60
- { segment : '🇷🇸' , index : 0 , input : '🇷🇸🇮' , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
61
- { segment : '🇮' , index : 4 , input : '🇷🇸🇮' , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
60
+ { segment : '🇷🇸' , index : 0 , input : '🇷🇸🇮' , _hd : '🇷🇸' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
61
+ { segment : '🇮' , index : 4 , input : '🇷🇸🇮' , _hd : '🇮' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
62
62
] ,
63
63
) ;
64
64
} ) ;
@@ -67,8 +67,8 @@ test('graphemeSegments', async t => {
67
67
assert . deepEqual (
68
68
[ ...graphemeSegments ( '👻👩👩👦👦' ) ] ,
69
69
[
70
- { segment : '👻' , index : 0 , input : '👻👩👩👦👦' , _catBegin : GraphemeCategory . Extended_Pictographic , _catEnd : GraphemeCategory . Extended_Pictographic } ,
71
- { segment : '👩👩👦👦' , index : 2 , input : '👻👩👩👦👦' , _catBegin : GraphemeCategory . Extended_Pictographic , _catEnd : GraphemeCategory . Extended_Pictographic } ,
70
+ { segment : '👻' , index : 0 , input : '👻👩👩👦👦' , _hd : '👻' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Extended_Pictographic , _catEnd : GraphemeCategory . Extended_Pictographic } ,
71
+ { segment : '👩👩👦👦' , index : 2 , input : '👻👩👩👦👦' , _hd : '👩👩👦👦' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Extended_Pictographic , _catEnd : GraphemeCategory . Extended_Pictographic } ,
72
72
] ,
73
73
) ;
74
74
} ) ;
0 commit comments